[研究]wafw00f測試沒發現 WAF,但實際是有過 WAF 的
2025-06-10
kali :Linux 測試沒發現 WAF,但實際是有過 WAF 的。
┌──(kali㉿kali)-[~]
└─$ wafw00f https://(遮蔽)/
? ,. ( . ) . "
__ ?? (" ) )' ,' ) . (` '`
(___()'`; ??? .; ) ' (( (" ) ;(, (( ( ;) " )")
/,___ /` _"., ,._'_.,)_(..,( . )_ _' )_') (. _..( ' )
\\ \\ |____|____|____|____|____|____|____|____|____|
~ WAFW00F : v2.3.1 ~
~ Sniffing Web Application Firewalls since 2014 ~
[*] Checking https://(遮蔽)/
[+] Generic Detection results:
[-] No WAF detected by the generic detection
[~] Number of requests: 7
┌──(kali㉿kali)-[~]
└─$
|
********************************************************************************
ChatGPT 說:
這種情況 —— WAFW00F 測不到 WAF,但實際目標有部署 WAF —— 在實務上並不少見。以下是可能的原因與對應建議:
🔍 一、為何 WAFW00F 測不到 WAF?
1. WAF 被設成非侵入式(被動偵測)或透明代理
- 某些 WAF 例如 Cloudflare、F5、AWS WAF 可以在不改變回應標頭、不封鎖探測的情況下運作,只在「明顯攻擊」時才攔截。
- WAFW00F 預設的探測不一定會觸發這些條件。
2. WAF 有設定白名單或學習模式
- 若你的 IP 是白名單、信任來源,WAF 不會對你觸發封鎖規則。
- 學習模式下,WAF 會先觀察行為,不主動阻擋。
3. Web Server 或 CDN 已隱匿 WAF 特徵
- 例如使用 nginx + ModSecurity 搭配自訂錯誤頁面,不容易從標頭或錯誤碼中看出 WAF 存在。
- 或使用 Edge Proxy(如 CloudFront) 將 WAF 內建於背後。
4. WAFW00F 探測 signature 不涵蓋該廠商或版本
- 雖然 WAFW00F 支援 80+ 種 WAF,但不是每一版、每一設定都能辨識。
- 某些中國大陸廠商、客製化 WAF,可能未列入其 signature 資料庫。
🧪 二、如何手動驗證是否有 WAF?
1. 使用明顯攻擊參數測試
curl -i "https://example.com/index.php?id=1 AND 1=1"
curl -i "https://example.com/index.php?id=1; DROP TABLE users--"
看是否出現:
403 Forbidden / 406 Not Acceptable / 429 Too Many Requests
X-WAF-* 標頭、Server: cloudflare、akamai, f5, mod_security
2. 增加 User-Agent、Referer、Cookie 異常內容測試
curl -i -H "User-Agent: sqlmap" https://example.com/
curl -i -H "Referer: http://evil.com" https://example.com/
3. 使用其他工具進行交叉比對
Nmap + http-waf-detect.nse
https://nmap.org/nsedoc/scripts/http-waf-detect.html
ffuf / sqlmap 在偵測時也可能會回報 WAF 存在
wafpass 或 wafninja 可嘗試繞過測試
https://github.com/wafpassproject/wafpass
https://github.com/khalilbijjou/wafninja
✅ 補充:sqlmap 偵測 WAF 的範例
sqlmap -u "https://example.com/page.php?id=1" --identify-waf
若有偵測到 WAF,sqlmap 會回報廠牌與類型。
(完)
沒有留言:
張貼留言