Access control vulnerabilities - gachikuku/portswigger GitHub Wiki
Apprentice lab:
Unprotected admin functionality
Apprentice lab:
Unprotected admin functionality
This lab has an unprotected admin panel.
Solve the lab by deleting the user carlos.
-
Solution
ffuf -u 'https://<uuid>.web-security-academy.net/FUZZ' \ -w wordlist/SecLists/Fuzzing/fuzz-Bo0oM.txt ... robots.txt [Status: 200, Size: 45, Words: 3, Lines: 3, Duration: 72ms]Looking at the
/robots.txtendpoint we getDisallow: /administrator-panel.
After accessing the admin panel we are able to delete poor carlos.
Apprentice lab:
Unprotected admin functionality with unpredictable URL
Apprentice lab:
Unprotected admin functionality with unpredictable URL
This lab has an unprotected admin panel. It's located at an unpredictable location, but the location is disclosed somewhere in the application.
Solve the lab by accessing the admin panel, and using it to delete the user carlos.
-
Solution
Checking source
view-source:https://<uuid>.web-security-academy.net/.
We get an interisting endpoint/admin-7eqvdhand poor carlos gets deleted.
Apprentice lab:
User role controlled by request parameter
Apprentice lab:
User role controlled by request parameter
This lab has an admin panel at /admin, which identifies administrators using a forgeable cookie.
Solve the lab by accessing the admin panel and using it to delete the user carlos.
You can log in to your own account using the following credentials: wiener:peter
-
Solution
- Log on with
wiener:peter. - Chrome:
⌘ ⌥ I, Application panel, cookies section we notice a cookie with a boolean. - Setting
Admin, fromfalsetotrueunder the currect session cookie
and refreshing⌘+Rwe get to access the Admin panel and deletecarlos.
- Log on with
Apprentice lab:
User role can be modified in user profile
Apprentice lab:
User role can be modified in user profile
This lab has an admin panel at /admin. It's only accessible to logged-in users with a roleid of 2.
Solve the lab by accessing the admin panel and using it to delete the user carlos.
You can log in to your own account using the following credentials: wiener:peter
-
Solution
- Log in with
wiener:peter. - Use Burp to intercept the Update email functionality.
- Observe the
POSTrequest made. Replay (r) it for further investigation. - Copy the json fields from Response to Request and set the
roleidto 2 as described in the lab description. - Refresh the page, and Admin panel is available. Delete poor carlos.
- Log in with
Apprentice lab:
User ID controlled by request parameter
Apprentice lab:
User ID controlled by request parameter
This lab has a horizontal privilege escalation vulnerability on the user account page.
To solve the lab, obtain the API key for the user carlos and submit it as the solution.
You can log in to your own account using the following credentials: wiener:peter
-
Solution
- Log in with
wiener:peter. - Notice the url parameter id is set to
wiener. Change it tocarlos. - Sumbit carlos's API Key.
- Log in with
Apprentice lab:
User ID controlled by request parameter, with unpredictable user IDs
Apprentice lab:
User ID controlled by request parameter, with unpredictable user IDs
This lab has a horizontal privilege escalation vulnerability on the user account page, but identifies users with GUIDs.
To solve the lab, find the GUID for carlos, then submit his API key as the solution.
You can log in to your own account using the following credentials: wiener:peter
-
Solution
- Log in with
wiener:peter. - Browse each blog post.
- We come across a blog post which
carloshas made. When clicking on his name, his GUID is disclosed in the URL. - Browse back to My account and use
carlos's GUID in the url's id parementer in place of wiener's - Retrieve and submit
carlos's API key.
- Log in with
Apprentice lab:
User ID controlled by request parameter with data leakage in redirect
Apprentice lab:
User ID controlled by request parameter with data leakage in redirect
This lab contains an access control vulnerability where sensitive information is leaked in the body of a redirect response.
To solve the lab, obtain the API key for the user carlos and submit it as the solution.
You can log in to your own account using the following credentials: wiener:peter
-
Solution
- Log in with
wiener:peter. - Change the id parementer to
carlos. Intercept before sumbiting. - Replay (
r) the request. Observe the code302 Found. Look through the Response. - Sumbit
carlos's api key from the redirected Response.
- Log in with
NOTE:
carlos's api key is briefly leaked during the redirection.
Without an interception with a repeater for each Request, the leaked data would have been missed.
Apprentice lab:
User ID controlled by request parameter with password disclosure
Apprentice lab:
User ID controlled by request parameter with password disclosure
This lab has user account page that contains the current user's existing password, prefilled in a masked input.
To solve the lab, retrieve the administrator's password, then use it to delete the user carlos.
You can log in to your own account using the following credentials: wiener:peter
-
Solution
- Log in with
wiener:peter. - Fuzz the id paremeter.
ffuf -u 'https://uuid.web-security-academy.net/my-account?id=FUZZ' \ -w wordlist/SecLists/Fuzzing/fuzz-Bo0oM.txt -fc 302 ... administrator [Status: 200, Size: 3825, Words: 1526, Lines: 71, Duration: 103ms]- Use
administratorin the id paramenter and sumbit. - Password is masked. View-source
⌘ ⌥ Uand find the value of the masked password. - Log out, and login with the
admin's credentials. Browse to Admin panel and deletecarlos.
- Log in with
Apprentice lab:
Insecure direct object references (IDOR)
Apprentice lab:
Insecure direct object references (IDOR)
This lab stores user chat logs directly on the server's file system, and retrieves them using static URLs.
Solve the lab by finding the password for the user carlos, and logging into their account.
-
Solution
- Head over to Live chat functionality. Intercept before View transcript.
- After couple Requests, there is a
GETmethod for downloading transcripts incrementally. - Change the number in the
GETRequest endpoint. - View downloaded file and log in as
carlos.
NOTE:
There may be a need to change more than just one Request.
Practitioner lab:
URL-based access control can be circumvented
Practitioner lab:
URL-based access control can be circumvented
This website has an unauthenticated admin panel at /admin, but a front-end system has been configured to block external access to that path. However, the back-end application is built on a framework that supports the X-Original-URL header.
To solve the lab, access the admin panel and delete the user carlos.
-
Solution
- Read up on OWASP for Testing for Bypassing Authorization Schema
- Common mistake is when error
missing usernameis found the attacker is adding the query to data INSTEAD on the URL.