首页
社区
课程
招聘
[原创]MS08-021漏洞分析
2008-12-10 13:22 8513

[原创]MS08-021漏洞分析

dge 活跃值
6
2008-12-10 13:22
8513
Author:dge

    我从分析这个漏洞的过程中重新认识到一些东西,写下来分享给像我一样的人们。

    在分析文件格式漏洞时只用调试工具跟踪有时候很费劲。如果POC可以顺利执行shellcode,跟踪比较简单,但如果POC执行不到shellcode,就很难去解决,当然我们可以通过补丁比较确定出几个可疑函数进行重点跟踪,当然前提是你得能确定出来,如果补丁对代码的改动很大,要确定出可疑函数实非易事,即使能确定出几个来,对他们跟踪也是非常麻烦的事情,让复杂的问题变的简单,那肯定是最理想的。

    认识PaiMei这个工具是在failwest的书里,虽然读完那本书已经很久了,但一直没用过这个工具,直到前几天分析这个漏洞,在分析未果的情况下,我想起了PaiMei,这才体会到了它的强大,这也是我想写这篇文章的原因。

    MS08-021有两个漏洞,这是其中的一个,这个漏洞的POC在很久之前就有人公布了,这是POC的地址:http://www.milw0rm.com/exploits/5442,有了POC和PaiMei,分析这个漏洞就变得简单了,这个漏洞发生在gdi32.dll中,是典型的栈溢出。

用PaiMei和od我们可以轻松地确定出漏洞触发路径。
PlayEnhMetaFileRecord
  |__MRCOLORMATCHTOTARGET::bPlay
       |__IcmCreateColorSpaceByName
            |__lstrcpyW

先简单了解下EMF文件格式



Header结构:
typedef struct tagENHMETAHEADER {
  DWORD iType;
  DWORD nSize;
  RECTL rclBounds;
  RECTL rclFrame;
  DWORD dSignature;
  DWORD nVersion;
  DWORD nBytes;
  DWORD nRecords;
  WORD  nHandles;
  WORD  sReserved;
  DWORD nDescription;
  DWORD offDescription;
  DWORD nPalEntries;
  SIZEL szlDevice;
  SIZEL szlMillimeters;
#if (WINVER >= 0x0400)
  DWORD cbPixelFormat;
  DWORD offPixelFormat;
  DWORD bOpenGL;
#endif /* WINVER >= 0x0400 */
#if (WINVER >= 0x0500)
  SIZEL szlMicrometers;
#endif /* WINVER >= 0x0500 */
} ENHMETAHEADER, *PENHMETAHEADER;

RECORD结构
typedef struct tagENHMETARECORD
{
    DWORD   iType;              // Record type EMR_XXX
    DWORD   nSize;              // Record size in bytes
    DWORD   dParm[1];           // DWORD Array of parameters
} ENHMETARECORD;

函数原型:
BOOL PlayEnhMetaFileRecord(
  HDC hdc,                              // handle to DC
  LPHANDLETABLE lpHandletable,          // metafile handle table
  CONST ENHMETARECORD *lpEnhMetaRecord, // metafile record
  UINT nHandles                         // count of handles
);

POC截图:


下边分析下这个漏洞:

.text:77EFEF66 __stdcall PlayEnhMetaFileRecord(x, x, x, x) proc near
.text:77EFEF66                                         ; CODE XREF: bInternalPlayEMF(x,x,x,x,x)+6A2 p
.text:77EFEF66                                         ; bInternalPlayEMF(x,x,x,x,x)+13B2 p ...
.text:77EFEF66
.text:77EFEF66 var_58          = dword ptr -58h
.text:77EFEF66 var_54          = dword ptr -54h
.text:77EFEF66 var_50          = dword ptr -50h
.text:77EFEF66 var_4C          = dword ptr -4Ch
.text:77EFEF66 var_48          = dword ptr -48h
.text:77EFEF66 var_44          = dword ptr -44h
.text:77EFEF66 var_40          = dword ptr -40h
.text:77EFEF66 var_3C          = dword ptr -3Ch
.text:77EFEF66 var_38          = dword ptr -38h
.text:77EFEF66 var_34          = dword ptr -34h
.text:77EFEF66 var_30          = dword ptr -30h
.text:77EFEF66 var_2C          = dword ptr -2Ch
.text:77EFEF66 var_28          = dword ptr -28h
.text:77EFEF66 var_24          = dword ptr -24h
.text:77EFEF66 var_20          = dword ptr -20h
.text:77EFEF66 var_1C          = dword ptr -1Ch
.text:77EFEF66 var_18          = dword ptr -18h
.text:77EFEF66 var_14          = dword ptr -14h
.text:77EFEF66 var_10          = dword ptr -10h
.text:77EFEF66 var_C           = dword ptr -0Ch
.text:77EFEF66 var_8           = dword ptr -8
.text:77EFEF66 var_4           = dword ptr -4
.text:77EFEF66 hdc             = dword ptr  8
.text:77EFEF66 lphandletable   = dword ptr  0Ch
.text:77EFEF66 lpenhmetarecord = dword ptr  10h
.text:77EFEF66 nhandles        = dword ptr  14h
.text:77EFEF66
.text:77EFEF66 ; FUNCTION CHUNK AT .text:77F18A61 SIZE 0000028A BYTES
.text:77EFEF66
.text:77EFEF66                 mov     edi, edi
.text:77EFEF68                 push    ebp
.text:77EFEF69                 mov     ebp, esp
.text:77EFEF6B                 sub     esp, 58h
.text:77EFEF6E                 push    ebx
.text:77EFEF6F                 mov     ebx, [ebp+lpenhmetarecord]
.text:77EFEF72                 mov     eax, [ebx]
.text:77EFEF74                 cmp     eax, 1
.text:77EFEF77                 push    esi
.text:77EFEF78                 push    edi
.text:77EFEF79                 jb      short loc_77EFEF99
.text:77EFEF7B                 cmp     eax, 122
.text:77EFEF7E                 ja      short loc_77EFEF99
.text:77EFEF80                 push    [ebp+nhandles]
.text:77EFEF83                 mov     ecx, ebx
.text:77EFEF85                 push    [ebp+lphandletable]
.text:77EFEF88                 push    [ebp+hdc]
.text:77EFEF8B                 call    _fpStartDocDlgW[eax*4] ; eax必须是79,这样才可以调用虚函数MRCOLORMATCHTOTARGET::bPlay
.text:77EFEF92
.text:77EFEF92 loc_77EFEF92:                           ; CODE XREF: PlayEnhMetaFileRecord(x,x,x,x)+19D72 j
.text:77EFEF92                                         ; PlayEnhMetaFileRecord(x,x,x,x)+19D80 j
.text:77EFEF92                 pop     edi
.text:77EFEF93                 pop     esi
.text:77EFEF94                 pop     ebx
.text:77EFEF95                 leave
.text:77EFEF96                 retn    10h
.text:77EFEF99 ; ---------------------------------------------------------------------------
.text:77EFEF99
.text:77EFEF99 loc_77EFEF99:                           ; CODE XREF: PlayEnhMetaFileRecord(x,x,x,x)+13 j
.text:77EFEF99                                         ; PlayEnhMetaFileRecord(x,x,x,x)+18 j
.text:77EFEF99                 test    eax, eax
.text:77EFEF9B                 js      loc_77F18CD5
.text:77EFEFA1                 jmp     loc_77F18A61
.text:77EFEFA1 __stdcall PlayEnhMetaFileRecord(x, x, x, x) endp

上图中的6Ch偏移处的四字节必须是79000000,这样才可以让数据流到达MRCOLORMATCHTOTARGET::bPlay。

