OSCP Exam Report
OSCP Exam Report
v.2.0
OSID: XXXXX
No part of this publication, in whole or in part, may be reproduced, copied, transferred or any other right reserved to its copyright owner,
including photocopying and all other copying, any transfer or transmission using any network or other means of communication, any broadcast
for distant learning, in any form or by any means such as any information storage, transmission or retrieval system, without prior written
permission from OffSec.
1 | Page
1. OffSec OSCP Exam Penetration Test Report 3
1.1 Introduction 3
1.2 Objective 3
1.3 Requirements 3
2. High-Level Summary 4
2.1 Recommendations 4
3. Methodologies 4
3.1 Information Gathering 4
3.2 Service Enumeration 5
3.3 Penetration 5
3.4 Maintaining Access 5
3.5 House Cleaning 5
4. Independent Challenges 7
4.1 Target #1 – 192.168.232.55 7
4.1.1 Service Enumeration 7
4.1.2 Initial Access – Anonymous SMB share leads to Wordpress RCE 7
5. Active Directory Set 21
5.1 Ajla – 10.4.4.10 21
5.1.1 Initial Access – Password Brute-Forcing 21
5.1.2 Privilege Escalation – Sudo group 22
5.1.3 Post-Exploitation 22
5.2 Poultry – 10.5.5.20 24
5.2.1 Initial Access – RDP login 24
5.2.2 Post-Exploitation 24
5.3 DC – 10.5.5.30 25
5.3.1 Initial Access – Remote Commands Execution 25
5.3.2 Post-Exploitation 26
2 | Page
1. OffSec OSCP Exam Penetration Test Report
1.1 Introduction
The OffSec Lab and Exam penetration test report contains all efforts that were
conducted in order to pass the OffSec course. This report should contain all items
that were used to pass the overall exam and it will be graded from a standpoint of
correctness and fullness to all aspects of the exam. The purpose of this report is to
ensure that the student has a full understanding of penetration testing
methodologies as well as the technical knowledge to pass the qualifications for the
OffSec Certified Professional.
1.2 Objective
1.3 Requirements
The student will be required to fill out this penetration testing report fully and to include the following
sections:
2. High-Level Summary
John Doe was tasked with performing an internal penetration test towards OffSec
Labs. An internal penetration test is a dedicated attack against internally connected
systems. The focus of this test is to perform attacks, similar to those of a hacker
3 | Page
and attempt to infiltrate OffSec’s internal lab systems – the THINC.local domain.
John’s overall objective was to evaluate the network, identify systems, and exploit
flaws while reporting the findings back to OffSec.
When performing the internal penetration test, there were several alarming
vulnerabilities that were identified on OffSec’s network. When performing the
attacks, John was able to gain access to multiple machines, primarily due to
outdated patches and poor security configurations. During the testing, John had
administrative level access to multiple systems. All systems were successfully
exploited and access granted.
2.1 Recommendations
John recommends patching the vulnerabilities identified during the testing to ensure
that an attacker cannot exploit these systems in the future. One thing to remember
is that these systems require frequent patching and once patched, should remain
on a regular patch program to protect additional vulnerabilities that are discovered
at a later date.
3. Methodologies
John utilized a widely adopted approach to performing penetration testing that is
effective in testing how well the OffSec Labs and Exam environments are secure.
Below is a breakout of how John was able to identify and exploit the variety of
systems and includes all individual vulnerabilities found.
Exam Network:
4 | Page
system. Understanding what applications are running on the system gives an
attacker needed information before performing the actual penetration test. In
some cases, some ports may not be listed.
3.3 Penetration
The penetration testing portions of the assessment focus heavily on gaining access
to a variety of systems. During this penetration test, John was able to successfully
gain access to 10 out of the 50 systems.
John added administrator and root level accounts on all systems compromised. In
addition to the administrative/root access, a Metasploit meterpreter service was
installed on the machine to ensure that additional access could be established.
The house cleaning portions of the assessment ensures that remnants of the
penetration test are removed. Often fragments of tools or user accounts are left on
an organizations computer which can cause security issues down the road. Ensuring
that we are meticulous and no remnants of our penetration test are left over is
important.
After the trophies on both the lab network and exam network were completed, John
removed all user accounts and passwords as well as the Meterpreter services
installed on the system. OffSec should not have to remove any user accounts or
services from the system.
5 | Page
4. Independent Challenges
4.1 Target #1 – 192.168.232.55
Vulnerability Explanation: The SMB server is not protected with the password and has some
sensitive information like credentials stored. Which leads to RCE from wordpress theme editor.
Vulnerability Fix: The SMB should be configured with credentials and guest enumeration should
be disabled.
Severity: Critical
Steps to reproduce the attack: Ran the initial service scan John discovered that this host is called
Sehnzi. Smbclient was used to interact on the port 445 to get the passwords.txt file from SMB
share shenzi and used those credentials for wordpress admin access.
We run nmap to scan the target and found a few ports open.
└─$ nmap 192.168.232.55 -p- --min-rate 20000
6 | Page
└─$ nmap -sCV 192.168.232.55
7 | Page
4.1.2 Initial Access – SMB share to Wordpress RCE
SMB revlead a ‘Shenzi’ share which was not protected with password and has
interesting files for us.
Shenzi share has passwords.txt file, we will download it which can be used for
login in wordpress admin account.
8 | Page
└─$ cat passwords.txt
└─$ http://192.168.232.55/shenzi/
9 | Page
We used initially discovered credentials admin:FeltHeadwallWight357 from the SMB share
to login into wordpress.
└─$ http://192.168.232.55/shenzi/wp-login.php
After successfully logged in, we'll navigate to Appearance -> Theme Editor ->
Theme Twenty Twenty to determine the active website theme. If we select
a .php page (such as 404.php) we discover that we can directly edit the page's
source code.
http://192.168.232.55/shenzi/wp-admin/theme-editor.php?file=404.php&theme=twentytwenty
10 | Page
We generated meterpreter payload with MSF and updated 404.php code with
it to get a RCE .
11 | Page
12 | Page
After updating 404.php file we will visit http://192.168.232.55/shenzi/wp-
content/themes/twentytwenty/404.php to execute the reverse shell and catch
it using multi/handler.
Since PHP reverse shells are somewhat unstable, let's upload a more stable
shell, which we'll generate with msfvenom and uploading using meterpreter.
13 | Page
On Kali attacking machine:
On Meterpreter session:
Local.txt value:
We used PowerUp.ps1 to check the low-hanging fruit and found that system is vulnerable to
14 | Page
AlwaysInstallElevated. As Microsoft mentioned, This option is equivalent to granting full
administrative rights, which can pose a massive security risk. Microsoft strongly discourages the
use of this setting.
● https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Privesc/
PowerUp.ps1
● https://learn.microsoft.com/en-us/windows/win32/msi/alwaysinstallelevated
We’ll load the PowerUp.ps1 script into powershell and check for any low-hanging fruit.
PS C:\Users\shenzi\Desktop> . .\PowerUp.ps1
PS C:\Users\shenzi\Desktop> Invoke-AllChecks
15 | Page
We can also confirm this vulnerability using manual command as suggested by Microsoft.
URL: https://learn.microsoft.com/en-us/windows/win32/msi/alwaysinstallelevated
PS C:\Users\shenzi\Desktop> reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer
AlwaysInstallElevated REG_DWORD 0x1
16 | Page
└─$ sudo nc -lvnp 445
Proof.txt value:
17 | Page
5. Active Directory Set
Vulnerability Explanation: The user account on the Ajla host was protected by a trivial password that
was cracked within 5 minutes of brute-forcing.
Vulnerability Fix: The SSH service should be configured to not accept password-based logins and the
user account itself should contain a unique password not contained in the publicly available wordlists.
Severity: Critical
Steps to reproduce the attack: rom the initial service scan John discovered that this host is called Ajla.
After adding the target’s IP to the /etc/hosts file, the Hydra tool was run against the SSH service using
the machine’s DNS name instead of its IP. With the extracted password at hand John was able to log
in as ajla using SSH.
18 | Page
5.1.2 Privilege Escalation – Sudo group
Vulnerability Explanation: sudo group allows any user in this group to escalate privileges to the root if
they know the user’s password.
Vulnerability Fix: The SSH service should be configured to not accept password-based logins and the
user account itself should contain a unique password not contained in the publicly available wordlists.
Severity: Critical
Steps to reproduce the attack: John spotted that the ajla user was a member of the sudo group
immediately upon logging in and using the “id” command. And knowing user’s password, he only
needed to use a single command “sudo su” in order to obtain a root shell.
19 | Page
5.1.3 Post-Exploitation
After collecting the proof files and establishing a backdoor using SSH, John began the enumeration of
the filesystem for the presence of interesting files. He noticed that there was a mounted share
originating from the 10.5.5.20 IP. Inspecting a custom sysreport.ps1 script in the /mnt/scripts
directory he found cleartext credentials for the “sandbox\alex” user. Taking into consideration the
type of scripts in this directory and the username structure, it seems that the “Poultry” host is a part
of the Active Directory environment.
John began the lateral movement by establishing a reverse dynamic port forwarding using SSH. First,
he generated a new pair of SSH keys and added those to the authorized_keys file on his Kali VM, then
he just needed to issue a single SSH port forwarding command:
20 | Page
[email protected]
With the dynamic reverse tunnel established, John only needed to edit the /etc/proxychains.conf to
use the port 1080.
Steps to reproduce the attack: with the credentials at hand and a reverse tunnel established, John
connected to an RDP session using proxychains accepting the certificate when prompted and entering
the retrieved password afterward.
5.2.2 Post-Exploitation
21 | Page
22 | Page
John noticed the presence of the Thunderbird program on the user’s desktop, and while checking
Alex’s inbox he found the email from a local administrator Roger:
5.3 DC – 10.5.5.30
Steps to reproduce the attack: John was able to reuse a temporary password that the administrator
left for Alex.
23 | Page
5.3.2 Post-Exploitation
24 | Page