agentleFS
HiyokoSauna37HiyokoSauna37/claudecode-re-toolkit/.claude/skills/malware-fetch/SKILL.md

malware-fetch

Skill17 starsChanged 2 months agoMITView on GitHub

Safely access dangerous websites (malware, phishing, ClickFix, C2) via Docker-isolated browser. AES-256 encrypted downloads. Integrated VT/MalwareBazaar/ThreatFox/OTX lookups, C2 auto-profiling, network log classification, batch domain probing. Use when: URL分析, C2偵察, ハッシュチェック, マルウェアサイト, フィッシング解析, ClickFix解析, malware-fetch, c2-profile, OTX, batch-probe, classify Do NOT use for: 単なるURL要約(url-summary)、通常のWebページ閲覧

The file

Files
SKILL.md

Proxy Web

Docker隔離ブラウザでの安全なWeb分析ツール。

コマンド早見表

PW="tools/malware-fetch/malware-fetch.exe"    # 毎回フルパスで実行

# === 基本 ===
$PW preflight                          # Docker/環境変数チェック
$PW probe "URL"                        # Direct probe (推奨: [Action] 判断後に --tor 要否決定)
$PW probe --tor "URL"                  # 強制 Tor probe (要ホスト側 127.0.0.1:9050)
$PW "URL"                             # URL分析(SS+DL+暗号化)
$PW --tor "URL"                       # Tor経由URL分析(tor-proxy コンテナ自動起動)
$PW decrypt <file.enc.gz>             # 復号化

# === 脅威インテリジェンス ===
$PW check <sha256>                    # VTハッシュ検出率
$PW behavior <sha256>                 # VT振る舞い
$PW lookup <sha256>                   # VT詳細
$PW vt-ip <IP>                        # VT IPレポート
$PW threatfox ioc "IP:port"           # ThreatFox IOC
$PW threatfox tag/hash/malware <val>  # ThreatFox検索
$PW bazaar hash/sig/tag <val>         # MalwareBazaar検索
$PW bazaar download <sha256>          # サンプルDL (--to-ghidra)
$PW otx domain/ip <val>              # OTXパルス検索
$PW otx pulse/hashes/urls/stats <id> # OTXパルス詳細

# === C2偵察 ===
$PW c2-profile <IP[:port]>           # 自動偵察(VT+TF+OTX+DNS+ポートスキャン)
$PW recon "URL"                       # HTTPメソッド/拡張子/SSL偵察
$PW ws probe "ws://IP:port/ws"       # WebSocket認証チェック
$PW ws capture "ws://IP:port/ws" -d 60 --json
$PW list "URL"                        # ディレクトリリスティング

# === 生ファイル取得 ===
$PW fetch "URL"                       # .enc.gz暗号化保存(Defender対策)
$PW fetch "URL" -o output.js          # ファイル名指定(保存は output.js.enc.gz)
$PW fetch "URL" -d ./mydir            # 出力先ディレクトリ指定
$PW decrypt <file.enc.gz>             # 復号してから解析

# === JS難読化解析 ===
python3 tools/malware-fetch/js_deobfuscate.py --url "URL"          # ★推奨: URL直接解析(ディスク書込なし)
python3 tools/malware-fetch/js_deobfuscate.py <file.js>            # ローカルファイル解析
python3 tools/malware-fetch/js_deobfuscate.py <file.enc.gz>        # 暗号化済みファイル自動復号+解析
python3 tools/malware-fetch/js_deobfuscate.py <file> --json        # JSON出力
python3 tools/malware-fetch/js_deobfuscate.py <file> --ioc-only    # IOCのみ
python3 tools/malware-fetch/js_deobfuscate.py <file> --strings-only # 抽出文字列のみ表示(IOC前段のスクリーニング用)
python3 tools/malware-fetch/js_deobfuscate.py page.html            # malware-fetch出力のpage.htmlも対応

