Skip to content
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

adding support for digest authentication #1811

Merged
merged 5 commits into from Apr 15, 2022
Merged

Conversation

Mzack9999
Copy link
Member

@Mzack9999 Mzack9999 commented Apr 5, 2022

Proposed changes

This PR adds support for HTTP Digest Authentication via the new template settings digest-username and digest-password

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Notes

Reproduction steps

$ cat digest.yaml
id: digest-test

info:
  name: digest-test
  author: digest-test
  severity: info
  reference: seh
  tags: boh

requests:
  - raw:
      - |
        GET /test HTTP/1.1
        Host: {{Hostname}}
    
    digest-username: user
    digest-password: passwd
$ echo http://httpbin.org/digest-auth/auth/user/passwd | go run . -duc -no-interactsh -t digest.yaml -debug
...
[INF] Templates loaded for scan: 1
[INF] [digest-test] Dumped HTTP request for http://httpbin.org/digest-auth/auth/user/passwd

GET /digest-auth/auth/user/passwd/test HTTP/1.1
Host: httpbin.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1944.0 Safari/537.36
Connection: close
Accept-Encoding: gzip

[DBG] [digest-test] Dumped HTTP response (Truncated) http://httpbin.org/digest-auth/auth/user/passwd/test

HTTP/1.1 200 OK
Connection: close
Content-Length: 47
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Tue, 05 Apr 2022 06:48:03 GMT
Server: gunicorn/19.9.0
Set-Cookie: fake=fake_value; Path=/

{
  "authenticated": true,
  "user": "user"
}
[INF] No results found. Better luck next time!

@Mzack9999 Mzack9999 self-assigned this Apr 5, 2022
@Mzack9999 Mzack9999 added the Type: Enhancement Most issues will probably ask for additions or changes. label Apr 5, 2022
@Mzack9999 Mzack9999 linked an issue Apr 5, 2022 that may be closed by this pull request
@Mzack9999 Mzack9999 added the Status: In Progress This issue is being worked on, and has someone assigned. label Apr 5, 2022
@Mzack9999 Mzack9999 added Status: Review Needed The issue has a PR attached to it which needs to be reviewed and removed Status: In Progress This issue is being worked on, and has someone assigned. labels Apr 5, 2022
Copy link
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GET /digest-auth/auth/user/passwd/test HTTP/1.1
Host: httpbin.org
User-Agent: Go-http-client/1.1
Authorization: Digest username="user", realm="me@kennethreitz.com", nonce="29e379f905327a31b79c022b35ee302a", uri="/digest-auth/auth/user/passwd/test", response="505c202f0680d37bbe5aec9919355e90", cnonce="662f62d9ac36ddb099fe8a3b14a92670", opaque="f151368fe26ba4e439be9f91e4890478", qop=auth, nc=00000001
Accept-Encoding: gzip, deflate
Connection: close

Custom or Random User-Agent is considered if defined in the template.

@ehsandeep ehsandeep added Status: Revision Needed Submitter of PR needs to revise the PR related to the issue. and removed Status: Review Needed The issue has a PR attached to it which needs to be reviewed labels Apr 14, 2022
@ehsandeep ehsandeep added Status: Review Needed The issue has a PR attached to it which needs to be reviewed and removed Status: Revision Needed Submitter of PR needs to revise the PR related to the issue. labels Apr 14, 2022
@ehsandeep ehsandeep merged commit 5b9f7cd into dev Apr 15, 2022
@ehsandeep ehsandeep deleted the issue-847-digest-auth branch April 15, 2022 13:29
@ehsandeep ehsandeep added Status: Completed Nothing further to be done with this issue. Awaiting to be closed. and removed Status: Review Needed The issue has a PR attached to it which needs to be reviewed labels Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTP digest access authentication support
3 participants