malware-analyst について
malware-analystは、許可されたサンプルを扱うセキュリティ分析者向けのスキルです。安全上の注意と、静的・動的解析、IOC抽出、レポート作成の手順を示します。
主な機能
- 01安全な隔離解析の指針
- 02静的・動的解析の手順
- 03IOC抽出とYARAの指針
- 04マルウェアの挙動と回避手法の資料
- 05構成化された解析レポート
活用シーン
- 01許可された不審ファイルのトリアージ
- 02隔離環境での動的解析の計画
- 03インシデント対応向け指標の抽出
- 04防御目的の解析結果の記録
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ sickn33/ agentic-awesome-skills --skill malware-analystインストール後、Claude Code で/malware-analystを入力して読み込まれたか確認します。
詳細
マルウェアの防御的なトリアージ
使い捨ての隔離された分析環境で、許可されたサンプルのみを使用してください。動的実行の前に、共有フォルダー、クリップボード、ホストの認証情報、外部へのライブネットワーク接続を無効にし、シミュレートされたサービスを使用してください。明示的な開示承認なしに、非公開のサンプルを公開サンドボックスへアップロードしないでください。静的解析ツールのパーサーも攻撃対象になり得ます。
# File identification
file sample.exe
sha256sum sample.exe
# String extraction
strings -a sample.exe | head -100
FLOSS sample.exe # Obfuscated strings
# Packer detection
diec sample.exe # Detect It Easy
exeinfope sample.exe
# Import analysis
rabin2 -i sample.exe
dumpbin /imports sample.exe
フェーズ 3:静的解析
- 逆アセンブラーに読み込む:IDA Pro、Ghidra、または Binary Ninja
- 主な機能を特定する:エントリーポイント、WinMain、DllMain
- 実行フローをマッピングする:主要な判断箇所、ループ
- 機能を特定する:ネットワーク、ファイル、レジストリ、プロセス操作
- IOC を抽出する:C2 アドレス、ファイルパス、ミューテックス名
フェーズ 4:動的解析
1. Environment Setup:
- Windows VM with common software installed
- Process Monitor, Wireshark, Regshot
- API Monitor or x64dbg with logging
- INetSim or FakeNet for network simulation
2. Execution:
- Start monitoring tools
- Execute sample
- Observe behavior for 5-10 minutes
- Trigger only approved behavior against simulated or contained network services
3. Documentation:
- Network connections attempted
- Files created/modified
- Registry changes
- Processes spawned
- Persistence mechanisms
このスキルを使用する場面
- ファイル識別のタスクやワークフローに取り組む場合
- ファイル識別に関するガイダンス、ベストプラクティス、チェックリストが必要な場合
このスキルを使用しない場面
- タスクがファイル識別と無関係な場合
- この範囲外の別のドメインやツールが必要な場合
手順
- 目標、制約、必要な入力を明確にします。
- 関連するベストプラクティスを適用し、結果を検証します。
- 実行可能な手順と検証方法を提示します。
- 参照先の実装プレイブックは同梱されていません。インラインの方法論と、確認したツールのドキュメントを使用してください。
一般的なマルウェアの手法
永続化の仕組み
Registry Run keys - HKCU/HKLM\Software\Microsoft\Windows\CurrentVersion\Run
Scheduled tasks - schtasks, Task Scheduler
Services - CreateService, sc.exe
WMI subscriptions - Event subscriptions for execution
DLL hijacking - Plant DLLs in search path
COM hijacking - Registry CLSID modifications
Startup folder - %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
Boot records - MBR/VBR modification
回避手法
Anti-VM - CPUID, registry checks, timing
Anti-debugging - IsDebuggerPresent, NtQueryInformationProcess
Anti-sandbox - Sleep acceleration detection, mouse movement
Packing - UPX, Themida, VMProtect, custom packers
Obfuscation - String encryption, control flow flattening
Process hollowing - Inject into legitimate process
Living-off-the-land - Use built-in tools (PowerShell, certutil)
C2 通信
HTTP/HTTPS - Web traffic to blend in
DNS tunneling - Data exfil via DNS queries
Domain generation - DGA for resilient C2
Fast flux - Rapidly changing DNS
Tor/I2P - Anonymity networks
Social media - Twitter, Pastebin as C2 channels
Cloud services - Legitimate services as C2
ツールの習熟度
分析プラットフォーム
Cuckoo Sandbox - Open-source automated analysis
ANY.RUN - Interactive cloud sandbox
Hybrid Analysis - VirusTotal alternative
Joe Sandbox - Enterprise sandbox solution
CAPE - Cuckoo fork with enhancements
監視ツール
Process Monitor - File, registry, process activity
Process Hacker - Advanced process management
Wireshark - Network packet capture
API Monitor - Win32 API call logging
Regshot - Registry change comparison
アンパッキングツール
Unipacker - Automated unpacking framework
x64dbg + plugins - Scylla for IAT reconstruction
OllyDumpEx - Memory dump and rebuild
PE-sieve - Detect hollowed processes
UPX - For UPX-packed samples
IOC の抽出
抽出する指標
Network:
- IP addresses (C2 servers)
- Domain names
- URLs
- User-Agent strings
- JA3/JA3S fingerprints
File System:
- File paths created
- File hashes (MD5, SHA1, SHA256)
- File names
- Mutex names
Registry:
- Registry keys modified
- Persistence locations
Process:
- Process names
- Command line arguments
- Injected processes
YARA ルール
rule Malware_Generic_Packer
{
meta:
description = "Detects common packer characteristics"
author = "Security Analyst"
strings:
$mz = { 4D 5A }
$upx = "UPX!" ascii
$section = ".packed" ascii
condition:
$mz at 0 and ($upx or $section)
}
報告の枠組み
分析レポートの構成
# Malware Analysis Report
## Executive Summary
- Sample identification
- Key findings
- Threat level assessment
## Sample Information
- Hashes (MD5, SHA1, SHA256)
- File type and size
- Compilation timestamp
- Packer information
## Static Analysis
- Imports and exports
- Strings of interest
- Code analysis findings
## Dynamic Analysis
- Execution behavior
- Network activity
- Persistence mechanisms
- Evasion techniques
## Indicators of Compromise
- Network IOCs
- File system IOCs
- Registry IOCs
## Recommendations
- Detection rules
- Mitigation steps
- Remediation guidance
倫理ガイドライン
適切な利用
- インシデント対応とフォレンジック
- 脅威インテリジェンスの調査
- セキュリティ製品の開発
- 学術研究
- CTF コンテスト
支援してはならないこと
- マルウェアの作成や配布
- 許可なくシステムを攻撃すること
- 悪意を持ってセキュリティ製品を回避すること
- ボットネットや C2 インフラストラクチャの構築
- 適切な許可を得ずに行うあらゆる攻撃的な活動
対応方針
- 状況を確認する:防御目的または許可された目的であることを確認します
- サンプルを評価する:簡易トリアージを行い、対象を把握します
- アプローチを提案する:適切な分析方法を提示します
- 分析を案内する:安全上の考慮事項を含め、段階的に手順を説明します
- 価値を抽出する:IOC、検出ルール、知見をまとめます
- 調査結果を文書化する:関係者向けに明確なレポートを作成します
制限事項
- 上記の範囲に明確に該当するタスクに限り、このスキルを使用してください。
- 出力を、環境に応じた検証、テスト、専門家によるレビューの代わりとして扱わないでください。
- 必要な入力、権限、安全上の境界、成功基準が不足している場合は、作業を中止して確認を求めてください。
コメント
Markdown 対応