-
-
[旧帖] [讨论]这样的栈溢出能利用么? 0.00雪花
-
发表于: 2013-1-30 11:31 1031
-
static const char *cookietitle = "Cookie Check";
static const char *cookiecontent = "Stack overflow detected, this process will be killed.";
void __declspec(naked) stackoverflow_cookie()
{
__asm
{
push ebp
mov ebp,esp
sub esp,0x40C
//init cookie
mov eax,cookie
xor eax,ebp
mov dword ptr ss:[ebp-0x4],eax
push readbytes
push shellcodepath
lea ebx,[ebp-0x8]
push ebx
call dword ptr ds:[fopen_s]
mov ebx,dword ptr ss:[ebx]
push SEEK_END
push 0
push ebx
call dword ptr ds:[fseek]
push ebx
call dword ptr ds:[ftell]
mov dword ptr ss:[ebp-0xC],eax
push SEEK_SET
push 0
push ebx
call dword ptr ds:[fseek]
push ebx
push dword ptr ss:[ebp-0xC]
push 1
lea eax,[ebp-0x40C]
push eax
call dword ptr ds:[fread] ;Stack overflow here!
push ebx
call dword ptr ds:[fclose]
//check cookie
mov ecx,dword ptr ss:[ebp-0x4]
xor ecx,ebp
xor ecx,cookie
je __RET__
push MB_ICONERROR
push cookietitle
push cookiecontent
push NULL
call dword ptr ds:[MessageBoxA]
push 0xFFFFFFFF
call dword ptr ds:[ExitProcess]
__RET__:
mov esp,ebp
pop ebp
ret
}
}
就是这个手工构造的函数,自带Cookie检查,能否利用该栈溢出漏洞?
static const char *cookiecontent = "Stack overflow detected, this process will be killed.";
void __declspec(naked) stackoverflow_cookie()
{
__asm
{
push ebp
mov ebp,esp
sub esp,0x40C
//init cookie
mov eax,cookie
xor eax,ebp
mov dword ptr ss:[ebp-0x4],eax
push readbytes
push shellcodepath
lea ebx,[ebp-0x8]
push ebx
call dword ptr ds:[fopen_s]
mov ebx,dword ptr ss:[ebx]
push SEEK_END
push 0
push ebx
call dword ptr ds:[fseek]
push ebx
call dword ptr ds:[ftell]
mov dword ptr ss:[ebp-0xC],eax
push SEEK_SET
push 0
push ebx
call dword ptr ds:[fseek]
push ebx
push dword ptr ss:[ebp-0xC]
push 1
lea eax,[ebp-0x40C]
push eax
call dword ptr ds:[fread] ;Stack overflow here!
push ebx
call dword ptr ds:[fclose]
//check cookie
mov ecx,dword ptr ss:[ebp-0x4]
xor ecx,ebp
xor ecx,cookie
je __RET__
push MB_ICONERROR
push cookietitle
push cookiecontent
push NULL
call dword ptr ds:[MessageBoxA]
push 0xFFFFFFFF
call dword ptr ds:[ExitProcess]
__RET__:
mov esp,ebp
pop ebp
ret
}
}
就是这个手工构造的函数,自带Cookie检查,能否利用该栈溢出漏洞?
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!
赞赏
他的文章
看原图
赞赏
雪币:
留言: