我正在我的 backtrack 5 笔记本电脑上训练堆溢出漏洞。但是,回溯似乎可以防止这些攻击。这是我尝试破坏 malloc 分配块的元数据时得到的结果。
Starting program: /root/exploit/basicheap `python -c 'print "A"*1024+"\xff\xff\xff\xff"+"\x01\x02\x03\x04"'`
buf1=0x804b008 buf2=0x804b410
*** glibc detected *** /root/exploit/basicheap: double free or corruption (out): 0x0804b410 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0xb7edf591]
/lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0xb7ee0de8]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xb7ee3ecd]
/root/exploit/basicheap[0x80484ee]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xb7e8abd6]
/root/exploit/basicheap[0x80483f1]
======= Memory map: ========
08048000-08049000 r-xp 00000000 08:01 13377588 /root/exploit/basicheap
08049000-0804a000 r--p 00000000 08:01 13377588 /root/exploit/basicheap
0804a000-0804b000 rw-p 00001000 08:01 13377588 /root/exploit/basicheap
0804b000-0806c000 rw-p 00000000 00:00 0 [heap]
(ETC...)
Program received signal SIGABRT, Aborted.
0xb7fe2430 in __kernel_vsyscall ()
有没有办法禁用这种保护?它是由内核处理还是在编译期间由 gcc 设置(我希望我可以使用 -fno-stack-protector 之类的选项禁用它以删除 gcc 中的堆栈溢出保护)?