T. *_*ter 4 c security shellcode
我刚刚开始研究缓冲区溢出攻击是如何工作的,并尝试使用Visual C 2010 模拟对Windows 7的攻击.缓冲区溢出攻击是非常人为的,它只是将返回地址覆盖到"缓冲区"局部变量的地址.缓冲区包含shellcode字符串.
无论我是否在Visual Studio 2010 Debug中运行程序,程序都会跳转到shellcode并几乎开始执行它,但是我遇到了Access Violation错误,程序将不会继续执行shellcode.
为什么我收到此错误?这是否可以防止Windows中的缓冲区溢出?
会如何,你让程序在缓冲区执行的shellcode?
编辑:
汉斯(回答)是对的.这在Windows Internals 5th的安全章节中讨论,错误的原因是Microsoft的可执行空间保护实现.
如果这个问题对任何人都有帮助,那么任何赞成票都会受到赞赏
void execute_my_shellcode()
{
char buffer[24];
memcpy(buffer, "\x6A\x21\xFF\x15\x40\x62\x40\x00\x83\xC4\x04\x6A\x0A\xFF\x15\x40\x62\x40\x00\x83\xC4\x04\xC3", 24);
printf("current return address: %p\n", *(int*)((char*)&buffer + 24 + 4));
*(int*)((char*)&buffer + 24 + 4) = (int)&buffer;
printf("return address is now : %p\n\n", (int*)*(int*)((char*)&buffer + 24 + 4) );
}
Run Code Online (Sandbox Code Playgroud)