TryHackMe — Reset
Reset is a hard rated box from tryhackme which showcases Active Directory attack vectors that are related ACLs. Let’s get started.
Initial Access
Nmap shows the following ports open
`nmap -p- -T 4 <ip>`
&
`nmap -p <ports> -sC -sV — open <ip> -oN nmap_tcp`
From the open ports we can deduce that the target is a domain controller. Enumerating smb;
Enum4linux doesn’t generate anything interesting with anonymous access neither does smbmap. Tried connecting to the shares enumerated starting with “Data” share.
Was able to connect to the “Data” share anonymously. Inside found the directory “onboarding” with some randomly named files.
Listing out the contents of the directory after a while shows the files named differently. Some sort of script maybe running (important for later!)
Downloaded the files one by one.
Discovered a default password in one of the txt files
Need a username / usernames to test this password against.
In another pdf file downloaded from the “Data” share we get a possible username as well
Can use “username-anarchy” to generate a potential username patters for AD.
Somehow trying the username patterns with crackmapexec throws false positives
Tried kerbrute instead with no luck with any of the default patterns generated with “username-anarchy”
Using crackmapexec to brute force RIDs
Using the usernames discovered by crackmapexec created a list to spray the default password discovered. AD username pattern is also revealed here.
We have lily_oneill user who has the default password unchanged.
Get PizzSec’s stories in your inbox
Join Medium for free to get updates from this writer.
Before trying to log in, tried kerberoasting, asreproasting and bloodhound enumeration
No luck with kerberoasting
Got several hashes launching the asreproasting attack.
Using hashcat was able to crack one user hash
Mapped the domain with bloodhound and discovered “Tabatha_Britt” user has “GenericAll” privileges on 2 users
We can reset the password of the users and gain access to these accounts. Bloodhound has instructions on how to do this
Further enumerated on bloodhound what privileges “Raquel_Benson” and “Shawna_Bray” users have.
“Shawna_Bray” can ForceChangePassword on “Cruz_Hall”. Used the same attack as before to take control of “Cruz_Hall” user.
Going further on bloodhound looked what privileges “Cruz_Hall” user has
“Cruz_Hall” can change the password of “Darla_Winters”. Rinse and repeat the same attack to gain control of “Darla_Winters”.
Privilege Escalation
Checking on privileges of “Darla_Winters” user.
“Darla_Winters” has constrained delegation privileges on the domain controller. This means we can request a ccache file of the administrator hash and export it to KRB5CCNAME environment variable and create remote session on the DC.
First the domain controller FQDN (haystack.thm.corp) should be added to the hosts file. Using impacket-getST module.
With that a remote session has been created as Administrator just by abusing ACLs.
Another Interesting Attack (URL File Attack)
There is another interesting attack vector in this box. Remember the unusual behavior in the SMB share from before where the filenames kept changing? With the “Tabatha_Britt” user enumerated SMB again.
We have write access on the “Data” share.
From here need to upload file with the url of our attack machine which could give us a hash.
File was named with “@” at the beginning to make it appear on top in the smb share when files are listed. Once this is created, it can be uploaded to the Data\onboarding directory. Then need to run responder in the hopes of catching a hash.
Starting responder
We can try to crack the hash using hashcat









