From 9feb2d9ec25998f136d513c1ba8a37c1952e1646 Mon Sep 17 00:00:00 2001 From: "Nicholas.ni" Date: Thu, 8 Jul 2021 23:25:27 +0800 Subject: [PATCH] fix: Skip when status codes do not match --- hydra-http.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hydra-http.c b/hydra-http.c index 31fbb1f..584f440 100644 --- a/hydra-http.c +++ b/hydra-http.c @@ -261,7 +261,7 @@ int32_t start_http(int32_t s, char *ip, int32_t port, unsigned char options, cha ptr++; // check status - if (match_status_code != NULL) { + if (match_status_code != NULL && match_status_code[0] != 0) { for (int i = 0; match_status_code[i]; i++) { if(match_status_code[i] == 0) continue; @@ -272,10 +272,23 @@ int32_t start_http(int32_t s, char *ip, int32_t port, unsigned char options, cha hydra_report_found_host(port, ip, "www", fp); hydra_completed_pair_found(); + if (http_buf != NULL) { + freeM(http_buf); + } + goto finish; } } } + + if (end_condition_type == -1) { + // Skip when status codes do not match + hydra_completed_pair(); + if (http_buf != NULL) { + freeM(http_buf); + } + goto finish; + } } if (ptr != NULL && (*ptr == '2' || *ptr == '3' || strncmp(ptr, "403", 3) == 0 || strncmp(ptr, "404", 3) == 0)) {