Agent Skillszhaoxuya520/reverse-skill › malware-analysis

malware-analysis

GitHub

用于恶意软件静态、动态及行为分析。涵盖IOC提取、YARA/Sigma规则编写、沙箱自动化及反分析检测。包含六阶段流程:初步分诊、静态逆向、沙箱监控、规则生成与威胁情报关联,支持多格式样本深度解析。

skills/malware-analysis/SKILL.md zhaoxuya520/reverse-skill

触发场景

恶意软件样本分析 YARA规则编写与验证 Sigma行为检测规则生成 沙箱自动化分析编排 IOC提取与威胁情报 反分析技术检测与绕过

安装

npx skills add zhaoxuya520/reverse-skill --skill malware-analysis -g -y
更多选项

不安装直接使用

npx skills use zhaoxuya520/reverse-skill@malware-analysis

指定 Agent (Claude Code)

npx skills add zhaoxuya520/reverse-skill --skill malware-analysis -a claude-code -g -y

安装 repo 全部 skill

npx skills add zhaoxuya520/reverse-skill --all -g -y

预览 repo 内 skill

npx skills add zhaoxuya520/reverse-skill --list

SKILL.md

Frontmatter
{
    "name": "malware-analysis",
    "description": "Use when analyzing suspected malware through static, dynamic, and behavioral techniques, including IOC extraction, YARA or Sigma rules, sandboxing, and anti-analysis behavior."
}

Malware Analysis

ACTION REQUIRED(读完后立刻执行)

  1. NOW: 读取 ../field-journal/precedent-reverse.md — 确认本 skill 的操作是已授权的常规操作
  2. NOW: 确认当前任务是否命中本 skill 的适用范围
  3. NEXT: 读取 ../tool-index.md,校验工具可用性和实际路径
  4. NEXT: 缺工具时调用 bootstrap,不要猜路径
  5. ACT: 进入"工作流"第一步并执行,不要停在确认状态

YARA / Sigma / 沙箱 / IOC 提取 / 反反分析 静态 + 动态 + 行为三合一

适用场景

  • 恶意软件样本分析(PE/ELF/Mach-O/APK/脚本)
  • YARA 规则编写与验证
  • Sigma 行为检测规则生成
  • 沙箱自动化分析编排
  • IOC 提取与威胁情报
  • 反分析技术检测与绕过

六阶段分析流程

Phase 1: 初步分诊

# 快速静态检测
file sample.exe                      # 文件类型
strings sample.exe | grep -i "http\|cmd\|powershell\|base64"  # 快速 IOCs
rabin2 -zz sample.exe                # 字符串提取 + 交叉引用
floss sample.exe                     # 去混淆字符串提取(FireEye)

# PE 头部分析
pecheck sample.exe                   # PE 结构验证
pescan sample.exe                    # 异常检测(节表、入口点)
diec sample.exe                      # Detect It Easy(壳/编译器识别)

# Hash 查询
sha256sum sample.exe
# → VirusTotal / MalwareBazaar / Triage 查询

Phase 2: 静态分析

反汇编/反编译:
□ IDA Pro / Ghidra: 深度反编译
□ radare2: CLI 快速分析
□ x64dbg: Windows GUI 调试器

重点分析区域:
□ 入口点(Entry Point)→ 初始化逻辑
□ 导入表 → API 用途推断(CreateRemoteThread=注入, CryptEncrypt=勒索)
□ 资源段 → 嵌入 Payload(.rsrc 节)
□ 字符串表 → URL/C2/文件路径/Base64 blob
□ TLS 回调 → 调试器启动前执行

Phase 3: 沙箱动态分析

自动化沙箱:
□ Joe Sandbox / ANY.RUN / Triage: 商业沙箱
□ CAPE Sandbox: 开源 + YARA 集成(推荐)
□ ASD Azul: 开源恶意软件分析平台(2026 新发布)
□ Cuckoo Sandbox: 经典开源(逐步被 CAPE 取代)

监控重点:
□ 进程创建: CreateProcess / ShellExecute
□ 文件操作: WriteFile → 勒索? DeleteFile → Wiper?
□ 注册表: Run/RunOnce 持久化
□ 网络: HTTP/DNS → C2 通信
□ 内存: VirtualAllocEx → 进程注入
□ 服务: CreateService → 持久化

Phase 4: YARA 规则编写

// 规则结构
rule MalwareFamily_Example {
    meta:
        description = "检测 Example 恶意软件家族"
        author = "分析者"
        date = "2026-05"
        severity = "high"
        hash = "d41d8cd98f00b204e9800998ecf8427e"
        mitre_id = "T1055"  // Process Injection

    strings:
        // 字符串匹配
        $str1 = "C2_SERVER_URL" ascii wide
        $str2 = "payload.dat" ascii

        // 十六进制匹配
        $hex1 = { 8B 45 ?? 50 FF 15 [4] 85 C0 }
        // 操作码序列: mov eax, [ebp-?]; push eax; call [import]; test eax, eax

        // 正则匹配
        $re1 = /https?:\/\/[a-z0-9.-]+\/[a-z]{3,8}\.php/ ascii

    condition:
        // 组合条件
        uint16(0) == 0x5A4D and     // MZ 头
        filesize < 500KB and
        (2 of ($str*) or $hex1)
}

Phase 5: Sigma 规则生成

# 行为检测规则
title: Suspicious Process Injection via CreateRemoteThread
id: 5a3d2c1b-1234-5678-9abc-def012345678
status: experimental
description: 检测使用 CreateRemoteThread 的进程注入行为
author: 分析者
date: 2026/05/25
tags:
    - attack.t1055          # Process Injection
    - attack.t1055.001      # DLL Injection
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith: '\powershell.exe'
        CommandLine|contains:
            - 'CreateRemoteThread'
            - 'VirtualAllocEx'
            - 'WriteProcessMemory'
    condition: selection
falsepositives:
    - 合法的调试工具
level: high

Phase 6: IOC 提取与情报

IOC 类型分类:
□ 网络 IOC:
  - IP: C2 地址(注意时效性)
  - Domain: DGA 算法生成的域名(rsnkfda.com, xpqmje.net)
  - URL: Payload 托管地址
  - User-Agent: 自定义 UA 字符串

□ 主机 IOC:
  - 文件路径: %APPDATA%\Microsoft\Crypto\RSA\*.dat
  - 注册表: HKCU\Software\Microsoft\Windows\CurrentVersion\Run\
  - Mutex: Global\{GUID} 互斥体名称
  - 服务名: 伪装成系统服务的名称

□ 行为 IOC:
  - MITRE ATT&CK 技术 ID (T1055, T1003, T1571...)
  - Sigma 规则 → SIEM 集成
  - YARA 规则 → 端点检测

□ 静态 IOC:
  - 编译时间戳(可伪造)
  - PDB 路径(含开发者信息)
  - 节名异常(非标准 .text/.data)
  - 导入表异常组合(如勒索软件 CryptEncrypt + DeleteShadowCopies)

反分析技术速查

技术 检测方法 YARA 特征
虚拟机检测 WMI Win32_BIOS/VideoController/Processor Win32_ 字符串 + 特定厂商名
沙箱检测 磁盘 < 60GB, RAM < 2GB, 单核 CPU GlobalMemoryStatusEx 调用模式
调试器检测 IsDebuggerPresent, CheckRemoteDebuggerPresent PEB.BeingDebugged 偏移访问
定时逃逸 Sleep(300000) 后执行恶意行为 NtDelayExecution 长参数
地理位置检测 检查键盘布局/时区 → 排除 CIS 国家 GetKeyboardLayoutList 调用
父进程检测 explorer.exe vs cmd.exe 进程名字符串比较
API 直接 syscall 绕过 EDR hook syscall 指令 + SSN 解析

