Created
March 12, 2013 22:25
-
-
Save benhagen/5147659 to your computer and use it in GitHub Desktop.
Enumerate locally supported SSL/TLS ciphers in Python / M2Crypto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from M2Crypto import SSL | |
versions = ["sslv2", "sslv23", "sslv3", "tlsv1"] | |
ciphers = [] | |
for version in versions: | |
ctx = SSL.Context(version, weak_crypto=True) | |
conn = SSL.Connection(ctx) | |
cipher_stack = conn.get_ciphers() | |
for cipher in cipher_stack: | |
print "%s\t%s" % (version, cipher) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This turned out to be easy, but was hard to find any details on. Essentially you connect to yourself with each SSL version and see what ciphers are available. The command line version: