[研究]對任意網站,Nessus 預設不追蹤第二層轉址 ?
2025-11-07
續
[研究]請問下面 HSTS 訊息可能是哪套黑箱主機弱點掃描軟體的掃描結果?https://shaurong.blogspot.com/2025/11/hsts.html
[研究]Nessus 對 HSTS 誤判可能分析
https://shaurong.blogspot.com/2025/11/nessus-hsts.html
**********
對任意網站,Nessus 預設不追蹤第二層轉址 ?
ChatGPT
答案是:
✅ 沒錯,Nessus(包含 Nessus Professional / Tenable.io / Tenable.sc)在預設設定下「不會追蹤第二層以上的 HTTP 轉址(Redirect)」,
而且在多數 plugin(包含 HSTS、Cookie、Header 檢測類)中,甚至「第一層 301/302 轉址」都不會被跟進。
🧩 一、Nessus 預設行為:不追轉址
根據 Tenable 官方 plugin framework 的行為:
Nessus 的 Web-based plugin(例如 Plugin ID 45411, 150437, 121005 等)
都屬於「Passive HTTP Header Checks」類型。
掃描時:
它會對目標 Port (443) 傳送一個單一的 GET /。
收到第一個 Response 後就停止分析。
❌ 不會依照 Location: header 追到第二個 URL。
即使該 Response 是:
HTTP/1.1 301 Moved Permanently Location: https://example.com/login.aspx |
Nessus 也不會再對 /login.aspx 發出第二次請求。
📘 二、Nessus 為何這樣設計
這是 為了效率與安全控制:
| 原因 | 說明 |
|---|---|
| 🕐 效能考量 | Nessus 掃描大量主機,若每個 301/302 都遞迴追,掃描時間會爆增。 |
| 🔐 安全邏輯 | 追蹤轉址可能導致外部導向(Redirect to external site)或循環轉址。 |
| 📊 報告一致性 | Tenable 想確保「掃描只反映第一層 HTTPS 回應狀態」,不依賴網站邏輯。 |
- Plugin ID 11219(HTTP Methods Allowed)
- Plugin ID 20007(Web Server Detection)
req = http_get(item:"/", port:port, ssl:TRUE);
res = http_send_recv_req(port:port, data:req);
if ('Strict-Transport-Security' >!< res)
security_warning(port:port, ...);
|
可以看到:
- 它只對 / 發送一次請求。
- 不會處理 Location: header。
- 所以只看「第一個回應」。
🧠 五、結論整理
| 項目 | Nessus 預設行為 |
|---|---|
| 追蹤第一層 301/302 轉址 | ❌ 否 |
| 追蹤第二層(再轉址) | ❌ 否 |
| 能否手動開啟追蹤 | ❌ 不行(Tenable Plugin Framework 不支援) |
| 有例外的 Plugin | ✅ 少數(Web server detection 類) |
| 結果影響 | 網站首頁若轉址,HSTS / CSP / Header 類弱點常誤報 |
💡 實務建議
若你希望 Nessus 不誤報「HSTS Missing」或「Security Header Missing」:
- 在 首頁 / 的 HTTP 回應 中就加入安全性標頭(即使只是 301)。
- 或在掃描報告中說明:「網站首頁 301 轉址,HSTS 實際存在於目標頁面。此為 Nessus 預設單層掃描導致之誤報。」
(完)
沒有留言:
張貼留言