Tag: exploit

试图粉碎堆栈

我试图重现stackoverflow结果,我从Aleph One的文章“粉碎堆栈的乐趣和利润”中读到(可以在这里找到: http : //insecure.org/stf/smashstack.html )。 试图覆盖返回地址似乎对我不起作用。 C代码: void function(int a, int b, int c) { char buffer1[5]; char buffer2[10]; int *ret; //Trying to overwrite return address ret = buffer1 + 12; (*ret) = 0x4005da; } void main() { int x; x = 0; function(1,2,3); x = 1; printf(“%d\n”,x); } 拆卸主要: (gdb) disassemble main Dump […]

编写一个返回libc攻击,但libc在内存中加载到0x00

我正在为我的系统安全类编写一个返回libc攻击。 首先,易受攻击的代码: //vuln.c #include #include int loadconfig(void){ char buf[1024]; sprintf(buf, “%s/.config”, getenv(“HOME”)); return 0; } int main(int argc, char **argv){ loadconfig(); return 0; } 我想使用返回libc攻击。 编译和调试程序: $ gcc -g -fno-stack-protector -o vuln vuln.c $ gdb vuln (gdb) break loadconfig (gdb) run Reached breakpoint blah blah blah. (gdb) p $ebp $1 = (void *) 0xbfffefb0 (gdb) […]

在printf中格式化字符串攻击

#include int main() { char s[200] int a=123; int b=&a; scanf(“%50s”,s); printf(s); if (a==31337) func(); } 目的是执行格式字符串攻击 – 通过输入字符串来执行func()。 我试图用%n覆盖变量,但我得出的结论是,如果不首先显示b变量是不可能的,我不知道如何。 任何提示将不胜感激。 对不起,我的英语不好。

如何在GCC,Windows XP,x86中编写缓冲区溢出漏洞?

void function(int a, int b, int c) { char buffer1[5]; char buffer2[10]; int *ret; ret = buffer1 + 12; (*ret) += 8;//why is it 8?? } void main() { int x; x = 0; function(1,2,3); x = 1; printf(“%d\n”,x); } 上面的演示来自这里: http://insecure.org/stf/smashstack.html 但它在这里不起作用: D:\test>gcc -Wall -Wextra hw.cpp && a.exe hw.cpp: In function `void function(int, int, […]