warning for smtp/pop3/imap usage with -S when starttls is needed

This commit is contained in:
van Hauser 2016-09-13 11:33:04 +02:00
parent d89983364b
commit d1d39badc0
4 changed files with 10 additions and 3 deletions

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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);