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协议详解

posted @ 2021-04-20 16:06  一曲天地远  阅读(4274)  评论(0编辑  收藏  举报