Information disclosure - gachikuku/portswigger GitHub Wiki
Apprentice lab: Source code disclosure via backup files
Apprentice lab: Source code disclosure via backup files
This lab leaks its source code via backup files in a hidden directory. To solve the lab, identify and submit the database password, which is hard-coded in the leaked source code.
-
Solution
- Check
/robots.txt. - Check
/backup. - Look through the source code for anything interisting.
- Check
Apprentice lab: Information disclosure in error messages
Apprentice lab: Information disclosure in error messages
This lab's verbose error messages reveal that it is using a vulnerable version of a third-party framework. To solve the lab, obtain and submit the version number of this framework.
-
Solution
- Check a product.
- Observe the endpoint with
productIdparameter expecting an integer. Try different types, perhaps achar. - Observe the error messege.
Apprentice lab: Information disclosure on debug page
Apprentice lab: Information disclosure on debug page
This lab contains a debug page that discloses sensitive information about the application. To solve the lab, obtain and submit the SECRET_KEY environment variable.
-
Solution
- View-source. Notice in the commends there is an interisting endpoint.
- Search and find (
⌘ F) forSECRET_KEY.
Apprentice lab: Authentication bypass via information disclosure
Apprentice lab: Authentication bypass via information disclosure
This lab's administration interface has an authentication bypass vulnerability, but it is impractical to exploit without knowledge of a custom HTTP header used by the front-end.
To solve the lab, obtain the header name then use it to bypass the lab's authentication. Access the admin interface and delete the user carlos.
You can log in to your own account using the following credentials: wiener:peter
-
Solution (Explaination)
-
/adminpanel is accessible to local users only. - Reload the page this time with Intercept on using
mitmproxy(set intercept 'admin'). - Use
TRACEmethod to inspect further the Response. - Notice there is a strange Header
X-Custom-IP-Authorization: <IP-Address>in the Response. -
set modify_headers /X-Custom-IP-Authorization/127.0.0.1is same as "Match and Replace" in Burp. - Delete poor carlos.
-
NOTE:
In this lablocalhostdid not work!
Practitioner lab: Information disclosure in version control history
Practitioner lab: Information disclosure in version control history
This lab discloses sensitive information via its version control history. To solve the lab, obtain the password for the administrator user then log in and delete the user carlos.
-
Solution
- Use the
dsstorewordlist.txtwordlist, to discover endpoints.
ffuf -u "https://uuid.web-security-academy.net/FUZZ" -w SecLists/Discovery/Web-Content/dsstorewordlist.txt -c ... admin [Status: 401, Size: 2617, Words: 1049, Lines: 54, Duration: 162ms] .git [Status: 200, Size: 1201, Words: 256, Lines: 27, Duration: 253ms] login [Status: 200, Size: 3192, Words: 1315, Lines: 64, Duration: 75ms] analytics [Status: 200, Size: 0, Words: 1, Lines: 1, Duration: 71ms] logout [Status: 302, Size: 0, Words: 1, Lines: 1, Duration: 108ms]- Download the version control history of the website.
wget -r "https://uuid.web-security-academy.net/.git"- Change into the downloaded directory and do a
git log.
commit b3c75939ffb61480adac0253742b29af73bb9492 (HEAD -> master) Author: Carlos Montoya <[email protected]> Date: Tue Jun 23 14:05:07 2020 +0000 Remove admin password from config commit 9ef3a538bab5e38d702bab0a8fa411a34fc60b0a Author: Carlos Montoya <[email protected]> Date: Mon Jun 22 16:23:42 2020 +0000 Add skeleton admin panel- Notice, there is an admin password in the config.
git statusreveals the files.
On branch master Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) deleted: admin.conf deleted: admin_panel.php no changes added to commit (use "git add" and/or "git commit -a")- Do a
git checkout 9ef3a538bab5e38d702bab0a8fa411a34fc60b0aand agit statusagain.
HEAD detached at 9ef3a53 Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) deleted: admin_panel.php no changes added to commit (use "git add" and/or "git commit -a")-
Do a
git restore admin_panel.phpand thencat *. -
go to
/loginand login asadministratorand delete poorcarlos.
- Use the
-
Solution (Better)
- Repeat steps one, two and three.
- Do a
git diff 9ef3a53. - Repeat last step.