适用于 TryHackMe DFIR 挑战的网络取证 Writeup 及配套工具:从 PCAP 流量中逆向还原 hex→Base64→XOR 数据外泄链,然后利用 CVE-2023-32784 从进程内存转储中恢复 KeePass 主密码。
通过逆向真实 DFIR CTF 场景(TryHackMe)中所使用的 hex → Base64 → XOR 混淆链,从 PCAP 流量中恢复被外泄的数据,随后利用 CVE-2023-32784 直接从进程内存转储中恢复 KeePass 主密码。
Victim workstation Attacker C2 Server
------------------- -------------------
Malicious .ps1 downloaded over HTTP
|
v
Downloads ProcDump (legit Sysinternals tool)
|
v
Dumps KeePass process memory ----------------------> port 1337
(XOR 0x41 + Base64 encoded first)
Steals Database1337.kdbx --------------------------> port 1338
(XOR 0x42 + Base64 encoded first)
| 路径 | 描述 |
|---|---|
docs/writeup.md | 完整的逐步调查分析报告 |
decoder.py | 用于逆向 hex → Base64 → XOR 链的通用工具 |
evidence/xxxmmdcclxxxiv.ps1 | 恢复的恶意 PowerShell 脚本 |
# 1. Extract the raw exfil stream from a pcap with tshark
tshark -r capture.pcapng -T fields -e data \
-Y "ip.dst == <C2_IP> and tcp.port == <PORT>" > payload.txt
# 2. Reverse the obfuscation
python3 decoder.py payload.txt recovered_file.bin --xor-key 0x41
tshark 进行快速、可脚本化的 PCAP 提取(GUI 工具在文件超过几百 MB 后扩展性不佳)调查基于 TryHackMe 房间 Extracted。密码恢复技术得益于 JorianWoltjer 的 keepass-dump-extractor,其基于 vdohney 的原始 CVE-2023-32784 研究。
本仓库记录的是一个用于教育目的的 CTF/实验室练习。不涉及任何真实的凭据、系统或数据。出于对 TryHackMe 平台准则的尊重,本文刻意省略了 CTF 房间中的 Flag 值和捕获到的具体密码。