ECPTXv2 Latest
ECPTXv2 Latest
It is strongly recommended to implement proper network segmentation to better isolate the hosts
and prevent lateral movement between systems. A firewall should be enabled on all systems with a
configuration that minimizes the unnecessary exposure of services. For each identified vulnerability,
mitigation recommendations are provided in the following chapters.
Methodologies
I utilized a widely adopted approach to performing penetration testing that is effective in testing
how well the ElearnSecurity Labs and Exam environments are secured. Below is a breakdown of how
I was able to identify and exploit the different systems and includes all individual vulnerabilities
found.
Information Gathering
The information-gathering portion of a penetration test focuses on identifying the scope of the test.
During this penetration test, the objective was to exploit the exam network. One IP range was in
scope: 172.16.80.0/0
Penetration
The penetration testing portions of the assessment focus heavily on gaining access to a variety
of systems. During this penetration test, I was able to successfully gain access to 5 out of the 5
systems.
Workstation 01
Steps to Reproduce
1. First, I perform host discovery using Ping Sweep and found that host 172.16.80.100 is up
2. I ran NMAP on the target and found that Port 139 and 445 were open
3. Enumerating the SMB shares, I found that share “Shared” is open for anonymous access
4. Accessing the open share and seeing that there is a file by the name “Bookmark.url”, so I
download it to my local machine and then checking the contents, it is an internet shortcut
link that is linking towards the SMB share of the Workstation-01 machine
5. I edited the Bookmark.url file and changed the location to my local machine IP and then
deleted the original file in the SMB share and uploaded the edited one
6. I set up responder listener and found that it captured NetNTLMv2 hash of the user
blasdelezo
7. Using john, I was able to crack the password successfully with the wordlist rockyou.txt
Steps to Reproduce
1. While using the Rubeus tool, I found out that there is a user michaelwalsh who is an AS-REP
Roastable, so I used the Rubeus tool to get the AS-REP hash of the user
2. After getting the hash of the user, I again used john to crack the hash successfully
3. Connecting to the user michaelwalsh through RDP
Workstation 01
Steps to Reproduce
1. Running SharpHound, I found out that the user michaelwalsh is a member of the group
HELPDESK L1 which has the ForceChangePassword enabled on the user lawrencecohen
2. Changing password for the user lawrencecohen
Workstation 01
Steps to Reproduce
1. Running SharpHound on the user lawrencecohen, I found out that the user has GenericWrite
permissions on two of the users clarkdevereaux and richardwang, and is also a member of
the group Helpdesk L2
2. Using Powerview to clear the SPNs of both the users and adding our fake one
5. Looking more into the new users I found out that both the users were local admin in
Workstation01
6. Connecting to the user richardwang through RDP
7. Connection is successful through RDP and got system shell using PsExec
10.100.11.130 / UAT Server
Steps to Reproduce
1. Looking more into the machines available on the domain, I found out that there were 4
machines available but out of the 4 one of the machine name exchange.els.bank was
not reachable
2. Getting the users available on the domain
3. Trying the credentials which I got before, it was found that the credentials of user
richardwang were working on the UAT server machine
Steps to Reproduce
1. Exploring more into the uatserver.els.bank, I found a vulnerable program inside the
Capcom directory. The capcom directory contains two files, one of which is a
readme.txt which says, “I’m running as SYSTEM every 5 minutes!” and the other is the
RunForrestRun.exe file which is getting executed by the SYSTEM every 5 minutes
2. Decompiling the .net binary using dnSpy, I found that the main function of the code
reads all the bytes from a file called lookmama on the temp directory and then executes
it
3. Then I modified the code a little bit so that it can add the current user to the
Administrators group
4. Replacing the original lookmama file with the modified lookmama file on the temp
directory
5. Waiting for 5 minutes, to check if the command got executed successfully
Steps to Reproduce
1. While searching about the UATServer machine on BloodHound, it turns out that
there is a vulnerable GPO named “Additional DC Configuration” which had
permissions that can be used to access the DC
As the current user was made the local administrator directly on Bank-DC, no Local
Privilege Escalation was required here.
10.100.9.253 / Trusted-DC
Steps to Reproduce
1. Using BloodHound to determine domain trust relationships, I found that els.bank and
trusted.corp are bidirectionally trusting each other
2. I recognized that clarkdevereaux is a local Administrator on the trusted.corp domain by
obtaining the shortest path to the trusted.corp domain.
3. Then, checking that the default WinRM port was closed, I was not able to connect
4. I performed a port scan and discovered that Port 6666 was opened on the target, but the
RDP port was closed
7. Then I added all host as trusted host and then reconnected to the Trusted-DC through PS-
Remoting
8. Since I had the local admin user on the Trusted-DC, I am using mimikatz to conduct a DCSync
attack on the domain and obtain all the NTML hashes
10.100.10.252 / Protect-DC
Steps to Reproduce
1. Enumerating further on UATServer, there was an SQL Instance with database UAT_DB1
found which has link towards the other domain Protect-DC’s UAT_DB2 database
2. Setting up a database connection by using HeidiSQL software which was already installed on
the machine
5. While using Netcat listener, I got reverse shell successfully on the Protect-DC machine as
user svcsql user
10.100.10.252 / Protect-DC
Steps to Reproduce
1. Taking a look at the system's directories, I found a folder by the name Microsoft on the
directory Program files which is a misspelling of Microsoft, so it made me doubtful
2. Looking more into the folder I found an executable file called Service.exe and also another
file by the name of Commands
3. Decompiling the executable using dNSpy and saw that the executable is reading bytes from
the file commands and then executing it
4. Changing the password in the previous code and recompiling the binary will add a new user
XXX to the Administrator’s group on the DC.
5. We waited a little while and confirmed that the user had been created and made a member
of the Administrator's group on the DC.
6. Connecting to the machine using my newly created user XXX
The flag was found on the main root directory of Bank-DC (10.100.10.253) machine as flag.txt