text:77F2EBB5 public: int __thiscall MRCOLORMATCHTOTARGET::bPlay(void *, struct tagHANDLETABLE *, unsigned int) proc near
.text:77F2EBB5                                         ; CODE XREF: PlayEnhMetaFileRecord(x,x,x,x)+25 P
.text:77F2EBB5                                         ; DATA XREF: .data:77F327C0 o
.text:77F2EBB5
.text:77F2EBB5 var_264         = dword ptr -264h
.text:77F2EBB5 var_260         = dword ptr -260h
.text:77F2EBB5 var_25C         = dword ptr -25Ch
.text:77F2EBB5 var_258         = dword ptr -258h
.text:77F2EBB5 var_254         = dword ptr -254h
.text:77F2EBB5 var_250         = dword ptr -250h
.text:77F2EBB5 var_24C         = dword ptr -24Ch
.text:77F2EBB5 var_248         = dword ptr -248h
.text:77F2EBB5 var_244         = dword ptr -244h
.text:77F2EBB5 var_240         = dword ptr -240h
.text:77F2EBB5 lp_buff         = dword ptr -20Ch
.text:77F2EBB5 var_4           = dword ptr -4
.text:77F2EBB5 hdc             = dword ptr  8
.text:77F2EBB5 lphandletable   = dword ptr  0Ch
.text:77F2EBB5
.text:77F2EBB5                 mov     edi, edi
.text:77F2EBB7                 push    ebp
.text:77F2EBB8                 mov     ebp, esp
.text:77F2EBBA                 sub     esp, 264h
.text:77F2EBC0                 mov     eax, ___security_cookie
.text:77F2EBC5                 push    ebx
.text:77F2EBC6                 mov     ebx, [ebp+hdc]
.text:77F2EBC9                 mov     [ebp+var_4], eax
.text:77F2EBCC                 mov     eax, [ebp+lphandletable]
.text:77F2EBCF                 push    esi
.text:77F2EBD0                 push    eax
.text:77F2EBD1                 mov     esi, ecx
.text:77F2EBD3                 mov     [ebp+var_258], ebx
.text:77F2EBD9                 call    MRCOLORMATCHTOTARGET::bCheckRecord(tagHANDLETABLE *) ;这个函数里规定[esi+0x14]+[esi+0x10]+0x1B==[esi+0x4]
.text:77F2EBDE                 test    eax, eax
.text:77F2EBE0                 jz      loc_77F2ED19
.text:77F2EBE6                 mov     eax, [esi+8]
.text:77F2EBE9                 xor     ecx, ecx
.text:77F2EBEB                 inc     ecx
.text:77F2EBEC                 cmp     eax, ecx
.text:77F2EBEE                 push    edi
.text:77F2EBEF                 mov     [ebp+var_254], ecx
.text:77F2EBF5                 jnz     loc_77F2ED03    ; ENHMETARECORD.iType==EMR_HEADER ?
.text:77F2EBFB                 test    [esi+0Ch], cl
.text:77F2EBFE                 jz      loc_77F2ECB2    ; Record size是否是偶数

从上边的代码知道要触发漏洞必须符合的几个条件:
1)        ENHMETARECORD.iType==EMR_HEADER,也就是第一个RECORD。
2)        当esi指向上图蓝色的位置时,([esi+0x14]+[esi+0x10]+0x1B)& 0FFFFFFFCh==[esi+0x4]。
3)        Record size必须是偶数。

.text:77F2ECB2 loc_77F2ECB2:                           ; CODE XREF: MRCOLORMATCHTOTARGET::bPlay(void *,tagHANDLETABLE *,uint)+49 j
.text:77F2ECB2                 mov     edi, 10002h
.text:77F2ECB7                 push    edi             ; const_10002
.text:77F2ECB8                 push    4               ; const_4
.text:77F2ECBA                 lea     eax, [esi+18h]
.text:77F2ECBD                 push    eax             ; lp_sz
.text:77F2ECBE                 push    ebx             ; hdc
.text:77F2ECBF                 call    IcmGetColorSpaceByName(x,x,x,x)
.text:77F2ECC4                 mov     ebx, eax        ;必须返回0
.text:77F2ECC6                 test    ebx, ebx
.text:77F2ECC8                 jnz     short loc_77F2ECE2
.text:77F2ECCA                 push    edi             ; int
.text:77F2ECCB                 push    4               ; int
.text:77F2ECCD                 lea     eax, [esi+18h]  
.text:77F2ECD0                 push    eax             ; 指向RECORD的内容
.text:77F2ECD1                 push    [ebp+var_258]   ; int
.text:77F2ECD7                 call    IcmCreateColorSpaceByName(x,x,x,x)  ;有漏洞的函数

IcmGetColorSpaceByName必须返回0。

.text:77F0335B __stdcall IcmCreateColorSpaceByName(x, x, x, x) proc near
.text:77F0335B                                         ; CODE XREF: IcmUpdateLocalDCColorSpace(x,x)+1043 p
.text:77F0335B                                         ; IcmUpdateLocalDCColorSpace(x,x)+150B7 p ...
.text:77F0335B
.text:77F0335B var_250         = dword ptr -250h
.text:77F0335B var_24C         = dword ptr -24Ch
.text:77F0335B var_248         = dword ptr -248h
.text:77F0335B var_244         = dword ptr -244h
.text:77F0335B var_240         = dword ptr -240h
.text:77F0335B String1         = word ptr -20Ch
.text:77F0335B var_4           = dword ptr -4
.text:77F0335B arg_0           = dword ptr  8
.text:77F0335B lpString2       = dword ptr  0Ch
.text:77F0335B arg_8           = dword ptr  10h
.text:77F0335B arg_C           = dword ptr  14h
.text:77F0335B
.text:77F0335B                 mov     edi, edi
.text:77F0335D                 push    ebp
.text:77F0335E                 mov     ebp, esp
.text:77F03360                 sub     esp, 250h
.text:77F03366                 mov     eax, ___security_cookie;使用了GS
.text:77F0336B                 mov     edx, [ebp+lpString2]
.text:77F0336E                 push    esi
.text:77F0336F                 mov     esi, [ebp+arg_0]
.text:77F03372                 mov     [ebp+var_4], eax
.text:77F03375                 push    edi
.text:77F03376                 xor     eax, eax
.text:77F03378                 mov     ecx, 93h
.text:77F0337D                 lea     edi, [ebp+var_250]
.text:77F03383                 rep stosd
.text:77F03385                 and     [ebp+var_244], eax
.text:77F0338B                 mov     eax, [ebp+arg_8]
.text:77F0338E                 mov     [ebp+var_240], eax
.text:77F03394                 push    edx             ; lpString2
.text:77F03395                 lea     eax, [ebp+String1]
.text:77F0339B                 push    eax             ; lpString1
.text:77F0339C                 mov     [ebp+var_250], 50534F43h
.text:77F033A6                 mov     [ebp+var_24C], 400h
.text:77F033B0                 mov     [ebp+var_248], 24Ch
.text:77F033BA                 call    ds:lstrcpyW(x,x) ; 如果第一个RECORD的内容足够大就可以溢出。
.text:77F033C0                 push    [ebp+arg_C]
.text:77F033C3                 lea     eax, [ebp+var_250]
.text:77F033C9                 push    0
.text:77F033CB                 push    eax
.text:77F033CC                 push    esi
.text:77F033CD                 call    IcmCreateColorSpaceByColorSpace(x,x,x,x)
.text:77F033D2                 mov     ecx, [ebp+var_4]
.text:77F033D5                 pop     edi
.text:77F033D6                 pop     esi
.text:77F033D7                 call    __security_check_cookie(x)
.text:77F033DC                 leave
.text:77F033DD                 retn    10h
.text:77F033DD __stdcall IcmCreateColorSpaceByName(x, x, x, x) endp

本人菜鸟一只,请指教,谢谢。

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

