-
Notifications
You must be signed in to change notification settings - Fork 0
Information disclosure
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
productId
parameter 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)
-
/admin
panel is accessible to local users only. - Reload the page this time with Intercept on using
mitmproxy
(set intercept 'admin')
. - Use
TRACE
method 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.1
is same as "Match and Replace" in Burp. - Delete poor carlos.
-
NOTE:
In this lablocalhost
did 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.txt
wordlist, 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 status
reveals 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 9ef3a538bab5e38d702bab0a8fa411a34fc60b0a
and agit status
again.
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.php
and thencat *
. -
go to
/login
and login asadministrator
and delete poorcarlos
.
- Use the
-
Solution (Better)
- Repeat steps one, two and three.
- Do a
git diff 9ef3a53
. - Repeat last step.
Solutions for the Portswigger's Web Security Academy using mitmproxy and other cli tools instead of Burp Suite
Server-side topics:
- SQL injection
- Authentication
- File path traversal
- OS command injection
- Business logic vulnerabilities
- Information disclosure
- Access control vulnerabilities
- File upload vulnerabilities
- Race conditions
- Server-side request forgery (SSRF)
- XML external entity (XXE) injection
- NoSQL injection
- API testing
Client-side topics:
- Cross-site scripting (XSS)
- Cross-site request forgery (CSRF)
- Cross-origin resource sharing (CORS)
- Clickjacking
- DOM-based vulnerabilities
- WebSockets
Advanced topics: