Commit 87443acf authored by robertdavidgraham's avatar robertdavidgraham
Browse files

ssl

parent 70a1b957
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -76,8 +76,8 @@ timeouts_add(struct Timeouts *timeouts, struct TimeoutEntry *entry,
             size_t offset, uint64_t timestamp)
{
    unsigned index;
    time_t now = time(0);
    time_t time_future = (unsigned)(timestamp/16384ULL);
    //time_t now = time(0);
    //time_t time_future = (unsigned)(timestamp/16384ULL);

    /* Unlink from wherever the entry came from */
    timeout_unlink(entry);
+4 −0
Original line number Diff line number Diff line
@@ -26,6 +26,10 @@ struct Patterns patterns[] = {
    {"\x16\x03\x01",3, PROTO_SSL3, SMACK_ANCHOR_BEGIN},
    {"\x16\x03\x02",3, PROTO_SSL3, SMACK_ANCHOR_BEGIN},
    {"\x16\x03\x03",3, PROTO_SSL3, SMACK_ANCHOR_BEGIN},
    {"\x15\x03\x00",3, PROTO_SSL3, SMACK_ANCHOR_BEGIN},
    {"\x15\x03\x01",3, PROTO_SSL3, SMACK_ANCHOR_BEGIN},
    {"\x15\x03\x02",3, PROTO_SSL3, SMACK_ANCHOR_BEGIN},
    {"\x15\x03\x03",3, PROTO_SSL3, SMACK_ANCHOR_BEGIN},
    {0,0}
};

+1 −1
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ http_selftest(void)
/***************************************************************************
 ***************************************************************************/
struct Banner1Stream banner_http = {
    "http", 80, http_hello, sizeof(http_hello),
    "http", 80, http_hello, sizeof(http_hello)-1,
    http_selftest,
    http_init,
    http_parse,
+9 −10
Original line number Diff line number Diff line
@@ -640,12 +640,8 @@ tcpcon_handle(struct TCP_ConnectionTable *tcpcon, struct TCP_Control_Block *tcb,
            const unsigned char *x;
            switch (tcb->port_them) {
            case 80: 
                x = (const unsigned char *)
                    "GET / HTTP/1.0\r\n"
                    "User-Agent: masscan/1.0 (https://github.com/robertdavidgraham/masscan)\r\n"
                    //"Connection: Keep-Alive\r\n"
                    //"Content-Length: 0\r\n"
                    "\r\n"; 
                x = (const unsigned char *)banner_ssl.hello;
                x_len = banner_ssl.hello_length;
                break;
            case 443:   /* HTTP/s */
            case 465:   /* SMTP/s */
@@ -659,13 +655,16 @@ tcpcon_handle(struct TCP_ConnectionTable *tcpcon, struct TCP_Control_Block *tcb,
            case 9050:  /* Tor */
                tcb->banner1_state.is_sent_sslhello = 1;
                x = (const unsigned char *)banner_ssl.hello;
                x_len = banner_ssl.hello_length;
                break;
            default:
                x = 0;
                break;
            }
            if (x) {
                /* send request */
                x_len = strlen((const char*)x);
            if (x && x_len) {
                /* Send request. This actually doens't send the packet right
                 * now, but instead queues up a packet that the transmit
                 * thread will send soon. */
                tcpcon_send_packet(tcpcon, tcb,
                    0x18, 
                    x, x_len);