SKILL.md
唯讀
名稱
recon-and-methodology
描述
偵察與測試方法論指南。適用於梳理目標資產、探索端點、分析技術棧(Fingerprinting),以及為新目標建立結構化的漏洞測試計畫。
SKILL: Recon and Methodology — 頂尖 Bug Bounty 實戰指南
AI 載入指令:來自頂尖漏洞獵人(Bug Hunter)的系統化偵察與漏洞挖掘方法論。涵蓋子域名枚舉、端點探索、技術指紋分析,以及尋找他人忽略之漏洞的心智模型。核心洞察:大多數高危漏洞來自全面且系統化的覆蓋,而非僅靠精妙的 Payload。
1. 偵察層級架構(RECON HIERARCHY)
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(整合多個來源):
subfinder -d target.com -o subdomains.txt
# Amass 被動收集:
amass enum -passive -d target.com
# Certsh(憑證透明度):
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 + 字典檔:
massdns -r /path/to/resolvers.txt -t A -o S -w output.txt \
<(cat wordlist.txt | sed 's/$/.target.com/')
# ffuf 進行子域名爆破:
ffuf -w subdomains-wordlist.txt -u https://FUZZ.target.com \
-mc 200,301,302,403 -H "Host: FUZZ.target.com"
# DNSx 進行批次解析:
cat subdomains.txt | dnsx -a -resp -o resolved.txt
# 推薦字典檔:SecLists/Discovery/DNS/
虛擬主機探索(Virtual Host Discovery)
# ffuf 虛擬主機(vhost)模式:
ffuf -w wordlist.txt -u https://target.com \
-H "Host: FUZZ.target.com" -mc 200,301,403
# gobuster 虛擬主機:
gobuster vhost -u https://target.com -w wordlist.txt
3. 服務與埠號探索
# 快速埠號掃描(常見埠號):
nmap -T4 -F target.com -oN ports.txt
# 對已解析的子域名進行全面掃描:
cat resolved_ips.txt | nmap -iL - --open -p 80,443,8080,8443,8888,3000,5000 -oG scan.txt
# 使用 httpx 進行 HTTP 探測:
cat subdomains.txt | httpx -title -tech-detect -status-code -o live_hosts.txt
# masscan 用於大型 IP 段的高速掃描:
masscan -p 80,443,8080,8443 10.0.0.0/8 --rate=1000
4. Web 技術指紋分析
# Wappalyzer(瀏覽器擴充功能)或:
whatweb https://target.com
# 搭配技術檢測的 httpx:
httpx -u https://target.com -tech-detect
# 手動檢查 Header:
curl -sI https://target.com | grep -i "server\|x-powered-by\|x-generator\|cf-ray"
# 指紋特徵來源:
- 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: <!-- Drupal 9 -->
- Meta generator: <meta name="generator" content="WordPress 6.2">
- JS framework files: /static/js/angular.min.js
5. 端點探索
目錄爆破
# ffuf(速度最快):
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(遞迴掃描):
feroxbuster -u https://target.com -w wordlist.txt -x php,html,txt -r
隱藏參數探索
# Arjun(隱藏參數尋找工具):
arjun -u https://target.com/api/endpoint
# x8:
x8 -u https://target.com/api/endpoint -w params-wordlist.txt
JavaScript 源碼挖掘
# 從 JS 檔案中提取端點:
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 端點探索
# 常見 API 路徑:
ffuf -u https://target.com/FUZZ -w /SecLists/Discovery/Web-Content/api/api-endpoints.txt
# Swagger/OpenAPI:
測試路徑:/swagger.json /api-docs /openapi.json /v2/api-docs /.well-known/ /docs/
# GraphQL:
測試路徑:/graphql /gql /v1/graphql /api/graphql
6. 原始碼偵察
GitHub / GitLab 敏感資訊洩漏
# trufflehog(Git 歷史紀錄金鑰掃描):
trufflehog git https://github.com/target-org/target-repo
# gitleaks:
gitleaks detect --source /path/to/cloned/repo
# 手動 GitHub 搜尋:
# 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
洩漏的環境設定檔
# 檢查常見路徑:
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 的測試方法論
核心哲學
- 深耕單一專案而非廣泛涉獵 — 徹底理解應用程式細節
- 建立目標公司的完整剖面(Profile) — 技術棧、開發人員習慣、開發流程
- 探索他人忽略的死角 — 檢查錯誤頁面、管理者路徑、舊版本、行動端 API
- 跟著過濾器走(Follow the filter) — 如果輸入在某處被過濾,代表該功能確實存在,且可能被繞過
測試步驟(針對單一頁面/功能)
針對每個輸入點:
1. 無害的 HTML 標籤(<h2>, <img>)→ 是否會被反映(Reflected)出來?
2. 不完整的標籤 → 會發生什麼事?(<iframe src=//evil.com )
3. 編碼測試 → %0d, %0a, %09, <%00
4. 同時觀察「輸出」(而不只是 HTTP 回應)— 你的輸入出現在哪裡?
5. 在所有結構相似的頁面上測試相同的輸入(共用程式碼 → 共用漏洞)
6. 檢查行動端/API 端點是否存在相同參數(保護通常較少)
參數分析洞察
- 每個參數都在訴說一個故事:「這個參數在伺服器端做了什麼?」
- 檔名(Filename)→ 作業系統互動 → 路徑穿越(Path Traversal)/ 命令注入(CMDi)
- URL/位置(Location)→ HTTP 抓取 → 伺服器端請求偽造(SSRF)
- 模板/HTML 參數 → 渲染函數 → 伺服器端模板注入(SSTI)
- XML 欄位 → 解析器 → XML 外部實體注入(XXE)
- SQL 過濾器 → 資料庫查詢 → SQL 注入(SQLi)
- 使用者內容 → 資料儲存 → 儲存型 XSS(Stored XSS)
8. BUG BOUNTY 計畫分流與時間分配
高價值目標篩選
✓ 範圍廣大的計畫 (*.target.com)
✓ 會針對 P2/P3 支付獎金的計畫(而不僅限於 RCE)
✓ 近期有技術架構變更的計畫(系統轉移 = 新漏洞)
✓ 處於活躍開發狀態的計畫(新功能 = 新攻擊面)
× 避免:凍結/老舊且充斥已知 CVE 的程式碼庫(通常已被回報)
× 避免:範圍過於狹窄的嚴苛計畫(攻擊面較小)
高價值功能聚焦(依漏洞出現機率)
優先級 1:身份驗證、重設密碼、雙因子驗證(2FA)→ 帳號劫持(Account Takeover)
優先級 2:檔案上傳、個人資料編輯、API 端點 → 儲存型 XSS、越權存取(IDOR)
優先級 3:管理後台、使用者管理 → 破壞功能級別存取控制(BFLA)、權限提升
優先級 4:支付流程、訂閱機制 → 業務邏輯漏洞
優先級 5:匯入/匯出、模板渲染 → XXE、SSTI
9. NUCLEI 腳本範本(自動化掃描)
# 對目標執行所有掃描:
nuclei -u https://target.com -t /nuclei-templates/ -o nuclei-results.txt
# 特定分類掃描:
nuclei -u https://target.com -t cves/ -severity critical,high
nuclei -u https://target.com -t exposures/
nuclei -u https://target.com -t misconfiguration/
# 對子域名清單執行掃描:
cat subdomains.txt | nuclei -t exposures/ -t misconfiguration/ -o exposed.txt
10. 常見設定錯誤(快速拿獎金)
□ CORS: Access-Control-Allow-Origin: * 搭配 credentials → CSRF + 資料竊取
□ S3 Bucket 公開:curl https://target.s3.amazonaws.com/
□ 目錄列表(Directory Listing):回應包含 "Index of /"
□ .git 目錄外露:curl https://target.com/.git/config
□ .env 檔案外露:curl https://target.com/.env
□ 除錯模式(Debug Mode):生產環境洩漏 Stack Trace(原始碼外露)
□ 預設憑證:管理後台使用 admin:admin, admin:password
□ phpinfo.php:curl https://target.com/phpinfo.php
□ 備份檔案:config.bak, database.sql.gz, app.zip
□ GraphQL 內省(Introspection)未關閉:POST /graphql {"query":"{__schema{types{name}}}"}
□ 管理後台:/admin /manager /console /phpmyadmin /wp-admin
11. 常用工具快速參考
| 分類 | 工具 |
|---|---|
| 子域名枚舉 | subfinder, amass, massdns |
| 埠號掃描 | nmap, masscan |
| HTTP 探測 | httpx |
| 目錄爆破 | ffuf, feroxbuster, gobuster |
| JS 挖掘 | LinkFinder, gau, waybackurls |
| 敏感資訊掃描 | trufflehog, gitleaks |
| 參數 Fuzzing | arjun, x8 |
| 漏洞掃描 | nuclei |
| 代理/攔截 | Burp Suite Pro |
| JWT 攻擊 | jwt_tool |
| SQLi | sqlmap |
| XSS | dalfox, XSStrike |
| SSRF | SSRFmap, 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/heapdump |
JSON 端點清單、Heap Dump 包含敏感憑證 |
| Spring Boot(替代路徑) | /actuator/jolokia, /actuator/gateway/routes |
Jolokia JMX 橋接、Gateway 路由注入 |
| Jenkins | /script, /manage |
Groovy 主控台、Cookie 中包含 API Token |
| GlassFish | /common/, /theme/ |
埠號 4848 上的管理介面、預設空密碼 |
| Jetty | /jolokia/ |
JMX 存取 |
| Resin | /resin-admin/ |
管理介面 |
Spring Boot Actuator 漏洞利用優先級
/actuator/env → 洩漏環境變數(資料庫憑證、API 金鑰)
/actuator/heapdump → 下載 JVM Heap Dump → 於記憶體中搜尋密碼
/actuator/jolokia → JMX → 可能透過 MBean 操作達成 RCE
/actuator/gateway/routes → Spring Cloud Gateway → SpEL 注入 (CVE-2022-22947)
/actuator/configprops → 所有設定屬性
/actuator/mappings → 所有 URL 映射(隱藏端點)
/actuator/beans → 所有 Spring Beans
/actuator/threaddump → Thread Dump(可能在堆疊幀中洩漏 Session Token/敏感資訊)
13. 資訊洩漏檢測清單
版本控制與備份外露
/.git/HEAD → Git 版本庫外露
/.svn/entries → SVN 中繼資料
/.svn/wc.db → SVN SQLite 資料庫
/.hg/requires → Mercurial
/.bzr/README → Bazaar
/.DS_Store → macOS 目錄列表
備份檔案模式
/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 文件
/graphql → GraphQL 測試場(Playground)
/graphiql → GraphQL IDE
/debug/ → 除錯端點
/phpinfo.php → PHP 設定資訊
/server-status → Apache 狀態
/server-info → Apache 資訊
/nginx_status → Nginx 狀態
雲端與基礎設施
/.aws/credentials → AWS 認證金鑰
/.docker/config.json → Docker Registry 驗證資訊
/robots.txt → 禁止存取路徑(提示清單)
/sitemap.xml → 完整 URL 列表
/crossdomain.xml → Flash 跨域策略
/.well-known/
<!-- 翻譯批次截斷;完整正文延續自原始資料 -->