# === ClearFake専用解析 ===
python3 tools/malware-fetch/clearfake_decode.py "URL"              # XOR+B64復号+スマートコントラクト設定+IOC
python3 tools/malware-fetch/clearfake_decode.py "URL" --modes cloudflare,browser  # モードスクリプット指定
python3 tools/malware-fetch/clearfake_decode.py "URL" --ioc-only   # IOCリストのみ
python3 tools/malware-fetch/clearfake_decode.py "URL" --json       # JSON出力

# === 分析 ===
$PW classify <csv> --target <domain>        # ネットワークログ分類
$PW batch-probe <file> --threads 30         # 大量ドメイン一括プローブ (stdout出力のみ、ファイル書込なし)
$PW batch-probe <file> --timeout 5 --dns-only   # DNS解決のみで高速チェック
$PW probe --batch "URL"                     # 並列安全probe (exit 2で全キャンセル回避)

batch-probe の出力仕様

  • ファイル出力なし、stdout のみ。結果を保存したい場合は | tee result.txt でリダイレクト
  • 分類: Alive(DNS解決+HTTP応答あり)/ Filtered(timeout、FW疑い)/ Dead(DNS失敗/refused/521)
  • Alive 行フォーマット: domain.example -> 1.2.3.4 HTTP 200 [nginx]
  • アクティブドメイン抽出 one-liner:
    $PW batch-probe domains.txt --threads 30 \
      | awk '/^Alive domains:/{flag=1;next} /^Filtered/{flag=0} flag && /->/{print $1}' > active.txt
  • 後続は active.txt を用いて probe → [Action] 判断 → URL分析 or classify へ

C2プロファイリング

$PW c2-profile <IP[:port]>

→ VT IP + ThreatFox + OTX + Passive DNS再帰ピボット + 全IPポートスキャン + SSHバナー + IOCリスト

追加調査が必要な場合のみ: recon / ws probe / list / URL分析

ネットワークログ分類

URL分析後のnetwork.csvを自動分類:

$PW classify Quarantine/<domain>/<ts>/network.csv --target <domain>

検出カテゴリ: BLOCKCHAIN_RPC(C2設定取得) / C2_API / TRACKER / TARGET / CDN

出力先

tools/malware-fetch/Quarantine/<domain>/<timestamp>/

主要ファイル: screenshot.png / page.html / *.enc.gz (AES-256-CBC + gzip) / metadata.json / network.csv

ClickFix検出時: clipboard_captured.json / decoded_payloads.json / inline_N.js / script_N.js

生のEXE/DLL/ZIPはホストに出現しない。

出力先の解決ロジック(cwd 非依存)

Quarantine/ の親ディレクトリは次の優先順で決まる。サブディレクトリから malware-fetch.exe を実行しても二重ネストしない(過去のバグ修正、2026-04-27):

  1. --out (analyze) / -d (fetch) で明示指定したパス
  2. 環境変数 MALWARE_FETCH_QUARANTINE(絶対パスのベースディレクトリを上書き)
  3. malware-fetch.exe が置かれているディレクトリ直下の Quarantine/(デフォルト)

注意: 以前は cwd 相対の tools/malware-fetch/Quarantine/... を書き込んでいたため、cd Tools/malware-fetch && ./malware-fetch.exe fetch ... のように呼ぶと tools/malware-fetch/tools/malware-fetch/Quarantine/... という二重ネスト構造ができ、後段の Ghidra コマンドが「ファイルが見つからない」エラーになる事例があった。現在は exe のディレクトリ基準の絶対パスで保存される。

後続解析

DLファイル検出時 → ユーザに「Ghidra Headlessで静的解析しますか?」と確認:

bash tools/ghidra-headless/ghidra.sh quarantine-analyze "<file.enc.gz>"

パッカー検出時 → 「VMware Sandboxで動的解析しますか?」と確認 → malware-sandboxスキル

リファレンス

  • 既知の問題と解決策: references/known-issues.md
  • 調査ナレッジ: references/knowledge.md
  • ビルド: cd tools/malware-fetch && go build -trimpath -ldflags="-s -w" -o malware-fetch.exe .
  • Docker再ビルド: cd tools/malware-fetch && docker build -t malware-fetch-browser:latest .

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.