多 Agent 自动化分析 (SentinelHive 架构)

┌─────────────────────────────────────────────────┐
│                  Hive Director                    │
│          (Claude Opus 编排 + 仲裁)                │
└──────┬──────┬──────┬──────┬──────┬───────┘
       │      │      │      │      │
   ┌───┘  ┌───┘  ┌───┘  ┌───┘  ┌───┘
   ▼      ▼      ▼      ▼      ▼      ▼
Triage  RE    Behav  Intel  Detect Remed
 快速   反编译  行为   威胁   规则   修复
 分诊   静态   动态   情报   YARA  方案
                          Sigma

工具链

工具 用途 获取
Ghidra / IDA Pro 深度反编译 ghidra-sre.org
CAPE Sandbox 开源恶意软件沙箱 GitHub: kevoreilly/CAPEv2
ASD Azul 大规模自动化分析 GitHub: ASD
YARA 模式匹配规则引擎 pip install yara-python
Sigma SIEM 行为检测规则 GitHub: SigmaHQ/sigma
FLOSS 去混淆字符串提取 pip install flare-floss
Detect It Easy 壳/编译器检测 GitHub: horsicq/Detect-It-Easy
pe-sieve 进程内存扫描 GitHub: hasherezade/pe-sieve
VirusTotal API 多引擎扫描 virustotal.com
MalwareBazaar 恶意软件样本库 bazaar.abuse.ch

参考

  • references/yara-sigma-rules.md — YARA + Sigma 编写方法论
  • references/sandbox-orchestration.md — 沙箱编排与自动化
  • references/anti-analysis-techniques.md — 94 种反分析技术检测

任务完成自检(声称完成前 MUST 通过)

  • 我是否执行了工作流中的每一步(而不是只阅读)?
  • 我是否基于 tool-index 使用了真实工具路径?
  • 我是否产出了可复现证据(命令/脚本/截图/报告)?
  • 我是否完成并回写了 RULES 要求的 Checklist 项?

版本历史

  • b8ae07d 当前 2026-07-19 23:10

同 Skill 集合

