開源工具 sslyze
簡介
SSLyze是一款快速且功能強大的 SSL/TLS開源掃描工具,能夠分析伺服器的 SSL/TLS 配置,檢測web頁面加密設定是否安全,並識別已知的 TLS 漏洞(如 Heartbleed、ROBOT、OpenSSL CCS Injection...等)。
免責聲明:
未經網路或設備所有者明確授權,任何人不得以任何形式干擾、入侵或破壞;本工具僅供教育研究與示範用途,不得用於任何非法或未經授權之活動。
安裝
安裝方法一(Debian linux):
安裝指令
1
2sudo apt update
sudo apt install sslyze
執行
sslyze <Target host>
範例
sslyze www.google.com
安裝方法二(python):
安裝指令
1
2pip install --upgrade pip setuptools wheel
pip install --upgrade sslyze
python -m sslyze <Target host>
範例
python -m sslyze www.google.com
安裝方法三(github):
安裝指令
1
2
3git clone https://github.com/nabla-c0d3/sslyze.git
cd sslyze
pip install .
sslyze <Target host>
範例
sslyze www.google.com
指令介紹
Mozilla 配置符合性檢查
--mozilla_config {modern,intermediate,old,disable}
檢查伺服器是否符合 Mozilla 的 TLS 配置建議,預設為
"intermediate"。
sslyze --mozilla_config modern <Target host>
更新信任憑證
--update_trust_stores
下載並更新內建的憑證信任清單。
sslyze --update_trust_stores
輸入/輸出選項
--json_out JSON_FILE
:將掃描結果輸出為 JSON 檔案。
--targets_in TARGET_FILE
:從檔案讀取掃描目標列表,每行一個主機:端口。
--quiet
:不輸出任何訊息。
範例
sslyze --json_out results.json example.com
連線選項
--slow_connection
:減少並發連線數量,適用於網路不穩或伺服器負載有限的情況。
--https_tunnel <PROXY_SETTINGS>
:通過 HTTP CONNECT 代理傳送流量(例如 http://user:pw@proxy:8080/)。
--starttls <PROTOCOL>
:執行 StartTLS 握手,支援協議包括 smtp、xmpp、pop3、imap 等。
--xmpp_to <HOSTNAME>
:為 XMPP 的 StartTLS 指定 'to' 屬性主機名。
--sni <SERVER_NAME_INDICATION>
:使用 SNI 指定連線主機名,適用於 TLS 1.0 以上。
範例
sslyze --starttls smtp smtp.example.com:587
客戶端證書選項
--cert <CERTIFICATE_FILE>
:指定客戶端證書鏈檔案(PEM 格式)。
--key <KEY_FILE>
:指定客戶端私鑰檔案。
--keyform <KEY_FORMAT>
:私鑰格式(DER 或 PEM,預設為 PEM)。
--pass <PASSPHRASE>
:私鑰的密碼短語。
範例
sslyze --cert client.crt --key client.key --pass mypass example.com
個別掃描功能
參數 | 說明 | 範例指令 |
---|---|---|
--certinfo |
分析 SSL 憑證內容與有效性 | sslyze --certinfo example.com |
--certinfo_ca_file |
指定驗證憑證用的 CA 根憑證檔 | --certinfo_ca_file my_ca.pem |
--elliptic_curves |
顯示伺服器支援的橢圓曲線演算法 | sslyze --elliptic_curves example.com |
--ems |
測試 TLS EMS(Extended Master Secret)支援 | sslyze --ems example.com |
--heartbleed |
測試是否存在 Heartbleed 漏洞 | sslyze --heartbleed example.com |
--robot |
測試是否存在 ROBOT 攻擊漏洞 | sslyze --robot example.com |
--openssl_ccs |
測試是否存在 OpenSSL CCS Injection 漏洞 | sslyze --openssl_ccs example.com |
--reneg |
測試是否允許不安全的 TLS 重新協商 | sslyze --reneg example.com |
--resum |
測試 TLS 會話恢復(Session Resumption)功能支援 | sslyze --resum example.com |
--resum_attempts |
指定會話恢復嘗試次數(預設為 5 次) | --resum_attempts 20 |
--fallback |
測試是否支援 TLS_FALLBACK_SCSV,防止降級攻擊 | sslyze --fallback example.com |
--http_headers |
檢查 HTTPS 回應中的安全標頭(如 HSTS、CSP 等) | sslyze --http_headers example.com |
--compression |
測試是否啟用 TLS 壓縮(可能導致 CRIME 攻擊) | sslyze --compression example.com |
--early_data |
檢查是否支援 TLS 1.3 Early Data(0-RTT) | sslyze --early_data example.com |
TLS/SSL 協定版本支援檢查
參數 | 說明 | 範例指令 |
---|---|---|
--sslv2 |
檢查是否支援過時的 SSL 2.0 | sslyze --sslv2 example.com |
--sslv3 |
檢查是否支援過時的 SSL 3.0 | sslyze --sslv3 example.com |
--tlsv1 |
檢查是否支援 TLS 1.0 | sslyze --tlsv1 example.com |
--tlsv1_1 |
檢查是否支援 TLS 1.1 | sslyze --tlsv1_1 example.com |
--tlsv1_2 |
檢查是否支援 TLS 1.2 | sslyze --tlsv1_2 example.com |
--tlsv1_3 |
檢查是否支援 TLS 1.3 | sslyze --tlsv1_3 example.com |
參考資料
- sslyze
- sslyze Kali
- Installation
of SSLyze
- SSLyze