Loading src/main.c +5 −0 Original line number Diff line number Diff line Loading @@ -787,6 +787,11 @@ int main(int argc, char *argv[]) sizeof(masscan->rotate_directory), "."); #if !defined(WIN32) if (access("/etc/masscan/masscan.conf", 0) == 0) { masscan_read_config_file(masscan, "/etc/masscan/masscan.conf"); } #endif /* * Read in the configuration from the command-line. We are looking for Loading src/proto-tcp.c +12 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ uint64_t global_tcb_count; unsigned global_recv_overwhelmed; extern time_t global_now; struct TCP_Control_Block { Loading @@ -44,6 +45,7 @@ struct TCP_Control_Block unsigned short payload_length; time_t when_created; const unsigned char *payload; unsigned char banner[128]; Loading Loading @@ -287,6 +289,7 @@ tcpcon_create_tcb( static unsigned nothing = 0; tcb->p_counter = ¬hing; } tcb->when_created = global_now; tcpcon->active_count++; global_tcb_count = tcpcon->active_count; Loading Loading @@ -527,9 +530,18 @@ tcpcon_handle(struct TCP_ConnectionTable *tcpcon, struct TCP_Control_Block *tcb, unsigned seqno_them) { const unsigned char *payload = (const unsigned char *)vpayload; if (tcb == NULL) return; /* Make sure no connection lasts more than 20 seconds */ if (what == TCP_WHAT_TIMEOUT) { if (tcb->when_created + 20 < secs) { tcpcon_destroy_tcb(tcpcon, tcb); return; } } LOG(10, "%u.%u.%u.%u =%s : %s \n", (unsigned char)(tcb->ip_them>>24), (unsigned char)(tcb->ip_them>>16), Loading util/masscan2text.c +11 −8 Original line number Diff line number Diff line Loading @@ -181,7 +181,7 @@ normalize_string(unsigned char *px, size_t offset, size_t length, size_t max) px += offset; max -= offset; for (i=offset; i<length; i++) { for (i=0; i<length; i++) { unsigned char c = px[i]; if (isprint(c) && c != '<' && c != '>' && c != '&' && c != '\\') { Loading Loading @@ -234,14 +234,17 @@ void parse_banner(unsigned char *buf, size_t buf_length) /* output string */ if (buf_length > 10) if (buf_length > 10) { const char *s; s = normalize_string(buf, 10, buf_length-10, BUF_MAX); printf("%s %-15s :%5u -- \"%s\"\n", timebuf, addrbuf, record.port, normalize_string(buf, 10, buf_length-10, BUF_MAX) s ); } } void parse_file(const char *filename) { Loading Loading
src/main.c +5 −0 Original line number Diff line number Diff line Loading @@ -787,6 +787,11 @@ int main(int argc, char *argv[]) sizeof(masscan->rotate_directory), "."); #if !defined(WIN32) if (access("/etc/masscan/masscan.conf", 0) == 0) { masscan_read_config_file(masscan, "/etc/masscan/masscan.conf"); } #endif /* * Read in the configuration from the command-line. We are looking for Loading
src/proto-tcp.c +12 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ uint64_t global_tcb_count; unsigned global_recv_overwhelmed; extern time_t global_now; struct TCP_Control_Block { Loading @@ -44,6 +45,7 @@ struct TCP_Control_Block unsigned short payload_length; time_t when_created; const unsigned char *payload; unsigned char banner[128]; Loading Loading @@ -287,6 +289,7 @@ tcpcon_create_tcb( static unsigned nothing = 0; tcb->p_counter = ¬hing; } tcb->when_created = global_now; tcpcon->active_count++; global_tcb_count = tcpcon->active_count; Loading Loading @@ -527,9 +530,18 @@ tcpcon_handle(struct TCP_ConnectionTable *tcpcon, struct TCP_Control_Block *tcb, unsigned seqno_them) { const unsigned char *payload = (const unsigned char *)vpayload; if (tcb == NULL) return; /* Make sure no connection lasts more than 20 seconds */ if (what == TCP_WHAT_TIMEOUT) { if (tcb->when_created + 20 < secs) { tcpcon_destroy_tcb(tcpcon, tcb); return; } } LOG(10, "%u.%u.%u.%u =%s : %s \n", (unsigned char)(tcb->ip_them>>24), (unsigned char)(tcb->ip_them>>16), Loading
util/masscan2text.c +11 −8 Original line number Diff line number Diff line Loading @@ -181,7 +181,7 @@ normalize_string(unsigned char *px, size_t offset, size_t length, size_t max) px += offset; max -= offset; for (i=offset; i<length; i++) { for (i=0; i<length; i++) { unsigned char c = px[i]; if (isprint(c) && c != '<' && c != '>' && c != '&' && c != '\\') { Loading Loading @@ -234,14 +234,17 @@ void parse_banner(unsigned char *buf, size_t buf_length) /* output string */ if (buf_length > 10) if (buf_length > 10) { const char *s; s = normalize_string(buf, 10, buf_length-10, BUF_MAX); printf("%s %-15s :%5u -- \"%s\"\n", timebuf, addrbuf, record.port, normalize_string(buf, 10, buf_length-10, BUF_MAX) s ); } } void parse_file(const char *filename) { Loading