Is it possible to have redirection with Raw HTTP protocol on nuclei? #6655
Unanswered
pascal-sun
asked this question in
Q&A
Replies: 1 comment
-
|
This is expected behavior - raw HTTP requests in nuclei do not follow redirects the same way as the basic HTTP protocol. This is by design because raw requests give you precise control over the HTTP interaction. For raw requests that need redirect following, you have a few options: 1. Use http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
max-redirects: 3
redirects: true2. Chain multiple raw requests: http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
extractors:
- type: regex
name: redirect_location
part: header
regex:
- "Location: (.*)"
internal: true
- raw:
- |
GET {{redirect_location}} HTTP/1.1
Host: {{Hostname}}
matchers:
- type: status
status:
- 2003. Use basic HTTP protocol (which you showed works) if you dont need the raw control. The raw protocol is primarily for when you need exact control over headers/body and typically for vulnerability testing where redirect behavior needs to be explicit. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi 👋
It seems that with
Raw HTTPprotocol, follow redirection does not work. I don't know if this is normal (due to technical constraints?) or if it's a bug.For example, I have a web application that redirect to
/auth/loginwhen you go to/.FastAPI demo
Code (main.py)
Run
Basic HTTP protocol ✅
The following template works perfectly and do follow redirection:
Complete template and result
Raw HTTP protocol ❌
But with the following template with the same request, the redirection is not followed (even with
-follow-redirectsoption):Complete template and result
Is it a normal behavior, do I missed something?
Beta Was this translation helpful? Give feedback.
All reactions