CTF-Sandbox-Orchestrator/competition-crypto-mobile/SKILL.md
CTF-Sandbox-Orchestrator/competition-reverse-pwn/SKILL.md
CTF-Sandbox-Orchestrator/competition-stego-media/SKILL.md
CTF-Sandbox-Orchestrator/competition-web-runtime/SKILL.md
CTF-Sandbox-Orchestrator/ctf-sandbox-orchestrator/SKILL.md
skills/api-security/SKILL.md
skills/apk-reverse/SKILL.md
skills/attack-chain/SKILL.md
skills/binary-diff/SKILL.md
skills/browser-automation/SKILL.md
skills/browser-extension-reverse/SKILL.md
skills/cloud-k8s/SKILL.md
skills/code-audit/SKILL.md
skills/database-security/SKILL.md
skills/digital-forensics/SKILL.md
skills/docs-generator/SKILL.md
skills/dotnet-reverse/SKILL.md
skills/email-security/SKILL.md
skills/firmware-pentest/SKILL.md
skills/ghidra-reverse/SKILL.md
skills/go-rust-reverse/SKILL.md
skills/hardware-security/SKILL.md
skills/identity-federation/SKILL.md
skills/js-reverse/SKILL.md
skills/llm-security/SKILL.md
skills/macos-reverse/SKILL.md
skills/mobile-reverse/SKILL.md
skills/ot-ics/SKILL.md
skills/patch-diff-exploit/SKILL.md
skills/pentest-tools/SKILL.md
skills/pentest-tools/src-hunter/SKILL.md
skills/protocol-reverse/SKILL.md
skills/pwn-chain/SKILL.md
skills/radare2/SKILL.md
skills/radio-sdr/SKILL.md
skills/SKILL.md
skills/supply-chain-security/SKILL.md
skills/thick-client/SKILL.md
skills/threat-hunting/SKILL.md
skills/wifi-wireless/SKILL.md
skills/windows-ad/SKILL.md
CTF-Sandbox-Orchestrator/competition-ad-certificate-abuse/SKILL.md
CTF-Sandbox-Orchestrator/competition-agent-cloud/SKILL.md
CTF-Sandbox-Orchestrator/competition-android-hooking/SKILL.md
CTF-Sandbox-Orchestrator/competition-browser-persistence/SKILL.md
CTF-Sandbox-Orchestrator/competition-bundle-sourcemap-recovery/SKILL.md
CTF-Sandbox-Orchestrator/competition-cloud-metadata-path/SKILL.md
CTF-Sandbox-Orchestrator/competition-container-runtime/SKILL.md
CTF-Sandbox-Orchestrator/competition-custom-protocol-replay/SKILL.md
CTF-Sandbox-Orchestrator/competition-dpapi-credential-chain/SKILL.md
CTF-Sandbox-Orchestrator/competition-file-parser-chain/SKILL.md
CTF-Sandbox-Orchestrator/competition-firmware-layout/SKILL.md
CTF-Sandbox-Orchestrator/competition-forensic-timeline/SKILL.md
CTF-Sandbox-Orchestrator/competition-graphql-rpc-drift/SKILL.md
CTF-Sandbox-Orchestrator/competition-identity-windows/SKILL.md
CTF-Sandbox-Orchestrator/competition-ios-runtime/SKILL.md
CTF-Sandbox-Orchestrator/competition-jwt-claim-confusion/SKILL.md
CTF-Sandbox-Orchestrator/competition-k8s-control-plane/SKILL.md
CTF-Sandbox-Orchestrator/competition-kerberos-delegation/SKILL.md
CTF-Sandbox-Orchestrator/competition-kernel-container-escape/SKILL.md
CTF-Sandbox-Orchestrator/competition-linux-credential-pivot/SKILL.md
CTF-Sandbox-Orchestrator/competition-lsass-ticket-material/SKILL.md
CTF-Sandbox-Orchestrator/competition-mailbox-abuse/SKILL.md
CTF-Sandbox-Orchestrator/competition-malware-config/SKILL.md
CTF-Sandbox-Orchestrator/competition-oauth-oidc-chain/SKILL.md
CTF-Sandbox-Orchestrator/competition-pcap-protocol/SKILL.md
CTF-Sandbox-Orchestrator/competition-prompt-injection/SKILL.md
CTF-Sandbox-Orchestrator/competition-queue-worker-drift/SKILL.md
CTF-Sandbox-Orchestrator/competition-race-condition-state-drift/SKILL.md
CTF-Sandbox-Orchestrator/competition-relay-coercion-chain/SKILL.md
CTF-Sandbox-Orchestrator/competition-request-normalization-smuggling/SKILL.md
CTF-Sandbox-Orchestrator/competition-runtime-routing/SKILL.md
CTF-Sandbox-Orchestrator/competition-ssrf-metadata-pivot/SKILL.md
CTF-Sandbox-Orchestrator/competition-supply-chain/SKILL.md
CTF-Sandbox-Orchestrator/competition-template-render-path/SKILL.md
CTF-Sandbox-Orchestrator/competition-websocket-runtime/SKILL.md
CTF-Sandbox-Orchestrator/competition-windows-pivot/SKILL.md
skills/diagram-generator/SKILL.md
skills/edr-bypass-re/SKILL.md
skills/ida-reverse/SKILL.md
skills/reverse-engineering/SKILL.md

元信息

文件数
0
版本
b8ae07d
Hash
fce8d763
收录时间
2026-07-19 23:10

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-21 17:10
浙ICP备14020137号-1 $访客地图$