-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] HTTP-GET module with option A=MD5 use Basic Auth instead of Digest Auth #888
Comments
The following line in hydra-http.c leads to to the described behavior. The http_buf may be NULL due to currency issues.
Here the unexpected result from option A=MD5 (Digest Auth) after a single run with less than 100K attempts:
|
I found the reason for the strange behavior in the debug log. It seems that the http-get option :A=MD5 is NOT enforced. If the an attempt with Digest Auth doesn't return the response header WWW-Authenticate, the next try with the next password is an attempt with Basic Auth. That's a BUG, because the next password can only be used after an WWW-Authenticate has been received again. The Authorization method MUST NOT be changed if option :A=MD5 is configured.
C:GET /cgi/login.cgi HTTP/1.0 S:HTTP/1.1 401 Unauthorized
C:GET /cgi/login.cgi HTTP/1.0 S:HTTP/1.1 403 Forbidden
C:GET /cgi/login.cgi HTTP/1.1 |
If you think there is a bug I will happily merge a PR from you :) |
✌️ ✌️ ✌️ |
You are right. If the server side responds with 403 Forbidden, the next request must start with new credentials and with Basic Auth. Anyways, if this request results in a 401 Unauthorized, hydra always should try the same credentials using configured MD5 Digest Auth. If this is the case (untested), we can close the issue. |
Describe the bug
Using hydra http-get module with the option A=MD5 (digest) should use Digest Auth only. However if you run hydra, you can find multiple Basic Auth attempts instead of Digest Auth only. Important note: It seems to be a threading issue, because the more tasks are running the more Basic Auth attempt can be seen. We have noticed a single Basic Auth attempt when running with options t 1 (single task). This is still not correct.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We expect to see Digest Auth only if we configure hydra http-get module with option :A=MD5.
grep -n "Basic " hydra.debug | wc -l
0
grep -n "Digest " hydra.debug
Authorization: Digest username="root"
Screenshots
None
Desktop (please complete the following information):
Additional context
None
The text was updated successfully, but these errors were encountered: