顯示具有 Nessus 標籤的文章。 顯示所有文章
顯示具有 Nessus 標籤的文章。 顯示所有文章

2025年11月7日 星期五

[研究]對任意網站,Nessus 預設不追蹤第二層轉址 ?

[研究]對任意網站,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 會追一次)

有部分特殊 Plugin 會「追一層轉址」,但條件嚴格:
  • Plugin ID 11219(HTTP Methods Allowed)
  • Plugin ID 20007(Web Server Detection)
這類 Plugin 會為了識別真正的伺服器名稱,追一次 301 轉址。
但「HSTS Missing」這類 Plugin 屬於 Header Presence Check,完全不追。

🔍 四、實證:HSTS Plugin 的實際代碼行為

以 Nessus Plugin ID 150437 為例,Tenable script (NASL) 內容包含:

               

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」:

  1. 在 首頁 / 的 HTTP 回應 中就加入安全性標頭(即使只是 301)。
  2. 或在掃描報告中說明:「網站首頁 301 轉址,HSTS 實際存在於目標頁面。此為 Nessus 預設單層掃描導致之誤報。」

(完)

[研究]Nessus 對 HSTS 誤判可能分析

[研究]Nessus 對 HSTS 誤判可能分析

2025-11-07

Nessus Pro 為何產生這種誤判,以下面網址測試 HSTS 是正常的,Nessus Pro 無法判斷首頁 default.aspx 轉址到 login.aspx 的情況嗎 ? 

Domsignal 網站 HSTS (HTTP Strict Transport Security) 測試 https://domsignal.com/hsts-test

弱點名稱 HSTS Missing From HTTPS Server (RFC 6797)
IP (略)
風險等級 Medium
弱點描述 The remote web server is not enforcing HSTS, as defined by RFC 6797.
建議修補方式 Configure the remote web server to use HSTS.
HSTS is an optional response header that can be configured on the server to instruct the browser to only communicate via HTTPS. The lack of HSTS allows downgrade attacks,SSL-stripping man-in-the-middle attacks, and weakens cookie-hijacking protections.
CVE Score 6.5
弱點ID (略)
HSTS Missing From HTTPS Server (RFC 6797)
Port Number Plugin_Output
443 HTTP/1.1 404 Not Found
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date:(略)
Connection: close
Content-Length:(略)

The remote HTTPS server does not send the HTTP "Strict-Transport-Security" header.

ChatGPT

✅ Domsignal 測試顯示 HSTS 正常

但 ❌ Nessus Pro 卻回報 “HSTS Missing From HTTPS Server (RFC 6797)”,這種情況在實務上其實相當常見,而且屬於 Nessus 的「誤判(False Positive)」 類型之一。

下面我詳細說明 為何 Nessus Pro 會誤報 HSTS 缺失,以及它在遇到 default.aspx → login.aspx 轉址時的行為限制。

🧩 一、Nessus 偵測 HSTS 的邏輯

1.Nessus 的 plugin(通常是 Plugin ID 150437 或相近)會:

向目標的 Port 443 發送 一個 HTTPS GET 要求,例如:

GET / HTTP/1.1

Host: example.com

2. 只分析這個 第一個回應(HTTP Response Header) 是否包含:

Strict-Transport-Security: max-age=xxxx


3.如果這個回應:

是 301/302 轉址;

或是 404/403 頁面;

或是伺服器使用 Microsoft-HTTPAPI/2.0 回覆(表示不是 IIS 正常網站回應);

那 Nessus 不會再自動追蹤轉址或執行第二次要求。

→ 因此,它會誤以為「HSTS header 不存在」。

⚙️ 二、你網站的狀況推測

根據你提供的資訊:

項目 狀況 說明
首頁 / 可能是 HTTPAPI 回覆 404 或轉址到 /default.aspx Nessus 掃描可能命中這頁
/default.aspx 再轉址到 /login.aspx Nessus 預設不追蹤第二層轉址
/login.aspx 正常載入並送出 Strict-Transport-Security: 標頭 Domsignal 測試會看到這個 header,所以判定正常
結果 Nessus 未抵達這層頁面 導致「誤報」HSTS 缺失

🧠 三、誤判的原因歸納

Nessus Plugin 報告中:

HTTP/1.1 404 Not Found

Server: Microsoft-HTTPAPI/2.0

這其實是關鍵。

這代表 Nessus 掃描的是:

一個不存在的路徑(例如 / 沒有 Default Document,或沒有正確映射到 IIS)。

或是 IIS 沒接手該請求,而是 Windows HTTPAPI(例如 URL ACL 沒綁定、IIS 沒在該 port 處理)回應的錯誤頁面。

👉 也就是說:

Nessus 沒有實際掃到你網站的 IIS 回應,而是掃到系統層的 HTTP.sys 回覆。

HTTPAPI/2.0 這行就代表它沒有看到你網站的 HSTS header。


🧩 四、驗證方式建議

你可以用 curl 指令驗證 Nessus 的視角:

curl -I https://yourdomain.com/

如果回傳是:

