mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-08-24 15:15:43 -07:00
fix: Skip when status codes do not match
This commit is contained in:
parent
c771c6397b
commit
9feb2d9ec2
1 changed files with 14 additions and 1 deletions
15
hydra-http.c
15
hydra-http.c
|
@ -261,7 +261,7 @@ int32_t start_http(int32_t s, char *ip, int32_t port, unsigned char options, cha
|
||||||
ptr++;
|
ptr++;
|
||||||
|
|
||||||
// check status
|
// 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++) {
|
for (int i = 0; match_status_code[i]; i++) {
|
||||||
if(match_status_code[i] == 0)
|
if(match_status_code[i] == 0)
|
||||||
continue;
|
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_report_found_host(port, ip, "www", fp);
|
||||||
hydra_completed_pair_found();
|
hydra_completed_pair_found();
|
||||||
|
|
||||||
|
if (http_buf != NULL) {
|
||||||
|
freeM(http_buf);
|
||||||
|
}
|
||||||
|
|
||||||
goto finish;
|
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)) {
|
if (ptr != NULL && (*ptr == '2' || *ptr == '3' || strncmp(ptr, "403", 3) == 0 || strncmp(ptr, "404", 3) == 0)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue