Skip to content

Commit

Permalink
ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdavidgraham committed Oct 4, 2013
1 parent 70a1b95 commit 87443ac
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/event-timeout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/proto-banner1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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}
};

Expand Down
2 changes: 1 addition & 1 deletion src/proto-http.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
19 changes: 9 additions & 10 deletions src/proto-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,13 +640,9 @@ 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";
break;
x = (const unsigned char *)banner_ssl.hello;
x_len = banner_ssl.hello_length;
break;
case 443: /* HTTP/s */
case 465: /* SMTP/s */
case 990: /* FTP/s */
Expand All @@ -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);
Expand Down

0 comments on commit 87443ac

Please sign in to comment.