Include - Penetration Test Walkthrough
This note details the steps taken during a penetration test, focusing on identifying and exploiting vulnerabilities across multiple services to achieve full system compromise and retrieve flags.
1. Initial Reconnaissance
The first step involved network scanning to identify open ports and services.
- Rustscan: Used for initial rapid port scanning.

- Nmap: Followed up with a more detailed Nmap scan to enumerate services and versions.

Key Findings:
- Several mail servers were open, but the focus was shifted to web services.
- Web services were identified on ports
4000and50000.
2. Exploiting the Web Application on Port 4000
2.1 Initial Access and IDOR Discovery
- Login: Visiting port
4000revealed a login page. Provided credentials (not specified in the original note, but implied they worked) successfully granted access.

- Insecure Direct Object Reference (IDOR): Incrementing the user ID in the URL allowed viewing other user profiles without proper authorization. Burp Intruder was used to test for other users, but no higher-privileged accounts were immediately found this way.

- Attempting to log in as ‘admin’ with various passwords after signing out was unsuccessful.

2.2 Privilege Escalation via IDOR
- Modifying User Information: The application had a “recommend an activity” functionality.

- It was discovered that user information, such as age, could be modified.
- Changed age from 25 to 30:

- Changed age from 25 to 30:
- Admin Privilege Escalation: This led to the attempt to modify the
IsAdminfield fromfalsetotrue.

- This modification was successful, granting administrative privileges and revealing two new functionalities: “API” and “Settings”.

2.3 Server-Side Request Forgery (SSRF)
- API Section: The API section revealed a URL to an endpoint
/internal-apion port5000.
- Settings Section - Update Banner Image URL: The “Settings” section contained a functionality to update the banner image, which received calls from external domains. This was identified as a potential SSRF vulnerability.
- Exploiting SSRF: The internal endpoint
/getAllAdmins101099991was supplied to the “Update Banner Image URL” field.
- The server processed the request and returned the data as a Base64 encoded Data URI.

- Credential Disclosure: Decoding the Base64 string in Burp Decoder revealed credentials for the
sysmoninstance running on port50000.
3. Accessing and Exploiting Sysmon on Port 50000
3.1 Initial Access and Flag Retrieval
- Login: Using the credentials obtained via SSRF, successful login to the
sysmoninstance on port50000was achieved.
- A flag was found immediately upon login.
3.2 Local File Inclusion (LFI)
- Vulnerability Discovery: Leaving an input field empty on the
sysmonapplication resulted in a response that indicated a possible Local File Inclusion (LFI) vulnerability.
- Exploiting LFI: Fuzzing confirmed the LFI vulnerability. The payload
....//....//....//....//....//....//....//....//....//etc/passwdwas used to retrieve the contents of/etc/passwd.

- The user list from
/etc/passwdwas extracted and saved for further brute-forcing attempts.
4. SSH Access and Final Flag
- SSH Brute-forcing: The users obtained from
/etc/passwdwere combined with the previously found credentials (and potentially other common passwords) to brute-force SSH access.
- Successful SSH Login: Valid credentials were found, allowing successful SSH access to the server.
- Final Flag: The last required flag was located in the
/var/www/html/directory.
This concludes the penetration test, with all flags successfully retrieved.