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
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue