首页
社区
课程
招聘
[原创]找寻盗号木马的踪迹。
2024-1-27 11:30 2336

[原创]找寻盗号木马的踪迹。

2024-1-27 11:30
2336

这一段时间,我在找盗号木马的踪迹,这是我的记录及心得。请大佬绕步。

我的系统是windows11系统。找盗号木马,用的是这个命令。

netstat -p TCP -anb

最后的-b参数能显示进程名。

根据进程找可疑ip可以定位木马。。。

这段代码通过进程名获得pid.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#写一段hook指定进程的程序
 
 
import psutil
 
def hook_process(process_name):
    for proc in psutil.process_iter():
        try:
            pinfo = proc.as_dict(attrs=['pid', 'name', 'cmdline'])
        except psutil.NoSuchProcess:
            pass
        else:
            if pinfo['name'] == process_name:
                print(pinfo)
                return pinfo['pid']
                 
if __name__ == '__main__':
    pid = hook_process('SearchHost.exe')
    if pid:
        print('hook process success')
    else:
        print('hook process failed')

我在SearchHost进程中找到了CoreMessaging.dll模块,里面的PostMessageW函数可疑。下面是我的hook代码。。。因环境不好复现,没有做的更多。。。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#根据进程pid钩住CoreMessaging.dll模块的PostMessagew函数
 
 
from ctypes import * 
from ctypes.wintypes import HWND, UINT, WPARAM, LPARAM 
   
# Load DLL 
dll = windll.LoadLibrary("CoreMessaging.dll"
   
# Get PostMessage function from DLL 
PostMessage = dll.PostMessageW 
   
# Set argument types and return type of PostMessage 
PostMessage.argtypes = [HWND, UINT, WPARAM, LPARAM] 
PostMessage.restype = BOOL  # According to the documentation, PostMessage returns a BOOL 
   
# Create a handle to a window (HWND) 
hwnd = c_int(6224# You should replace this with the actual window handle you want to send the message to 
   
# Define the message you want to send (UINT) and the parameters for the message (WPARAM and LPARAM) 
message = 0x100  # You should replace this with the actual message you want to send 
wparam = 0 
lparam = 0 
   
# Call PostMessage with the given arguments 
#result = PostMessage(hwnd, message, wparam, lparam) 
result = PostMessage(6224, message, wparam, lparam)
if result == 0
    print("Failed to post message"
else
    print("Message posted successfully")

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

收藏
点赞0
打赏
分享
最新回复 (3)
雪    币: 1134
活跃值: (379)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
ranshu 2024-1-27 11:38
2
0

这是我在研究的dll文件。附带一些微软的工具。。。

上传的附件:
雪    币: 6
活跃值: (1459)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
zjjhszs 2024-1-27 18:14
3
0
现在还有盗号,不怕牢底坐穿
雪    币: 19431
活跃值: (29092)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
秋狝 2024-1-28 23:21
4
1
感谢分享
游客
登录 | 注册 方可回帖
返回