-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
HTTP Requests Annotation Prototype #1805
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mzack9999 we can extend this support to capture other cases, for example:
- hostname input
- input with scheme
currently, scheme is set based on the input target input url scheme, which will be ignored if it is defined in the template as shown below.
- |
@Host: 93.184.216.34
POST / HTTP/1.1
Host: {{Hostname}}
- |
@Host: example.com
POST / HTTP/1.1
Host: {{Hostname}}
- |
@Host: https://example.com
POST / HTTP/1.1
Host: {{Hostname}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also consider adding the relevant information about this feature in the guide document for HTTP protocol.
Done in projectdiscovery/nuclei-docs#32
Proposed changes
This PR implements a proposal for http requests to override settings via annotations. Raw requests are specified as a multiline string. Protocol settings are applied at the template level for all the subsequent requests, without the possibility to override per requests setting. Here it's proposed a mechanism inspired by a few programming languages based on annotations. If specified, it allows overriding specific request settings. An annotation looks like the following snippet:
@Setting:Value
For example, to override the real target of the request (the connection will be performed to
login.microsoftonline.com:443
Checklist