fix hydra telnet in some terminals, login failure will be accompanied by %, for example:% Authenticate failed

This commit is contained in:
Nicholas.Ni 2021-07-02 09:34:25 +08:00
commit a69c5d87d6
2 changed files with 14 additions and 9 deletions

View file

@ -504,7 +504,10 @@ int32_t service_http_init(char *ip, int32_t sp, unsigned char options, char *mis
}
match_status_code = atoi(status_code);
free(status_code);
if (debug) {
hydra_report(stdout, "Find match reply status code: %d", match_status_code);
}
}
}
return 0;
@ -517,8 +520,8 @@ void usage_http(const char *service) {
"NTLM or MD5\n"
" (h|H)=My-Hdr\\: foo to send a user defined HTTP header with each "
"request\n"
" (c|C)=check for status code in the HTTP reply. If the reply status "
" code matches it, it is judged as successful \n"
" (c|C)=check for status code in the HTTP reply. If the reply status code\n"
" matches it, it is judged as successful \n"
" (F|S)=check for text in the HTTP reply. S= means if this text is "
"found, a\n"
" valid account has been found, F= means if this string is "

View file

@ -37,12 +37,14 @@ int32_t start_telnet(int32_t s, char *ip, int32_t port, unsigned char options, c
return 1;
if (strchr(buf, '/') != NULL || strchr(buf, '>') != NULL || strchr(buf, '%') != NULL || strchr(buf, '$') != NULL || strchr(buf, '#') != NULL) {
hydra_report_found_host(port, ip, "telnet", fp);
hydra_completed_pair_found();
free(buf);
if (memcmp(hydra_get_next_pair(), &HYDRA_EXIT, sizeof(HYDRA_EXIT)) == 0)
return 3;
return 1;
if (strstr(buf, "ailed") == NULL) {
hydra_report_found_host(port, ip, "telnet", fp);
hydra_completed_pair_found();
free(buf);
if (memcmp(hydra_get_next_pair(), &HYDRA_EXIT, sizeof(HYDRA_EXIT)) == 0)
return 3;
return 1;
}
}
(void)make_to_lower(buf);