HackTheBox — Baby
Hack The Box Baby is an Easy rate Windows machine
Initial Access
Initial nmap scan show the following open ports
Judging by the open ports with the ports like 53 & 88 present we can assume we are up against a Domain Controller.
We need to identify a username/usernames to proceed with AD attack vectors. Let’s enumerate SMB with anonymous login
No luck with smbclient.
No luck with netexec either.
Rpcclient doesn’t yield anything either.
Smb is not giving us anything. Switched to ldap enumeration with netexec.
There’s a detailed output with all the users. Down in the bottom we see a password in the description field for user Teresa.Bell
We can put the users into a list and spray the password to see which users are accessible with it. But first we can get a cleaner list of names that can be copied easily
Tried password spraying with “BabyStart123!”
We don’t get any hits but we have Caroline.Robinson user with an expired password. Meaning this user’s password can be changed.
We can use impacket’s changepasswd tool to change this user’s password to a one we choose and gain access.
Password changed successfully.
Get PizzSec’s stories in your inbox
Join Medium for free to get updates from this writer.
Just for good measure before proceeding further tried Asreproasting and kerberoasting for any other users that can be compromised.
No luck with Asreproasting
No luck with Kerberoasting either.
Enumerate SMB with the compromised user.
There are no shares that are standing out. We can try to gain access via WinRM
We have access to the user flag
Privesc
With the access gained enumerated user privileges for potential abuse possibilities.
We have 2 privileges with viable escalation paths
- SeMachineAccountPrivilege
- SeBackupPrivilege/SeRestorePrivilege
First path didn’t work with NOPAC so that’s a no go. With SeBackupPrivilege we can copy the SAM, SYSTEM and SECURITY files dump the hashes. However, since we are in a domain controller we need the ntds.dit file. This file cannot be copied since it is being used by the system before making a shadow of the C:\ drive.
First we create “diskshadow.txt” on the local attacker machine with the following content that is going to be given as an argument diskshadow.exe which will create a shadow of the C:\ drive
Then this file is uploaded to a writable directory on the target and diskshadow.exe is run as below
We have the drive E:\ which is a shadow of C:\. We can use “robocopy” to copy the ntds.dit and the SYSTEM file which are needed for the hashdump.
We now have the ntds.dit file. Time to copy the SYSTEM file.
Now we can simply download the 2 files and use impacket’s secretsdump to dump the hashes
We can use administrator hash to login








