Server Message Block (SMB) is a network file-sharing protocol used by Windows for sharing files, printers, and named pipes across a network. It runs over TCP and is one of the most commonly attacked services in a Windows environment.
OSCP relevance: SMB is almost always present on Windows targets. It enables file share access, user enumeration, relay attacks, credential dumping, and lateral movement.
Ports
Port
Protocol
Description
139/TCP
NetBIOS Session Service
Older SMB over NetBIOS
445/TCP
SMB Direct (CIFS)
Modern SMB — target this one
137/UDP
NetBIOS Name Service
Name resolution
138/UDP
NetBIOS Datagram Service
Connectionless data
SMB Versions
Version
OS
Notes
SMBv1
Windows XP / 2003 / 7
Vulnerable to EternalBlue (MS17-010). Disabled by default in modern Windows.
SMBv2
Windows Vista / 2008+
More efficient; still widely used
SMBv3
Windows 8 / 2012+
Encryption support; current standard
Quick Enumeration Flow
1. Nmap scan — confirm ports 139/445 open, grab version banner
2. Anonymous / null session test — can you list shares without creds?
3. Enumerate shares — what shares exist? what can you access?
4. Enumerate users / groups — via RPC or SMB
5. Check for known vulns — EternalBlue, PrintNightmare, etc.
6. Authenticated access — use creds to read/write shares, exec commands