I was experimenting with a web app on Hack the Box the other day, and remembered…
- User
I was experimenting with a web app on Hack the Box the other day, and remembered something about verb tempering. So I went ahead and intercepted a request in Burp, and then literally typed "POST" instead of "GET" in the HTTP header before forwarding. Now I found out that there is a "change request method" option Burp...what does that do? I assume it changes other thing in that request to make it a "true" change of the method?
Assistant
Great question! You're on the right track with HTTP verb tampering (or method tampering), which is a technique used to test how a web server or application handles unexpected HTTP methods.
Manual Method Tampering (Typing "POST" instead of "GET")
When you manually change
GETtoPOSTin the request line (e.g.,POST /login HTTP/1.1), you're only altering the method in the request line. However, a properPOSTrequest usually requires:- A
Content-Typeheader (e.g.,application/x-www-form-urlencodedormultipart/form-data) - A
Content-Lengthheader (if there's a body) - A request body (if applicable)
If you just change
GETtoPOSTwithout adjusting these, the server might reject the request or handle it differently than a "real"POST.Burp's "Change Request Method" Option
Burp Suite’s "Change request method" (right-click on a request → "Change request method") does more than just swap
GETtoPOST(or vice versa). It:- Switches the HTTP method (e.g.,
GET→POSTorPOST→GET). - Adjusts headers automatically:
- If converting
GET→POST, it adds:Content-Type: application/x-www-form-urlencodedContent-Length: [calculated]
- If converting
POST→GET, it removes these headers.
- If converting
- Moves the body (if any) to the query string (when converting
POST→GET).
Why This Matters in Security Testing
- Some web apps enforce strict method handling (e.g., only allowing
POSTfor login). - Misconfigured servers might process
GETandPOSTdifferently, leading to security flaws (e.g., authentication bypass, CSRF issues). - Some APIs or frameworks (like Flask, Express, or .NET) may behave unexpectedly when methods are altered.
Example: Manual vs. Burp's Method Change
Original
GETrequest:GET /admin HTTP/1.1 Host: example.comManual change to
POST(incomplete):POST /admin HTTP/1.1 Host: example.com→ Missing
Content-TypeandContent-Length; server may reject it.Burp's "Change request method" to
POST:POST /admin HTTP/1.1 Host: example.com Content-Type: application/x-www-form-urlencoded Content-Length: 0→ Properly formatted
POSTrequest.Takeaway
- Manual changes are quick but may not work if the request isn't properly structured.
- Burp’s built-in method change ensures the request is correctly formatted for the new method.
- Testing both ways can reveal different behaviors (e.g., some endpoints may accept
GETbut notPOST, or vice versa).
Would you like an example of how this could lead to a security vulnerability?
- A
- User
haha, makes me wonder if I was closer to that flag than I thought I was Will try this next time, thanks!
Assistant
Haha, you might have been way closer than you thought! 😆
Since you're playing with HTTP method tampering on Hack The Box, here’s a quick pro tip for next time:
Common HTB/CTF Tricks with HTTP Methods
-
Admin Bypass via
GET→POST(or vice versa)- Some apps check
POSTfor auth but ignoreGET. - Example: If
/adminrequiresPOST, tryGET /admin—maybe it leaks data or lets you in!
- Some apps check
-
API Logic Flaws
- REST APIs often expect
GETfor reading andPOSTfor writing. - Swapping them might bypass checks (e.g.,
GET /delete?id=1instead ofPOST).
- REST APIs often expect
-
Missing
Content-TypeExploits- If you manually change to
POSTwithout headers, the server might parse data differently (e.g., weird parameter injection).
- If you manually change to
-
HEADorPUTShenanigans- Some HTB boxes have misconfigured
PUT(file upload) orHEAD(info leaks).
- Some HTB boxes have misconfigured
What to Try Next Time
- Right-click → "Change request method" (Burp does the heavy lifting).
- Test all methods:
GET,POST,PUT,DELETE,HEAD,PATCH, even garbage likeHACKorFLAG. - Check response differences: Status codes, hidden data, or errors that leak info.
You might’ve been one right-click away from that flag! 🚩 Next time, spam all the methods and see what breaks. Happy hacking! 🔥
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.