Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
wgpsec avatar

Malware Analysis Methodology

  • 24 installs
  • 1.6k repo stars
  • Updated July 19, 2026
  • wgpsec/aboutsecurity

Helps with ai & agent building tasks during AI-assisted development.

About

malware-analysis-methodology is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • malware-analysis-methodology
  • AI & Agent Building
  • AI-coding skill

Malware Analysis Methodology by the numbers

  • 24 all-time installs (skills.sh)
  • +2 installs in the week ending Jul 27, 2026 (Skillselion tracking)
  • Ranked #9,876 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/wgpsec/aboutsecurity --skill malware-analysis-methodology

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs24
repo stars1.6k
Last updatedJuly 19, 2026
Repositorywgpsec/aboutsecurity

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

恶意软件分析方法论

红队价值:理解样本如何被分析 → 知道哪些特征会暴露 → 改进免杀和 OPSEC

⛔ 深入参考

  • PE/ELF 静态分析详细命令与脚本 → references/static-analysis.md
  • 动态分析与沙箱对抗 → references/dynamic-analysis.md

---

Phase 0: 样本处理与安全准备

NEVER 在非隔离环境执行样本!

# 计算哈希
sha256sum sample.bin
md5sum sample.bin

# 基础识别
file sample.bin
strings -n 6 sample.bin | head -50

# 检查是否加壳
upx -t sample.bin         # UPX
die sample.bin            # Detect It Easy

决策:

样本类型?
├─ PE (Windows) → Phase 1A
├─ ELF (Linux) → Phase 1B
├─ Mach-O (macOS) → Phase 1C
├─ Shellcode/内存 dump → Phase 2(直接动态分析)
└─ 脚本(PS1/VBS/JS/Python)→ 直接静态阅读代码

Phase 1A: PE 静态分析

# PE 头信息
python3 -c "
import pefile
pe = pefile.PE('sample.exe')
print(f'Compiled: {pe.FILE_HEADER.TimeDateStamp}')
print(f'Sections: {len(pe.sections)}')
for s in pe.sections:
    print(f'  {s.Name.decode().strip(chr(0)):8} Entropy:{s.get_entropy():.2f} VSize:{s.Misc_VirtualSize}')
print(f'Imports: {len(pe.DIRECTORY_ENTRY_IMPORT)}')
for entry in pe.DIRECTORY_ENTRY_IMPORT:
    print(f'  {entry.dll.decode()}')
"

关键 Import 特征映射:

Import API功能推断
VirtualAlloc + WriteProcessMemory进程注入
CreateRemoteThread远程线程注入
WinHttpOpen / InternetOpenA网络通信/C2
CryptEncrypt / BCryptEncrypt加密(可能是勒索软件)
RegSetValueEx + RunKey持久化
NtQueryInformationProcess反调试
IsDebuggerPresent反调试
GetTickCount / QueryPerformanceCounter沙箱检测

Phase 1B: ELF 静态分析

readelf -h sample          # ELF 头
readelf -S sample          # 节表
readelf -d sample          # 动态链接
nm sample 2>/dev/null      # 符号表(未 strip 时)

# 高熵节 = 可能加密/压缩
python3 -c "
from elftools.elf.elffile import ELFFile
import math
from collections import Counter
with open('sample','rb') as f:
    elf = ELFFile(f)
    for s in elf.iter_sections():
        data = s.data()
        if len(data) > 100:
            entropy = -sum((c/len(data))*math.log2(c/len(data)) for c in Counter(data).values())
            if entropy > 7.0:
                print(f'[!] 高熵: {s.name} entropy={entropy:.2f}')
"

Phase 2: 动态分析决策

目标:观察样本运行时行为
├─ 有沙箱环境 → 直接投递(AnyRun/Cuckoo/CAPE)
├─ 本地 VM → strace/procmon + 网络抓包
└─ 仅有样本无法执行 → 纯静态(Ghidra/IDA)

Windows 动态分析:

1. Procmon 过滤进程名 → 文件/注册表/网络操作
2. Wireshark/fakenet → C2 通信
3. API Monitor → 关键 API 调用序列

Linux 动态分析:

strace -f -e trace=network,process,file -o trace.log ./sample
ltrace -f -o ltrace.log ./sample
# 另一终端监控
ss -tlnp    # 监听端口
ss -tnp     # 外连

Phase 3: IOC 提取清单

⛔ 必须提取以下所有类型 IOC:

  • [ ] 文件哈希(MD5 + SHA256)
  • [ ] 网络指标(IP/域名/URL/URI 路径)
  • [ ] 文件系统指标(创建/修改的文件路径)
  • [ ] 注册表指标(Windows)
  • [ ] 进程指标(进程名、命令行、父子关系)
  • [ ] 持久化机制(启动项/计划任务/服务/cron)
  • [ ] MITRE ATT&CK TTP 映射

Phase 4: 红队反思(OPSEC 审查)

分析完成后,从红队视角反思:

该样本暴露了哪些特征?
├─ 静态特征 → 特定字符串/Import/节名/编译时间
├─ 行为特征 → 进程注入方式/持久化手法/C2 模式
├─ 网络特征 → User-Agent/URI 模式/心跳间隔
└─ 内存特征 → 未加密字符串/固定 XOR key/特征字节序列

→ 用于改进自身工具的免杀设计

工具速查

用途工具
PE 分析pefile, pestudio, CFF Explorer
ELF 分析readelf, pyelftools, radare2
反编译Ghidra, IDA Pro, Binary Ninja
字符串提取FLOSS (FireEye), strings
沙箱AnyRun, CAPE, Cuckoo
网络Wireshark, FakeNet-NG
YARAyara-python, yarGen

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.