PortScan › Port guide › Port 445

Port 445 (SMB): The Port WannaCry Spread Through — Always Close It to the Internet

TCP 445SMBWindowsExposure risk: High

Port 445 is Windows file sharing (SMB). WannaCry spread worldwide in 2017 via the EternalBlue flaw on this port. How to close it, and 139, to the internet.

What is port 445?

Port 445 is SMB (Server Message Block), the Windows file and printer sharing port. Shared folders on your PC and NAS network drives (\\NAS\share) all run on SMB. Port 139 is the older form, SMB over NetBIOS.

It is an essential feature inside a home or office, but there is almost never a reason for it to be visible from the internet. If you need file sharing over the cloud, do not open SMB directly; use a VPN or a different protocol.

When it is normally open

Risks if it is open

WannaCry and EternalBlue

In May 2017, WannaCry ransomware used an SMBv1 vulnerability (MS17-010, EternalBlue) to infect PCs with port 445 open, with no human interaction, encrypting hundreds of thousands of machines in some 150 countries. NotPetya used the same route that same year.

NTLM hash theft and brute forcing

An open port 445 makes you a target for credential guessing and NTLM credential theft attacks.

Exposed NAS devices

If you port-forward a NAS's port 445, ransomware groups can walk straight in and encrypt every shared folder.

Security checklist

How to check whether port 445 is open

From outside (is it exposed to the internet?)

Whether your server or home router accepts port 445 from the internet can only be confirmed by connecting from outside. A check from inside the same network bypasses the router's firewall and gives a different answer.

PortScan opens a real TCP connection from the Cloudflare edge and reports Open, Closed or Filtered. Members can scan every port on their own IP for free and other targets free once a day.

Check port 445

On the server (what is listening?)

Windows (PowerShell):

netstat -ano | findstr ":445 "
Get-NetTCPConnection -LocalPort 445 -State Listen | Select LocalAddress,OwningProcess

Linux:

sudo ss -tlnp | grep ':445 '

If it listens on 0.0.0.0 or [::] it is open on every network; 127.0.0.1 means only that machine can connect. To test port 445 on a server from another computer, use Test-NetConnection server-address -Port 445 on Windows or nc -vz server-address 445 on Linux and macOS.

How to close or restrict port 445

The best fix is to turn the service off or make it listen only on 127.0.0.1 (see the checklist above). If you need the service but must keep it off the internet, use a firewall.

Windows Firewall

# Administrator PowerShell
New-NetFirewallRule -DisplayName "Block TCP 445" -Direction Inbound -Protocol TCP -LocalPort 445 -Action Block
# To allow a single IP instead (block rules take precedence, so use this instead of the rule above)
New-NetFirewallRule -DisplayName "Allow TCP 445 from office" -Direction Inbound -Protocol TCP -LocalPort 445 -RemoteAddress 203.0.113.10 -Action Allow

Linux (ufw)

sudo ufw deny 445/tcp
# Allow a single IP only
sudo ufw allow from 203.0.113.10 to any port 445 proto tcp

On a cloud server, also check port 445 in the security group (inbound rules), which is separate from the OS firewall. For services running in Docker, the rules Docker creates can bypass ufw, so binding the port to localhost with -p 127.0.0.1:445:445 is the reliable option.

Router

At home or in a small office, open the router's admin page and check whether port 445 is in the port forwarding list, whether DMZ is enabled, and whether any program opened ports by itself through UPnP. If any of the three applies, port 445 on your PC is directly visible from the internet.

How to read the scan result

The verdict can depend on where you connect from. Many ISPs (including most Korean ISPs) block some ports such as 135, 139 and 445 on their network, so the same server can look Filtered from inside that network and Closed from abroad.

FAQ

I scanned my home IP and port 445 is Filtered
Since WannaCry, many ISPs (including most Korean ISPs) block 135/139/445 at the network edge. In fact, while building this site we confirmed on a Korean residential line that these ports were silently blocked. Still, do not rely on ISP policy; keep your PC firewall on too.
I scanned my PC and port 445 is open
Your PC is most likely receiving a public IP directly (connected straight to the modem with no router) or is set as the router's DMZ host. Check this immediately.
139 NetBIOS/SMB135 MS-RPC3389 RDP (Remote Desktop)

Last updated 2026-11-04 · Use this guide to check systems you manage. Scanning systems without permission may carry legal liability.