← /notes
Web Requests — GET, Basic Auth, Parameters
GET Method
Browsers use GET by default when visiting a URL. GET parameters are placed directly in the URL.
/search.php?search=le
- Endpoint:
search.php - Parameter:
search - Value:
le
Anything after ? is client-controlled input. Multiple parameters:
/page.php?id=3&debug=1
Observing GET Requests
- Open browser DevTools
- Go to Network tab
- Perform an action (reload page, submit search)
- Filter by Fetch/XHR
- Click the request → inspect URL, Parameters, Headers, Response
Copy Request as curl
From Network tab: Right click request → Copy → Copy as cURL
Paste into terminal to replay exact request. Allows offline testing, parameter modification, automation.
HTTP Basic Authentication
Unauthenticated response:
HTTP/1.1 401 Authorization Required
WWW-Authenticate: Basic realm="Access denied"
Authenticated request:
curl -u admin:admin http://IP:PORT/
# or
curl http://admin:admin@IP:PORT/
Authorization Header
Basic Auth uses:
Authorization: Basic YWRtaW46YWRtaW4=
This is Base64 of admin:admin. Can be sent manually:
curl -H "Authorization: Basic YWRtaW46YWRtaW4=" http://IP:PORT/
Server only checks the Authorization header — doesn’t care how credentials were supplied.
Viewing Headers
curl -i URL # response headers only
curl -v URL # full request + response
Parameter Tampering
Anything in URL, Headers, Cookies, or Body is untrusted input.
Process:
- Capture request
- Replay with curl
- Change parameter value
- Compare response
search=le → search=a
If response changes, parameter affects logic — investigate.
Common Parameter Types
- Identifiers:
id,uid - Search input:
search,q - Files:
file,page - Flags:
debug,admin
All are attack surface.
Key Mindset
- Frontend is not security.
- All parameters are attacker-controlled.
- Server must validate everything.
- If changing a value changes behavior, investigate.