mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 20:41:39 -07:00
SSL SNI support; important http-*:// fix; also http-post support added
This commit is contained in:
parent
4c25bddad7
commit
1579369097
52 changed files with 437 additions and 418 deletions
3
CHANGES
3
CHANGES
|
@ -7,6 +7,9 @@ Release 8.2-pre
|
|||
* Added new -O option to hydra to support SSL servers that do not suport TLS
|
||||
* Added xhydra gtk patche by Petar Kaleychev to support modules that do not use usernames
|
||||
* Added patch to redis for initial service checking by Petar Kaleychev - thanks a lot!
|
||||
* Added support in hydra-http for http-post (content length 0)
|
||||
* Fixed important bug in http-*://server/url command line processing
|
||||
* Added SSL SNI support
|
||||
* Fixed bug in HTTP Form redirection following - thanks for everyone who reported and especially to Hayden Young for setting up a test page for debugging
|
||||
* Better library finding in ./configure for SVN + support for Darwin Homebrew (and further enhanced)
|
||||
* Fixed http-form module crash that only occurs on *BSD/OSX systems. Thanks to zdk for reporting!
|
||||
|
|
|
@ -119,7 +119,7 @@ int start_afp(int s, char *ip, int port, unsigned char options, char *miscptr, F
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_afp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_afp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_AFP;
|
||||
|
||||
|
@ -173,7 +173,7 @@ void service_afp(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
|
||||
#endif
|
||||
|
||||
int service_afp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_afp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -62,7 +62,7 @@ int start_asterisk(int s, char *ip, int port, unsigned char options, char *miscp
|
|||
return 2;
|
||||
}
|
||||
|
||||
void service_asterisk(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_asterisk(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_ASTERISK, mysslport = PORT_ASTERISK_SSL;
|
||||
|
||||
|
@ -83,7 +83,7 @@ void service_asterisk(char *ip, int sp, unsigned char options, char *miscptr, FI
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ void service_asterisk(char *ip, int sp, unsigned char options, char *miscptr, FI
|
|||
}
|
||||
}
|
||||
|
||||
int service_asterisk_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_asterisk_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -58,7 +58,7 @@ int start_cisco_enable(int s, char *ip, int port, unsigned char options, char *m
|
|||
return 3;
|
||||
}
|
||||
|
||||
void service_cisco_enable(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_cisco_enable(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, failc = 0, retry = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_TELNET, mysslport = PORT_TELNET_SSL;
|
||||
char buffer[300];
|
||||
|
@ -83,7 +83,7 @@ void service_cisco_enable(char *ip, int sp, unsigned char options, char *miscptr
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -196,7 +196,7 @@ void service_cisco_enable(char *ip, int sp, unsigned char options, char *miscptr
|
|||
}
|
||||
}
|
||||
|
||||
int service_cisco_enable_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_cisco_enable_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -115,7 +115,7 @@ int start_cisco(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_cisco(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_cisco(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, failc = 0, retry = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_TELNET, mysslport = PORT_TELNET_SSL;
|
||||
|
||||
|
@ -143,7 +143,7 @@ void service_cisco(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -198,7 +198,7 @@ void service_cisco(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
}
|
||||
}
|
||||
|
||||
int service_cisco_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_cisco_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -85,7 +85,7 @@ int start_cvs(int s, char *ip, int port, unsigned char options, char *miscptr, F
|
|||
return 3;
|
||||
}
|
||||
|
||||
void service_cvs(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_cvs(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_CVS, mysslport = PORT_CVS_SSL;
|
||||
|
||||
|
@ -113,7 +113,7 @@ void service_cvs(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ void service_cvs(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
int service_cvs_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_cvs_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -87,7 +87,7 @@ int start_firebird(int s, char *ip, int port, unsigned char options, char *miscp
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_firebird(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_firebird(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_FIREBIRD, mysslport = PORT_FIREBIRD_SSL;
|
||||
|
||||
|
@ -109,7 +109,7 @@ void service_firebird(char *ip, int sp, unsigned char options, char *miscptr, FI
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -146,7 +146,7 @@ void service_firebird(char *ip, int sp, unsigned char options, char *miscptr, FI
|
|||
|
||||
#endif
|
||||
|
||||
int service_firebird_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_firebird_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
16
hydra-ftp.c
16
hydra-ftp.c
|
@ -72,7 +72,7 @@ int start_ftp(int s, char *ip, int port, unsigned char options, char *miscptr, F
|
|||
return 2;
|
||||
}
|
||||
|
||||
void service_ftp_core(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, int tls) {
|
||||
void service_ftp_core(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname, int tls) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_FTP, mysslport = PORT_FTP_SSL;
|
||||
|
||||
|
@ -93,7 +93,7 @@ void service_ftp_core(char *ip, int sp, unsigned char options, char *miscptr, FI
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -130,7 +130,7 @@ void service_ftp_core(char *ip, int sp, unsigned char options, char *miscptr, FI
|
|||
hydra_child_exit(2);
|
||||
}
|
||||
if (buf[0] == '2') {
|
||||
if ((hydra_connect_to_ssl(sock) == -1) && verbose) {
|
||||
if ((hydra_connect_to_ssl(sock, hostname) == -1) && verbose) {
|
||||
hydra_report(stderr, "[ERROR] Can't use TLS\n");
|
||||
hydra_child_exit(2);
|
||||
} else {
|
||||
|
@ -165,15 +165,15 @@ void service_ftp_core(char *ip, int sp, unsigned char options, char *miscptr, FI
|
|||
}
|
||||
}
|
||||
|
||||
void service_ftp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
service_ftp_core(ip, sp, options, miscptr, fp, port, 0);
|
||||
void service_ftp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
service_ftp_core(ip, sp, options, miscptr, fp, port, hostname, 0);
|
||||
}
|
||||
|
||||
void service_ftps(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
service_ftp_core(ip, sp, options, miscptr, fp, port, 1);
|
||||
void service_ftps(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
service_ftp_core(ip, sp, options, miscptr, fp, port, hostname, 1);
|
||||
}
|
||||
|
||||
int service_ftp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_ftp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -548,17 +548,17 @@ int analyze_server_response(int s) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void hydra_reconnect(int s, char *ip, int port, unsigned char options) {
|
||||
void hydra_reconnect(int s, char *ip, int port, unsigned char options, char *hostname) {
|
||||
if (s >= 0)
|
||||
s = hydra_disconnect(s);
|
||||
if ((options & OPTION_SSL) == 0) {
|
||||
s = hydra_connect_tcp(ip, port);
|
||||
} else {
|
||||
s = hydra_connect_ssl(ip, port);
|
||||
s = hydra_connect_ssl(ip, port, hostname);
|
||||
}
|
||||
}
|
||||
|
||||
int start_http_form(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp, char *type, ptr_header_node ptr_head, ptr_cookie_node ptr_cookie) {
|
||||
int start_http_form(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp, char *hostname, char *type, ptr_header_node ptr_head, ptr_cookie_node ptr_cookie) {
|
||||
char *empty = "";
|
||||
char *login, *pass, clogin[256], cpass[256];
|
||||
char header[8096], *upd3variables;
|
||||
|
@ -597,7 +597,7 @@ int start_http_form(int s, char *ip, int port, unsigned char options, char *misc
|
|||
i = analyze_server_response(s); // ignore result
|
||||
if (strlen(cookie) > 0)
|
||||
process_cookies(&ptr_cookie, cookie);
|
||||
hydra_reconnect(s, ip, port, options);
|
||||
hydra_reconnect(s, ip, port, options, hostname);
|
||||
}
|
||||
// now prepare for the "real" request
|
||||
if (strcmp(type, "POST") == 0) {
|
||||
|
@ -645,7 +645,7 @@ int start_http_form(int s, char *ip, int port, unsigned char options, char *misc
|
|||
i = analyze_server_response(s); // ignore result
|
||||
if (strlen(cookie) > 0)
|
||||
process_cookies(&ptr_cookie, cookie);
|
||||
hydra_reconnect(s, ip, port, options);
|
||||
hydra_reconnect(s, ip, port, options, hostname);
|
||||
}
|
||||
// now prepare for the "real" request
|
||||
if (strcmp(type, "POST") == 0) {
|
||||
|
@ -693,7 +693,7 @@ int start_http_form(int s, char *ip, int port, unsigned char options, char *misc
|
|||
process_cookies(&ptr_cookie, cookie);
|
||||
normal_request = stringify_headers(&ptr_head);
|
||||
}
|
||||
hydra_reconnect(s, ip, port, options);
|
||||
hydra_reconnect(s, ip, port, options, hostname);
|
||||
}
|
||||
// now prepare for the "real" request
|
||||
if (strcmp(type, "POST") == 0) {
|
||||
|
@ -852,7 +852,7 @@ int start_http_form(int s, char *ip, int port, unsigned char options, char *misc
|
|||
}
|
||||
}
|
||||
|
||||
hydra_reconnect(s, ip, port, options);
|
||||
hydra_reconnect(s, ip, port, options, hostname);
|
||||
|
||||
if (hydra_send(s, http_request, strlen(http_request), 0) < 0)
|
||||
return 1;
|
||||
|
@ -874,7 +874,7 @@ int start_http_form(int s, char *ip, int port, unsigned char options, char *misc
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_http_form(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *type, ptr_header_node * ptr_head, ptr_cookie_node * ptr_cookie) {
|
||||
void service_http_form(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname, char *type, ptr_header_node * ptr_head, ptr_cookie_node * ptr_cookie) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_HTTP, mysslport = PORT_HTTP_SSL;
|
||||
|
||||
|
@ -910,7 +910,7 @@ void service_http_form(char *ip, int sp, unsigned char options, char *miscptr, F
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -924,7 +924,7 @@ void service_http_form(char *ip, int sp, unsigned char options, char *miscptr, F
|
|||
break;
|
||||
}
|
||||
case 2: /* run the cracking function */
|
||||
next_run = start_http_form(sock, ip, port, options, miscptr, fp, type, *ptr_head, *ptr_cookie);
|
||||
next_run = start_http_form(sock, ip, port, options, miscptr, fp, hostname, type, *ptr_head, *ptr_cookie);
|
||||
break;
|
||||
case 3: /* clean exit */
|
||||
if (sock >= 0)
|
||||
|
@ -955,31 +955,31 @@ void service_http_form(char *ip, int sp, unsigned char options, char *miscptr, F
|
|||
free(miscptr);
|
||||
}
|
||||
|
||||
void service_http_get_form(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_http_get_form(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
ptr_cookie_node ptr_cookie = NULL;
|
||||
ptr_header_node ptr_head = initialize(ip, options, miscptr);
|
||||
|
||||
if (ptr_head)
|
||||
service_http_form(ip, sp, options, miscptr, fp, port, "GET", &ptr_head, &ptr_cookie);
|
||||
service_http_form(ip, sp, options, miscptr, fp, port, hostname, "GET", &ptr_head, &ptr_cookie);
|
||||
else {
|
||||
hydra_report(stderr, "[ERROR] Could not launch head. Error while initializing.\n");
|
||||
hydra_child_exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void service_http_post_form(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_http_post_form(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
ptr_cookie_node ptr_cookie = NULL;
|
||||
ptr_header_node ptr_head = initialize(ip, options, miscptr);
|
||||
|
||||
if (ptr_head)
|
||||
service_http_form(ip, sp, options, miscptr, fp, port, "POST", &ptr_head, &ptr_cookie);
|
||||
service_http_form(ip, sp, options, miscptr, fp, port, hostname, "POST", &ptr_head, &ptr_cookie);
|
||||
else {
|
||||
hydra_report(stderr, "[ERROR] Could not launch head. Error while initializing.\n");
|
||||
hydra_child_exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
int service_http_form_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_http_form_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -5,7 +5,7 @@ extern char *HYDRA_EXIT;
|
|||
char *buf;
|
||||
static int http_proxy_auth_mechanism = AUTH_ERROR;
|
||||
|
||||
int start_http_proxy_urlenum(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp) {
|
||||
int start_http_proxy_urlenum(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp, char *hostname) {
|
||||
char *empty = "";
|
||||
char *login, *pass, buffer[500], buffer2[500], mlogin[260], mpass[260], mhost[260];
|
||||
char url[260], host[30];
|
||||
|
@ -66,7 +66,7 @@ int start_http_proxy_urlenum(int s, char *ip, int port, unsigned char options, c
|
|||
if ((options & OPTION_SSL) == 0) {
|
||||
s = hydra_connect_tcp(ip, port);
|
||||
} else {
|
||||
s = hydra_connect_ssl(ip, port);
|
||||
s = hydra_connect_ssl(ip, port, hostname);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -228,7 +228,7 @@ int start_http_proxy_urlenum(int s, char *ip, int port, unsigned char options, c
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_http_proxy_urlenum(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_http_proxy_urlenum(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_HTTP_PROXY, mysslport = PORT_HTTP_PROXY_SSL;
|
||||
|
||||
|
@ -252,7 +252,7 @@ void service_http_proxy_urlenum(char *ip, int sp, unsigned char options, char *m
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -263,7 +263,7 @@ void service_http_proxy_urlenum(char *ip, int sp, unsigned char options, char *m
|
|||
break;
|
||||
}
|
||||
case 2: /* run the cracking function */
|
||||
next_run = start_http_proxy_urlenum(sock, ip, port, options, miscptr, fp);
|
||||
next_run = start_http_proxy_urlenum(sock, ip, port, options, miscptr, fp, hostname);
|
||||
break;
|
||||
case 3: /* clean exit */
|
||||
if (sock >= 0)
|
||||
|
@ -278,7 +278,7 @@ void service_http_proxy_urlenum(char *ip, int sp, unsigned char options, char *m
|
|||
}
|
||||
}
|
||||
|
||||
int service_http_proxy_urlenum_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_http_proxy_urlenum_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -5,7 +5,7 @@ extern char *HYDRA_EXIT;
|
|||
static int http_proxy_auth_mechanism = AUTH_ERROR;
|
||||
char *http_proxy_buf = NULL;
|
||||
|
||||
int start_http_proxy(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp) {
|
||||
int start_http_proxy(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp, char *hostname) {
|
||||
char *empty = "";
|
||||
char *login, *pass, buffer[500], buffer2[500];
|
||||
char url[210], host[30];
|
||||
|
@ -74,7 +74,7 @@ int start_http_proxy(int s, char *ip, int port, unsigned char options, char *mis
|
|||
if ((options & OPTION_SSL) == 0) {
|
||||
s = hydra_connect_tcp(ip, port);
|
||||
} else {
|
||||
s = hydra_connect_ssl(ip, port);
|
||||
s = hydra_connect_ssl(ip, port, hostname);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,7 +246,7 @@ int start_http_proxy(int s, char *ip, int port, unsigned char options, char *mis
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_http_proxy(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_http_proxy(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_HTTP_PROXY, mysslport = PORT_HTTP_PROXY_SSL;
|
||||
|
||||
|
@ -272,7 +272,7 @@ void service_http_proxy(char *ip, int sp, unsigned char options, char *miscptr,
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ void service_http_proxy(char *ip, int sp, unsigned char options, char *miscptr,
|
|||
break;
|
||||
}
|
||||
case 2: /* run the cracking function */
|
||||
next_run = start_http_proxy(sock, ip, port, options, miscptr, fp);
|
||||
next_run = start_http_proxy(sock, ip, port, options, miscptr, fp, hostname);
|
||||
break;
|
||||
case 3: /* clean exit */
|
||||
if (sock >= 0)
|
||||
|
@ -299,7 +299,7 @@ void service_http_proxy(char *ip, int sp, unsigned char options, char *miscptr,
|
|||
}
|
||||
}
|
||||
|
||||
int service_http_proxy_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_http_proxy_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
37
hydra-http.c
37
hydra-http.c
|
@ -11,7 +11,7 @@ int http_auth_mechanism = AUTH_BASIC;
|
|||
int start_http(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp, char *type) {
|
||||
char *empty = "";
|
||||
char *login, *pass, buffer[500], buffer2[500];
|
||||
char *header = ""; /* XXX TODO */
|
||||
char header[64] = "Content-Length: 0\r\n";
|
||||
char *ptr, *fooptr;
|
||||
int complete_line = 0;
|
||||
char tmpreplybuf[1024] = "", *tmpreplybufptr;
|
||||
|
@ -21,6 +21,9 @@ int start_http(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
if (strlen(pass = hydra_get_next_password()) == 0)
|
||||
pass = empty;
|
||||
|
||||
if (strcmp(type, "POST") != 0)
|
||||
header[0] = 0;
|
||||
|
||||
// we must reset this if buf is NULL and we do MD5 digest
|
||||
if (http_buf == NULL && http_auth_mechanism == AUTH_DIGESTMD5)
|
||||
http_auth_mechanism = AUTH_BASIC;
|
||||
|
@ -234,7 +237,7 @@ int start_http(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_http(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *type) {
|
||||
void service_http(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname, char *type) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_HTTP, mysslport = PORT_HTTP_SSL;
|
||||
char *ptr, *ptr2;
|
||||
|
@ -243,6 +246,8 @@ void service_http(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
if (memcmp(hydra_get_next_pair(), &HYDRA_EXIT, sizeof(HYDRA_EXIT)) == 0)
|
||||
return;
|
||||
|
||||
printf("DEBUG0: %s\n", miscptr);
|
||||
|
||||
if ((webtarget = strstr(miscptr, "://")) != NULL) {
|
||||
webtarget += strlen("://");
|
||||
if ((ptr2 = index(webtarget, ':')) != NULL) { /* step over port if present */
|
||||
|
@ -259,12 +264,12 @@ void service_http(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
strcpy(miscptr, ptr2);
|
||||
*ptr2 = 0;
|
||||
} else
|
||||
webtarget = NULL;
|
||||
}
|
||||
if (cmdlinetarget != NULL && webtarget == NULL)
|
||||
webtarget = cmdlinetarget;
|
||||
else if (webtarget == NULL && cmdlinetarget == NULL)
|
||||
webtarget = hydra_address2string(ip);
|
||||
webtarget = hostname;
|
||||
} else
|
||||
if (strlen(miscptr) == 0)
|
||||
miscptr = strdup("/");
|
||||
if (webtarget == NULL)
|
||||
webtarget = hostname;
|
||||
if (port != 0)
|
||||
webport = port;
|
||||
else if ((options & OPTION_SSL) == 0)
|
||||
|
@ -287,7 +292,7 @@ void service_http(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -319,15 +324,19 @@ void service_http(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
void service_http_get(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
service_http(ip, sp, options, miscptr, fp, port, "GET");
|
||||
void service_http_get(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
service_http(ip, sp, options, miscptr, fp, port, hostname, "GET");
|
||||
}
|
||||
|
||||
void service_http_head(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
service_http(ip, sp, options, miscptr, fp, port, "HEAD");
|
||||
void service_http_post(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
service_http(ip, sp, options, miscptr, fp, port, hostname, "POST");
|
||||
}
|
||||
|
||||
int service_http_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_http_head(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
service_http(ip, sp, options, miscptr, fp, port, hostname, "HEAD");
|
||||
}
|
||||
|
||||
int service_http_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -196,7 +196,7 @@ int start_icq(int sock, char *ip, int port, FILE * output, char *miscptr, FILE *
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_icq(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_icq(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_ICQ;
|
||||
|
||||
|
@ -241,7 +241,7 @@ void service_icq(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
int service_icq_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_icq_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -353,7 +353,7 @@ int start_imap(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_imap(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_imap(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_IMAP, mysslport = PORT_IMAP_SSL, disable_tls = 1;
|
||||
char *buffer1 = "1 CAPABILITY\r\n";
|
||||
|
@ -375,7 +375,7 @@ void service_imap(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -425,7 +425,7 @@ void service_imap(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
hydra_report(stderr, "[ERROR] TLS negotiation failed, no answer received from STARTTLS request\n");
|
||||
} else {
|
||||
free(buf);
|
||||
if ((hydra_connect_to_ssl(sock) == -1)) {
|
||||
if ((hydra_connect_to_ssl(sock, hostname) == -1)) {
|
||||
if (verbose)
|
||||
hydra_report(stderr, "[ERROR] Can't use TLS\n");
|
||||
disable_tls = 1;
|
||||
|
@ -571,7 +571,7 @@ void service_imap(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
int service_imap_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_imap_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
16
hydra-irc.c
16
hydra-irc.c
|
@ -60,7 +60,7 @@ int send_nick(int s, char *ip, char *pass) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int irc_server_connect(char *ip, int sock, int port, unsigned char options) {
|
||||
int irc_server_connect(char *ip, int sock, int port, unsigned char options, char *hostname) {
|
||||
if (sock >= 0)
|
||||
sock = hydra_disconnect(sock);
|
||||
// sleepn(275);
|
||||
|
@ -72,13 +72,13 @@ int irc_server_connect(char *ip, int sock, int port, unsigned char options) {
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
return sock;
|
||||
}
|
||||
|
||||
int start_pass_irc(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp) {
|
||||
int start_pass_irc(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp, char *hostname) {
|
||||
char *empty = "";
|
||||
char *pass;
|
||||
int ret;
|
||||
|
@ -86,7 +86,7 @@ int start_pass_irc(int s, char *ip, int port, unsigned char options, char *miscp
|
|||
if (strlen(pass = hydra_get_next_password()) == 0)
|
||||
pass = empty;
|
||||
|
||||
s = irc_server_connect(ip, s, port, options);
|
||||
s = irc_server_connect(ip, s, port, options, hostname);
|
||||
if (s < 0) {
|
||||
hydra_report(stderr, "[ERROR] Child with pid %d terminating, can not connect\n", (int) getpid());
|
||||
return 3;
|
||||
|
@ -118,7 +118,7 @@ int start_pass_irc(int s, char *ip, int port, unsigned char options, char *miscp
|
|||
return 4;
|
||||
}
|
||||
|
||||
void service_irc(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_irc(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1, ret;
|
||||
char *buf;
|
||||
|
||||
|
@ -131,7 +131,7 @@ void service_irc(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
switch (run) {
|
||||
case 1: /* connect and service init function */
|
||||
|
||||
sock = irc_server_connect(ip, sock, port, options);
|
||||
sock = irc_server_connect(ip, sock, port, options, hostname);
|
||||
if (sock < 0) {
|
||||
hydra_report(stderr, "[ERROR] Child with pid %d terminating, can not connect\n", (int) getpid());
|
||||
hydra_child_exit(1);
|
||||
|
@ -199,7 +199,7 @@ void service_irc(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
hydra_child_exit(0);
|
||||
return;
|
||||
case 4:
|
||||
next_run = start_pass_irc(sock, ip, port, options, miscptr, fp);
|
||||
next_run = start_pass_irc(sock, ip, port, options, miscptr, fp, hostname);
|
||||
break;
|
||||
default:
|
||||
hydra_report(stderr, "[ERROR] Caught unknown return code, exiting!\n");
|
||||
|
@ -209,7 +209,7 @@ void service_irc(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
int service_irc_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_irc_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
28
hydra-ldap.c
28
hydra-ldap.c
|
@ -7,7 +7,7 @@ unsigned char *buf;
|
|||
int counter;
|
||||
int tls_required = 0;
|
||||
|
||||
int start_ldap(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp, char version, int auth_method) {
|
||||
int start_ldap(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp, char *hostname, char version, int auth_method) {
|
||||
char *empty = "";
|
||||
char *login = "", *pass, *fooptr = "";
|
||||
unsigned char buffer[512];
|
||||
|
@ -351,7 +351,7 @@ int start_ldap(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 2;
|
||||
}
|
||||
|
||||
void service_ldap(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char version, int auth_method) {
|
||||
void service_ldap(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname, char version, int auth_method) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_LDAP, mysslport = PORT_LDAP_SSL;
|
||||
|
||||
|
@ -372,7 +372,7 @@ void service_ldap(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -393,7 +393,7 @@ void service_ldap(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
|
||||
if ((buf[0] != 0 && buf[9] == 0) || (buf[0] != 32 && buf[9] == 32)) {
|
||||
/* TLS option negociation goes well, now trying to connect */
|
||||
if ((hydra_connect_to_ssl(sock) == -1) && verbose) {
|
||||
if ((hydra_connect_to_ssl(sock, hostname) == -1) && verbose) {
|
||||
hydra_report(stderr, "[ERROR] Can't use TLS\n");
|
||||
hydra_child_exit(1);
|
||||
} else {
|
||||
|
@ -409,7 +409,7 @@ void service_ldap(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
next_run = 2;
|
||||
break;
|
||||
case 2: /* run the cracking function */
|
||||
next_run = start_ldap(sock, ip, port, options, miscptr, fp, version, auth_method);
|
||||
next_run = start_ldap(sock, ip, port, options, miscptr, fp, hostname, version, auth_method);
|
||||
counter++;
|
||||
break;
|
||||
case 3: /* clean exit */
|
||||
|
@ -425,23 +425,23 @@ void service_ldap(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
void service_ldap2(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
service_ldap(ip, sp, options, miscptr, fp, port, 2, AUTH_CLEAR);
|
||||
void service_ldap2(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
service_ldap(ip, sp, options, miscptr, fp, port, hostname, 2, AUTH_CLEAR);
|
||||
}
|
||||
|
||||
void service_ldap3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
service_ldap(ip, sp, options, miscptr, fp, port, 3, AUTH_CLEAR);
|
||||
void service_ldap3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
service_ldap(ip, sp, options, miscptr, fp, port, hostname, 3, AUTH_CLEAR);
|
||||
}
|
||||
|
||||
void service_ldap3_cram_md5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
service_ldap(ip, sp, options, miscptr, fp, port, 3, AUTH_CRAMMD5);
|
||||
void service_ldap3_cram_md5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
service_ldap(ip, sp, options, miscptr, fp, port, hostname, 3, AUTH_CRAMMD5);
|
||||
}
|
||||
|
||||
void service_ldap3_digest_md5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
service_ldap(ip, sp, options, miscptr, fp, port, 3, AUTH_DIGESTMD5);
|
||||
void service_ldap3_digest_md5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
service_ldap(ip, sp, options, miscptr, fp, port, hostname, 3, AUTH_DIGESTMD5);
|
||||
}
|
||||
|
||||
int service_ldap_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_ldap_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
18
hydra-mod.c
18
hydra-mod.c
|
@ -457,7 +457,7 @@ RSA *ssl_temp_rsa_cb(SSL * ssl, int export, int keylength) {
|
|||
}
|
||||
|
||||
|
||||
int internal__hydra_connect_to_ssl(int socket) {
|
||||
int internal__hydra_connect_to_ssl(int socket, char *hostname) {
|
||||
int err;
|
||||
|
||||
if (ssl_first) {
|
||||
|
@ -511,8 +511,8 @@ int internal__hydra_connect_to_ssl(int socket) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* add SNI */
|
||||
SSL_set_tlsext_host_name(ssl, "localhost");
|
||||
/* add SNI */
|
||||
SSL_set_tlsext_host_name(ssl, hostname);
|
||||
|
||||
SSL_set_fd(ssl, socket);
|
||||
|
||||
|
@ -533,13 +533,13 @@ int internal__hydra_connect_to_ssl(int socket) {
|
|||
return socket;
|
||||
}
|
||||
|
||||
int internal__hydra_connect_ssl(char *host, int port, int protocol, int type) {
|
||||
int internal__hydra_connect_ssl(char *host, int port, int protocol, int type, char *hostname) {
|
||||
int socket;
|
||||
|
||||
if ((socket = internal__hydra_connect(host, port, protocol, type)) < 0)
|
||||
return -1;
|
||||
|
||||
return internal__hydra_connect_to_ssl(socket);
|
||||
return internal__hydra_connect_to_ssl(socket, hostname);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -774,22 +774,22 @@ void hydra_report_found_host_msg(int port, char *ip, char *svc, FILE * fp, char
|
|||
*/
|
||||
}
|
||||
|
||||
int hydra_connect_to_ssl(int socket) {
|
||||
int hydra_connect_to_ssl(int socket, char *hostname) {
|
||||
#ifdef LIBOPENSSL
|
||||
return (internal__hydra_connect_to_ssl(socket));
|
||||
return (internal__hydra_connect_to_ssl(socket, hostname));
|
||||
#else
|
||||
fprintf(stderr, "Error: not compiled with SSL\n");
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
int hydra_connect_ssl(char *host, int port) {
|
||||
int hydra_connect_ssl(char *host, int port, char *hostname) {
|
||||
if (__first_connect != 0)
|
||||
__first_connect = 0;
|
||||
else
|
||||
sleep(conwait);
|
||||
#ifdef LIBOPENSSL
|
||||
return (internal__hydra_connect_ssl(host, port, SOCK_STREAM, 6));
|
||||
return (internal__hydra_connect_ssl(host, port, SOCK_STREAM, 6, hostname));
|
||||
#else
|
||||
fprintf(stderr, "Error: not compiled with SSL\n");
|
||||
return -1;
|
||||
|
|
|
@ -18,8 +18,8 @@ extern void hydra_report_pass_found(int port, char *ip, char *svc, FILE * fp);
|
|||
extern void hydra_report_found_host(int port, char *ip, char *svc, FILE * fp);
|
||||
extern void hydra_report_found_host_msg(int port, char *ip, char *svc, FILE * fp, char *msg);
|
||||
extern void hydra_report_debug(FILE *st, char *format, ...);
|
||||
extern int hydra_connect_to_ssl(int socket);
|
||||
extern int hydra_connect_ssl(char *host, int port);
|
||||
extern int hydra_connect_to_ssl(int socket, char *hostname);
|
||||
extern int hydra_connect_ssl(char *host, int port, char *hostname);
|
||||
extern int hydra_connect_tcp(char *host, int port);
|
||||
extern int hydra_connect_udp(char *host, int port);
|
||||
extern int hydra_disconnect(int socket);
|
||||
|
|
|
@ -107,7 +107,7 @@ int start_mssql(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_mssql(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_mssql(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_MSSQL, mysslport = PORT_MSSQL_SSL;
|
||||
|
||||
|
@ -125,7 +125,7 @@ void service_mssql(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -153,7 +153,7 @@ void service_mssql(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
}
|
||||
}
|
||||
|
||||
int service_mssql_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_mssql_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -11,7 +11,7 @@ void dummy_mysql() {
|
|||
printf("\n");
|
||||
}
|
||||
|
||||
void service_mysql(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_mysql(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
printf("\n");
|
||||
}
|
||||
#else
|
||||
|
@ -308,7 +308,7 @@ int start_mysql(int sock, char *ip, int port, unsigned char options, char *miscp
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_mysql(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_mysql(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_MYSQL;
|
||||
|
||||
|
@ -424,7 +424,7 @@ char *hydra_scramble(char *to, const char *message, const char *password) {
|
|||
}
|
||||
#endif
|
||||
|
||||
int service_mysql_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_mysql_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -133,7 +133,7 @@ int start_ncp(int s, char *ip, int port, unsigned char options, char *miscptr, F
|
|||
return 1; //reconnect
|
||||
}
|
||||
|
||||
void service_ncp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_ncp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_NCP;
|
||||
|
||||
|
@ -182,7 +182,7 @@ void service_ncp(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
|
||||
#endif
|
||||
|
||||
int service_ncp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_ncp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -266,7 +266,7 @@ int start_nntp(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 2;
|
||||
}
|
||||
|
||||
void service_nntp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_nntp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int i = 0, run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_NNTP, mysslport = PORT_NNTP_SSL, disable_tls = 0;
|
||||
char *buffer1 = "CAPABILITIES\r\n";
|
||||
|
@ -288,7 +288,7 @@ void service_nntp(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -327,7 +327,7 @@ void service_nntp(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
hydra_report(stderr, "[VERBOSE] TLS negotiation failed\n");
|
||||
} else {
|
||||
free(buf);
|
||||
if ((hydra_connect_to_ssl(sock) == -1)) {
|
||||
if ((hydra_connect_to_ssl(sock, hostname) == -1)) {
|
||||
if (verbose)
|
||||
hydra_report(stderr, "[ERROR] Can't use TLS\n");
|
||||
disable_tls = 1;
|
||||
|
@ -472,7 +472,7 @@ SASL PLAIN DIGEST-MD5 LOGIN NTLM CRAM-MD5
|
|||
}
|
||||
}
|
||||
|
||||
int service_nntp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_nntp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -258,7 +258,7 @@ int start_oracle_listener(int s, char *ip, int port, unsigned char options, char
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_oracle_listener(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_oracle_listener(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_ORACLE, mysslport = PORT_ORACLE_SSL;
|
||||
|
||||
|
@ -296,7 +296,7 @@ void service_oracle_listener(char *ip, int sp, unsigned char options, char *misc
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -325,7 +325,7 @@ void service_oracle_listener(char *ip, int sp, unsigned char options, char *misc
|
|||
}
|
||||
}
|
||||
|
||||
int service_oracle_listener_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_oracle_listener_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -85,7 +85,7 @@ int start_oracle_sid(int s, char *ip, int port, unsigned char options, char *mis
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_oracle_sid(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_oracle_sid(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_ORACLE, mysslport = PORT_ORACLE_SSL;
|
||||
|
||||
|
@ -106,7 +106,7 @@ void service_oracle_sid(char *ip, int sp, unsigned char options, char *miscptr,
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -134,7 +134,7 @@ void service_oracle_sid(char *ip, int sp, unsigned char options, char *miscptr,
|
|||
}
|
||||
}
|
||||
|
||||
int service_oracle_sid_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_oracle_sid_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -126,7 +126,7 @@ int start_oracle(int s, char *ip, int port, unsigned char options, char *miscptr
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_oracle(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_oracle(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_ORACLE;
|
||||
|
||||
|
@ -176,7 +176,7 @@ void service_oracle(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
|
||||
#endif
|
||||
|
||||
int service_oracle_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_oracle_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -224,7 +224,7 @@ int start_pcanywhere(int s, char *ip, int port, unsigned char options, char *mis
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_pcanywhere(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_pcanywhere(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_PCANYWHERE, mysslport = PORT_PCANYWHERE_SSL;
|
||||
|
||||
|
@ -247,7 +247,7 @@ void service_pcanywhere(char *ip, int sp, unsigned char options, char *miscptr,
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -278,7 +278,7 @@ void service_pcanywhere(char *ip, int sp, unsigned char options, char *miscptr,
|
|||
}
|
||||
}
|
||||
|
||||
int service_pcanywhere_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_pcanywhere_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -136,7 +136,7 @@ int start_pcnfs(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_pcnfs(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_pcnfs(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
|
||||
hydra_register_socket(sp);
|
||||
|
@ -183,7 +183,7 @@ void service_pcnfs(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
}
|
||||
}
|
||||
|
||||
int service_pcnfs_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_pcnfs_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
16
hydra-pop3.c
16
hydra-pop3.c
|
@ -18,7 +18,7 @@ char apop_challenge[300] = "";
|
|||
pool *plist = NULL, *p = NULL;
|
||||
|
||||
/* functions */
|
||||
int service_pop3_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
int service_pop3_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
|
||||
pool *list_create(pool data) {
|
||||
pool *p;
|
||||
|
@ -411,13 +411,13 @@ int start_pop3(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 2;
|
||||
}
|
||||
|
||||
void service_pop3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_pop3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
char *ptr = NULL;
|
||||
|
||||
//extract data from the pool, ip is the key
|
||||
if (plist == NULL)
|
||||
if (service_pop3_init(ip, sp, options, miscptr, fp, port) != 0)
|
||||
if (service_pop3_init(ip, sp, options, miscptr, fp, port, hostname) != 0)
|
||||
hydra_child_exit(2);
|
||||
p = list_find(ip);
|
||||
if (p == NULL) {
|
||||
|
@ -442,7 +442,7 @@ void service_pop3(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
if ((options & OPTION_SSL) == 0) {
|
||||
sock = hydra_connect_tcp(ip, port);
|
||||
} else {
|
||||
sock = hydra_connect_ssl(ip, port);
|
||||
sock = hydra_connect_ssl(ip, port, hostname);
|
||||
}
|
||||
if (sock < 0) {
|
||||
if (verbose || debug)
|
||||
|
@ -475,7 +475,7 @@ void service_pop3(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
hydra_report(stderr, "[ERROR] TLS negotiation failed, no answer received from STARTTLS request\n");
|
||||
} else {
|
||||
free(buf);
|
||||
if ((hydra_connect_to_ssl(sock) == -1)) {
|
||||
if ((hydra_connect_to_ssl(sock, hostname) == -1)) {
|
||||
if (verbose)
|
||||
hydra_report(stderr, "[ERROR] Can't use TLS\n");
|
||||
p->disable_tls = 1;
|
||||
|
@ -511,7 +511,7 @@ void service_pop3(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
|
||||
|
||||
int service_pop3_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_pop3_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int myport = PORT_POP3, mysslport = PORT_POP3_SSL;
|
||||
char *ptr = NULL;
|
||||
int sock = -1;
|
||||
|
@ -533,7 +533,7 @@ int service_pop3_init(char *ip, int sp, unsigned char options, char *miscptr, FI
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(p.ip, mysslport);
|
||||
sock = hydra_connect_ssl(p.ip, mysslport, hostname);
|
||||
}
|
||||
if (sock < 0) {
|
||||
if (verbose || debug)
|
||||
|
@ -593,7 +593,7 @@ int service_pop3_init(char *ip, int sp, unsigned char options, char *miscptr, FI
|
|||
hydra_report(stderr, "[ERROR] TLS negotiation failed, no answer received from STARTTLS request\n");
|
||||
} else {
|
||||
free(buf);
|
||||
if ((hydra_connect_to_ssl(sock) == -1)) {
|
||||
if ((hydra_connect_to_ssl(sock, hostname) == -1)) {
|
||||
if (verbose)
|
||||
hydra_report(stderr, "[ERROR] Can't use TLS\n");
|
||||
p.disable_tls = 1;
|
||||
|
|
|
@ -66,7 +66,7 @@ int start_postgres(int s, char *ip, int port, unsigned char options, char *miscp
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_postgres(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_postgres(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_POSTGRES, mysslport = PORT_POSTGRES_SSL;
|
||||
|
||||
|
@ -89,7 +89,7 @@ void service_postgres(char *ip, int sp, unsigned char options, char *miscptr, FI
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -119,7 +119,7 @@ void service_postgres(char *ip, int sp, unsigned char options, char *miscptr, FI
|
|||
|
||||
#endif
|
||||
|
||||
int service_postgres_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_postgres_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -2449,7 +2449,7 @@ int start_rdp(int s, char *ip, int port, unsigned char options, char *miscptr, F
|
|||
}
|
||||
|
||||
/* Client program */
|
||||
void service_rdp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_rdp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1;
|
||||
int myport = PORT_RDP;
|
||||
|
||||
|
@ -3199,7 +3199,7 @@ static BOOL process_data_pdu(STREAM s, uint32 * ext_disc_reason) {
|
|||
}
|
||||
#endif
|
||||
|
||||
int service_rdp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_rdp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -33,7 +33,7 @@ int start_redis(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_redis_core(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, int tls) {
|
||||
void service_redis_core(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname, int tls) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_REDIS, mysslport = PORT_REDIS_SSL;
|
||||
|
||||
|
@ -54,7 +54,7 @@ void service_redis_core(char *ip, int sp, unsigned char options, char *miscptr,
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -84,8 +84,8 @@ void service_redis_core(char *ip, int sp, unsigned char options, char *miscptr,
|
|||
}
|
||||
}
|
||||
|
||||
void service_redis(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
service_redis_core(ip, sp, options, miscptr, fp, port, 0);
|
||||
void service_redis(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
service_redis_core(ip, sp, options, miscptr, fp, port, hostname, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -103,7 +103,7 @@ void service_redis(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
* (error) ERR operation not permitted (for older redis versions)
|
||||
* That is used for initial password authentication and redis server response tests in service_redis_init
|
||||
*/
|
||||
int service_redis_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_redis_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
@ -126,7 +126,7 @@ int service_redis_init(char *ip, int sp, unsigned char options, char *miscptr, F
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (verbose)
|
||||
|
|
|
@ -45,7 +45,7 @@ int start_rexec(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_rexec(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_rexec(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_REXEC, mysslport = PORT_REXEC_SSL;
|
||||
|
||||
|
@ -68,7 +68,7 @@ void service_rexec(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -95,7 +95,7 @@ void service_rexec(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
}
|
||||
}
|
||||
|
||||
int service_rexec_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_rexec_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -89,7 +89,7 @@ int start_rlogin(int s, char *ip, int port, unsigned char options, char *miscptr
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_rlogin(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_rlogin(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_RLOGIN, mysslport = PORT_RLOGIN_SSL;
|
||||
|
||||
|
@ -115,7 +115,7 @@ void service_rlogin(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -141,7 +141,7 @@ void service_rlogin(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
}
|
||||
}
|
||||
|
||||
int service_rlogin_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_rlogin_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -60,7 +60,7 @@ int start_rsh(int s, char *ip, int port, unsigned char options, char *miscptr, F
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_rsh(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_rsh(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_RSH, mysslport = PORT_RSH_SSL;
|
||||
|
||||
|
@ -85,7 +85,7 @@ void service_rsh(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -111,7 +111,7 @@ void service_rsh(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
int service_rsh_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_rsh_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -180,7 +180,7 @@ int start_rtsp(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 2;
|
||||
}
|
||||
|
||||
void service_rtsp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_rtsp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_RTSP, mysslport = PORT_RTSP_SSL;
|
||||
char *ptr, *ptr2;
|
||||
|
@ -229,7 +229,7 @@ void service_rtsp(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
int service_rtsp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_rtsp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -124,7 +124,7 @@ int start_s7_300(int s, char *ip, int port, unsigned char options, char *miscptr
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_s7_300(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_s7_300(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int s7port = PORT_S7_300;
|
||||
|
||||
|
@ -163,7 +163,7 @@ void service_s7_300(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
}
|
||||
}
|
||||
|
||||
int service_s7_300_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_s7_300_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -89,7 +89,7 @@ int start_sapr3(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_sapr3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_sapr3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
|
||||
hydra_register_socket(sp);
|
||||
|
@ -117,7 +117,7 @@ void service_sapr3(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
|
||||
#endif
|
||||
|
||||
int service_sapr3_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_sapr3_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -176,7 +176,7 @@ int start_sip(int s, char *ip, char *lip, int port, int lport, unsigned char opt
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_sip(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_sip(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_SIP, mysslport = PORT_SIP_SSL;
|
||||
|
||||
|
@ -212,7 +212,7 @@ void service_sip(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
|
||||
|
@ -289,7 +289,7 @@ char *get_iface_ip(unsigned long int ip) {
|
|||
|
||||
#endif
|
||||
|
||||
int service_sip_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_sip_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -1303,7 +1303,7 @@ int start_smb(int s, char *ip, int port, unsigned char options, char *miscptr, F
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_smb(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_smb(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
|
||||
//default is both (local and domain) checks and normal passwd
|
||||
|
@ -1427,7 +1427,7 @@ void service_smb(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
#endif
|
||||
|
||||
int service_smb_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_smb_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -150,7 +150,7 @@ int start_smtp_enum(int s, char *ip, int port, unsigned char options, char *misc
|
|||
return 2;
|
||||
}
|
||||
|
||||
void service_smtp_enum(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_smtp_enum(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1, i = 0;
|
||||
int myport = PORT_SMTP, mysslport = PORT_SMTP_SSL;
|
||||
char *buffer = "HELO hydra\r\n";
|
||||
|
@ -171,7 +171,7 @@ void service_smtp_enum(char *ip, int sp, unsigned char options, char *miscptr, F
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -249,7 +249,7 @@ void service_smtp_enum(char *ip, int sp, unsigned char options, char *miscptr, F
|
|||
}
|
||||
}
|
||||
|
||||
int service_smtp_enum_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_smtp_enum_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -254,7 +254,7 @@ int start_smtp(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 2;
|
||||
}
|
||||
|
||||
void service_smtp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_smtp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1, i = 0;
|
||||
int myport = PORT_SMTP, mysslport = PORT_SMTP_SSL, disable_tls = 1;
|
||||
char *buf;
|
||||
|
@ -277,7 +277,7 @@ void service_smtp(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -328,7 +328,7 @@ void service_smtp(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
hydra_report(stderr, "[ERROR] TLS negotiation failed, no answer received from STARTTLS request\n");
|
||||
} else {
|
||||
free(buf);
|
||||
if ((hydra_connect_to_ssl(sock) == -1)) {
|
||||
if ((hydra_connect_to_ssl(sock, hostname) == -1)) {
|
||||
if (verbose)
|
||||
hydra_report(stderr, "[ERROR] Can't use TLS\n");
|
||||
disable_tls = 1;
|
||||
|
@ -443,7 +443,7 @@ void service_smtp(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
int service_smtp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_smtp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -470,7 +470,7 @@ int start_snmp(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_snmp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_snmp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1, i = 0;
|
||||
int myport = PORT_SNMP;
|
||||
char *lptr;
|
||||
|
@ -573,7 +573,7 @@ void service_snmp(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
int service_snmp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_snmp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -104,7 +104,7 @@ int start_socks5(int s, char *ip, int port, unsigned char options, char *miscptr
|
|||
return 2;
|
||||
}
|
||||
|
||||
void service_socks5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_socks5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_SOCKS5, mysslport = PORT_SOCKS5_SSL;
|
||||
|
||||
|
@ -128,7 +128,7 @@ void service_socks5(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -165,7 +165,7 @@ void service_socks5(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
}
|
||||
}
|
||||
|
||||
int service_socks5_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_socks5_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -107,7 +107,7 @@ int start_ssh(int s, char *ip, int port, unsigned char options, char *miscptr, F
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_ssh(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_ssh(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
|
||||
hydra_register_socket(sp);
|
||||
|
@ -151,7 +151,7 @@ void service_ssh(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
#endif
|
||||
#endif
|
||||
|
||||
int service_ssh_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_ssh_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -108,7 +108,7 @@ int start_sshkey(int s, char *ip, int port, unsigned char options, char *miscptr
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_sshkey(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_sshkey(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
|
||||
hydra_register_socket(sp);
|
||||
|
@ -151,7 +151,7 @@ void service_sshkey(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
#endif
|
||||
#endif
|
||||
|
||||
int service_sshkey_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_sshkey_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -137,7 +137,7 @@ int start_svn(int s, char *ip, int port, unsigned char options, char *miscptr, F
|
|||
return 3;
|
||||
}
|
||||
|
||||
void service_svn(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_svn(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_SVN, mysslport = PORT_SVN_SSL;
|
||||
|
||||
|
@ -161,7 +161,7 @@ void service_svn(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -191,7 +191,7 @@ void service_svn(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
|
||||
#endif
|
||||
|
||||
int service_svn_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_svn_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -102,7 +102,7 @@ int start_teamspeak(int s, char *ip, int port, unsigned char options, char *misc
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_teamspeak(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_teamspeak(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_TEAMSPEAK;
|
||||
|
||||
|
@ -142,7 +142,7 @@ void service_teamspeak(char *ip, int sp, unsigned char options, char *miscptr, F
|
|||
}
|
||||
}
|
||||
|
||||
int service_teamspeak_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_teamspeak_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -95,7 +95,7 @@ int start_telnet(int s, char *ip, int port, unsigned char options, char *miscptr
|
|||
return 2;
|
||||
}
|
||||
|
||||
void service_telnet(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_telnet(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1, fck;
|
||||
int myport = PORT_TELNET, mysslport = PORT_TELNET_SSL;
|
||||
|
||||
|
@ -123,7 +123,7 @@ void service_telnet(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -203,7 +203,7 @@ void service_telnet(char *ip, int sp, unsigned char options, char *miscptr, FILE
|
|||
}
|
||||
}
|
||||
|
||||
int service_telnet_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_telnet_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -65,7 +65,7 @@ int start_vmauthd(int s, char *ip, int port, unsigned char options, char *miscpt
|
|||
return 2;
|
||||
}
|
||||
|
||||
void service_vmauthd(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_vmauthd(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_VMAUTHD, mysslport = PORT_VMAUTHD_SSL;
|
||||
|
||||
|
@ -86,7 +86,7 @@ void service_vmauthd(char *ip, int sp, unsigned char options, char *miscptr, FIL
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ void service_vmauthd(char *ip, int sp, unsigned char options, char *miscptr, FIL
|
|||
if (strstr(buf, "SSL Required") != NULL) {
|
||||
if ((options & OPTION_SSL) == 0) {
|
||||
//reconnecting using SSL
|
||||
if (hydra_connect_to_ssl(sock) == -1) {
|
||||
if (hydra_connect_to_ssl(sock, hostname) == -1) {
|
||||
free(buf);
|
||||
hydra_report(stderr, "[ERROR] Can't use SSL\n");
|
||||
hydra_child_exit(2);
|
||||
|
@ -142,7 +142,7 @@ void service_vmauthd(char *ip, int sp, unsigned char options, char *miscptr, FIL
|
|||
}
|
||||
}
|
||||
|
||||
int service_vmauthd_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_vmauthd_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -143,7 +143,7 @@ int start_vnc(int s, char *ip, int port, unsigned char options, char *miscptr, F
|
|||
return 1; /* never reached */
|
||||
}
|
||||
|
||||
void service_vnc(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_vnc(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1;
|
||||
int myport = PORT_VNC, mysslport = PORT_VNC_SSL;
|
||||
|
||||
|
@ -163,7 +163,7 @@ void service_vnc(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -229,7 +229,7 @@ void service_vnc(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
int service_vnc_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_vnc_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
|
@ -278,7 +278,7 @@ int start_xmpp(int s, char *ip, int port, unsigned char options, char *miscptr,
|
|||
return 3;
|
||||
}
|
||||
|
||||
void service_xmpp(char *target, char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
void service_xmpp(char *target, char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1, tls = 0;
|
||||
char buffer[500], *buf = NULL;
|
||||
int myport = PORT_XMPP, mysslport = PORT_XMPP_SSL, disable_tls = 0;
|
||||
|
@ -320,7 +320,7 @@ void service_xmpp(char *target, char *ip, int sp, unsigned char options, char *m
|
|||
} else {
|
||||
if (port != 0)
|
||||
mysslport = port;
|
||||
sock = hydra_connect_ssl(ip, mysslport);
|
||||
sock = hydra_connect_ssl(ip, mysslport, hostname);
|
||||
port = mysslport;
|
||||
}
|
||||
if (sock < 0) {
|
||||
|
@ -443,7 +443,7 @@ void service_xmpp(char *target, char *ip, int sp, unsigned char options, char *m
|
|||
hydra_report(stderr, "[VERBOSE] TLS negotiation failed\n");
|
||||
} else {
|
||||
free(buf);
|
||||
if ((hydra_connect_to_ssl(sock) == -1)) {
|
||||
if ((hydra_connect_to_ssl(sock, hostname) == -1)) {
|
||||
if (verbose)
|
||||
hydra_report(stderr, "[ERROR] Can't use TLS\n");
|
||||
disable_tls = 1;
|
||||
|
@ -486,7 +486,7 @@ void service_xmpp(char *target, char *ip, int sp, unsigned char options, char *m
|
|||
}
|
||||
}
|
||||
|
||||
int service_xmpp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) {
|
||||
int service_xmpp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
435
hydra.c
435
hydra.c
|
@ -15,140 +15,141 @@
|
|||
#include <term.h>
|
||||
#endif
|
||||
|
||||
extern void service_asterisk(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_telnet(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_ftp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_ftps(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_pop3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_vmauthd(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_imap(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_ldap2(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_ldap3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_ldap3_cram_md5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_ldap3_digest_md5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_cisco(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_cisco_enable(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_vnc(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_socks5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_rexec(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_rlogin(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_rsh(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_nntp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_http_head(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_http_get(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_http_get_form(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_http_post_form(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_icq(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_pcnfs(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_mssql(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_cvs(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_snmp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_smtp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_smtp_enum(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_teamspeak(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_pcanywhere(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_http_proxy(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_xmpp(char *target, char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_irc(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_redis(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_http_proxy_urlenum(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_s7_300(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_rtsp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_asterisk(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_telnet(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_ftp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_ftps(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_pop3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_vmauthd(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_imap(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_ldap2(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_ldap3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_ldap3_cram_md5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_ldap3_digest_md5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_cisco(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_cisco_enable(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_vnc(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_socks5(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_rexec(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_rlogin(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_rsh(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_nntp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_http_head(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_http_get(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_http_post(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_http_get_form(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_http_post_form(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_icq(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_pcnfs(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_mssql(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_cvs(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_snmp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_smtp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_smtp_enum(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_teamspeak(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_pcanywhere(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_http_proxy(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_xmpp(char *target, char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_irc(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_redis(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_http_proxy_urlenum(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_s7_300(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_rtsp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
|
||||
#ifdef HAVE_MATH_H
|
||||
extern void service_mysql(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_mysql_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_mysql(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_mysql_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
#endif
|
||||
#ifdef LIBPOSTGRES
|
||||
extern void service_postgres(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_postgres_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_postgres(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_postgres_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
#endif
|
||||
#ifdef LIBOPENSSL
|
||||
extern void service_smb(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_smb_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_oracle_listener(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_oracle_listener_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_oracle_sid(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_oracle_sid_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_sip(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_sip_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_rdp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_rdp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_smb(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_smb_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_oracle_listener(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_oracle_listener_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_oracle_sid(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_oracle_sid_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_sip(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_sip_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_rdp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_rdp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
#endif
|
||||
#ifdef LIBSAPR3
|
||||
extern void service_sapr3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_sapr3_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_sapr3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_sapr3_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
#endif
|
||||
#ifdef LIBFIREBIRD
|
||||
extern void service_firebird(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_firebird_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_firebird(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_firebird_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
#endif
|
||||
#ifdef LIBAFP
|
||||
extern void service_afp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_afp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_afp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_afp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
#endif
|
||||
#ifdef LIBNCP
|
||||
extern void service_ncp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_ncp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_ncp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_ncp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
#endif
|
||||
#ifdef LIBSSH
|
||||
extern void service_ssh(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_ssh_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_sshkey(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_sshkey_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_ssh(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_ssh_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern void service_sshkey(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_sshkey_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
#endif
|
||||
#ifdef LIBSVN
|
||||
extern void service_svn(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_svn_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_svn(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_svn_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
#endif
|
||||
#ifdef LIBORACLE
|
||||
extern void service_oracle(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_oracle_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_oracle(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_oracle_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
#endif
|
||||
|
||||
extern int service_cisco_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_cisco_enable_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_cvs_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_smtp_enum_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_http_form_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_ftp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_http_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_icq_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_imap_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_irc_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_ldap_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_mssql_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_nntp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_pcanywhere_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_pcnfs_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_pop3_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_http_proxy_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_asterisk_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_redis_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_rexec_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_rlogin_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_rsh_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_smtp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_snmp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_socks5_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_teamspeak_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_telnet_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_http_proxy_urlenum_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_vmauthd_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_vnc_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_xmpp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_s7_300_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_rtsp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_cisco_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_cisco_enable_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_cvs_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_smtp_enum_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_http_form_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_ftp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_http_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_icq_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_imap_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_irc_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_ldap_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_mssql_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_nntp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_pcanywhere_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_pcnfs_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_pop3_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_http_proxy_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_asterisk_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_redis_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_rexec_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_rlogin_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_rsh_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_smtp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_snmp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_socks5_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_teamspeak_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_telnet_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_http_proxy_urlenum_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_vmauthd_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_vnc_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_xmpp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_s7_300_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
extern int service_rtsp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname);
|
||||
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
|
||||
// ADD NEW SERVICES HERE
|
||||
char *SERVICES =
|
||||
"asterisk afp cisco cisco-enable cvs firebird ftp ftps http[s]-{head|get} http[s]-{get|post}-form http-proxy http-proxy-urlenum icq imap[s] irc ldap2[s] ldap3[-{cram|digest}md5][s] mssql mysql ncp nntp oracle oracle-listener oracle-sid pcanywhere pcnfs pop3[s] postgres rdp redis rexec rlogin rsh rtsp s7-300 sapr3 sip smb smtp[s] smtp-enum snmp socks5 ssh sshkey svn teamspeak telnet[s] vmauthd vnc xmpp";
|
||||
"asterisk afp cisco cisco-enable cvs firebird ftp ftps http[s]-{head|get|post} http[s]-{get|post}-form http-proxy http-proxy-urlenum icq imap[s] irc ldap2[s] ldap3[-{cram|digest}md5][s] mssql mysql ncp nntp oracle oracle-listener oracle-sid pcanywhere pcnfs pop3[s] postgres rdp redis rexec rlogin rsh rtsp s7-300 sapr3 sip smb smtp[s] smtp-enum snmp socks5 ssh sshkey svn teamspeak telnet[s] vmauthd vnc xmpp";
|
||||
|
||||
#define MAXBUF 520
|
||||
#define MAXLINESIZE ( ( MAXBUF / 2 ) - 4 )
|
||||
|
@ -1120,120 +1121,120 @@ void hydra_service_init(int target_no) {
|
|||
|
||||
#ifdef LIBAFP
|
||||
if (strcmp(hydra_options.service, "afp") == 0)
|
||||
x = service_afp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_afp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "asterisk") == 0)
|
||||
x = service_asterisk_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_asterisk_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "cisco-enable") == 0)
|
||||
x = service_cisco_enable_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_cisco_enable_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "cvs") == 0)
|
||||
x = service_cvs_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_cvs_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "cisco") == 0)
|
||||
x = service_cisco_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_cisco_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#ifdef LIBFIREBIRD
|
||||
if (strcmp(hydra_options.service, "firebird") == 0)
|
||||
x = service_firebird_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_firebird_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "ftp") == 0 || strcmp(hydra_options.service, "ftps") == 0)
|
||||
x = service_ftp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_ftp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "redis") == 0 || strcmp(hydra_options.service, "redis") == 0)
|
||||
x = service_redis_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_redis_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "http-get") == 0 || strcmp(hydra_options.service, "http-head") == 0)
|
||||
x = service_http_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_http_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "http-form") == 0 || strcmp(hydra_options.service, "http-get-form") == 0 || strcmp(hydra_options.service, "http-post-form") == 0)
|
||||
x = service_http_form_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_http_form_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "http-proxy") == 0)
|
||||
x = service_http_proxy_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_http_proxy_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "http-proxy-urlenum") == 0)
|
||||
x = service_http_proxy_urlenum_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_http_proxy_urlenum_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "icq") == 0)
|
||||
x = service_icq_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_icq_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "imap") == 0)
|
||||
x = service_imap_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_imap_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "irc") == 0)
|
||||
x = service_irc_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_irc_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strncmp(hydra_options.service, "ldap", 4) == 0)
|
||||
x = service_ldap_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_ldap_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#ifdef LIBOPENSSL
|
||||
if (strcmp(hydra_options.service, "sip") == 0)
|
||||
x = service_sip_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_sip_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "smb") == 0 || strcmp(hydra_options.service, "smbnt") == 0)
|
||||
x = service_smb_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_smb_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "oracle-listener") == 0)
|
||||
x = service_oracle_listener_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_oracle_listener_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "oracle-sid") == 0)
|
||||
x = service_oracle_sid_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_oracle_sid_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "rdp") == 0)
|
||||
x = service_rdp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_rdp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "mssql") == 0)
|
||||
x = service_mssql_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_mssql_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#ifdef HAVE_MATH_H
|
||||
if (strcmp(hydra_options.service, "mysql") == 0)
|
||||
x = service_mysql_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_mysql_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#endif
|
||||
#ifdef LIBNCP
|
||||
if (strcmp(hydra_options.service, "ncp") == 0)
|
||||
x = service_ncp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_ncp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "nntp") == 0)
|
||||
x = service_nntp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_nntp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#ifdef LIBORACLE
|
||||
if (strcmp(hydra_options.service, "oracle") == 0)
|
||||
x = service_oracle_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_oracle_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "pcanywhere") == 0)
|
||||
x = service_pcanywhere_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_pcanywhere_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "pcnfs") == 0)
|
||||
x = service_pcnfs_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_pcnfs_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "pop3") == 0)
|
||||
x = service_pop3_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_pop3_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#ifdef LIBPOSTGRES
|
||||
if (strcmp(hydra_options.service, "postgres") == 0)
|
||||
x = service_postgres_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_postgres_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "rexec") == 0)
|
||||
x = service_rexec_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_rexec_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "rlogin") == 0)
|
||||
x = service_rlogin_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_rlogin_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "rsh") == 0)
|
||||
x = service_rsh_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_rsh_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#ifdef LIBSAPR3
|
||||
if (strcmp(hydra_options.service, "sapr3") == 0)
|
||||
x = service_sapr3_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_sapr3_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "smtp") == 0)
|
||||
x = service_smtp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_smtp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "smtp-enum") == 0)
|
||||
x = service_smtp_enum_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_smtp_enum_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "snmp") == 0)
|
||||
x = service_snmp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_snmp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "socks5") == 0)
|
||||
x = service_socks5_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_socks5_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#ifdef LIBSSH
|
||||
if (strcmp(hydra_options.service, "ssh") == 0)
|
||||
x = service_ssh_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_ssh_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "sshkey") == 0)
|
||||
x = service_sshkey_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_sshkey_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#endif
|
||||
#ifdef LIBSVN
|
||||
if (strcmp(hydra_options.service, "svn") == 0)
|
||||
x = service_svn_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_svn_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "teamspeak") == 0)
|
||||
x = service_teamspeak_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_teamspeak_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "telnet") == 0)
|
||||
x = service_telnet_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_telnet_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "vmauthd") == 0)
|
||||
x = service_vmauthd_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_vmauthd_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "vnc") == 0)
|
||||
x = service_vnc_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_vnc_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "xmpp") == 0)
|
||||
x = service_xmpp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_xmpp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "s7-300") == 0)
|
||||
x = service_s7_300_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_s7_300_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
if (strcmp(hydra_options.service, "rtsp") == 0)
|
||||
x = service_rtsp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
x = service_rtsp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[target_no]->target);
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
|
||||
|
@ -1298,143 +1299,144 @@ int hydra_spawn_head(int head_no, int target_no) {
|
|||
|
||||
// now call crack module
|
||||
if (strcmp(hydra_options.service, "asterisk") == 0)
|
||||
service_asterisk(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_asterisk(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "telnet") == 0)
|
||||
service_telnet(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_telnet(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "ftp") == 0) {
|
||||
|
||||
service_ftp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_ftp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
|
||||
}
|
||||
if (strcmp(hydra_options.service, "ftps") == 0)
|
||||
service_ftps(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_ftps(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "redis") == 0)
|
||||
service_redis(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_redis(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "pop3") == 0)
|
||||
service_pop3(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_pop3(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "imap") == 0)
|
||||
service_imap(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_imap(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "vmauthd") == 0)
|
||||
service_vmauthd(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_vmauthd(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "ldap2") == 0)
|
||||
service_ldap2(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_ldap2(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "ldap3") == 0)
|
||||
service_ldap3(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_ldap3(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "http-head") == 0)
|
||||
service_http_head(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_http_head(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "ldap3-crammd5") == 0)
|
||||
service_ldap3_cram_md5(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_ldap3_cram_md5(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "ldap3-digestmd5") == 0)
|
||||
service_ldap3_digest_md5(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_ldap3_digest_md5(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "http-post") == 0)
|
||||
service_http_post(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "http-get") == 0)
|
||||
service_http_get(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_http_get(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "http-get-form") == 0)
|
||||
service_http_get_form(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_http_get_form(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "http-post-form") == 0)
|
||||
service_http_post_form(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_http_post_form(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "http-proxy") == 0)
|
||||
service_http_proxy(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_http_proxy(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "http-proxy-urlenum") == 0)
|
||||
service_http_proxy_urlenum(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_http_proxy_urlenum(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "cisco") == 0)
|
||||
service_cisco(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_cisco(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "cisco-enable") == 0)
|
||||
service_cisco_enable(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_cisco_enable(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "socks5") == 0)
|
||||
service_socks5(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_socks5(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "vnc") == 0)
|
||||
service_vnc(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_vnc(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "rexec") == 0)
|
||||
service_rexec(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_rexec(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "rlogin") == 0)
|
||||
service_rlogin(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_rlogin(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "rsh") == 0)
|
||||
service_rsh(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_rsh(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "nntp") == 0)
|
||||
service_nntp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_nntp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "icq") == 0)
|
||||
service_icq(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_icq(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "pcnfs") == 0)
|
||||
service_pcnfs(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_pcnfs(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#ifdef HAVE_MATH_H
|
||||
if (strcmp(hydra_options.service, "mysql") == 0)
|
||||
service_mysql(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_mysql(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "mssql") == 0)
|
||||
service_mssql(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_mssql(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#ifdef LIBOPENSSL
|
||||
if (strcmp(hydra_options.service, "oracle-listener") == 0)
|
||||
service_oracle_listener(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_oracle_listener(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "oracle-sid") == 0)
|
||||
service_oracle_sid(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_oracle_sid(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
#ifdef LIBORACLE
|
||||
if (strcmp(hydra_options.service, "oracle") == 0)
|
||||
service_oracle(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_oracle(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
#ifdef LIBPOSTGRES
|
||||
if (strcmp(hydra_options.service, "postgres") == 0)
|
||||
service_postgres(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_postgres(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
#ifdef LIBFIREBIRD
|
||||
if (strcmp(hydra_options.service, "firebird") == 0)
|
||||
service_firebird(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_firebird(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
#ifdef LIBAFP
|
||||
if (strcmp(hydra_options.service, "afp") == 0)
|
||||
service_afp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_afp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
#ifdef LIBNCP
|
||||
if (strcmp(hydra_options.service, "ncp") == 0)
|
||||
service_ncp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_ncp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "pcanywhere") == 0)
|
||||
service_pcanywhere(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_pcanywhere(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "cvs") == 0)
|
||||
service_cvs(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_cvs(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#ifdef LIBSVN
|
||||
if (strcmp(hydra_options.service, "svn") == 0)
|
||||
service_svn(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_svn(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "snmp") == 0)
|
||||
service_snmp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_snmp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#ifdef LIBOPENSSL
|
||||
if ((strcmp(hydra_options.service, "smb") == 0) || (strcmp(hydra_options.service, "smbnt") == 0))
|
||||
service_smb(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_smb(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
#ifdef LIBSAPR3
|
||||
if (strcmp(hydra_options.service, "sapr3") == 0)
|
||||
service_sapr3(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_sapr3(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
#ifdef LIBSSH
|
||||
if (strcmp(hydra_options.service, "ssh") == 0)
|
||||
service_ssh(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_ssh(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "sshkey") == 0)
|
||||
service_sshkey(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_sshkey(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "smtp") == 0)
|
||||
service_smtp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_smtp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "smtp-enum") == 0)
|
||||
service_smtp_enum(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_smtp_enum(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "teamspeak") == 0)
|
||||
service_teamspeak(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_teamspeak(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#ifdef LIBOPENSSL
|
||||
if (strcmp(hydra_options.service, "sip") == 0)
|
||||
service_sip(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_sip(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "xmpp") == 0)
|
||||
service_xmpp(hydra_targets[target_no]->target, hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp,
|
||||
hydra_targets[target_no]->port);
|
||||
service_xmpp(hydra_targets[target_no]->target, hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "irc") == 0)
|
||||
service_irc(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_irc(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#ifdef LIBOPENSSL
|
||||
if (strcmp(hydra_options.service, "rdp") == 0)
|
||||
service_rdp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_rdp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
#endif
|
||||
if (strcmp(hydra_options.service, "s7-300") == 0)
|
||||
service_s7_300(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_s7_300(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
if (strcmp(hydra_options.service, "rtsp") == 0)
|
||||
service_rtsp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
service_rtsp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
|
||||
|
@ -1476,6 +1478,7 @@ int hydra_lookup_port(char *service) {
|
|||
{"ftp", PORT_FTP, PORT_FTP_SSL},
|
||||
{"ftps", PORT_FTP, PORT_FTP_SSL},
|
||||
{"http-head", PORT_HTTP, PORT_HTTP_SSL},
|
||||
{"http-post", PORT_HTTP, PORT_HTTP_SSL},
|
||||
{"http-get", PORT_HTTP, PORT_HTTP_SSL},
|
||||
{"http-get-form", PORT_HTTP, PORT_HTTP_SSL},
|
||||
{"http-post-form", PORT_HTTP, PORT_HTTP_SSL},
|
||||
|
@ -2466,7 +2469,7 @@ int main(int argc, char *argv[]) {
|
|||
// stuff we have to copy from the non-restore part
|
||||
if (strncmp(hydra_options.service, "http-", 5) == 0) {
|
||||
if (getenv("HYDRA_PROXY_HTTP") && getenv("HYDRA_PROXY"))
|
||||
bail("Found HYDRA_PROXY_HTTP *and* HYDRA_PROXY environment variables - you can use only ONE for the service http-head/http-get!");
|
||||
bail("Found HYDRA_PROXY_HTTP *and* HYDRA_PROXY environment variables - you can use only ONE for the service http-head/http-get/http-post!");
|
||||
if (getenv("HYDRA_PROXY_HTTP")) {
|
||||
printf("[INFO] Using HTTP Proxy: %s\n", getenv("HYDRA_PROXY_HTTP"));
|
||||
use_proxy = 1;
|
||||
|
@ -2536,7 +2539,7 @@ int main(int argc, char *argv[]) {
|
|||
if (param_pos != NULL) {
|
||||
if (strstr(hydra_options.service, "http") != NULL && strstr(hydra_options.service, "http-proxy") == NULL && param_pos[1] != '/')
|
||||
*--param_pos = '/';
|
||||
hydra_options.miscptr = param_pos;
|
||||
hydra_options.miscptr = strdup(param_pos);
|
||||
}
|
||||
//printf("target: %s service: %s port: %s opt: %s\n", target_pos, hydra_options.service, port_pos, param_pos);
|
||||
if (debug)
|
||||
|
@ -2709,7 +2712,6 @@ int main(int argc, char *argv[]) {
|
|||
if (strcmp(hydra_options.service, "http-proxy") == 0) {
|
||||
i = 1;
|
||||
if (hydra_options.miscptr != NULL && strncmp(hydra_options.miscptr, "http://", 7) != 0)
|
||||
|
||||
bail("module option must start with http://");
|
||||
}
|
||||
if (strcmp(hydra_options.service, "cvs") == 0) {
|
||||
|
@ -2902,7 +2904,6 @@ int main(int argc, char *argv[]) {
|
|||
if (hydra_options.miscptr == NULL)
|
||||
bail("-m option is required to specify the DN\n");
|
||||
}
|
||||
// ADD NEW SERVICES HERE
|
||||
if (strcmp(hydra_options.service, "rtsp") == 0)
|
||||
i = 1;
|
||||
if (strcmp(hydra_options.service, "s7-300") == 0) {
|
||||
|
@ -2936,19 +2937,22 @@ int main(int argc, char *argv[]) {
|
|||
if (hydra_options.tasks > 4)
|
||||
fprintf(stderr, "[WARNING] you should set the number of parallel task to 4 for vnc services.\n");
|
||||
}
|
||||
if (strcmp(hydra_options.service, "https-head") == 0 || strcmp(hydra_options.service, "https-get") == 0) {
|
||||
if (strcmp(hydra_options.service, "https-head") == 0 || strcmp(hydra_options.service, "https-get") == 0 || strcmp(hydra_options.service, "https-post") == 0) {
|
||||
#ifdef LIBOPENSSL
|
||||
i = 1;
|
||||
hydra_options.ssl = 1;
|
||||
if (strcmp(hydra_options.service, "https-head") == 0)
|
||||
strcpy(hydra_options.service, "http-head");
|
||||
else
|
||||
strcpy(hydra_options.service, "http-get");
|
||||
if (strcmp(hydra_options.service, "https-post") == 0)
|
||||
strcpy(hydra_options.service, "http-post");
|
||||
else
|
||||
strcpy(hydra_options.service, "http-get");
|
||||
#else
|
||||
bail("Compiled without SSL support, module not available");
|
||||
#endif
|
||||
}
|
||||
if (strcmp(hydra_options.service, "http-get") == 0 || strcmp(hydra_options.service, "http-head") == 0) {
|
||||
if (strcmp(hydra_options.service, "http-get") == 0 || strcmp(hydra_options.service, "http-head") == 0 || strcmp(hydra_options.service, "http-post") == 0) {
|
||||
i = 1;
|
||||
if (hydra_options.miscptr == NULL) {
|
||||
fprintf(stderr, "[WARNING] You must supply the web page as an additional option or via -m, default path set to /\n");
|
||||
|
@ -3317,7 +3321,8 @@ int main(int argc, char *argv[]) {
|
|||
} else if (index(hydra_options.server, '/') != NULL) {
|
||||
if (strstr(cmdtarget, "://") != NULL) {
|
||||
tmpptr = index(hydra_options.server, '/');
|
||||
*tmpptr = 0;
|
||||
if (tmpptr != NULL)
|
||||
*tmpptr = 0;
|
||||
countservers = hydra_brains.targets = 1;
|
||||
hydra_targets = malloc(sizeof(int) * 4);
|
||||
hydra_targets[0] = malloc(sizeof(hydra_target));
|
||||
|
@ -3511,6 +3516,7 @@ int main(int argc, char *argv[]) {
|
|||
hydra_options.tasks = hydra_brains.todo;
|
||||
}
|
||||
}
|
||||
|
||||
if (hydra_options.max_use == MAXTASKS) { // only if it was not set via -T
|
||||
if (hydra_options.max_use < hydra_brains.targets * hydra_options.tasks)
|
||||
hydra_options.max_use = hydra_brains.targets * hydra_options.tasks;
|
||||
|
@ -3578,6 +3584,7 @@ int main(int argc, char *argv[]) {
|
|||
printf("[VERBOSE] Resolving addresses ... ");
|
||||
if (debug)
|
||||
printf("\n");
|
||||
|
||||
for (i = 0; i < hydra_brains.targets; i++) {
|
||||
if (debug)
|
||||
printf("[DEBUG] resolving %s\n", hydra_targets[i]->target);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue