Commit b128c3ec authored by robertdavidgraham's avatar robertdavidgraham
Browse files

x509

parent ba042857
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -285,6 +285,10 @@ masscan_echo(struct Masscan *masscan, FILE *fp)
                    masscan->http_headers[i].header_value_length,
                masscan->http_headers[i].header_value);
    }

    
    fprintf(fp, "%scapture = cert\n", masscan->is_capture_cert?"":"no");
    fprintf(fp, "%scapture = html\n", masscan->is_capture_html?"":"no");
}

/***************************************************************************
@@ -784,6 +788,24 @@ 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("capture", name)) {
        if (EQUALS("cert", value))
            masscan->is_capture_cert = 1;
        else if (EQUALS("html", value))
            masscan->is_capture_html = 1;
        else {
            fprintf(stderr, "FAIL: %s: unknown capture type\n", value);
            exit(1);
        }
    } else if (EQUALS("nocapture", name)) {
        if (EQUALS("cert", value))
            masscan->is_capture_cert = 0;
        else if (EQUALS("html", value))
            masscan->is_capture_html = 0;
        else {
            fprintf(stderr, "FAIL: %s: unknown capture type\n", value);
            exit(1);
        }
    } else if (EQUALS("ping", name) || EQUALS("ping-sweep", name)) {
        /* Add ICMP ping request */
        struct Range range;
+7 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@
#include "main-globals.h"       /* all the global variables in the program */
#include "proto-zeroaccess.h"
#include "siphash24.h"
#include "proto-x509.h"


#include <assert.h>
#include <limits.h>
@@ -561,6 +563,9 @@ receive_thread(void *v)
            out,
            masscan->tcb.timeout
            );
        tcpcon_set_banner_flags(tcpcon,
                masscan->is_capture_cert,
                masscan->is_capture_html);
        if (masscan->http_user_agent_length)
            tcpcon_set_parameter(   tcpcon, 
                                    "http-user-agent",
@@ -1258,6 +1263,7 @@ int main(int argc, char *argv[])
    strcpy_s(   masscan->rotate_directory,
                sizeof(masscan->rotate_directory),
                ".");
    masscan->is_capture_cert = 1;

    /*
     * On non-Windows systems, read the defaults from the file in
@@ -1286,6 +1292,7 @@ int main(int argc, char *argv[])

    /* Init some protocol parser data structures */
    snmp_init();
    x509_init();

    /* Set randomization seed for SYN-cookies */
    syn_set_entropy(masscan->seed);
+2 −0
Original line number Diff line number Diff line
@@ -93,6 +93,8 @@ struct Masscan
    unsigned is_interactive:1;  /* --interactive */
	unsigned is_arp:1;			/* --arp */
    unsigned is_gmt:1;          /* --gmt, all times in GMT */
    unsigned is_capture_cert:1; /* --capture cert */
    unsigned is_capture_html:1; /* --capture html */

    /**
     * Wait forever for responses, instead of the default 10 seconds
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
#define STATE_DONE 0xFFFFFFFF
#include <stdio.h>
#include "proto-banout.h"
#include "proto-x509.h"

struct Banner1
{
@@ -34,6 +35,7 @@ struct SSL_SERVER_CERT {
        unsigned state;
        unsigned b64x;
    } sub;
    struct CertDecode x509;
};

struct SSLRECORD {
+0 −4
Original line number Diff line number Diff line
@@ -205,10 +205,6 @@ banout_selftest(void)

    if (banout->next == 0)
        return 1;
    if (banout->next->next == 0)
        return 1;
    if (banout->next->next->next != 0)
        return 1;
    if (banout_string_length(banout, 1) != 40)
        return 1;
    if (banout_string_length(banout, 2) != 50)
Loading