Commit a71d2e51 authored by Robert David Graham's avatar Robert David Graham
Browse files

hello ssl

parent 0c7eb402
Loading
Loading
Loading
Loading
+11
Changes for src/main-conf.c: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -452,6 +452,10 @@ masscan_echo(struct Masscan *masscan, FILE *fp)
    fprintf(fp, "%scapture = heartbleed\n", masscan->is_capture_heartbleed?"":"no");
    fprintf(fp, "%scapture = ticketbleed\n", masscan->is_capture_ticketbleed?"":"no");
    
    if (masscan->is_hello_ssl) {
        fprintf(fp, "hello = ssl\n");
    }

    /*
     *  TCP payloads
     */
@@ -1108,6 +1112,13 @@ masscan_set_parameter(struct Masscan *masscan,
            free(masscan->bpf_filter);
        masscan->bpf_filter = (char*)malloc(len);
        memcpy(masscan->bpf_filter, value, len);
    } else if (EQUALS("hello", name)) {
        if (EQUALS("ssl", value))
            masscan->is_hello_ssl = 1;
        else {
            fprintf(stderr, "FAIL: %s: unknown hello type\n", value);
            exit(1);
        }
    } else if (EQUALS("capture", name)) {
        if (EQUALS("cert", value))
            masscan->is_capture_cert = 1;
+5
Changes for src/main.c: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -621,6 +621,11 @@ receive_thread(void *v)
                                    "http-user-agent",
                                    masscan->http_user_agent_length,
                                    masscan->http_user_agent);
        if (masscan->is_hello_ssl)
            tcpcon_set_parameter(   tcpcon,
                                 "hello",
                                 1,
                                 "ssl");
        if (masscan->is_heartbleed)
            tcpcon_set_parameter(   tcpcon,
                                 "heartbleed",
+1
Changes for src/masscan.h: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ struct Masscan
    unsigned is_heartbleed:1;   /* --heartbleed, scan for this vuln */
    unsigned is_ticketbleed:1;  /* --ticketbleed, scan for this vuln */
    unsigned is_poodle_sslv3:1; /* --script poodle, scan for this vuln */
    unsigned is_hello_ssl:1;    /* --ssl, use SSL HELLO on all ports */
        
    /**
     * Wait forever for responses, instead of the default 10 seconds
+14
Changes for src/proto-tcp.c: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -228,6 +228,20 @@ tcpcon_set_parameter(struct TCP_ConnectionTable *tcpcon,
        return;
    }

    /*
     * Force SSL processing on all ports
     */
    if (name_equals(name, "hello") && name_equals(value, "ssl")) {
        unsigned i;
        
        LOG(2, "HELLO: setting SSL hello message\n");
        for (i=0; i<65535; i++) {
            banner1->tcp_payloads[i] = &banner_ssl;
        }
        
        return;
    }
    
    /*
     * 2014-04-08: scan for Neel Mehta's "heartbleed" bug
     */