在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用malware-analysis
星标1
分支0
更新时间2026年6月9日 18:05
恶意软件分析 — 沙箱、动态分析、脱壳、反混淆、YARA规则
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
恶意软件分析 — 沙箱、动态分析、脱壳、反混淆、YARA规则
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | malware-analysis |
| description | 恶意软件分析 — 沙箱、动态分析、脱壳、反混淆、YARA规则 |
| version | 1.0.0 |
| author | Hermes Agent |
| license | MIT |
| metadata | {"hermes":{"tags":["malware","sandbox","dynamic-analysis","unpacking","yara","reverse-engineering"]}} |
| 工具 | 用途 |
|---|---|
| YARA | 模式匹配/恶意软件分类 |
| PEframe | PE文件静态分析 |
| PEiD | 壳/编译器检测 |
| Detect It Easy (DIE) | 壳/编译器检测(PEiD替代) |
| UPX | 脱壳/加壳 |
| Fakenet-NG | 网络模拟 |
| Procmon | 进程监控(Windows) |
| x64dbg/OllyDbg | Windows调试器 |
| Cuckoo Sandbox | 自动化沙箱 |
| CAPE | Cuckoo改进版沙箱 |
| Any.Run | 在线沙箱 |
| VirusTotal | 在线扫描 |
| MalwareBazaar | 恶意样本库 |
| strings | 字符串提取 |
| ssdeep | 模糊哈希 |
| Volatility | 内存取证 |
| ClamAV | 开源杀毒引擎 |
| Radare2/Ghidra | 反编译 |
sudo apt install yara
pip install yara-python
# 扫描文件/目录
yara rules.yar target_file
yara -r rules.yar /path/to/scan/
# 常用选项
yara -s rules.yar target_file # 显示匹配的字符串
yara -m rules.yar target_file # 显示元数据
yara -w rules.yar target_file # 抑制警告
rule malware_detection {
meta:
description = "Detects ExampleMalware"
author = "Hermes"
date = "2024-01-01"
hash = "abc123..."
strings:
$s1 = "cmd.exe /c" ascii
$s2 = "HKEY_LOCAL_MACHINE" ascii
$s3 = { 6A 40 68 00 30 00 00 6A 14 } // hex pattern
$s4 = /https?:\/\/[a-z0-9\.]+\/[a-z]+/ // regex
$mutex = "Global\\MyMalwareMutex" wide
condition:
uint16(0) == 0x5A4D and // PE文件
filesize < 500KB and
2 of ($s*) and
$mutex
}
// PE导入表检测
rule pe_imports {
condition:
pe.imports("kernel32.dll", "VirtualAlloc") and
pe.imports("ws2_32.dll", "connect")
}
// 加壳检测
rule packed_pe {
condition:
pe.sections[0].name == "UPX0" or
pe.number_of_sections < 3
}
// 字符串加密检测
rule encrypted_strings {
strings:
$xor = { 31 C0 40 31 DB } // XOR解密循环
condition:
$xor and filesize < 100KB
}
git clone https://github.com/Yara-Rules/rules.git
# 规则分类: malware/, exploit_kits/, crypto/, packers/
pip install peframe
peframe malware.exe
# 输出: 壳信息、导入表、节信息、字符串、URL、IP
import pefile
pe = pefile.PE("malware.exe")
# 基本信息
print(f"Entry: 0x{pe.OPTIONAL_HEADER.AddressOfEntryPoint:x}")
print(f"ImageBase: 0x{pe.OPTIONAL_HEADER.ImageBase:x}")
print(f"Sections: {len(pe.sections)}")
# 节信息
for section in pe.sections:
print(f"{section.Name}: VA=0x{section.VirtualAddress:x} Size={section.Misc_VirtualSize}")
# 导入表
if hasattr(pe, 'DIRECTORY_ENTRY_IMPORT'):
for entry in pe.DIRECTORY_ENTRY_IMPORT:
print(f"\n{entry.dll.decode()}")
for imp in entry.imports:
print(f" {imp.name.decode() if imp.name else 'ordinal'}")
# 字符串
data = open("malware.exe", "rb").read()
import re
strings = re.findall(b'[\x20-\x7e]{6,}', data)
for s in strings[:20]:
print(s.decode())
# 下载
wget https://github.com/horsicq/DIE-engine/releases/latest/download/die_linux64_portable.tar.gz
tar xzf die_linux64_portable.tar.gz
# 命令行
die malware.exe
diec malware.exe
# 检测
upx -t malware.exe
# 脱壳
upx -d malware.exe -o unpacked.exe
# 如果UPX被修改/损坏
# 1. 找到OEP(Original Entry Point)
# 2. 运行到OEP后dump内存
1. 用x64dbg加载
2. F8单步到JMP/跳转指令
3. 找到跳向OEP的跳转(通常是一个大的JMP)
4. 在OEP处设置断点
5. 运行到断点
6. 使用Scylla/MiniDump dump进程
7. 修复导入表(IAT)
# ClamUnpacker
# UnpacMe (在线)
# https://unpac.me/
# VMUnpacker
# 虚拟机检测 + 自动脱壳
1. 隔离环境(VM/沙箱)
2. 快照当前状态
3. 启动监控工具
4. 运行恶意软件
5. 收集行为数据
6. 恢复快照
# Fakenet-NG (模拟网络)
# 恶意软件会尝试连接C2服务器
# Fakenet模拟所有协议,捕获通信
# Wireshark/tshark
tshark -i eth0 -w capture.pcap
tshark -r capture.pcap -Y "http.request"
# INetSim (模拟服务)
sudo apt install inetsim
inetsim --conf /etc/inetsim/inetsim.conf
# Linux
strace -e trace=file -f malware
# 用inotifywait
inotifywait -mr /tmp/monitor/
# 创建监控目录
mkdir -p /tmp/monitor && cd /tmp/monitor
# 运行恶意软件,检查新增文件
find . -newer marker_file -type f
# Linux
ps aux | grep malware
ls -la /proc/PID/exe
cat /proc/PID/maps
# 查看网络连接
ss -tlnp
netstat -tlnp
lsof -i
# 查看子进程
pstree -p PID
# 需要VirtualBox + 虚拟机
sudo apt install virtualbox
pip install cuckoo
# 初始化
cuckoo init
# 配置虚拟机
cuckoo machine
# 提交样本
cuckoo submit malware.exe
# 查看报告
cuckoo report 1
https://www.virustotal.com # 多引擎扫描
https://any.run # 交互式沙箱
https://www.hybrid-analysis.com
https://unpac.me # 脱壳专用
https://bazaar.abuse.ch # 恶意样本库
1. IsDebuggerPresent()
2. NtQueryInformationProcess()
3. CheckRemoteDebuggerPresent()
4. 时间检查(RDTSC)
5. INT 2D
6. PEB.BeingDebugged
7. TLS回调
8. 异常处理
9. 父进程检查
10. 沙箱检测(鼠标移动、进程数、MAC地址)
# Patch IsDebuggerPresent
# 将mov eax, [fs:0x30] + 检查BeingDebugged的代码patch为NOP
# 修改PEB
# 在调试器中:
# !peb → 找到BeingDebugged → 修改为0
# 绕过时间检查
# 在调试器中hook RDTSC指令
# 绕过沙箱检测
# 修改MAC地址、主机名、用户名
# 模拟鼠标移动
# 延迟执行(等沙箱超时)
1. DIE检测壳类型
2. UPX直接脱壳
3. 其他壳: x64dbg手动脱壳
4. Ghidra分析去混淆后的代码
5. 提取C2地址、通信协议
6. 编写解密脚本
# 文件哈希
md5sum malware.exe
sha256sum malware.exe
ssdeep malware.exe # 模糊哈希
# 字符串
strings -n 8 malware.exe
strings -el malware.exe # 宽字符
# 网络指标
strings malware.exe | grep -E 'https?://|[\d\.]+:\d+'
strings malware.exe | grep -E '\.onion|\.xyz|\.top'
# 注册表
strings malware.exe | grep -i 'HKEY_\|CurrentVersion\\\\Run'
# 文件路径
strings malware.exe | grep -i 'AppData\\\\|Temp\\\\|System32\\\\'
pip install ssdeep
ssdeep -b malware1.exe > hash1.txt
ssdeep -b malware2.exe > hash2.txt
ssdeep -br hash1.txt hash2.txt
# Python
import ssdeep
h1 = ssdeep.hash_from_file("malware1.exe")
h2 = ssdeep.hash_from_file("malware2.exe")
print(ssdeep.compare(h1, h2)) # 0-100相似度
Delegate coding to OpenAI Codex CLI (features, PRs).
Configure, extend, or contribute to Hermes Agent.
Manage multiple remote servers from Hermes via SSH — deploy services, configure firewalls, transfer files, run commands across servers
Clone/create/fork repos; manage remotes, releases.
Parallel data collection from web sources, APIs, and documentation sites
Deploy static sites to GitHub Pages via API — create repo, push, enable Pages, all from CLI