SSLyze是一个Python打造的工具,它可以分析我们用于连接某服务器的SSL配置。其设计出来就是为了帮助组织和测试人员,快速发现会影响他们SSL服务器的错误配置。 主要特点多进程+多线程扫描:速度会非常快。 SSLyze也可以作为库文件,从python直接调用运行扫描和处理结果。 性能测试:session resumption和TLS票据支持。 安全测试:弱密码套件,不安全的renegotiation,CRIME、心脏滴血攻击。 服务器证书检查,通过OCSP stapling进行SSL撤销检查。 支持SMTP、XMPP、LDAP、POP、IMAP、RDP、PostGres、FTP协议的StartTLS握手。 支持扫描服务器时,用于交互验证的客户端证书。 扫描结果可以写入XML或者JSON文件进行进一步处理。 开始使用下载地址: https://github.com/nabla-c0d3/sslyze SSLyze可以通过pip直接安装: 直接从repository库里获取代码,然后进行安装也是很方便的。 git clone https://github.com/nabla-c0d3/sslyze.git cd sslyze pip install -r requirements. txt --target./lib 然后我们可以使用命令行工具来扫描服务器了: SSLyze已经在以下平台通过测试: Windows 7 (32 and 64 bits) Debian 7 (32 and 64 bits) OS X El Capitan 作为库文件使用从SSLyze v0.13.0开始,它就可以被当作直接扫描和处理结果的python模块。 # Script to get the list of SSLv3 ciphersuites supported by smtp.gmail.com hostname = 'smtp.gmail.com' try: # First we must ensure that the server is reachable server_info = ServerConnectivityInfo(hostname=hostname, port=587, tls_wrapped_protocol=TlsWrappedProtocolEnum.STARTTLS_SMTP) server_info.test_connectivity_to_server() except ServerConnectivityError as e: raise RuntimeError('Error when connecting to {}: {}'.format(hostname,e.error_msg)) # Get the list of available plugins sslyze_plugins = PluginsFinder() # Create a process pool to run scanningcommands concurrently plugins_process_pool =PluginsProcessPool(sslyze_plugins) # Queue a scan command to get the server'scertificate plugins_process_pool.queue_plugin_task(server_info,'sslv3') # Process the result and print thecertificate CN for plugin_result inplugins_process_pool.get_results(): if plugin_result.plugin_command == 'sslv3': # Do something with the result print 'SSLV3 cipher suites' for cipher in plugin_result.accepted_cipher_list: print ' {}'.format(cipher.name) 关于扫描的详细命令,可参见sslyze_cly. py –help命令。 他们运行时都能使用python的多进程模块,每条命令都会返回一个 PluginResult 对象,其中包含正在扫描的命令的结果(比如 –tlsv1 的密码套件列表),这些属性对于每个插件和命令都是单独隶属的,但是在每个插件的模块里都有记录。 想要知道更多情况么?请查看 api_sample.py 的 Python API 示例。 Windows 可执行文件在 Release 处有个预编译的 windows 可执行文件,你也可以通过下面的方法来生成: |
|
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系
[邮箱地址] 删除
|