Ports 139 | 445 | SMB
Enumeration
sudo nmap -sT -sU -sV -p135,137,138,139,445 --open <IP>Nmap Scripts
# Enumerate shares
nmap --script smb-enum-shares -p 445 <IP>
# OS Discovery
nmap --script smb-os-discovery -p 445 <IP>
# Enumerate Users
nmap --script=smb-enum-users -p 445 <IP>
# All
nmap --script=smb-enum-users,smb-enum-shares,smb-os-discovery -p 139,445 <IP>NULL / Anonymous Login
# On some configuration omitting '-N' will grant access.
smbclient -U '' -L \\\\<IP>
smbclient -U '' -N -L \\\\<IP>
smbclient -U '%' -N -L \\\\<IP>
smbclient -U '%' -N \\\\<IP>\\<Folder>
# Enter a random username with no password and try for anonymous login.
crackmapexec smb <IP> -u 'anonymous' -p ''
crackmapexec smb <IP> -u '' -p ''
crackmapexec smb <IP> -u '' -p '' --sharesAuthenticated
Download Files
Tools
Enum4Linux
Crackmapexec
PsMapExec
User Enumeration
Nmap

Exploits
Samba
CVE-2007-2447 Samba Symlink Directory Traversal
Platform
Link
Last updated