mcpField
R
recon-and-methodology

recon-and-methodology

github.com/yaklangセキュリティ2.6k4.1k 回インストール6 週間前に更新
リポジトリ

recon-and-methodology について

セキュリティ研究者向けの体系的な偵察とバグバウンティの手法です。資産・エンドポイントの発見、技術スタックの特定、テスト手順、対象の優先順位付けを扱います。

主な機能

  1. 01サブドメインと資産の発見
  2. 02ポートとサービスのスキャン
  3. 03技術スタックの特定
  4. 04エンドポイントとパラメーターの探索
  5. 05テスト手順と優先順位付け

活用シーン

  1. 01プログラム対象の資産を把握
  2. 02隠れた Web エンドポイントの発見
  3. 03対象の技術スタックを特定
  4. 04アプリ機能のテスト順を計画

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/yaklang/hack-skills --skill recon-and-methodology

インストール後、Claude Code で/recon-and-methodologyを入力して読み込まれたか確認します。

詳細

スキル:偵察と方法論 — バグバウンティのエキスパート向けプレイブック

AI LOAD INSTRUCTION:トップクラスのバグハンターによる体系的な偵察とバグ発見の方法論です。サブドメインの列挙、エンドポイントの発見、技術スタックのフィンガープリンティング、他の人が見逃すバグを見つけるためのハンターの思考モデルを扱います。重要なポイントは、深刻度の高いバグの大半は、巧妙なペイロードだけではなく、体系的に網羅することで見つかるということです。


1. 偵察の優先順位

