diff --git a/hydra-imap.c b/hydra-imap.c index a9833b9..dcf45ed 100644 --- a/hydra-imap.c +++ b/hydra-imap.c @@ -409,7 +409,7 @@ void service_imap(char *ip, int sp, unsigned char options, char *miscptr, FILE * for (i = 0; i < strlen(miscptr); i++) miscptr[i] = (char) toupper((int) miscptr[i]); - if (strstr(miscptr, "TLS") || strstr(miscptr, "SSL")) { + if (strstr(miscptr, "TLS") || strstr(miscptr, "SSL") || strstr(miscptr, "STARTTLS")) { disable_tls = 0; } } diff --git a/hydra-pop3.c b/hydra-pop3.c index d2c58f7..b78525a 100644 --- a/hydra-pop3.c +++ b/hydra-pop3.c @@ -577,7 +577,7 @@ int service_pop3_init(char *ip, int sp, unsigned char options, char *miscptr, FI for (i = 0; i < strlen(miscptr); i++) miscptr[i] = (char) toupper((int) miscptr[i]); - if (strstr(miscptr, "TLS") || strstr(miscptr, "SSL")) { + if (strstr(miscptr, "TLS") || strstr(miscptr, "SSL") || strstr(miscptr, "STARTTLS")) { p.disable_tls = 0; } } diff --git a/hydra-smtp.c b/hydra-smtp.c index f4f9007..92ebe61 100644 --- a/hydra-smtp.c +++ b/hydra-smtp.c @@ -312,7 +312,7 @@ void service_smtp(char *ip, int sp, unsigned char options, char *miscptr, FILE * for (i = 0; i < strlen(miscptr); i++) miscptr[i] = (char) toupper((int) miscptr[i]); - if (strstr(miscptr, "TLS") || strstr(miscptr, "SSL")) { + if (strstr(miscptr, "TLS") || strstr(miscptr, "SSL") || strstr(miscptr, "STARTTLS")) { disable_tls = 0; } } diff --git a/hydra.c b/hydra.c index 712df43..d7d18a3 100644 --- a/hydra.c +++ b/hydra.c @@ -2599,6 +2599,13 @@ int main(int argc, char *argv[]) { if (getenv("HYDRA_PROXY_CONNECT")) fprintf(stderr, "[WARNING] The environment variable HYDRA_PROXY_CONNECT is not used! Use HYDRA_PROXY instead!\n"); + // wrong option use patch + if (hydra_options.ssl && ( ((strcmp(hydra_options.service, "smtp") == 0 || strcmp(hydra_options.service, "smtp-enum") == 0) && hydra_options.port != 465) || \ + (strcmp(hydra_options.service, "pop3") == 0 && hydra_options.port != 995) || \ + (strcmp(hydra_options.service, "imap") == 0 && hydra_options.port != 993) + )) + fprintf(stderr, "[WARNING] you want to access SMTP/POP3/IMAP with SSL. Are you sure you want to use direct SSL (-S) instead of STARTTLS (-m TLS)?\n"); + if (strcmp(hydra_options.service, "http") == 0 || strcmp(hydra_options.service, "https") == 0) { fprintf(stderr, "[ERROR] There is no service \"%s\", most likely you mean one of the many web modules, e.g. http-get or http-form-post. Read it up!\n", hydra_options.service); exit(-1);