我正在对 Immunity Debugger 中的一个恶意软件进行逆向工程,并尝试将其连接到我使用 Python 设置的服务器,SimpleHTTPServer
这样我就可以下载我放在那里的文件。
我的电话HttpSendRequestA
一直失败,给出错误:ERROR_SXS_KEY_NOT_FOUND (00002EE7)
. 我理解这意味着“无法解析服务器名称或地址”。但是,我可以从浏览器访问服务器(它显示了我放在服务器上的文件,我可以单击并阅读),并且可以在访问站点时看到请求(如下所示)。我使用了 ping127.0.0.1
和 ping 127.0.0.1:8000
,结果如下所示(第一个有效,后者无效)。我尝试在 Immunity Debugger 中通过127.0.0.1
,访问它127.0.0.1:8000
,https://127.0.0.1:8000/
并且都产生相同的结果。
我知道这HttpSendRequestA
是几个 API 调用的一部分(列表和顺序在这里),它们都在那里。我事先添加了 3 个函数调用,因为我认为这是错误所在。
平:
C:\Users\Daniel>ping 127.0.0.1
Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\Users\Daniel>ping 127.0.0.1:8000
Ping request could not find host 127.0.0.1:8000. Please check the name and try a
gain.
简单HTTP服务器:
C:\Users\Daniel>cd Documents/
C:\Users\Daniel\Documents>cd tempServer
C:\Users\Daniel\Documents\tempServer>dir
Volume in drive C has no label.
Volume Serial Number is 9C0B-05CE
Directory of C:\Users\Daniel\Documents\tempServer
02/21/2014 12:48 PM <DIR> .
02/21/2014 12:48 PM <DIR> ..
02/21/2014 12:48 PM 11 data.txt
1 File(s) 11 bytes
2 Dir(s) 31,708,946,432 bytes free
C:\Users\Daniel\Documents\tempServer>python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
WIN-NATUEANO3LL - - [23/Feb/2014 17:16:56] "GET / HTTP/1.1" 200 -
WIN-NATUEANO3LL - - [23/Feb/2014 17:20:10] "GET /data.txt HTTP/1.1" 200 -
WIN-NATUEANO3LL - - [23/Feb/2014 17:32:28] "GET / HTTP/1.1" 200 -
WIN-NATUEANO3LL - - [23/Feb/2014 17:32:56] "GET / HTTP/1.1" 200 -
代码:
push ebx ; dwFlags //0
push ebx ; lpszProxyBypass //0
push ebx ; lpszProxy //0
push ebx ; dwAccessType //0
push offset szAgent ; "Windows+NT+5.1"
call ds:Internet
push ebx ; dwContext //0
push 400000h ; dwFlags
mov eax, offset szUserName
push 3 ; dwService
push eax ; lpszPassword //0040B130
push eax ; lpszUserName //0040B130
lea eax, [ebp+szServerName]
push ebx ; nServerPort //000008000
push eax ; lpszServerName //127.0.0.1
push esi ; hInternet //handle to previous call
call ds:InternetConnectA
push ebx //0
push 4000000h ; dwFlags
push offset lpszAcceptTypes ; lplpszAcceptTypes
push ebx ; lpszReferrer //0
lea ecx, [ebp+fileToDownload]
push offset szPassword ; "HTTP/1.1"
push ecx ; lpszObjectName //"/data.txt"
push offset szVerb ; "GET"
push eax ; hConnect //handle to previous call
call ds:HttpOpenRequestA