VulnNet Active (Windows Redis + SMB scheduled job + SharpGPOAbuse)
This is a writeup for the VulnNET: Active machine, available on the TryHackMe.
You can take advantage of a Windows user's edit rights on a Group Policy Object in order to compromise the objects that are controlled by that GPO.
Introduction
Machine Description
VulnNet Entertainment had a bad time with their previous network which suffered multiple breaches. Now they moved their entire infrastructure and hired you again as a core penetration tester. Your objective is to get full access to the system and compromise the domain.
Notes & Observations
You can retrieve a user's NTLM hash by running Lua
evalcommand and withResponderInitial access can be done by modifying the content of a file found among the shares
Besides abusing the GPO there are other ways to escalate privileges (Print Nightmare)
Tools: nmap, redis-tools, Responder, smbclient, psexec.py, Metasploit
Walkthrough
What is the user flag?
Answer:
THM{3eb176aee96432d5b100bc93580b291e}
Run the usual
nmapscan:

Connect to the Redist service and check the configurations, notice the windows user:
The
redisc-clicommand can be used after installing theredis-tools
In other terminal window start responder:
Run the following script inside the Redis service with your ip address:
You should capture the user's NTLM hash

Save the hash into a file and crack it with hashcat (use -O instead of --force if you have dedicated GPU):

image.png List the SMB shares with the username and password you've just cracked:
smbclient -L //$ip -U enterprise-security --password=sand_0873959498
Access the
Enterprise-ShareSMB share and list its content:This file is ran by a scheduler process

Prepare a
meterpetermulti handler session:Create a
PurgeIrrelevantData_1826.ps1file with the following content (put your IP address and port specified in meterpreter):Replace the same SMB file with the newly created one and wait:

Get the
user.txtfile's content atC:\Users\enterprise-security\Desktop\user.txt.
What is the root flag?
Answer:
THM{d540c0645975900e5bb9167aa431fc9b}
Enumerate the machine with Bloodhound (detailed description can be found here)

If you check the "Find Shortest Paths to Domain Admins", you will see that enterpise-secrutiy user has generic write access to the GPO security-pol-vn
Download or compile the SharpexeGPOAbuse.exe file and update the group policies on the target machine:

Access the machine with our new privileges:

Get the
system.txtat theC:\Users\Administrator\Desktop\system.txtlocation
Last updated