Common attacks and weaknesses
- Wormable vulnerabilities: EternalBlue (MS17-010, WannaCry, NotPetya) and SMBGhost (CVE-2020-0796).
- NTLM relay and credential theft, lateral movement with admin shares.
- Anonymous shares leaking data.
Windows file and printer sharing, also used for remote administration (PsExec, admin shares).
Files are sent over port 445 in pieces and reassembled on the other side. Encryption is optional: it only happens if both sides negotiate TLS (STARTTLS).
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| microsoft-ds | 445 | TCP, UDP | Microsoft-DS | - | - |
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :445' # process listening on 445
sudo lsof -nP -i :445macOS
sudo lsof -nP -i :445
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 445 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 445 netstat -ano | findstr :445
From another machine
nmap -p 445 -sV <host> sudo nmap -sU -p 445 <host> nc -zv <host> 445
Block it in the firewall
sudo ufw deny 445/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 445" -Direction Inbound -LocalPort 445 -Protocol TCP -Action Block # Windows
Windows file and printer sharing, also used for remote administration (PsExec, admin shares).
Port 445 is registered for TCP and UDP. In practice the service mostly uses TCP.
It is rated 9/10 (critical) when exposed to the Internet. Wormable vulnerabilities: EternalBlue (MS17-010, WannaCry, NotPetya) and SMBGhost (CVE-2020-0796). Block 445 at the Internet edge, always.
On Linux run "ss -ltnup 'sport = :445'", on macOS "lsof -nP -i :445", and on Windows "netstat -ano | findstr :445" to see the local process. From another machine, "nmap -p 445 <host>" shows whether it is reachable.