上传的附件:
收藏
点赞7
打赏
分享
最新回复 (21)
雪    币: 116
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
boainfall 2008-12-10 13:26
2
0
占楼 留名 支持
雪    币: 211
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
aoyuhuaoju 2008-12-10 14:02
3
0
MS08-021漏洞分析好文章
雪    币: 34
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
jordanpz 2008-12-10 19:39
4
0
感快顶一下,这次没抢到沙发。
雪    币: 34
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
jordanpz 2008-12-12 15:42
5
0
想知道怎么用PAIMEI跟踪到漏洞的?
雪    币: 620
活跃值: (65)
能力值: ( LV13,RANK:290 )
在线值:
发帖
回帖
粉丝
dge 6 2008-12-12 19:55
6
0
添加gdi32.dll的PIDA文件,用PAIMEIi跟踪explorer.exe,然后打开图片POC,PAIMEI会记录下在POC执行期间explorer.exe执行过的在gdi32.dll中的所有代码,分析最后边的记录即可。
另外PAIMEI的跟踪严重依赖IDA的分析结果,所以往往有点瑕疵,但好在基本不影响我们的分析。
雪    币: 250
活跃值: (16)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
amour 2008-12-13 00:23
7
0
楼主能不能好心给传个paimei啊,下了一个多月了都是超时
雪    币: 201
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
jwasami 2008-12-13 10:03
8
0
好东西啊,正学习漏洞分析,要好好看看了
雪    币: 34
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
jordanpz 2008-12-15 10:28
9
0
有几个问题想问下楼主:
1.在跟踪前添加pida modules的时候是不是只加了gdi32.dll的.pida文件?我在试验时还加了exploit_08021.exe.pida,跟踪的是exploit_08021.exe。
2.楼主在paimei中有没有看到显示的gdi32.dll内函数的断点?试验时只看到了下面类似的代码:
Stalking module exploit_08021.exe
  • Stalking module gdi32.dll
  • Setting 272 breakpoints on functions in main module
  • Loading 0x7c920000 \WINDOWS\system32\ntdll.dll
  • Loading 0x7c800000 \WINDOWS\system32\kernel32.dll
  • debugger hit 00405c5b cc #1
  • debugger hit 00402c58 cc #2
  • debugger hit 00405c2b cc #3
  • debugger hit 0040325c cc #4
  • Loading 0x76d70000 \WINDOWS\system32\apphelp.dll
  • debugger hit 0040145f cc #5
  • debugger hit 00402ebe cc #6
  • debugger hit 00402e4c cc #7
  • debugger hit 00403ec7 cc #8
  • debugger hit 00403e58 cc #9
  • debugger hit 00402a70 cc #10
  • debugger hit 00403e49 cc #11
  • debugger hit 00403e3a cc #12
  • 这不知怎么找到溢出处。
    雪    币: 34
    活跃值: (10)
    能力值: ( LV2,RANK:10 )
    在线值:
    发帖
    回帖
    粉丝
    jordanpz 2008-12-15 10:48
    10
    0
    在使用你说的方法时发现explorer总是执行到打开“我的文档”文件夹就停了,没有机会再去打开图片poc了,我把图片poc放到"我的文档"中后结果也没有什么改变。
  • Stalking module gdi32.dll
  • Loading 0x7c920000 \WINDOWS\system32\ntdll.dll
  • Loading 0x7c800000 \WINDOWS\system32\kernel32.dll
  • Loading 0x77be0000 \WINDOWS\system32\msvcrt.dll
  • Loading 0x77da0000 \WINDOWS\system32\advapi32.dll
  • Loading 0x77e50000 \WINDOWS\system32\rpcrt4.dll
  • Loading 0x77ef0000 \WINDOWS\system32\gdi32.dll
  • Setting 1624 breakpoints on functions in gdi32.dll
  • Loading 0x77d10000 \WINDOWS\system32\user32.dll
  • Loading 0x77f40000 \WINDOWS\system32\shlwapi.dll
  • Loading 0x773a0000 \WINDOWS\system32\shell32.dll
  • Loading 0x76990000 \WINDOWS\system32\ole32.dll
  • Loading 0x770f0000 \WINDOWS\system32\oleaut32.dll
  • Loading 0x75ef0000 \WINDOWS\system32\browseui.dll
  • Loading 0x76370000 \WINDOWS\system32\shdocvw.dll
  • Loading 0x765e0000 \WINDOWS\system32\crypt32.dll
  • Loading 0x76db0000 \WINDOWS\system32\msasn1.dll
  • Loading 0x75430000 \WINDOWS\system32\cryptui.dll
  • Loading 0x76c00000 \WINDOWS\system32\wintrust.dll
  • Loading 0x76c60000 \WINDOWS\system32\imagehlp.dll
  • Loading 0x5fdd0000 \WINDOWS\system32\netapi32.dll
  • Loading 0x76680000 \WINDOWS\system32\wininet.dll
  • Loading 0x76f30000 \WINDOWS\system32\wldap32.dll
  • Loading 0x77bd0000 \WINDOWS\system32\version.dll
  • Loading 0x5adc0000 \WINDOWS\system32\uxtheme.dll
  • Loading 0x5cc30000 \WINDOWS\system32\shimeng.dll
  • Loading 0x58fb0000 \WINDOWS\AppPatch\AcGenral.dll
  • Loading 0x76b10000 \WINDOWS\system32\winmm.dll
  • Loading 0x77bb0000 \WINDOWS\system32\msacm32.dll
  • Loading 0x759d0000 \WINDOWS\system32\userenv.dll
  • Loading 0x76300000 \WINDOWS\system32\imm32.dll
  • debugger hit 77ef6370 cc #1
  • debugger hit 77ef65fb cc #2
  • debugger hit 77ef644f cc #3
  • debugger hit 77f250e6 cc #4
  • debugger hit 77ef660d cc #5
  • debugger hit 77f1c5b3 cc #6
  • Loading 0x62c20000 \WINDOWS\system32\lpk.dll
  • Loading 0x73fa0000 \WINDOWS\system32\usp10.dll
  • debugger hit 77f30ffb cc #7
  • debugger hit 77ef5b9c cc #8
  • debugger hit 77ef5e10 cc #9
  • debugger hit 77ef5e7e cc #10
  • debugger hit 77ef5ff1 cc #11
  • debugger hit 77ef635c cc #12
  • debugger hit 77ef601f cc #13
  • debugger hit 77ef60cd cc #14
  • debugger hit 77ef5fd5 cc #15
  • debugger hit 77ef5fa5 cc #16
  • debugger hit 77ef5e92 cc #17
  • debugger hit 77ef6285 cc #18
  • debugger hit 77ef6298 cc #19
  • debugger hit 77ef59a0 cc #20
  • debugger hit 77ef5d9a cc #21
  • debugger hit 77ef5dfc cc #22
  • debugger hit 77ef5d0b cc #23
  • debugger hit 77ef5ba7 cc #24
  • debugger hit 77ef5c59 cc #25
  • debugger hit 77ef63ca cc #26
  • debugger hit 77ef6621 cc #27
  • Loading 0x77180000 \WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
  • debugger hit 77ef58a2 cc #28
  • debugger hit 77ef581e cc #29
  • debugger hit 77ef57cc cc #30
  • debugger hit 77ef62ac cc #31
  • Loading 0x5d170000 \WINDOWS\system32\comctl32.dll
  • debugger hit 77efd547 cc #32
  • debugger hit 77efcdef cc #33
  • debugger hit 77efa133 cc #34
  • debugger hit 77ef6a3b cc #35
  • debugger hit 77ef6c05 cc #36
  • debugger hit 77ef6c58 cc #37
  • debugger hit 77efd55b cc #38
  • debugger hit 77ef8dd7 cc #39
  • debugger hit 77ef8df3 cc #40
  • debugger hit 77ef6ca6 cc #41
  • debugger hit 77ef6cc1 cc #42
  • Loading 0x74d90000 \WINDOWS\system32\riched20.dll
  • debugger hit 77ef8bba cc #43
  • debugger hit 77ef8c11 cc #44
  • debugger hit 77ef8b44 cc #45
  • debugger hit 77ef8abc cc #46
  • debugger hit 77ef8a88 cc #47
  • debugger hit 77ef8b30 cc #48
  • debugger hit 77ef7d78 cc #49
  • debugger hit 77efb4d2 cc #50
  • debugger hit 77efb4ec cc #51
  • debugger hit 77ef844b cc #52
  • [*] debugger hit 77ef63f6 cc #53
    雪    币: 620
    活跃值: (65)
    能力值: ( LV13,RANK:290 )
    在线值:
    发帖
    回帖
    粉丝
    dge 6 2008-12-15 15:59
    11
    0
    只加gdi32.dll,因为漏洞代码在这里边。
    把POC放到桌面上的一个文件夹里,可以方便打开,还有就是在没打补丁的机器上玩。
    雪    币: 34
    活跃值: (10)
    能力值: ( LV2,RANK:10 )
    在线值:
    发帖
    回帖
    粉丝
    jordanpz 2008-12-16 14:52
    12
    0
    你说的这个方法我搞不来,跟踪explorer后会自动打开“我的文档“文件夹,然后白眉就停了,根本没有机会再去双击图片。要是把图片放到我的文档文件夹中的话就会出现跟踪到一半就出异常的情况。
    雪    币: 620
    活跃值: (65)
    能力值: ( LV13,RANK:290 )
    在线值:
    发帖
    回帖
    粉丝
    dge 6 2008-12-16 15:10
    13
    0
    用白眉添加gdi32.dll模块的pida文件,然后用白眉attach上explorer.exe跟踪,然后打开桌面文件夹里的POC图片,接着explorer.exe崩溃,然后就可以分析PAIMEI的记录,我在XP SP2虚拟机里测试的, 我就是这样弄的,如果还没解决,我也没办法,抱歉。
    雪    币: 34
    活跃值: (10)
    能力值: ( LV2,RANK:10 )
    在线值:
    发帖
    回帖
    粉丝
    jordanpz 2008-12-16 15:31
    14
    0
    那我试试,发现好难的。我在另一个帖子中粗口只是为了引起你的注意,抱歉。
    0day与驱动开发群67181435,过来指教下吧,现加到190人了,看雪上的不少牛人都在的。
    雪    币: 620
    活跃值: (65)
    能力值: ( LV13,RANK:290 )
    在线值:
    发帖
    回帖
    粉丝
    dge 6 2008-12-16 15:56
    15
    0
    做什么事都得慢慢来,我工作1年半了,才混了这么个烂水平。
    雪    币: 236
    活跃值: (13)
    能力值: ( LV5,RANK:60 )
    在线值:
    发帖
    回帖
    粉丝
    梧桐 1 2008-12-16 16:04
    16
    0
    又是马甲~~
    雪    币: 620
    活跃值: (65)
    能力值: ( LV13,RANK:290 )
    在线值:
    发帖
    回帖
    粉丝
    dge 6 2008-12-16 16:10
    17
    0
    不是马甲,而且我在任何论坛都没马甲,因为感觉注册很麻烦,注册马甲简直是浪费时间。
    雪    币: 34
    活跃值: (10)
    能力值: ( LV2,RANK:10 )
    在线值:
    发帖
    回帖
    粉丝
    jordanpz 2008-12-16 16:20
    18
    0
    原来是附加explorer,根据你的提示现在看最后的hit处是能定位到溢出点了。谢谢!
    再菜菜的问下,你编辑那个poc图片时用的是什么工具? 这个emf格式的资料有点不好找的诶。
    雪    币: 34
    活跃值: (10)
    能力值: ( LV2,RANK:10 )
    在线值:
    发帖
    回帖
    粉丝
    jordanpz 2008-12-17 22:25
    19
    0
    楼主说了用paimei和od就可搞定,现在paimei的使用是说的很细很透,只是不知大牛怎么用od调试跟踪的?还有,楼主说poc如果执行到shellcode的话跟踪很简单,怎么个简单法?也说说嘛。
    雪    币: 2056
    活跃值: (13)
    能力值: ( LV13,RANK:250 )
    在线值:
    发帖
    回帖
    粉丝
    vxasm 6 2008-12-18 10:17
    20
    0
    我觉得用OD的Run Trace跟踪也是不错的。
    或者两个工具结合起来用,这个搞不定就用那个,总有办法找到漏出点的。
    雪    币: 212
    活跃值: (10)
    能力值: ( LV2,RANK:10 )
    在线值:
    发帖
    回帖
    粉丝
    ndbmz 2008-12-19 13:16
    21
    0
    我上次遇见一个漏洞不知道怎么益出
    3d fa 25 45 25 65 12 00 da ef es b5 12 54 6f 41
    41 6f 54 12是函数返回地址
    00 12 65 25 是一个函数内部指针
    但是执行了memcpy后 是从3d 开始覆盖,如果要覆盖到返回地址(41 6f 54 12)那么前面的函数内部指针(00 12 65 25)也要被覆盖,该内部指针覆盖以后当然程序就不能正常运行 就不能执行到函数结束retn 那么我的shellcode该怎么安装呢?

    请各位大大不吝赐教!谢谢
    雪    币: 310
    活跃值: (111)
    能力值: ( LV3,RANK:30 )
    在线值:
    发帖
    回帖
    粉丝
    rockl 2008-12-19 15:22
    22
    0
    同情之!那为啥不跳!
    游客
    登录 | 注册 方可回帖
    返回