-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bscp): first 3 access control labs
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
docs/writeups/2023/portswigger-bscp-labs/access-control.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Access Control | ||
|
||
## File path traversal, simple case | ||
|
||
Change last parameter path of `https://0a4100de0481f1a8815553d000b50008.web-security-academy.net/image?filename=36.jpg` | ||
to `../../../etc/passwd` | ||
|
||
## Unprotected admin functionality | ||
|
||
1. Open `robots.txt` | ||
2. See `Disallow: /administrator-panel` | ||
3. Navigate to that route | ||
4. Delete carlos user | ||
|
||
## Unprotected admin functionality with unpredictable URL | ||
|
||
1. Find this script in the source code: | ||
``` js | ||
var isAdmin = false; | ||
if (isAdmin) { | ||
var topLinksTag = document.getElementsByClassName("top-links")[0]; | ||
var adminPanelTag = document.createElement('a'); | ||
adminPanelTag.setAttribute('href', '/admin-jquaos'); | ||
adminPanelTag.innerText = 'Admin panel'; | ||
topLinksTag.append(adminPanelTag); | ||
var pTag = document.createElement('p'); | ||
pTag.innerText = '|'; | ||
topLinksTag.appendChild(pTag); | ||
} | ||
``` | ||
2. Navigate to `/admin-jquaos` | ||
|