Master the art of SMB/CIFS reconnaissance. Learn to identify, enumerate, and analyze SMB services without triggering security alerts.
# Scan for SMB services on port 445
nmap -sS -O -p445 192.168.1.0/24
# Fast scan with service detection
nmap -sS -sV -p445 --open 192.168.1.0/24
This command performs a SYN scan (-sS) with OS detection (-O) specifically targeting port 445 (SMB) across the entire subnet. The --open flag shows only systems with open ports.
# Comprehensive SMB discovery
nmap -sU -sS -p U:137,T:139,445 192.168.1.0/24
# NetBIOS name resolution
nbtscan 192.168.1.0/24
This scan checks both UDP port 137 (NetBIOS Name Service) and TCP ports 139/445 (SMB). NetBIOS scanning can reveal computer names and workgroup information.
# SMB OS discovery
nmap --script smb-os-discovery -p445 <target_ip>
# SMB protocol version detection
nmap --script smb-protocols -p445 <target_ip>
# SMB security mode detection
nmap --script smb-security-mode -p445 <target_ip>
These scripts reveal operating system version, computer name, domain information, supported SMB protocol versions, and security configurations.
# enum4linux-ng comprehensive scan
enum4linux-ng -A <target_ip>
# Specific enumeration options
enum4linux-ng -U -S -G -P <target_ip>
# -U: Users, -S: Shares, -G: Groups, -P: Password policy
enum4linux-ng is the next-generation version of the classic enum4linux tool, providing comprehensive SMB enumeration capabilities.
# Nmap share enumeration
nmap --script smb-enum-shares -p445 <target_ip>
# smbclient share listing
smbclient -L //<target_ip> -N
# -N attempts null session authentication
# smbmap for detailed share analysis
smbmap -H <target_ip> -u guest
# Check share permissions
smbmap -H <target_ip> -u username -p password
# Recursive directory listing
smbmap -H <target_ip> -u username -p password -R
# Download files from accessible shares
smbmap -H <target_ip> -u username -p password --download 'share\file.txt'
Network discovery and SMB script scanning
Comprehensive SMB enumeration
SMB client for share access
Share enumeration and file operations
Framework for understanding adversary tactics
Comprehensive security testing methodology
Professional vulnerability management