# SMB

> SMB is a Windows file and printer sharing protocol. Attackers enumerate shares, users, and domain info, then exploit misconfigs via relay, PtH, or RCE to move laterally and exfiltrate data

- **URL:** https://hackindex.io/services/smb
- **Type:** Service
- **Default ports:** 139, 445
- **Tags:** smb, windows, file-sharing, network, lateral-movement, enumeration
- **Published:** 2025-12-31
- **Updated:** 2026-07-13

SMB (Server Message Block) runs on **TCP port 445** and provides file sharing, printer access, and inter-process communication on Windows networks. Nmap identifies it as `microsoft-ds`. SMB is one of the most commonly targeted services in both internal pentests and CTF environments.

Null sessions, guest access, and weak credentials frequently expose readable or writable shares. Sensitive files (scripts, config backups, credentials) often sit on accessible shares. SMB also carries named pipes used for RPC, enabling user and group enumeration. Critical vulnerabilities like EternalBlue (MS17-010) and SMBGhost (CVE-2020-0796) provide remote code execution on unpatched systems.

Start with `enum4linux-ng`, `smbclient`, or `crackmapexec` to enumerate shares, users, and policies. Check for null session and guest access. Nmap's `smb-vuln-*` scripts test for known exploits. If credentials are available, enumerate shares and test for write access or lateral movement with `psexec`, `wmiexec`, or `smbexec`.

## Phases

- [Enumeration](https://hackindex.io/services/smb/enumeration.md): SMB shares, users, hosts, NetBIOS, and domain info enumeration guides (5 guides)
- [Vulnerability Discovery](https://hackindex.io/services/smb/vulnerability-discovery.md): SMB vuln scans covering signing, EternalBlue, shares, and access control (13 guides)
- [Exploitation](https://hackindex.io/services/smb/exploitation.md): SMB shells via relay, PtH, RCE exploits, and share abuse (8 guides)
- [Lateral Movement](https://hackindex.io/services/smb/lateral-movement.md): Spray creds, dump SAM, and pivot via SMB using nxc and impacket (1 guides)
