Reset redirect flag and fix redirect port error issue

fix following 2 issues:

1. when fail is a redirect url, matched is not - but the redirect flag is still 1 - causing match missed

2. when redirect to a relative url on a port not 80, it fails to attach the port to the redirect url
This commit is contained in:
mindon 2017-06-24 08:26:39 -05:00 committed by GitHub
commit 6a6c58c925

View file

@ -468,7 +468,8 @@ return -1 if no response from server
*/
int analyze_server_response(int s) {
int runs = 0;
redirected_flag = 0;
auth_flag = 0;
while ((buf = hydra_receive_line(s)) != NULL) {
runs++;
//check for http redirection
@ -848,6 +849,10 @@ int start_http_form(int s, char *ip, int port, unsigned char options, char *misc
str3[0] = '/';
}
if(strrchr(url, ':') == NULL && port != 80) {
sprintf(str2, "%s:%d", str2, port);
}
if (verbose)
hydra_report(stderr, "[VERBOSE] Page redirected to http://%s%s\n", str2, str3);