SSL Version 2 and 3 Protocol Detection


1. 漏洞報告

image

2. 漏洞介紹

     2014年10月14號由Google發現的POODLE漏洞,全稱是Padding Oracle On Downloaded Legacy Encryption vulnerability,又被稱為“貴賓犬攻擊”(CVE-2014-3566),POODLE漏洞只對CBC模式的明文進行了身份驗證,但是沒有對填充字節進行完整性驗證,攻擊者竊取采用SSL3.0版加密通信過程中的內容,對填充字節修改並且利用預置填充來恢復加密內容,以達到攻擊目的。
      2016年3月發現的針對TLS的新漏洞攻擊——DROWN(Decrypting RSA with Obsolete and Weakened eNcryption,CVE-2016-0800),也即利用過時的、弱化的一種RSA加密算法來解密破解TLS協議中被該算法加密的會話密鑰。 具體說來,DROWN漏洞可以利用過時的SSLv2協議來解密與之共享相同RSA私鑰的TLS協議所保護的流量。 DROWN攻擊依賴於SSLv2協議的設計缺陷以及知名的Bleichenbacher攻擊。

3. 漏洞危害

      遠程服務接受使用SSL 2.0和SSL 3.0加密的連接。這些版本的SSL受如下一些加密漏洞的影響,建議完全禁用這些協議。常見的幾種SSL/TLS漏洞及攻擊方式

  1. 具有CBC密碼的不安全填充方案。
  2. 不安全的會話重新協商和恢復方案。
  3. 攻擊者可以利用這些漏洞進行中間人攻擊或解密受影響的服務與客戶端之間的通信。

4. 漏洞檢測

4.1 使用namp檢測

# 確定服務器是否存在SSLv2-DROWN漏洞
 nmap --script="sslv2-drown" -p 443 192.168.43.58

# 確定服務器是否存在SSLv3-POODLE漏洞
 nmap --script="ssl-poodle" -p 443 192.168.43.58

# 查看證書支持的SSL/TCL版本和加密算法
nmap --script="ssl-enum-ciphers" -p 443 192.168.43.58

# 確定服務器是否支持SSLv2的和SSLv2的加密算法。
nmap --script="sslv2" -p 443 192.168.43.58
PORT    STATE SERVICE
443/tcp open  https
| sslv2:
|   SSLv2 supported
|   ciphers:
|     SSL2_RC2_128_CBC_EXPORT40_WITH_MD5
|     SSL2_RC4_128_WITH_MD5
|     SSL2_RC4_128_EXPORT40_WITH_MD5
|     SSL2_RC2_128_CBC_WITH_MD5
|     SSL2_DES_64_CBC_WITH_MD5
|_    SSL2_DES_192_EDE3_CBC_WITH_MD5

4.2 使用sslscan檢測

C:\root\桌面> sslscan 192.168.43.58                                                                                                127 ⨯
Version: 2.0.8-static
OpenSSL 1.1.1k-dev  xx XXX xxxx

Connected to 192.168.43.58

Testing SSL server 192.168.43.58 on port 443 using SNI name 192.168.43.58

SSL/TLS Protocols:
SSLv2     enabled
SSLv3     enabled
TLSv1.0   enabled
TLSv1.1   disabled
TLSv1.2   disabled
TLSv1.3   disabled

3.使用testssl.sh檢測

C:\root\桌面> git clone https://github.com/drwetter/testssl.sh.git
C:\root\桌面> cd testssl.sh
C:\root\桌面\testssl.sh> ./testssl.sh 192.168.43.58:443

 Testing protocols via sockets except NPN+ALPN 

 SSLv2      offered (NOT ok), also VULNERABLE to DROWN attack -- 6 ciphers
 SSLv3      offered (NOT ok)
 TLS 1      offered (deprecated)
 TLS 1.1    not offered
 TLS 1.2    not offered and downgraded to a weaker protocol
 TLS 1.3    not offered and downgraded to a weaker protocol
 NPN/SPDY   not offered
 ALPN/HTTP2 not offered

5. 漏洞修復

1. Apache禁用SSL2和SSL3協議

## 將SSLProtocol all -SSLv2 -SSLv3添加到/etc/apache2/mods-available/ssl.conf文件中重新啟動服務
root@bee-box:/# cat /etc/apache2/mods-available/ssl.conf | grep "SSLv3" -A 1 -B 1
# enable only secure protocols: SSLv3 and TLSv1, but not SSLv2
SSLProtocol all -SSLv2 -SSLv3
</IfModule>
root@bee-box:/# /etc/init.d/apache2 restart
 * Restarting web server apache2                                              [ OK ] 
root@bee-box:/# 


## 漏洞復測
C:\root\桌面\testssl.sh> ./testssl.sh 192.168.43.58:443

 SSLv2      not offered (OK)
 SSLv3      not offered (OK)
 TLS 1      offered (deprecated)
 TLS 1.1    not offered
 TLS 1.2    not offered and downgraded to a weaker protocol
 TLS 1.3    not offered and downgraded to a weaker protocol
 NPN/SPDY   not offered
 ALPN/HTTP2 not offered

2. SMTP禁用SSL2和SSL3協議

## 修改配置文件/etc/postfix/main.cf注釋掉/etc/ssl目錄下的證書,保存后重啟SMTP服務。

root@bee-box:/# cat /etc/postfix/main.cf | grep "# TLS parameters" -A 3
# TLS parameters
#smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
#smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
root@bee-box:/# /etc/init.d/postfix restart
 * Stopping Postfix Mail Transport Agent postfix                              [ OK ] 
 * Starting Postfix Mail Transport Agent postfix                              [ OK ] 

## 漏洞復測

C:\root\桌面\testssl.sh> ./testssl.sh 192.168.43.58:25 

 Start 2021-04-20 15:49:26        -->> 192.168.43.58:25 (192.168.43.58) <<--

 SSLv2      not offered (OK)
 SSLv3      not offered (OK)
 TLS 1      not offered
 TLS 1.1    not offered
 TLS 1.2    not offered
 TLS 1.3    not offered


6.參考鏈接

1. 常見的幾種SSL/TLS漏洞及攻擊方式
2. 測試ssl漏洞的工具:testssl.sh
3. SSL/TLS發展歷史和SSLv3.0協議詳解


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM