SSLyze:快速全面的SSL安全掃描器

JameyGuinn 8年前發布 | 41K 次閱讀 SSL協議 Python 加密/解密軟件包

來自: http://www.freebuf.com/tools/99151.html

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直接安裝:

pip install sslyze

直接從repository庫里獲取代碼,然后進行安裝也是很方便的。

git clone https://github.com/nabla-c0d3/sslyze.git
cd sslyze
pip install -r requirements. txt --target./lib

然后我們可以使用命令行工具來掃描服務器了:

python sslyze_cli. py --regularwww.yahoo.com:443 www.google.com

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 可執行文件,你也可以通過下面的方法來生成:

python.exe setup_py2exe.py py2exe

*參考來源: kitploit ,FB小編dawner編譯,轉載請注明來自FreeBuf黑客與極客(FreeBuf.COM)

 本文由用戶 JameyGuinn 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!