本节书摘来自异步社区《Nmap渗透测试指南》一书中的第7章7.14节枚举SSL密钥,作者 商广明,更多章节内容可以访问云栖社区“异步社区”公众号查看。
7.14 枚举SSL密钥
表7.14所示为本章节所需Nmap命令表,表中加粗命令为本小节所需命令——枚举SSL密钥。
SSL(Secure Sockets Layer,安全套接层)及其继任者传输层安全(Transport Layer Security,TLS)是为网络通信提供安全及数据完整性的一种安全协议。TLS与SSL在传输层对网络连接进行加密。
SSL协议使用密钥对数据进行加密,这样可以最大程度保障数据的安全,通过发送SSLv3/TLS请求可以判断目标服务器支持的密钥算法和压缩方法。
操作步骤
使用命令“nmap -p 443 --script=ssl-enum-ciphers目标”即可枚举SSL密钥。
root@Wing:~# nmap -p 443 --script=ssl-enum-ciphers www.baidu.com
Starting Nmap 6.47 ( http://nmap.org ) at 2015-06-28 16:43 CST
Nmap scan report for www.baidu.com (61.135.169.121)
Host is up (0.0034s latency).
Other addresses for www.baidu.com (not scanned): 61.135.169.125
PORT STATE SERVICE
443/tcp open https
| ssl-enum-ciphers:
| SSLv3:
| ciphers:
| TLS_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_RSA_WITH_RC4_128_SHA - strong
| compressors:
| NULL
| TLSv1.0:
| ciphers:
| TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_ECDHE_RSA_WITH_RC4_128_SHA - strong
| TLS_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_RSA_WITH_RC4_128_SHA - strong
| compressors:
| NULL
| TLSv1.1:
| ciphers:
| TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_ECDHE_RSA_WITH_RC4_128_SHA - strong
| TLS_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_RSA_WITH_RC4_128_SHA - strong
| compressors:
| NULL
| TLSv1.2:
| ciphers:
| TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - strong
| TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - strong
| TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - strong
| TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - strong
| TLS_ECDHE_RSA_WITH_RC4_128_SHA - strong
| TLS_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_RSA_WITH_AES_128_CBC_SHA256 - strong
| TLS_RSA_WITH_AES_128_GCM_SHA256 - strong
| TLS_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_RSA_WITH_AES_256_CBC_SHA256 - strong
| TLS_RSA_WITH_AES_256_GCM_SHA384 - strong
| TLS_RSA_WITH_RC4_128_SHA - strong
| compressors:
| NULL
|_ least strength: strong
Nmap done: 1 IP address (1 host up) scanned in 1.38 seconds
root@Wing:~#
分析
从以上输出的结果中可以得知百度支持的密钥算法。其中,SSLv3版本中的密钥算法有:TLS_RSA_WITH_AES_128_CBC_SHA - strong、TLS_RSA_WITH_AES_256_CBC_SHA - strong、TLS_RSA_WITH_RC4_128_SHA - strong。