[Python] Python Script to scan a host cipher suites

Discussão em 'Python' iniciado por Stack, Maio 19, 2025.

  1. Stack

    Stack Membro Participativo

    I try to write a script like "sslscan" to scan and grab all cipher suites that a website is using.

    This is my sample code. This code only grabs one cipher.

    import ssl
    import socket

    def ssl_scan(hostname, port):
    context = ssl.create_default_context()
    with socket.create_connection((hostname, port)) as sock:
    with context.wrap_socket(sock, server_hostname=hostname) as ssock:
    cipher_suites = ssock.cipher()
    print(cipher_suites)
    if __name__ == "__main__":
    hostname = "host.co,"
    port = 443
    ssl_scan(hostname, port)


    I want to print all cipher suites.

    Continue reading...

Compartilhe esta Página