概述
testssl.sh 是一個(gè)免費(fèi)的命令行工具萨赁,它檢查任何端口上的服務(wù)器服務(wù)是否支持 TLS/SSL 密碼、協(xié)議以及密碼缺陷等等敲董。
testssl.sh 開箱即用腋寨,可移植:它可以在任何類 Unix 堆棧下運(yùn)行.
其輸出按顏色或嚴(yán)重性對結(jié)果進(jìn)行評分化焕,以便您能夠判斷某事是好是壞撒桨。
參考:https://testssl.sh/doc/testssl.1.html
使用步驟
step1: git clone --depth 1 https://github.com/drwetter/testssl.sh.git
step2: clone完后進(jìn)入目錄 cd testssl.sh/
setp3: 運(yùn)行檢測./testssl.sh yourdomain.com
PS:獲取幫助testssl.sh --help
輸出報(bào)告解讀
testssl.sh URI作為默認(rèn)調(diào)用執(zhí)行所謂的默認(rèn)運(yùn)行,它會執(zhí)行下面列出的所有檢查赖阻,除了-E(出現(xiàn)順序):
- 對 IP 地址進(jìn)行 DNS 查找,并對返回的 IP 地址進(jìn)行反向查找棋电。赶盔。
Using "OpenSSL 1.0.2-chacha (1.0.2k-dev)" [~183 ciphers]
on kunzites1:./bin/openssl.Linux.x86_64
(built: "Jan 18 17:12:17 2019", platform: "linux-x86_64")
Start 2022-06-07 20:09:46 -->> xxx.xx.xxx.18:20000 (xxx.xxxx.xxx.xxx.com) <<--
Further IP addresses: xxxx:xxxx:90:0:xxxx:4bef:xxxx:472f
rDNS (172.xx.xxx.18): --
Service detected: HTTP
- SSL/TLS 協(xié)議檢查
Testing protocols via sockets except NPN+ALPN
SSLv2 not offered (OK)
SSLv3 not offered (OK)
TLS 1 not offered
TLS 1.1 not offered
TLS 1.2 offered (OK)
TLS 1.3 offered (OK): final
NPN/SPDY not offered
ALPN/HTTP2 http/1.1 (offered)
- 標(biāo)準(zhǔn)密碼類別于未,讓您提前了解支持的密碼
Testing cipher categories
NULL ciphers (no encryption) not offered (OK)
Anonymous NULL Ciphers (no authentication) not offered (OK)
Export ciphers (w/o ADH+NULL) not offered (OK)
LOW: 64 Bit + DES, RC[2,4], MD5 (w/o export) not offered (OK)
Triple DES Ciphers / IDEA not offered
Obsoleted CBC ciphers (AES, ARIA etc.) not offered
Strong encryption (AEAD ciphers) with no FS not offered
Forward Secrecy strong encryption (AEAD ciphers) offered (OK)
- 服務(wù)器偏好(服務(wù)器順序)
Testing server's cipher preferences
Hexcode Cipher Suite Name (OpenSSL) KeyExch. Encryption Bits Cipher Suite Name (IANA/RFC)
-----------------------------------------------------------------------------------------------------------------------------
SSLv2
-
SSLv3
-
TLSv1
-
TLSv1.1
-
TLSv1.2 (server order)
xc030 ECDHE-RSA-AES256-GCM-SHA384 ECDH 253 AESGCM 256 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
xcca8 ECDHE-RSA-CHACHA20-POLY1305 ECDH 253 ChaCha20 256 TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
xc02f ECDHE-RSA-AES128-GCM-SHA256 ECDH 253 AESGCM 128 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLSv1.3 (server order)
x1302 TLS_AES_256_GCM_SHA384 ECDH 253 AESGCM 256 TLS_AES_256_GCM_SHA384
x1303 TLS_CHACHA20_POLY1305_SHA256 ECDH 253 ChaCha20 256 TLS_CHACHA20_POLY1305_SHA256
x1301 TLS_AES_128_GCM_SHA256 ECDH 253 AESGCM 128 TLS_AES_128_GCM_SHA256
Has server cipher order? yes (OK) -- TLS 1.3 and below
Negotiated protocol TLSv1.3
Negotiated cipher TLS_AES_256_GCM_SHA384, 253 bit ECDH (X25519)
5.檢查(完美)前向保密:密碼和橢圓曲線
Testing robust forward secrecy (FS) -- omitting Null Authentication/Encryption, 3DES, RC4
FS is offered (OK) TLS_AES_256_GCM_SHA384
TLS_CHACHA20_POLY1305_SHA256
ECDHE-RSA-AES256-GCM-SHA384
ECDHE-RSA-CHACHA20-POLY1305
TLS_AES_128_GCM_SHA256
ECDHE-RSA-AES128-GCM-SHA256
Elliptic curves offered: prime256v1 secp384r1 secp521r1 X25519 X448
- 服務(wù)器默認(rèn)值(證書信息抖坪、TLS 擴(kuò)展闷叉、會話信息)
Testing server defaults (Server Hello)
TLS extensions (standard) "renegotiation info/#65281"
"EC point formats/#11" "session ticket/#35"
"supported versions/#43" "key share/#51"
"supported_groups/#10" "max fragment length/#1"
"application layer protocol negotiation/#16"
"extended master secret/#23"
Session Ticket RFC 5077 hint 7200 seconds, session tickets keys seems to be rotated < daily
SSL Session ID support yes
Session Resumption Tickets no, ID: no
TLS clock skew Random values, no fingerprinting possible
Certificate Compression none
Client Authentication none
Signature Algorithm SHA256 with RSA
Server key size RSA 2048 bits (exponent is 65537)
Server key usage Digital Signature, Key Encipherment
Server extended key usage TLS Web Server Authentication, TLS Web Client Authentication
Serial 0B60576712E4D3C84D67FBC8546B1067 (OK: length 16)
Fingerprints SHA1 447916BCD81FC825296698F467F1FFE0C36B09B9
SHA256 9379D7573F5B27EAC8678259299B6324AA43B3C65189C3364903293097BF0DEF
Common Name (CN) *.xxxx.xxxx.xx.com
subjectAltName (SAN) *.xxx.xxx.xxx.com
xxxx.cxx.xxx.com
private.xxx.cloud.xxx.com
*.private.xxx.cloud.xxx.com
Trust (hostname) Ok via SAN wildcard and CN wildcard (same w/o SNI)
Chain of trust Ok
EV cert (experimental) no
Certificate Validity (UTC) 355 >= 60 days (2022-04-28 00:00 --> 2023-05-29 23:59)
ETS/"eTLS", visibility info not present
Certificate Revocation List http://crl3.digicert.com/DigiCertTLSRSASHA2562020CA1-4.crl
http://crl4.digicert.com/DigiCertTLSRSASHA2562020CA1-4.crl
OCSP URI http://ocsp.digicert.com
OCSP stapling not offered
OCSP must staple extension --
DNS CAA RR (experimental) not offered
Certificate Transparency yes (certificate extension)
Certificates provided 3 (certificate list ordering problem)
Issuer DigiCert TLS RSA SHA256 2020 CA1 (DigiCert Inc from US)
Intermediate cert validity #1: ok > 40 days (2031-04-13 23:59). DigiCert TLS RSA SHA256 2020 CA1 <-- DigiCert Global Root CA
#2: ok > 40 days (2023-03-08 12:00). DigiCert SHA2 Secure Server CA <-- DigiCert Global Root CA
Intermediate Bad OCSP (exp.) Ok
- HTTP 標(biāo)頭(如果檢測到 HTTP 或通過 強(qiáng)制執(zhí)行--assume-http)
Testing HTTP header response @ "/api/vx/xxxx"
HTTP Status Code 400 Bad Request (Hint: better try another URL)
HTTP clock skew 0 sec from localtime
Strict Transport Security 365 days=31536000 s, includeSubDomains
Public Key Pinning --
Server banner (no "Server" line in header, interesting!)
Application banner --
Cookie(s) (none issued at "/api/xx/xxxf/clusters/xxxx/bxxxxs/xxx/xxx") -- maybe better try target URL of 30x
Security headers X-Content-Type-Options: nosniff
Content-Security-Policy: default-src 'none';
frame-ancestors 'self'
X-XSS-Protection: 1; mode=block
Cache-Control: no-store
Pragma: no-cache
Reverse Proxy banner
- 漏洞
Testing vulnerabilities
Heartbleed (CVE-2014-0160) not vulnerable (OK), no heartbeat extension
CCS (CVE-2014-0224) not vulnerable (OK)
Ticketbleed (CVE-2016-9244), experiment. not vulnerable (OK)
ROBOT Server does not support any cipher suites that use RSA key transport
Secure Renegotiation (RFC 5746) supported (OK)
Secure Client-Initiated Renegotiation not vulnerable (OK) -- mitigated (disconnect within 6)
CRIME, TLS (CVE-2012-4929) not vulnerable (OK)
BREACH (CVE-2013-3587) no gzip/deflate/compress/br HTTP compression (OK) - only supplied "/api/vx/xxxx" tested
POODLE, SSL (CVE-2014-3566) not vulnerable (OK), no SSLv3 support
TLS_FALLBACK_SCSV (RFC 7507) No fallback possible (OK), no protocol below TLS 1.2 offered
SWEET32 (CVE-2016-2183, CVE-2016-6329) not vulnerable (OK)
FREAK (CVE-2015-0204) not vulnerable (OK)
DROWN (CVE-2016-0800, CVE-2016-0703) not vulnerable on this host and port (OK)
make sure you don't use this certificate elsewhere with SSLv2 enabled services, see
https://search.censys.io/search?resource=hosts&virtual_hosts=INCLUDE&q=9379D7573F5B27EAC8678259299B6324AA43B3C65189C3364903293097BF0DEF
LOGJAM (CVE-2015-4000), experimental not vulnerable (OK): no DH EXPORT ciphers, no DH key detected with <= TLS 1.2
BEAST (CVE-2011-3389) not vulnerable (OK), no SSL3 or TLS1
LUCKY13 (CVE-2013-0169), experimental not vulnerable (OK)
Winshock (CVE-2014-6321), experimental not vulnerable (OK)
RC4 (CVE-2013-2566, CVE-2015-2808) no RC4 ciphers detected (OK)
- 客戶端模擬
Running client simulations (HTTP) via sockets
Browser Protocol Cipher Suite Name (OpenSSL) Forward Secrecy
------------------------------------------------------------------------------------------------
Android 6.0 TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 256 bit ECDH (P-256)
Android 7.0 (native) TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256 bit ECDH (P-256)
Android 8.1 (native) TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 253 bit ECDH (X25519)
Android 9.0 (native) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Android 10.0 (native) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Android 11 (native) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Android 12 (native) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Chrome 79 (Win 10) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Chrome 101 (Win 10) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Firefox 66 (Win 8.1/10) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Firefox 100 (Win 10) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
IE 6 XP No connection
IE 8 Win 7 No connection
IE 8 XP No connection
IE 11 Win 7 No connection
IE 11 Win 8.1 No connection
IE 11 Win Phone 8.1 No connection
IE 11 Win 10 TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256 bit ECDH (P-256)
Edge 15 Win 10 TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 253 bit ECDH (X25519)
Edge 101 Win 10 21H2 TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Safari 12.1 (iOS 12.2) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Safari 13.0 (macOS 10.14.6) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Safari 15.4 (macOS 12.3.1) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Java 7u25 No connection
Java 8u161 TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256 bit ECDH (P-256)
Java 11.0.2 (OpenJDK) TLSv1.3 TLS_AES_256_GCM_SHA384 256 bit ECDH (P-256)
Java 17.0.3 (OpenJDK) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
go 1.17.8 TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
LibreSSL 2.8.3 (Apple) TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 253 bit ECDH (X25519)
OpenSSL 1.0.2e TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256 bit ECDH (P-256)
OpenSSL 1.1.0l (Debian) TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 253 bit ECDH (X25519)
OpenSSL 1.1.1d (Debian) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
OpenSSL 3.0.3 (git) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
Apple Mail (16.0) TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256 bit ECDH (P-256)
Thunderbird (91.9) TLSv1.3 TLS_AES_256_GCM_SHA384 253 bit ECDH (X25519)
- 評級
Rating (experimental)
Rating specs (not complete) SSL Labs's 'SSL Server Rating Guide' (version 2009q from 2020-01-30)
Specification documentation https://github.com/ssllabs/research/wiki/SSL-Server-Rating-Guide
Protocol Support (weighted) 100 (30)
Key Exchange (weighted) 90 (27)
Cipher Strength (weighted) 90 (36)
Final Score 93
Overall Grade A+
Done 2022-06-07 20:11:07 [ 85s] -->> xx.xxx.xxxx.xx:20000 (xxxx.xx.com) <<--
使用方法
testssl.sh [OPTIONS] <URI>,
testssl.sh [OPTIONS] --file <FILE>
testssl.sh <URI>
作為默認(rèn)調(diào)用執(zhí)行所謂的默認(rèn)運(yùn)行,它會執(zhí)行默認(rèn)所有檢查甚颂。
參數(shù)
- URI:可以是主機(jī)名西设、IPv4 或 IPv6 地址、 URL棠笑。IPv6 地址需要放在方括號中禽绪。對于任何給定的參數(shù),除非通過附加冒號和端口號指定循捺,否則假定端口 443雄人。
- --file <fname>: 是大規(guī)模測試選項(xiàng)础钠。默認(rèn)情況下,它會隱式打開--warnings batch踩萎。
- --mode <serial|parallel>:.批量測試以串行(默認(rèn))或并行進(jìn)行很钓。默認(rèn)情況下,大規(guī)模測試以串行模式運(yùn)行企孩,即一行接一行地被處理和調(diào)用柠硕。
- --warnings <batch|off>: warnings 參數(shù)決定了 testssl.sh 將如何處理需要用戶正常輸入的情況。batch遇到客戶端或服務(wù)器端問題時(shí)闻葵,不會等待確認(rèn)按鍵而會終止特定的掃描癣丧,這適用于大規(guī)模測試 ( --file);off只是跳過警告厢钧,確認(rèn)但繼續(xù)掃描嬉橙,不管它是否有意義市框。
- --connect-timeout <seconds> : 如果節(jié)點(diǎn)沒有完成 TCP 握手,testssl.sh 通秤髌裕可能會掛起大約 2 分鐘甚至更長時(shí)間粪滤。此參數(shù)指示 testssl.shseconds在放棄之前最多等待握手完成。此選項(xiàng)僅在您的操作系統(tǒng)安裝了超時(shí)二進(jìn)制文件時(shí)才有效肆汹。CONNECT_TIMEOUT 是對應(yīng)的環(huán)境變量县踢。
- --openssl-timeout <seconds>: 這對于使用 openssl 的所有連接特別有用伟件,并且對于大規(guī)模測試非常有用议经。它避免了 openssl 連接掛起約 2 分鐘。僅當(dāng)您的操作系統(tǒng)安裝了超時(shí)二進(jìn)制文件時(shí)煞肾,該選項(xiàng)才可用籍救。
單項(xiàng)檢查選項(xiàng)
作為參數(shù)提供的任何單個(gè)檢查開關(guān)都會阻止 testssl.sh 執(zhí)行默認(rèn)運(yùn)行。它只需要這個(gè)闪萄,如果提供了其他選項(xiàng)并運(yùn)行它們 - 它們也將出現(xiàn)在默認(rèn)運(yùn)行中败去。
- -e, --each-cipher: 通過服務(wù)器上的 openssl + 套接字遠(yuǎn)程檢查(當(dāng)前配置的)370 個(gè)密碼中的每一個(gè),并以寬模式報(bào)告結(jié)果广鳍。如果要顯示測試的每個(gè)密碼吓妆,則需要添加--show-each. 默認(rèn)情況下,它列出以下參數(shù):hexcode, OpenSSL cipher suite name, key exchange, encryption bits, IANA/RFC cipher suite name.
- --E, --cipher-per-proto: 類似于-e, --each-cipher祖秒。它檢查每個(gè)可能的密碼剂陡,這里:每個(gè)協(xié)議鸭栖。如果要顯示測試的每個(gè)密碼,則需要添加--show-each. 輸出按安全強(qiáng)度排序松却,但它列出了加密位溅话。
- -f, --pfs, --fs,--nsa: 檢查穩(wěn)健的前向保密密鑰交換飞几。“健壯”意味著這里不會考慮具有諸如空身份驗(yàn)證或加密躁锁、3DES 和 RC4 等內(nèi)在嚴(yán)重弱點(diǎn)的密碼卵史。不應(yīng)該有錯(cuò)誤的印象以躯,即安全密鑰交換已經(jīng)發(fā)生并且一切都很好,而實(shí)際上加密很糟糕刁标。
- -p, --protocols: 檢查 TLS/SSL 協(xié)議 SSLv2、SSLv3蒜哀、TLS 1.0 到 TLS 1.3 以及 HTTP:SPDY (NPN) 和 ALPN吏砂,即 HTTP/2狐血。對于 TLS 1.3,支持并測試了幾個(gè)草案(從 18 開始)和最終版本浪默。
漏洞
- -U, --vulnerable, --vulnerabilities:只需測試所有(以下)漏洞缀匕。環(huán)境變量VULN_THRESHLD確定在哪個(gè)值之后顯示每個(gè)漏洞的單獨(dú)標(biāo)題乡小。默認(rèn)是1這意味著如果您檢查兩個(gè)漏洞,除了漏洞和結(jié)果之外胜榔,僅顯示漏洞部分的一般標(biāo)題湃番。否則吠撮,除了漏洞名稱和測試結(jié)果的輸出之外,每個(gè)漏洞或漏洞部分都有自己的標(biāo)題择浊。一個(gè)漏洞部分由多個(gè)檢查組成,例如重新協(xié)商漏洞檢查有兩個(gè)檢查投剥,Logjam 也是如此。
- -H, --heartbleed :檢查心臟出血吃警,openssl 中的內(nèi)存泄漏酌心。除非服務(wù)器端不支持心跳擴(kuò)展,否則此檢查可能會超時(shí)墩崩○谐铮可以用 調(diào)整等待回復(fù)的秒數(shù)HEARTBLEED_MAX_WAITSOCK址貌。8 是默認(rèn)值练对。
- -I, --ccs, --ccs-injection: 檢查 CCS 注入,這是一個(gè) openssl 漏洞虚青。有時(shí)這里的支票也需要等待回復(fù)赂摆⊙毯牛可以使用環(huán)境變量更改預(yù)定義的 5 秒超時(shí)CCS_MAX_WAITSOCK。
- -T, --ticketbleed: 檢查 BigIP 負(fù)載平衡器中的 Ticketbleed 內(nèi)存泄漏达传。
- **-BB, --robot 檢查 ROBOT /(Bleichenbacher 的 Oracle 威脅回歸)攻擊的漏洞迫筑。
- -R, --renegotiation: 測試重新協(xié)商漏洞脯燃。目前有一個(gè)檢查Secure Renegotiation和 for Secure Client-Initiated Renegotiation。請注意欲主,易受攻擊的服務(wù)器很容易被 DoSed (HTTP) 攻擊扁瓢。尚未實(shí)施對不安全的客戶端發(fā)起的重新協(xié)商的檢查。
- -C, --compression, --crime: 檢查 TLS 中的 CRIME(壓縮比信息泄漏變得容易)漏洞昧互。SPDY 中的 CRIME 尚未被檢查伟桅。
- -B, --breach: 檢查 BREACH(通過自適應(yīng)超文本壓縮的瀏覽器偵察和滲透)漏洞敞掘。至于此漏洞,HTTP 級別壓縮是先決條件贿讹,如果無法檢測到 HTTP 或未通過`--assume-http. 請注意渐逃,只有提供的 URL(通常是 "/" )正在測試中。
- -O, --poodle: 測試 SSL POODLE(Padding Oracle On Downgraded Legacy Encryption)漏洞民褂。它基本上檢查 SSLv3 中是否存在 CBC 密碼茄菊。
-------------------------------------------------------------更多詳情參見參考文檔--------------------------------------------------------------