Is port 445 (SMB) exposed to the internet?
AdminKit explains why port 445, used by Windows' SMB file-sharing protocol, should never face the internet: SMB was never designed for untrusted networks, an old SMBv1 flaw (EternalBlue, CVE-2017-0144) let WannaCry and NotPetya spread with no credentials needed, and CISA still names SMB a high-risk service to block at the network boundary.
By AdminKit team, Netbase JSC · Updated
Key takeaways
- Port 445 carries SMB directly over TCP. It is how Windows, Samba and most NAS devices share files and printers, and it also carries remote administration traffic.
- SMB was built for trusted local networks. Its older dialect, SMBv1, is behind some of the worst worm outbreaks on record; current dialects are much stronger but still not meant for the open internet.
- Both Windows and Samba file servers have had flaws reachable over 445 that led to remote code execution.
- AdminKit’s port check does not test port 445. Test from outside your network, then confirm the listener and its SMB settings on the host.
Why shouldn’t port 445 normally face the internet?
IANA registers TCP port 445 for microsoft-ds, the direct-hosted transport for SMB (Server Message Block) — the protocol Windows, and compatible implementations like Samba, use for file sharing, printer sharing and some remote administration. SMB was designed to run between machines on the same trusted local network, the same assumption behind several other protocols covered elsewhere on this site, and a server or NAS box that answers on 445 from the open internet is offering exactly that trusted-network feature to anyone who happens to scan for it.
What does an exposed port 445 actually give away?
The starkest example is historical but still the reason CISA’s guidance exists at all: EternalBlue (CVE-2017-0144), a flaw in the older SMBv1 protocol version, let the WannaCry and NotPetya ransomware outbreaks of 2017 spread from one internet-reachable, unpatched machine to the next with no credentials and no user interaction whatsoever — a worm, not a phishing email or a tricked click. CISA’s own Petya ransomware alert names it directly: NotPetya used “EternalBlue — the same Windows SMBv1 exploit used by WannaCry.” Patched, SMBv3-only hosts aren’t vulnerable to that specific exploit, but a reachable port 445 is still useful to an attacker in quieter ways: it confirms a Windows or Samba host with file sharing lives at that address, and it opens the door to credential-guessing against any share that requires a login, or to NTLM relay attacks that abuse SMB’s authentication handshake rather than a code flaw.
Is this still a problem after 2017?
CISA’s guidance on SMB exposure has been reissued, not retired. Its dedicated SMB Security Best Practices alert and its Petya ransomware alert both give the identical recommendation: “block all versions of SMB at the network boundary by blocking TCP port 445 with related protocols on UDP ports 137-138 and TCP port 139, for all boundary devices” — not just SMBv1. A separate, more recent joint CISA/FBI advisory on initial-access techniques (AA22-137A) groups SMB with three other protocols this site also covers, stating that “RDP, Server Message Block (SMB), Telnet, and NetBIOS are high-risk services” — see RDP and VNC exposed to the internet and securing an exposed Telnet device for the same pattern on those other three.
How do you check your own exposure?
AdminKit’s open ports check checks a fixed nine-port list, and port 445 isn’t on it — confirm this one manually with a TCP-aware check such as nc -vz your-public-ip 445 run from outside your network, after confirming your public IP with what is my IP. A file server, NAS box or Windows host can be fully patched to the latest SMB version and still be reachable on 445 from the internet simply because of a router’s UPnP rule or a cloud firewall rule nobody remembers adding — worth confirming directly rather than assuming the perimeter is closed.
What is the difference between port 445 and port 139?
SMB can run over two transports. The older one wraps SMB in NetBIOS session service on TCP 139, the way Windows networking worked in the 1990s. The newer one, “direct hosted” SMB, runs SMB straight over TCP 445 without NetBIOS. Current Windows versions use 445 first, and the IANA port registry lists 445 as microsoft-ds. For exposure purposes treat them as one service: if 445 is reachable, check 139 (and the NetBIOS UDP ports 137 and 138) as well, because a router rule that forwards “Windows file sharing” often includes all of them.
Which SMB dialect is the server speaking?
“SMB” covers several protocol versions with very different security properties. Client and server negotiate the highest dialect both support.
| Dialect | Introduced with | Security relevant to exposure |
|---|---|---|
| SMB 1 (CIFS) | Windows NT era | No encryption; the dialect behind EternalBlue. Microsoft documents that SMBv1 is not installed by default on current Windows releases. |
| SMB 2.0 / 2.1 | Windows Vista / Windows 7 | Redesigned protocol, signing supported, no encryption. |
| SMB 3.0 / 3.1.1 | Windows 8 / Windows 10 | Encryption per share or per server, pre-authentication integrity in 3.1.1. |
Even with SMB 3.1.1 and encryption on, the server is still offering a Windows login to anyone who can reach it. Password spraying against SMB works the same way it does against RDP, and NTLM authentication over SMB can be relayed or captured. Encryption protects the files in transit; it does not decide who gets to try logging in.
What is usually listening on port 445?
| Listener | Where it turns up |
|---|---|
Windows (the LanmanServer service) | Every Windows PC and server; it listens on 445 by default even when nothing is shared, because administrative shares such as C$ and ADMIN$ exist on most editions. |
| Samba | Linux servers and most NAS devices; also many routers that share a USB drive. |
| Storage appliances | Enterprise filers and backup targets with their own SMB stack. |
Samba deserves its own mention, because “we don’t run Windows” is not the same as “we don’t run SMB”. CVE-2017-7494 let a client that could write to a share upload a shared library and make the Samba server load and run it. NAS devices running affected Samba versions were exposed wherever port 445 was reachable and a writable share existed. The Samba security page lists the project’s advisories, and a NAS firmware update is usually how those fixes reach a home or office device. Many of the same Linux servers and NAS devices also share folders over NFS, which has its own exposure check in is port 2049 (NFS) exposed.
How do you confirm the listener and its settings?
From outside your network, nc -vz -w 3 203.0.113.5 445 (with your own public IP in place of the documentation address) tells you whether the TCP port answers. SMB does not send a greeting until the client speaks, so a succeeded line is all you will see.
On a Windows host, PowerShell shows whether it is listening and how SMB is configured:
PS> Get-NetTCPConnection -LocalPort 445 -State Listen
PS> Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol, RequireSecuritySignature, EncryptData
EnableSMB1Protocol should be False. On a Linux or Samba host, ss -ltnp 'sport = :445' shows the smbd process, and testparm -s prints the effective configuration, including server min protocol.
If the port was open from the internet, also review which accounts can log in over the network and look for failed and successful network logons in the Security log. Remove the exposure first; the review then tells you whether anyone used it while it was open.
Is there a safe way to reach file shares remotely?
Yes, and none of them involve forwarding 445. A VPN puts the remote client on the internal network so SMB never crosses the internet unwrapped. A sync or web file service publishes files over HTTPS with its own authentication. On recent Windows Server versions, Microsoft also offers SMB over QUIC, which carries SMB inside a TLS 1.3 QUIC connection on UDP 443 and is designed for access from untrusted networks. Each option keeps the classic TCP 445 listener inside the LAN, where SMB was designed to run, and puts a purpose-built authentication layer in front of remote users.
How to fix it
- Block TCP 445, TCP 139 and UDP 137-138 at your perimeter firewall or router, exactly as CISA’s advisory recommends, so SMB only answers requests from your internal network.
- Disable SMBv1 entirely on every host that still has it enabled — current Windows and Samba releases support this as a feature to turn off, and it closes the specific flaw EternalBlue exploited without affecting modern SMBv3 file sharing.
- Require SMB signing so a session can’t be tampered with or relayed in transit, closing the NTLM relay path that doesn’t depend on any unpatched code flaw.
- Route any file sharing you genuinely need between sites or for remote staff through a VPN, instead of forwarding port 445 directly — the same fix this site recommends for RDP and VNC, since none of these protocols were designed to have their login or session-negotiation step reachable by an anonymous scanner.
CISA’s own guidance adds a fair caveat worth repeating: “disabling or blocking SMB may create problems by obstructing access to shared files, data, or devices” — weigh that disruption against the risk, and if internal file sharing genuinely depends on SMB, the fix is restricting where it’s reachable from, not necessarily turning it off altogether.
Defensive use only
Every check this page links to is for assets you own or are explicitly authorized to test. Never scan, probe, or attempt to connect to a network or device you don’t control — AdminKit’s active checks only ever run against the IP making the request or an asset you’ve verified ownership of. See our Disclaimer and Acceptable Use Policy for the full terms.
This guide is general information, not a security audit of your specific network — see our disclaimer for what AdminKit's guidance does and does not commit to.
Frequently asked questions
Is SMB itself broken, or was it just one bad version?
The wormable EternalBlue exploit specifically targeted a flaw in SMBv1, an old version of the protocol still enabled by default on many older Windows installations in 2017. Current SMB versions (3.x) with signing and encryption enabled are far more robust, but CISA's guidance is still to block all versions of SMB at the network boundary, not just SMBv1 — an internet-facing SMB port is a high-risk service regardless of which version answers.
Why would my SMB port ever be reachable from the internet in the first place?
Usually a misconfigured firewall rule, a router's UPnP feature opening a port automatically for a NAS or file-sharing device, or a cloud server built from a Windows image with a default or broad inbound rule that was never tightened. Nobody sets out to expose SMB directly; it almost always happens as a side effect of something else.
What can someone actually do with a reachable port 445?
If SMBv1 is still enabled and unpatched, a wormable remote-code-execution exploit like EternalBlue requires no credentials and no user interaction at all. Even on a patched, SMBv3-only host, a reachable port 445 still exposes file shares to credential-guessing and NTLM relay attacks, and simply confirms to any scanner that a Windows (or Samba) host with file sharing lives at that address — information an attacker uses to plan the next step.
What does CISA actually recommend?
CISA's dedicated SMB Security Best Practices alert recommends "disabling SMBv1" and "blocking all versions of SMB at the network boundary by blocking TCP port 445 with related protocols on UDP ports 137-138 and TCP port 139, for all boundary devices" — the same guidance it repeated in its Petya ransomware alert. A separate joint CISA/FBI advisory on initial-access techniques groups SMB with RDP, Telnet and NetBIOS, stating plainly that "RDP, Server Message Block (SMB), Telnet, and NetBIOS are high-risk services."
I need file sharing between my own sites or for remote staff — what's the safe way to do that?
Put SMB traffic inside a VPN or a zero-trust access tunnel between the specific sites or users that need it, rather than forwarding port 445 on a router or cloud firewall. That keeps the protocol reachable for people who have already authenticated onto the private network, while an internet scanner finds nothing listening on 445 at your public IP at all.
Sources
- CISA — SMB Security Best Practices
- CISA — Petya Ransomware Alert
- CISA & FBI — Weak Security Controls and Practices Routinely Exploited for Initial Access (AA22-137A)
- IANA Service Name and Transport Protocol Port Number Registry
- Microsoft Learn — SMBv1 is not installed by default in Windows
- Microsoft Learn — SMB over QUIC
- NVD — CVE-2017-7494, Samba remote code execution via writable share
- Samba — Security updates and information
Want AdminKit to watch this for you?
Free checks tell you the state today. Protective DNS and monitoring tell you when it changes.
Talk to an expert
Huy Nguyen (David), Founder & CEO, Netbase JSC
Ask whether this fix applies to your setup, or get a second pair of eyes on your DNS and mail records.