Target Selection
└── Scope Definition (in-scope assets)
    └── Asset Discovery (subdomains, IPs, domains)
        └── Tech Fingerprinting (what's running)
            └── Endpoint Discovery (attack surface)
                └── Vulnerability Testing (per vulnerability type)

2. サブドメインの列挙(最初に必ず実施)

パッシブ(対象への DNS クエリなし)
# Subfinder (aggregates multiple sources):
subfinder -d target.com -o subdomains.txt

# Amass passive:
amass enum -passive -d target.com

# Certsh (certificate transparency):
curl -s "https://crt.sh/?q=%.target.com&output=json" | jq -r '.[].name_value' | sort -u

# SecurityTrails API, Shodan:
# Web: https://securitytrails.com/list/apex_domain/target.com
アクティブ(DNS ブルートフォース+名前解決)
# Massdns + wordlist:
massdns -r /path/to/resolvers.txt -t A -o S -w output.txt \
  <(cat wordlist.txt | sed 's/$/.target.com/')

# ffuf for subdomain brute:
ffuf -w subdomains-wordlist.txt -u https://FUZZ.target.com \
  -mc 200,301,302,403 -H "Host: FUZZ.target.com"

# DNSx for bulk resolution:
cat subdomains.txt | dnsx -a -resp -o resolved.txt

# Recommended wordlist: SecLists/Discovery/DNS/
バーチャルホストの発見
# ffuf vhost mode:
ffuf -w wordlist.txt -u https://target.com \
  -H "Host: FUZZ.target.com" -mc 200,301,403

# gobuster vhost:
gobuster vhost -u https://target.com -w wordlist.txt

3. サービスとポートの発見

# Fast port scan (common ports):
nmap -T4 -F target.com -oN ports.txt

# Comprehensive scan on resolved subdomains:
cat resolved_ips.txt | nmap -iL - --open -p 80,443,8080,8443,8888,3000,5000 -oG scan.txt

# httpx for HTTP probing:
cat subdomains.txt | httpx -title -tech-detect -status-code -o live_hosts.txt

# masscan for speed on large IP ranges:
masscan -p 80,443,8080,8443 10.0.0.0/8 --rate=1000

4. ウェブ技術のフィンガープリンティング

# Wappalyzer (browser extension) or:
whatweb https://target.com

# httpx with tech detection:
httpx -u https://target.com -tech-detect

# Check headers manually:
curl -sI https://target.com | grep -i "server\|x-powered-by\|x-generator\|cf-ray"

# Fingerprint from:
- Server header: nginx/1.18, Apache/2.4, IIS/10.0
- X-Powered-By: PHP/7.4, ASP.NET
- Cookies: PHPSESSID (PHP), JSESSIONID (Java), _rails_session (Rails)
- HTML comments: 
- Meta generator: <meta name="generator" content="WordPress 6.2">
- JS framework files: /static/js/angular.min.js

5. エンドポイントの発見

ディレクトリのブルートフォース
# ffuf (fastest):
ffuf -u https://target.com/FUZZ -w /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt \
  -mc 200,301,302,403 -t 50 -o dirs.txt

# Gobuster:
gobuster dir -u https://target.com -w wordlist.txt -x php,html,js,json

# feroxbuster (recursive):
feroxbuster -u https://target.com -w wordlist.txt -x php,html,txt -r
パラメーターの発見
# Arjun (hidden parameter finder):
arjun -u https://target.com/api/endpoint

# x8:
x8 -u https://target.com/api/endpoint -w params-wordlist.txt
JavaScript ソースの調査
# Extract endpoints from JS files:
gau target.com | grep '\.js$' | httpx -mc 200 | xargs -I{} curl -s {} | \
  grep -oE '"/[a-zA-Z0-9/_-]+"' | sort -u

# LinkFinder:
python3 linkfinder.py -i https://target.com -d -o output.html

# GetAllURLs (gau):
gau target.com | sort -u > all_urls.txt

# Wayback URLs:
waybackurls target.com | sort -u > wayback_urls.txt
API エンドポイントの発見
# Common API paths:
ffuf -u https://target.com/FUZZ -w /SecLists/Discovery/Web-Content/api/api-endpoints.txt

# Swagger/OpenAPI:
test: /swagger.json /api-docs /openapi.json /v2/api-docs /.well-known/ /docs/

# GraphQL:
test: /graphql /gql /v1/graphql /api/graphql

6. ソースコードの偵察

GitHub / GitLab の露出
# trufflehog (secret scanner in git history):
trufflehog git https://github.com/target-org/target-repo

# gitleaks:
gitleaks detect --source /path/to/cloned/repo

# Manual GitHub search:
# site:github.com "target.com" "api_key" OR "secret" OR "password"
# site:github.com "target.com" ".env" OR "config.php" OR "db_password"

# GitHub dorks:
# "target.com" extension:env
# "target.com" filename:*.config password
# org:target-org secret OR password OR apikey
環境ファイルの露出
# Check common paths:
https://target.com/.env
https://target.com/.git/config
https://target.com/config.json
https://target.com/config.yaml
https://target.com/credentials.json
https://target.com/secrets.json
https://target.com/wp-config.php
https://target.com/backup.sql
https://target.com/backup.zip

7. ZSEANO のテスト方法論

基本理念
  1. 多数のプログラムに手を広げるよりも、1 つのプログラムを深く調べる — アプリケーションを徹底的に理解します
  2. 企業のプロフィールを作成する — 技術スタック、開発者、プロセスを調べます
  3. 他の人が見ない場所を調べる — エラーページ、管理者向けパス、旧バージョン、モバイル API を確認します
  4. フィルターをたどる — ある場所で入力がフィルタリングされているなら、その機能は存在しており、回避できる可能性があります
テストの順序(1 ページ/機能)
For each input point:
1. Non-malicious HTML tags (<h2>, <img>) → are they reflected?
2. Incomplete tags → what happens? (<iframe src=//evil.com )
3. Encoding tests → %0d, %0a, %09, <%00
4. Observe the OUTPUT too (not just response) — where does your input appear?
5. Test same input in ALL similarly-structured pages (shared code → shared vuln)
6. Check if the same parameter exists in mobile/API endpoint (less protected)
パラメーターに関する知見
- Each parameter tells a story: "what does this do server-side?"
- Filename → OS interaction → Path Traversal / CMDi
- URL/location → HTTP fetch → SSRF
- Template/HTML parameter → render function → SSTI
- XML field → parser → XXE
- SQL filter → query → SQLi
- User-content → storage → Stored XSS

8. バグバウンティプログラムのトリアージ(時間をかける対象)

高価値なターゲットの選定
✓ Programs with large scope (*.target.com)
✓ Programs that pay for P2/P3 (not just RCE)
✓ Programs with recent tech changes (migrations = new bugs)
✓ Programs with active development (new features = new attack surface)
× Avoid: frozen/old codebases with well-known CVEs (already claimed)
× Avoid: strict programs with narrow scope (less surface)
高価値な機能に注目(バグの発生確率別)
Priority 1: Authentication, password reset, 2FA → account takeover
Priority 2: File upload, profile edit, API endpoints → stored XSS, IDOR
Priority 3: Admin panels, user management → BFLA, privilege escalation
Priority 4: Payment flows, subscription → business logic
Priority 5: Import/export, template rendering → XXE, SSTI

9. NUCLEI テンプレート(自動スキャン)

# Run all on target:
nuclei -u https://target.com -t /nuclei-templates/ -o nuclei-results.txt

# Specific categories:
nuclei -u https://target.com -t cves/ -severity critical,high
nuclei -u https://target.com -t exposures/
nuclei -u https://target.com -t misconfiguration/

# On subdomain list:
cat subdomains.txt | nuclei -t exposures/ -t misconfiguration/ -o exposed.txt

10. よくある設定ミス(手軽に見つかる成果)

□ CORS: Access-Control-Allow-Origin: * with credentials → CSRF + data theft
□ S3 bucket public: curl https://target.s3.amazonaws.com/
□ Directory listing: response contains "Index of /"
□ .git exposed: curl https://target.com/.git/config
□ .env exposed: curl https://target.com/.env
□ Debug mode: stack traces in production (source code exposure)
□ Default credentials: admin:admin, admin:password on admin panels
□ phpinfo.php: curl https://target.com/phpinfo.php
□ Backup files: config.bak, database.sql.gz, app.zip
□ GraphQL introspection enabled: POST /graphql {"query":"{__schema{types{name}}}"}
□ Admin panels: /admin /manager /console /phpmyadmin /wp-admin

11. ツール早見表

カテゴリツール
サブドメイン列挙subfinder, amass, massdns
ポートスキャンnmap, masscan
HTTP プローブhttpx
ディレクトリのブルートフォースffuf, feroxbuster, gobuster
JS 調査LinkFinder, gau, waybackurls
シークレットスキャンtrufflehog, gitleaks
パラメーターファジングarjun, x8
脆弱性スキャンnuclei
プロキシ/インターセプトBurp Suite Pro
JWT 攻撃jwt_tool
SQLisqlmap
XSSdalfox, XSStrike
SSRFSSRFmap, Gopherus

12. JAVA ミドルウェアのフィンガープリント一覧

ミドルウェア検出パス主な兆候
Apache Tomcat/manager/html, /manager/statusデフォルト認証情報:tomcat:tomcat、admin:admin
JBoss / WildFly/jmx-console/, /web-console/JMX MBean アクセス、WAR のデプロイ
WebLogic/console/, /wls-wsat/7001/7002 ポートでの T3 プロトコル、IIOP
Spring Boot Actuator/actuator/, /actuator/env, /actuator/heapdumpJSON エンドポイント一覧、ヒープダンプにシークレットが含まれる
Spring Boot(代替パス)/actuator/jolokia, /actuator/gateway/routesJolokia JMX ブリッジ、Gateway ルートへのインジェクション
Jenkins/script, /manageGroovy コンソール、Cookie 内の API トークン
GlassFish/common/, /theme/4848 ポートの管理者向け機能、デフォルトの空のパスワード
Jetty/jolokia/JMX アクセス
Resin/resin-admin/管理パネル
Spring Boot Actuator の悪用優先度
/actuator/env          → Leak environment variables (DB creds, API keys)
/actuator/heapdump     → Download JVM heap → search for passwords in memory
/actuator/jolokia      → JMX → possible RCE via MBean manipulation
/actuator/gateway/routes → Spring Cloud Gateway → SpEL injection (CVE-2022-22947)
/actuator/configprops  → All configuration properties
/actuator/mappings     → All URL mappings (hidden endpoints)
/actuator/beans        → All Spring beans
/actuator/threaddump   → Thread dump (may leak session tokens / secrets in stack frames)

13. 情報漏えい検出チェックリスト

バージョン管理とバックアップの漏えい
/.git/HEAD                    → Git repository exposed
/.svn/entries                 → SVN metadata
/.svn/wc.db                   → SVN SQLite database
/.hg/requires                 → Mercurial
/.bzr/README                  → Bazaar
/.DS_Store                    → macOS directory listing
バックアップファイルのパターン
/backup.zip    /backup.tar.gz    /backup.sql
/wwwroot.rar   /www.zip          /web.zip
/db.sql        /database.sql     /dump.sql
/config.php.bak    /config.php~    /config.php.swp
/.config.php.swp   /wp-config.php.bak
/.env          /.env.bak         /.env.production
API ドキュメントとデバッグ
/swagger-ui.html              → Swagger/OpenAPI
/swagger-ui/                  → Swagger UI
/api-docs                     → API documentation
/graphql                      → GraphQL playground
/graphiql                     → GraphQL IDE
/debug/                       → Debug endpoints
/phpinfo.php                  → PHP configuration
/server-status                → Apache status
/server-info                  → Apache info
/nginx_status                 → Nginx status
クラウドとインフラストラクチャ
/.aws/credentials             → AWS credentials
/.docker/config.json          → Docker registry auth
/robots.txt                   → Disallowed paths (hint list)
/sitemap.xml                  → Full URL listing
/crossdomain.xml              → Flash cross-domain policy
/.well-known/                 → Various well-known URIs

コメント