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)) {