Red Team Tools and Methodology について
セキュリティ研究者向けに、偵察、脆弱性の発見、バグバウンティの作業手順をまとめたスキルです。自動化パイプラインと手動分析を扱い、プログラムの対象範囲に沿ったテストを重視します。
主な機能
- 01サブドメイン列挙と稼働ホスト検出
- 02技術フィンガープリントとコンテンツ探索
- 03脆弱性および API テスト手順
- 04XSS と偵察の自動化パイプライン
- 05対象範囲、レート制限、検証の指針
活用シーン
- 01対象のサブドメインと稼働ホストを把握
- 02追加テスト用のエンドポイントと技術を発見
- 03許可された対象をスキャンして一般的な脆弱性を調査
- 04検証済みのバグバウンティ報告を作成
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ davila7/ claude-code-templates --skill red-team-tools-and-methodologyインストール後、Claude Code で/red-team-tools-and-methodologyを入力して読み込まれたか確認します。
詳細
レッドチームツールと手法
目的
トップレベルのセキュリティ研究者による実績のある手法とツールワークフローを実装し、効果的な偵察、脆弱性の発見、バグバウンティハンティングを行います。一般的なタスクを自動化しつつ、攻撃対象領域を網羅的にカバーします。
入力/前提条件
- ターゲットのスコープ定義(ドメイン、IP 範囲、アプリケーション)
- Linux ベースの攻撃用マシン(Kali、Ubuntu)
- バグバウンティプログラムのルールとスコープ
- ツールの依存関係のインストール(Go、Python、Ruby)
- 各種サービス(Shodan、Censys など)の API キー
出力/成果物
- 包括的なサブドメイン列挙
- 稼働ホストの検出と技術フィンガープリント
- 特定された脆弱性と攻撃ベクトル
- 自動化された偵察パイプラインの出力
- レポート用に文書化された調査結果
中核ワークフロー
1. プロジェクトの追跡と取得
偵察の追跡を設定します:
# Create project structure
mkdir -p target/{recon,vulns,reports}
cd target
# Find acquisitions using Crunchbase
# Search manually for subsidiary companies
# Get ASN for targets
amass intel -org "Target Company" -src
# Alternative ASN lookup
curl -s "https://bgp.he.net/search?search=targetcompany&commit=Search"
2. サブドメイン列挙
包括的なサブドメイン探索:
# Create wildcards file
echo "target.com" > wildcards
# Run Amass passively
amass enum -passive -d target.com -src -o amass_passive.txt
# Run Amass actively
amass enum -active -d target.com -src -o amass_active.txt
# Use Subfinder
subfinder -d target.com -silent -o subfinder.txt
# Asset discovery
cat wildcards | assetfinder --subs-only | anew domains.txt
# Alternative subdomain tools
findomain -t target.com -o
# Generate permutations with dnsgen
cat domains.txt | dnsgen - | httprobe > permuted.txt
# Combine all sources
cat amass_*.txt subfinder.txt | sort -u > all_subs.txt
3. 稼働ホストの検出
応答するホストを特定します:
# Check which hosts are live with httprobe
cat domains.txt | httprobe -c 80 --prefer-https | anew hosts.txt
# Use httpx for more details
cat domains.txt | httpx -title -tech-detect -status-code -o live_hosts.txt
# Alternative with massdns
massdns -r resolvers.txt -t A -o S domains.txt > resolved.txt
4. 技術フィンガープリント
標的型攻撃のために技術を特定します:
# Whatweb scanning
whatweb -i hosts.txt -a 3 -v > tech_stack.txt
# Nuclei technology detection
nuclei -l hosts.txt -t technologies/ -o tech_nuclei.txt
# Wappalyzer (if available)
# Browser extension for manual review
5. コンテンツ探索
隠されたエンドポイントやファイルを見つけます:
# Directory bruteforce with ffuf
ffuf -ac -v -u https://target.com/FUZZ -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
# Historical URLs from Wayback
waybackurls target.com | tee wayback.txt
# Find all URLs with gau
gau target.com | tee all_urls.txt
# Parameter discovery
cat all_urls.txt | grep "=" | sort -u > params.txt
# Generate custom wordlist from historical data
cat all_urls.txt | unfurl paths | sort -u > custom_wordlist.txt
6. アプリケーション分析(Jason Haddix の手法)
ヒートマップの優先領域:
- ファイルアップロード - インジェクション、XXE、SSRF、シェルアップロードをテスト
- コンテンツタイプ - multipart フォームを Burp でフィルタリング
- API - 隠れたメソッドや認証の欠如を探す
- プロフィールセクション - 保存型 XSS、カスタムフィールド
- 連携機能 - サードパーティ経由の SSRF
- エラーページ - 特殊なインジェクションポイント
分析の問い:
- アプリはどのようにデータを受け渡しするか?(パラメータ、API、ハイブリッド)
- アプリはどこでユーザーについて扱っているか?(UID、UUID のエンドポイント)
- サイトはマルチテナントやユーザーレベルを持っているか?
- 独自の脅威モデルを持っているか?
- サイトは XSS/CSRF をどのように処理しているか?
- サイトに過去のライトアップや脆弱性悪用の事例はあるか?
7. 自動化された XSS ハンティング
# ParamSpider for parameter extraction
python3 paramspider.py --domain target.com -o params.txt
# Filter with Gxss
cat params.txt | Gxss -p test
# Dalfox for XSS testing
cat params.txt | dalfox pipe --mining-dict params.txt -o xss_results.txt
# Alternative workflow
waybackurls target.com | grep "=" | qsreplace '"><script>alert(1)</script>' | while read url; do
curl -s "$url" | grep -q 'alert(1)' && echo "$url"
done > potential_xss.txt
8. 脆弱性スキャン
# Nuclei comprehensive scan
nuclei -l hosts.txt -t ~/nuclei-templates/ -o nuclei_results.txt
# Check for common CVEs
nuclei -l hosts.txt -t cves/ -o cve_results.txt
# Web vulnerabilities
nuclei -l hosts.txt -t vulnerabilities/ -o vuln_results.txt
9. API 列挙
API ファジング用のワードリスト:
# Enumerate API endpoints
ffuf -u https://target.com/api/FUZZ -w /usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt
# Test API versions
ffuf -u https://target.com/api/v1/FUZZ -w api_wordlist.txt
ffuf -u https://target.com/api/v2/FUZZ -w api_wordlist.txt
# Check for hidden methods
for method in GET POST PUT DELETE PATCH; do
curl -X $method https://target.com/api/users -v
done
10. 自動化された偵察スクリプト
#!/bin/bash
domain=$1
if [[ -z $domain ]]; then
echo "Usage: ./recon.sh <domain>"
exit 1
fi
mkdir -p "$domain"
# Subdomain enumeration
echo "[*] Enumerating subdomains..."
subfinder -d "$domain" -silent > "$domain/subs.txt"
# Live host discovery
echo "[*] Finding live hosts..."
cat "$domain/subs.txt" | httpx -title -tech-detect -status-code > "$domain/live.txt"
# URL collection
echo "[*] Collecting URLs..."
cat "$domain/live.txt" | waybackurls > "$domain/urls.txt"
# Nuclei scanning
echo "[*] Running Nuclei..."
nuclei -l "$domain/live.txt" -o "$domain/nuclei.txt"
echo "[+] Recon complete!"
クイックリファレンス
主要ツール
| ツール | 用途 |
|---|---|
| Amass | サブドメイン列挙 |
| Subfinder | 高速なサブドメイン検出 |
| httpx/httprobe | 稼働ホストの検出 |
| ffuf | コンテンツ探索 |
| Nuclei | 脆弱性スキャン |
| Burp Suite | 手動テスト |
| Dalfox | XSS の自動化 |
| waybackurls | 過去の URL の収集 |
確認すべき主な API エンドポイント
/api/v1/users
/api/v1/admin
/api/v1/profile
/api/users/me
/api/config
/api/debug
/api/swagger
/api/graphql
XSS フィルターのテスト
<h1><img><table>
<script>
%3Cscript%3E
%253Cscript%253E
%26lt;script%26gt;
制約事項
- プログラムのスコープ境界を遵守すること
- 許可なく本番環境に対して DoS やファジングを行わないこと
- ブロックを避けるためにリクエストのレート制限を行うこと
- ツールによっては誤検知が発生する場合があること
- 一部のツールで完全な機能を利用するには API キーが必要であること
例
例 1: 簡易サブドメイン偵察
subfinder -d target.com | httpx -title | tee results.txt
例 2: XSS ハンティングパイプライン
waybackurls target.com | grep "=" | qsreplace "test" | httpx -silent | dalfox pipe
例 3: 包括的スキャン
# Full recon chain
amass enum -d target.com | httpx | nuclei -t ~/nuclei-templates/
トラブルシューティング
| 問題 | 解決策 |
|---|---|
| レート制限 | プロキシのローテーションを使用し、同時実行数を減らす |
| 結果が多すぎる | 特定の技術スタックに絞り込む |
| 誤検知 | 報告の前に調査結果を手動で検証する |
| サブドメインの欠落 | 複数の列挙ソースを組み合わせる |
| API キーのエラー | 設定ファイル内のキーを確認する |
| ツールが見つからない | go install で Go ツールをインストールする |
コメント
Markdown 対応