From feaab90b1fe29c9f059e4b548540f00b6df79ff1 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Thu, 3 Nov 2022 17:05:41 +0100 Subject: [PATCH] fix smtp --- CHANGES | 5 +++-- hydra-smtp.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 55d74e9..2c27d84 100644 --- a/CHANGES +++ b/CHANGES @@ -2,10 +2,11 @@ Changelog for hydra ------------------- Release 9.5-dev +* The help for http-form was wrong. the condition variable must always be + the *last* parameter, not the third * smb2: fix for updated libsmb2 which resulted in correct guessing attempts not being detected -* The help for http forms was wrong. the condition variable must always be - the *last* parameter, not the third +* smtp: break early if the server does not allow authentication Release 9.4 diff --git a/hydra-smtp.c b/hydra-smtp.c index dc6e54a..97d5b72 100644 --- a/hydra-smtp.c +++ b/hydra-smtp.c @@ -61,6 +61,10 @@ int32_t start_smtp(int32_t s, char *ip, int32_t port, unsigned char options, cha return 1; if (strstr(buf, "334") == NULL) { hydra_report(stderr, "[ERROR] SMTP PLAIN AUTH : %s\n", buf); + if (strstr(buf, "503") != NULL) { + free(buf); + return 4; + } free(buf); return 3; } @@ -438,6 +442,12 @@ void service_smtp(char *ip, int32_t sp, unsigned char options, char *miscptr, FI } hydra_child_exit(0); return; + case 4: /* error exit */ + if (sock >= 0) { + sock = hydra_disconnect(sock); + } + hydra_child_exit(3); + return; default: hydra_report(stderr, "[ERROR] Caught unknown return code, exiting!\n"); hydra_child_exit(0);