HTTP/1.1 404 Not Found

Server: Microsoft-HTTPAPI/2.0

→ 代表 Nessus 看到的就是這個頁面,而不是 login.aspx。

這樣 HSTS 當然不會被偵測到。

如果你用:

curl -I https://yourdomain.com/login.aspx

看到:

HTTP/1.1 200 OK

Strict-Transport-Security: max-age=31536000; includeSubDomains

→ 那 HSTS 實際上是正確設定的,只是 Nessus 沒追到這層。

🧩 五、解法建議

✅ 解法 1:讓首頁 / 就回應 HSTS Header

即使會轉址,也建議首頁加上:

Strict-Transport-Security: max-age=31536000; includeSubDomains

在 所有回應(含 301/302) 都送出這個 Header,

可以在 IIS 內設定:

HTTP 回應標頭 → 新增:

名稱:Strict-Transport-Security

值:max-age=31536000; includeSubDomains

✅ 解法 2:確認 Default Document 與轉址處理

在 IIS → 網站 → Default Document 功能中,確認:

default.aspx

位於清單中並啟用,確保 / 不會直接 404。

✅ 解法 3:忽略此誤報(在報告註記中)

若是政府資安稽核報告要求,只要附上:

curl 實測畫面

Domsignal / SecurityHeaders.com 測試結果

就可佐證為「誤報(False Positive)」。

📘 總結

項目 說明
掃描工具 Nessus Pro
問題原因 Nessus 不追蹤 302/404、未看到 login.aspx header
誤判條件 default.aspx / login.aspx 轉址、HTTPAPI 回應
驗證方式 curl / SecurityHeaders.com / Domsignal
解決方式 在所有回應包含 HSTS、確認 IIS Default Document

(完)

[研究]請問下面 HSTS 訊息可能是哪套黑箱主機弱點掃描軟體的掃描結果?

[研究]請問下面 HSTS 訊息可能是哪套黑箱主機弱點掃描軟體的掃描結果?

2025-11-07

請問下面 HSTS 訊息可能是哪套黑箱主機弱點掃描軟體的掃描結果?從機率高到低?機率多少?

弱點名稱HSTS Missing From HTTPS Server (RFC 6797)
IP(略)
風險等級Medium
弱點描述The remote web server is not enforcing HSTS, as defined by RFC 6797.
建議修補方式Configure the remote web server to use HSTS.
HSTS is an optional response header that can be configured on the server to instruct the browser to only communicate via HTTPS. The lack of HSTS allows downgrade attacks,SSL-stripping man-in-the-middle attacks, and weakens cookie-hijacking protections.
CVE Score6.5
弱點ID(略)
HSTS Missing From HTTPS Server (RFC 6797)
Port NumberPlugin_Output
443HTTP/1.1 404 Not Found
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date:(略)
Connection: close
Content-Length:(略)

The remote HTTPS server does not send the HTTP "Strict-Transport-Security" header.

ChatGPT

排名 掃描工具名稱 可能性 (%) 判斷依據
1 Tenable Nessus / Tenable.io ≈80% 弱點名稱格式「HSTS Missing From HTTPS Server (RFC 6797)」、弱點描述英文語氣、欄位名稱(如 Plugin_Output、CVE Score)皆與 Nessus 報告一致。
2 Qualys Web Application Scanner (WAS) ≈10% Qualys 也會偵測 HSTS 缺失,但報告格式不同,較少用「Plugin_Output」,通常標為 “QID”。
3 OpenVAS / Greenbone Vulnerability Manager (GVM) ≈7% OpenVAS 的報告也含「HSTS Missing...」,但欄位名稱不同(使用 Result 而非 Plugin_Output),而且語句風格較簡潔。
4 Rapid7 Nexpose / InsightVM ≈3% 雖有相同弱點名稱,但其報告格式更偏向 JSON / CVSS 條列,較少用「Plugin_Output」。

特徵如下:

  • 「Plugin_Output」是 Nessus 專有欄位名。
  • 弱點標題慣用 “(RFC xxxx)” 格式。
  • 「CVE Score」為簡化的 CVSS 欄位名稱(Nessus 報告會顯示 “CVSS Base Score” 或 “CVE Score”)。
  • 弱點描述段落完全照搬 Tenable 官方語句庫。

(完)

2023年9月19日 星期二

[研究]Nessus 版本在 pdf 報告甚麼地方?

[研究]Nessus 版本在 pdf 報告甚麼地方?

2023-09-19

找 Nessus Scan Information 或 Nessus version,

但對 .html 報告 或其他版本 Nessus 不保證。

(完)

2022年10月31日 星期一

[研究]Tenable Core Nessus 10.4.0 v20220719 虛擬機器

[研究]Tenable Core Nessus 10.4.0 v20220719 虛擬機器

2022-10-31

https://www.tenable.com/downloads/nessus?loginAttempted=true

下載得到 Tenable-Core-Nessus-20220719.ova

0.97 GB (1,049,088,000 位元組)




因為上面說 This system is restricted to authorized users only.
敝人就沒有再測試了。

(完)