Practice library / Active Directory and Windows attacks
Lab · Medium · 2.5 hoursFree account
Attacking Enterprise Networks
Full attack chain from external foothold to domain admin in a lab network.
On this page 14 sections
- ·What you need first
- ·Build the target
- 1Map the external segment
- 2Recover a credential from an open share
- Locked: Get a shell and confirm the pivot
- Locked: Pivot into the internal network
- Locked: Enumerate the domain through the pivot
- Locked: Map the domain with BloodHound
- Locked: Kerberoast svc-backup and crack the ticket
- Locked: Move laterally and escalate to Domain Admin
- Locked: Technique map
- Locked: Check
- Locked: Clean-up
- Locked: Next lab
Before you start
An enterprise engagement rarely ends at the first shell. The attacker chains an external foothold into credential recovery, pivots into Active Directory, enumerates the domain with BloodHound, Kerberoasts a service account, and escalates through a DACL gap to Domain Admin. Incident reports show this exact pattern in most ransomware intrusions, which is why the chain — not any one trick — is the thing a defender must break.
Lab Objectives
- Map an external segment and find the one host that gives a foothold
- Recover a credential from a misconfigured share and turn it into a shell
- Pivot from a dual-homed host into an internal Active Directory network
- Enumerate the domain through the pivot and build an attack path with BloodHound
- Kerberoast a service account, crack its ticket, and move laterally with the password
- Escalate to Domain Admin through a DACL misconfiguration and prove the compromise
- Map each stage of the chain to the event ID or signal a defender would check
What you need first
Complete these items before you start:
- Active Directory Basics. You must know AD terms (DC, LDAP, Kerberos, SPN) and basic enumeration with
crackmapexec. - Pivoting, Tunneling & Port Forwarding. You must know how a SOCKS pivot works. This lab uses one; it does not re-teach it.
These are not required, but they go deeper into single stages of this chain:
- Active Directory Fundamentals and Windows Active Directory for Pentesters, for the theory behind each stage.
- Windows Command Line & PowerShell, if PowerShell syntax is new to you.
- SMB Enumeration, for Step 2 in full depth.
- AD Enumeration with CrackMapExec and Active Directory LDAP Enumeration, for Step 5 in full depth.
- AD Enumeration with BloodHound, for Step 6 in full depth.
- Kerberos Attacks, for Step 7 in full depth.
- DACL Attacks in Active Directory and Windows Lateral Movement, for Step 8 in full depth.
Build the target
KaliRange hosts no targets, no virtual machines and no lab files. You run this lab on your own machine, against a network that you build. The domain CORP.LOCAL and every address below are the example values of this lab. Replace them with your own.
| Host | Role | Address |
|---|---|---|
| Kali attack host | Your machine. Starts on the external segment only. | 192.168.50.50 |
WEB01 | A domain-joined application server, exposed on the external segment and also on the internal domain network (dual-homed). This is the only host you can reach at the start. | 192.168.50.10 (external), 10.10.10.5 (internal) |
DC01 | Domain Controller for CORP.LOCAL. Reachable only from the internal segment. | 10.10.10.10 |
WS01 | A domain-joined workstation used by the help-desk team. Reachable only from the internal segment. | 10.10.10.25 |
- On
WEB01, an anonymous SMB share that holds a script with the plaintext credentialCORP\svc-web/LabWebDeploy#1(Step 2).svc-webis a domain account, and WinRM (port 5985) is open onWEB01. - The domain accounts
svc-webandsvc-backup, withsvc-weba member of the groupIT-Support(Step 6). svc-backuphas a Service Principal Name, with the passwordLabSummer2026!set weak enough for your wordlist to crack it (Step 7).svc-backupholdsGenericAllover theDomain Adminsgroup (Steps 6 and 8).- An open session of
svc-backuponWS01(Step 6), for example a scheduled task or a mapped drive that you start and leave running.
Build such a network from free, legal parts. Install evaluation copies of Windows Server from the Microsoft Evaluation Center (180 days) in virtual machines on your own computer, promote one to a domain controller and join the others. Or start from GOAD ("Game of Active Directory"), a deliberately vulnerable Active Directory lab that Orange Cyberdefense publishes on GitHub, and add the dual-homed server and the open share yourself. Isolate the network from the internet.
Authorized lab only. Run every step of this lab only against a network that you own or have written permission to test, never a real organisation. Take a snapshot of all four hosts before Step 1. Step 8 adds an account to Domain Admins and dumps domain secrets; the snapshot is how you undo both.
In this lab, a foothold is the first host you get a credential or a shell on. A pivot is a second host you route traffic through to reach a network your attack host cannot reach directly. The attack path is the chain of accounts and permissions that leads from the foothold to Domain Admin.
Step 1: Map the external segment
Scan the external segment
Scan the external segment for open ports and service versions. Find the one host that answers.
Your Kali host sits on 192.168.50.0/24 at the start. DC01 and WS01 are not on this segment, so you cannot scan them yet.
nmap -sV -p- --open -T4 192.168.50.0/24Nmap scan report for 192.168.50.10
Host is up (0.004s latency).
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds Windows Server 2019 Standard 17763 microsoft-ds
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)192.168.50.10 (WEB01) is the only host that answers. Port 445 means SMB, and port 5985 means WinRM is open, both worth checking next.
Why this matters. A real engagement starts from the outside with no known credentials. The first task is always to find the one host that gives you a way in, not to attack every open port at once.
What a defender sees. A full-port scan of a whole subnet from one source address is loud. A firewall or network IDS with a port-scan signature logs and often blocks it. On a real engagement, this traffic belongs in the client's own monitoring, not in a Windows event log.
Step 2: Recover a credential from an open share
List and read an anonymous SMB share
List the shares on WEB01 with a null session. Read the files in any share that allows it. Look for a credential.
A server exposed for deployment often has a share left open for build or release tooling. Null-session SMB access needs no credential at all.
smbclient -L //192.168.50.10 -N
smbclient //192.168.50.10/Deploy -N -c 'get deploy.ps1'
cat deploy.ps1 Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
Deploy Disk Release automation
IPC$ IPC Remote IPC
getting file \deploy.ps1 of size 211 as deploy.ps1 (12.4 KiloBytes/sec)
$cred = New-Object System.Management.Automation.PSCredential(
"CORP\svc-web", (ConvertTo-SecureString "LabWebDeploy#1" -AsPlainText -Force))
Invoke-Command -ComputerName WEB01 -Credential $cred -ScriptBlock { Restart-Service w3svc }The script holds a domain credential in clear text: CORP\svc-web / LabWebDeploy#1. svc-web is a domain account, so this credential also works on other hosts.
Why this matters. A credential left in an automation script is one of the most common real foothold paths. It needs no exploit, only enumeration of what a host already exposes.
What a defender sees. Anonymous access to a share, when auditing for object access is on, writes event 5140 (A network share object was accessed) with the ANONYMOUS LOGON account name (SID S-1-5-7). A rule that alerts on anonymous SMB access to any share other than well-known defaults catches this stage. Disabling null-session access removes the path entirely.
Sign in to continue
10 more sections are for signed-in members. It is free: sign in with Google.