skills/ctf/ctf-malware/SKILL.md
CTF 恶意软件分析技术。当遇到混淆脚本分析、C2 流量还原、PE/.NET 恶意样本逆向、自定义加密协议解析、YARA 规则编写、Shellcode 分析等 CTF 恶意软件分析类挑战时使用。覆盖静态分析(IDA/Ghidra)、动态调试(Frida/x64dbg)、流量分析(Wireshark)、内存取证等
npx skillsauth add wgpsec/AboutSecurity ctf-malwareInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
以下参考资料按需加载,根据识别出的具体方向选择对应文件:
恶意软件分析题?
├─ 脚本类
│ ├─ JS → eval 替换为 console.log → 解码 unescape/atob
│ ├─ PowerShell → -enc base64解码 → IEX 替换为输出
│ ├─ Bash → eval 替换为 echo → base64/hex 提取
│ └─ Debian包 → ar -x → 检查 postinst 脚本
├─ 二进制类
│ ├─ PE → peframe/pestudio 快速分类 → [references/pe-and-dotnet.md](references/pe-and-dotnet.md)
│ ├─ .NET → dnSpy 反编译 → AsmResolver 编程分析
│ ├─ PyInstaller → pyinstxtractor 提取 → PyArmor 脱壳
│ └─ 查加密常量: AES S-box(0x637c777b) / ChaCha20 / TEA(0x9E3779B9) / RC4
├─ 流量分析
│ ├─ PCAP → tshark 提取流 → 识别 C2 模式
│ ├─ 自定义加密 → 找密钥 → 按时间序拼接解密
│ ├─ DNS C2 → 域名编码 / DGA 模式
│ └─ RC4 WebSocket → tcprewrite 重映射端口 → 找RC4密钥
├─ 反分析检测
│ ├─ VM检测 → CPUID/MAC/注册表/磁盘大小
│ ├─ 调试器 → PEB/时间检测/API哈希
│ └─ 进程注入 → hollowing/APC/CreateRemoteThread
└─ 内存取证 → vol3 malfind + YARA 扫描
# 文件快速分类
file malware && strings -n 8 malware | head -50
# 提取网络指标
strings malware | grep -E '[0-9]{1,3}(\.[0-9]{1,3}){3}'
# PCAP 流量分析
tshark -r capture.pcap -Y "tcp.stream eq 0" -T fields -e tcp.payload
# PE 分析
peframe malware.exe
# 内存取证
vol3 -f memory.dmp windows.malfind
vol3 -f memory.dmp windows.pstree
| 特征 | 算法 |
|------|------|
| S-box 0x637c777b | AES |
| expand 32-byte k | ChaCha20 |
| 0x9E3779B9 | TEA/XTEA |
| 256字节 S-box 顺序初始化 | RC4 |
| MD5/SHA256(硬编码字符串) | AES-CBC 密钥派生 |
rule XOR_Loop { strings: $xor = { 31 ?? 80 ?? ?? 4? 75 } condition: $xor }
| 语言 | 方法 |
|------|------|
| JavaScript | eval → console.log |
| PowerShell | -enc base64解码 / IEX → 输出 |
| Bash | eval → echo |
| 垃圾代码 | 过滤 NOP/push-pop/死写 → 提取真实 call |
objdump -b binary -m i386:x86-64 -D shellcode.bin # 反汇编
# Unicorn 模拟执行 / Capstone 编程反汇编
testing
Azure 云环境渗透测试总体方法论。当目标使用 Azure/Microsoft 365/Entra ID、发现 Azure 相关资产(Blob Storage/App Service/Azure VM/Azure Functions)、获取 Azure 凭据(Service Principal/Managed Identity/Access Token)、或需要对 Azure 环境进行安全评估时使用。提供从未授权枚举到 Entra ID 攻击、服务提权、Cloud-to-OnPrem 横向移动的全流程决策树。覆盖 35+ Azure 服务攻击面
tools
Mythic C2 操作方法论。当需要部署 Mythic、选择 Mythic Agent、安装 C2 Profile、配置 HTTP/DNS/WebSocket/SMB/TCP 通信、生成 payload、管理回连任务,或把 Mythic 作为跨平台 C2 框架用于授权红队演练时使用。覆盖 mythic-cli 安装、Agent/Profile 选择、SSL 证书配置、payload 构建和基础 OPSEC 判断
development
Docker 安全测试与容器渗透方法论。当需要评估 Docker 容器、Docker Daemon、Docker Registry、镜像层、构建产物或容器逃逸风险时使用。覆盖容器环境识别、特权容器逃逸、docker.sock/Remote API 利用、procfs/cgroup/capabilities 滥用、Docker 用户组提权、运行时/内核 CVE、Registry 枚举、镜像层 Secret 分析和构建上下文泄露。发现 Docker 容器环境、Registry 暴露、镜像凭据或容器配置错误时应使用此技能
development
使用 PadBuster 进行 Padding Oracle 攻击。当发现 Web 应用使用 CBC 模式加密且存在 Padding Oracle 漏洞时使用。PadBuster 可自动解密密文和伪造任意明文对应的合法密文,适用于加密 Cookie/Token/URL 参数。任何涉及 Padding Oracle 攻击、CBC 密文解密、Cookie 伪造的场景都应使用此技能