Skip to content

Commit

Permalink
poodle
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdavidgraham committed Oct 22, 2014
1 parent 2441f18 commit a614031
Show file tree
Hide file tree
Showing 13 changed files with 392 additions and 51 deletions.
10 changes: 10 additions & 0 deletions src/main-conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,16 @@ masscan_set_parameter(struct Masscan *masscan,
while (*p && (p[strlen(p)-1] == '/' || p[strlen(p)-1] == '/'))
p[strlen(p)-1] = '\0';
} else if (EQUALS("script", name)) {
if (EQUALS("heartbleed", value)) {
masscan_set_parameter(masscan, "heartbleed", "true");
return;
} else if (EQUALS("poodle", value) || EQUALS("sslv3", value)) {
masscan->is_poodle_sslv3 = 1;
masscan_set_parameter(masscan, "no-capture", "cert");
masscan_set_parameter(masscan, "banners", "true");
return;
}

if (!script_lookup(value)) {
fprintf(stderr, "FAIL: script '%s' does not exist\n", value);
fprintf(stderr, " hint: most nmap scripts aren't supported\n");
Expand Down
11 changes: 8 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,14 @@ receive_thread(void *v)
masscan->http_user_agent);
if (masscan->is_heartbleed)
tcpcon_set_parameter( tcpcon,
"heartbleed",
1,
"1");
"heartbleed",
1,
"1");
if (masscan->is_poodle_sslv3)
tcpcon_set_parameter( tcpcon,
"sslv3",
1,
"1");
if (masscan->tcp_connection_timeout) {
char foo[64];
sprintf_s(foo, sizeof(foo), "%u", masscan->tcp_connection_timeout);
Expand Down
3 changes: 3 additions & 0 deletions src/masscan-app.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ masscan_app_to_string(enum ApplicationProtocol proto)
case PROTO_VULN: return "vuln";
case PROTO_HEARTBLEED: return "heartbleed";
case PROTO_VNC_RFB: return "vnc";
case PROTO_SAFE: return "safe";

default:
sprintf_s(tmp, sizeof(tmp), "(%u)", proto);
return tmp;
Expand Down Expand Up @@ -67,6 +69,7 @@ masscan_string_to_app(const char *str)
{"vuln", PROTO_VULN},
{"heartbleed", PROTO_HEARTBLEED},
{"vnc", PROTO_VNC_RFB},
{"safe", PROTO_SAFE},
{0,0}
};
size_t i;
Expand Down
1 change: 1 addition & 0 deletions src/masscan-app.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum ApplicationProtocol {
PROTO_VULN,
PROTO_HEARTBLEED,
PROTO_VNC_RFB,
PROTO_SAFE,
};

const char *
Expand Down
1 change: 1 addition & 0 deletions src/masscan.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ struct Masscan
unsigned is_infinite:1; /* -infinite */
unsigned is_readscan:1; /* --readscan, Operation_Readscan */
unsigned is_heartbleed:1; /* --heartbleed, scan for this vuln */
unsigned is_poodle_sslv3:1; /* --script poodle, scan for this vuln */


/**
Expand Down
6 changes: 6 additions & 0 deletions src/proto-banner1.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct Banner1
unsigned is_capture_cert:1;
unsigned is_capture_heartbleed:1;
unsigned is_heartbleed:1;
unsigned is_poodle_sslv3:1;

struct ProtocolParserStream *tcp_payloads[65536];
};
Expand Down Expand Up @@ -47,6 +48,10 @@ struct SSL_SERVER_CERT {
} sub;
struct CertDecode x509;
};
struct SSL_SERVER_ALERT {
unsigned char level;
unsigned char description;
};

struct SSLRECORD {
unsigned char type;
Expand All @@ -66,6 +71,7 @@ struct SSLRECORD {
} all;
struct SSL_SERVER_HELLO server_hello;
struct SSL_SERVER_CERT server_cert;
struct SSL_SERVER_ALERT server_alert;
} x;

};
Expand Down
Loading

0 comments on commit a614031

Please sign in to comment.