Is port 445 putting you at risk? SMB exposure self-check
Answer ten questions about how SMB is set up and get a risk rating, the reasons behind it, and a block-or-harden plan with the exact firewall rules and PowerShell commands.
How SMB is set up today
SMB exposure rating
Confirm from outside that 445 is closed first; everything else here assumes it is.
A points model from your answers, weighted by PlayCISO from the cited Microsoft, CISA and Samba guidance. Not a scan and not a vulnerability assessment.
Why: what drives the rating
- highNobody has confirmed 445 is closed from outside
Exposure usually comes from a forgotten port-forward, a server with a public IP, or a cloud security group opened for a test. The only reliable answer is a check from a host outside your network against addresses you own.
- mediumSMBv1 status unknown
Older Windows builds and many appliances still ship with SMBv1. Microsoft gives a one-line check and an audit setting that logs every SMBv1 connection attempt, so you can find the devices that still use it before you switch it off.
Source: Microsoft: Detect, enable, and disable SMBv1, SMBv2, and SMBv3 in Windows
- mediumSMB signing not required everywhere
Without required signing, an attacker on the network can relay captured authentication to a file server or tamper with traffic. Windows 11 24H2 now requires it by default on Pro, Enterprise and Education; Windows Server 2025 requires it only for outbound connections, so servers still need it set.
- mediumSMB relies on NTLM
NTLM can be captured, cracked, relayed or passed as a hash. Connecting by IP address or to workgroup machines forces NTLM. Windows 11 24H2 and Server 2025 clients can block NTLM for SMB with exceptions for the servers that still need it.
Source: Microsoft: Block NTLM connections on SMB, Microsoft: Control SMB signing behavior
- mediumWorkstations can reach each other over SMB
WannaCry spread host to host over 445 inside networks. Workstations rarely need to be SMB servers; host firewall rules that only allow SMB to file servers and domain controllers stop worm-style spread.
Source: CISA: Alert TA17-132A: Indicators Associated With WannaCry Ransomware, Microsoft: Secure SMB Traffic in Windows Server
- mediumOutbound 445 to the internet not blocked
Outbound SMB lets a phishing link or malicious document make a machine authenticate to an attacker's server, leaking an NTLM response, and gives malware an exfiltration path. Microsoft says few organisations need outbound 445 other than for specific cloud file services.
Source: Microsoft: Secure SMB Traffic in Windows Server, Microsoft: Block NTLM connections on SMB
Block-or-harden plan
Built from your answers. Test each change on a pilot group first.
Block SMB at the perimeter firewall
Deny inbound TCP 445 and TCP 139, and UDP 137-138, from any external source on every internet edge: office firewalls, cloud security groups and network ACLs, and any port-forward on a branch router. Remove the port-forward or public IP that exposed it rather than only adding a deny rule above it.
Perimeter rules# Rule intent for any firewall (adapt to your vendor syntax): deny inbound tcp any -> any port 445 deny inbound tcp any -> any port 139 deny inbound udp any -> any port 137-138 # AWS: find security groups that allow 445 from anywhere aws ec2 describe-security-groups \ --filters Name=ip-permission.from-port,Values=445 Name=ip-permission.cidr,Values=0.0.0.0/0 \ --query "SecurityGroups[].GroupId"Source: CISA: SMB Security Best Practices, CISA: Alert TA17-132A: Indicators Associated With WannaCry Ransomware, Microsoft: Secure SMB Traffic in Windows Server
Find and then disable SMBv1
Turn on SMBv1 auditing for a couple of weeks to see which devices still use it (event ID 3000 in Microsoft-Windows-SMBServer/Audit), fix or replace them, then remove SMBv1. Removing the optional feature restarts the machine.
PowerShell (elevated)# Is SMBv1 on? Get-SmbServerConfiguration | Select EnableSMB1Protocol # Log who still uses it before switching off Set-SmbServerConfiguration -AuditSmb1Access $true # Turn off the SMBv1 server (no restart) Set-SmbServerConfiguration -EnableSMB1Protocol $false # Remove the SMBv1 feature on Windows 8.1 / 10 / 11 (restarts) Disable-WindowsOptionalFeature -Online -FeatureName SMB1ProtocolSource: Microsoft: Detect, enable, and disable SMBv1, SMBv2, and SMBv3 in Windows, Microsoft: Security Bulletin MS17-010 (Critical)
Require SMB signing on servers and clients
Set it by Group Policy (Microsoft network server / client: Digitally sign communications (always)) or PowerShell. Devices that cannot sign will fail to connect: fix or replace them rather than switching signing back off. Requiring signing also ends guest access.
PowerShell (elevated)Set-SmbServerConfiguration -RequireSecuritySignature $true Set-SmbClientConfiguration -RequireSecuritySignature $true # check Get-SmbServerConfiguration | FL RequireSecuritySignature Get-SmbClientConfiguration | FL RequireSecuritySignatureCut NTLM out of SMB
Connect to shares by DNS name, not IP address, so Kerberos is used. On Windows 11 24H2 and Windows Server 2025 clients, block NTLM for SMB and add exceptions (Group Policy: Block NTLM Server Exception List) for the few non-domain servers that still need it.
PowerShell (Windows 11 24H2 / Server 2025)Set-SmbClientConfiguration -BlockNTLM $true # per mapping New-SmbMapping -RemotePath \\server\share -BlockNTLM $trueSource: Microsoft: Block NTLM connections on SMB, Microsoft: Control SMB signing behavior
Stop workstation-to-workstation SMB
Workstations rarely need to accept SMB. Block inbound 445 on workstations by GPO-deployed firewall rules, allowing it only on file servers and domain controllers, and disable the Server service on machines that share nothing (test first: some management tools use admin shares).
PowerShell (elevated)# On a workstation that should not serve files (test before rolling out) Set-Service -Name LanmanServer -StartupType Disabled Stop-Service -Name LanmanServer -ForceSource: Microsoft: Secure SMB Traffic in Windows Server, CISA: Alert TA17-132A: Indicators Associated With WannaCry Ransomware
Block outbound 445 to the internet
Deny TCP 445 outbound at the corporate firewall. If you use a cloud file service over SMB (for example Azure Files), allow only its published address ranges, ideally through a VPN.
Firewall rule intentdeny outbound tcp internal -> internet port 445 # exception, only if needed: allow to the cloud file service's published rangesEncrypt SMB to sensitive shares
SMB 3 encryption protects data on untrusted network segments. Turn it on per share for sensitive data, or server-wide once every client supports SMB 3.
PowerShell (elevated)Set-SmbShare -Name "Finance" -EncryptData $true # or server-wide Set-SmbServerConfiguration -EncryptData $trueSource: Microsoft: Detect, enable, and disable SMBv1, SMBv2, and SMBv3 in Windows
Check from outside, against addresses you own
From a host outside your network (a cloud VM or a phone hotspot), test your own public IPs, and repeat after every firewall change. Only scan addresses you own or are authorised to test. Searching your own ranges on internet-scan search engines also shows what they have seen.
External check# from OUTSIDE your network, against your own public IP nmap -Pn -p 139,445 203.0.113.10 # "filtered" or "closed" is what you want; "open" means exposedKeep an SMB inventory
List which servers must accept SMB and from where. Audit file share access (Advanced Audit Policy > Object Access > File Share, event 5140) for a set period to see who connects, and review the list after each change.
PowerShellGet-SmbShare Get-SmbSession | Select ClientComputerName, ClientUserName, DialectAlert on SMB that should not happen
Alert on SMBv1 connection attempts (event 3000 once auditing is on), inbound 445 hits on the perimeter firewall, outbound 445 attempts, and workstation-to-workstation SMB. Each one is either a misconfiguration or an attacker.
Source: Microsoft: Detect, enable, and disable SMBv1, SMBv2, and SMBv3 in Windows, Microsoft: Secure SMB Traffic in Windows Server
Loading…
TL;DRThe short answer
5 points
- TCP port 445 carries SMB (Server Message Block): Windows file and printer sharing, named pipes, domain controller SYSVOL and Samba. Port 139 is the older SMB over NetBIOS.
- It should never be reachable from the internet. CISA has advised blocking TCP 445, TCP 139 and UDP 137-138 at the network boundary since 2017; Microsoft says to block 445 both inbound from and outbound to the internet.
- WannaCry (May 2017) spread over 445 using EternalBlue, an SMBv1 flaw Microsoft had patched in MS17-010 two months earlier. SMBGhost (CVE-2020-0796, March 2020) hit SMB 3.1.1 compression on Windows 10 and Server 1903 and 1909.
- Inside the network, the controls that matter are SMBv1 off, signing required, NTLM reduced, no guest shares, and no workstation-to-workstation SMB.
- For remote file access, use a VPN, a zero-trust broker or SMB over QUIC (UDP 443), never 445 over the internet.
What port 445 and the other SMB ports are used for
SMB2 and later need only TCP 445. The NetBIOS ports are SMB1-era; Windows 11 24H2 and Windows Server 2025 no longer open them in the built-in file sharing firewall rules.
Why 445 is the port attackers check first
SMB was built for trusted office networks. Two flaws show what happens when it is reachable by the wrong people. EternalBlue exploited the SMBv1 server bugs that Microsoft fixed in MS17-010 on 14 March 2017; an unauthenticated attacker needed only a crafted packet. On 12 May 2017 WannaCry used it to spread from machine to machine over 445, inside networks as well as across the internet. SMBGhost (CVE-2020-0796) was a remote code execution flaw in SMB 3.1.1 compression on Windows 10 and Server 1903 and 1909, fixed in March 2020, with working public exploit code by June.
Blocking 445 at the edge removes the internet as an attack path. The inside controls (SMBv1 off, signing required, less NTLM, no guest shares, no workstation-to-workstation SMB) decide how far an attacker who is already in can get. For more background, read SMB ports 139 and 445 explained, or look up any other port in the Port Risk Lookup.
How the rating works
Each answer that leaves a gap adds points, weighted by PlayCISO from the sources below. Internet exposure counts most, and exposure combined with SMBv1, out-of-support Windows, old Samba, SMBGhost builds or guest shares always rates Critical. Without exposure, the score reflects how easily an attacker inside could spread or relay credentials over SMB. It is a self-assessment, not a vulnerability scan: confirm exposure from outside, against addresses you own.
Frequently asked questions
What is port 445 used for?
TCP port 445 is SMB (Server Message Block) running directly over TCP. Windows uses it for file and printer sharing, named pipes and RPC, and domain controllers serve Group Policy through SYSVOL over it. Samba uses it on Linux and on most NAS appliances. Port 139 is SMB over the older NetBIOS session service.
Is it safe to have port 445 open?
Open inside the network to file servers and domain controllers, yes, with SMBv1 off and signing required. Open to the internet, no: CISA recommends blocking TCP 445 (and TCP 139, UDP 137-138) at the network boundary, and Microsoft says to block 445 inbound from the internet at your firewalls.
Should I block TCP port 445?
Block it at the internet edge in both directions, and block it between workstations. Do not block it between clients and your file servers or domain controllers, because Windows needs it for shares and Group Policy. Microsoft notes few organisations need outbound 445 to the internet except for specific cloud file services.
What did WannaCry have to do with port 445?
WannaCry spread by exploiting the MS17-010 SMBv1 vulnerability, known as EternalBlue. Per CISA, it scanned for open TCP 445 (and 139, UDP 137-138) and used SMBv1 to propagate. Microsoft had released the MS17-010 fix on 14 March 2017; the outbreak began on 12 May 2017.
What is SMBGhost (CVE-2020-0796)?
A remote code execution flaw in how SMB 3.1.1 handled compressed requests, affecting Windows 10 and Windows Server versions 1903 and 1909 on both the server and client side. Microsoft fixed it in March 2020, and in June 2020 CISA warned of public, working exploit code and advised patching and blocking SMB ports from the internet.
How do I disable SMBv1?
Check with Get-SmbServerConfiguration | Select EnableSMB1Protocol. Turn on Set-SmbServerConfiguration -AuditSmb1Access $true for a while to find devices that still use it (event 3000), then run Set-SmbServerConfiguration -EnableSMB1Protocol $false, and remove the feature with Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol. SMBv1 is not installed by default on Windows 11 or Windows Server 2019 and later.
Does this tool scan my IP address or network?
No. It makes no connection to any host. The rating comes only from your answers, which stay in your browser. The plan explains how to check your own public addresses from outside, with a tool you run yourself, against addresses you own.
Sources
- Microsoft: Security Bulletin MS17-010 (Critical) (14 Mar 2017). Remote code execution flaws in the SMBv1 server: in most situations an unauthenticated attacker could send a specially crafted packet to a targeted SMBv1 server. Rated Critical for all supported Windows releases; the listed workaround is to disable SMBv1.
- CISA: Alert TA17-132A: Indicators Associated With WannaCry Ransomware (12 May 2017 (rev. 7 Jun 2018)). WannaCry spread by exploiting the MS17-010 / EternalBlue SMBv1 flaw, scanning for TCP 139 and 445 and UDP 137-138. CISA advised applying MS17-010, or else disabling SMBv1 and blocking TCP 445, TCP 139 and UDP 137-138 at network boundaries.
- CISA: SMB Security Best Practices (16 Jan 2017 (rev. 16 Mar 2017)). 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.
- CISA: Unpatched Microsoft Systems Vulnerable to CVE-2020-0796 (5 Jun 2020). CISA was aware of publicly available, functional proof-of-concept code exploiting CVE-2020-0796 ("SMBGhost") in unpatched systems, and recommended applying Microsoft's update and using a firewall to block SMB ports from the internet.
- Microsoft: CVE-2020-0796: Windows SMBv3 Client/Server Remote Code Execution Vulnerability (12 Mar 2020). A flaw in how the SMB 3.1.1 protocol handles certain compressed requests allows remote code execution against servers and clients. Affects Windows 10 and Windows Server versions 1903 and 1909; fixed in the March 2020 update.
- Microsoft: Detect, enable, and disable SMBv1, SMBv2, and SMBv3 in Windows (updated 2025). SMBv1 is not installed by default in any edition of Windows 11 or Windows Server 2019 and later. Gives the PowerShell to detect and disable it, and to audit SMBv1 use (event ID 3000 in Microsoft-Windows-SMBServer/Audit).
- Microsoft: Control SMB signing behavior (13 Aug 2025). Signing protects SMB against relay and spoofing. Windows 11 24H2 Enterprise, Pro and Education require inbound and outbound signing; Windows Server 2025 requires outbound signing only; Windows 11 24H2 Home requires neither. Microsoft also recommends Kerberos over NTLMv2.
- Microsoft: Secure SMB Traffic in Windows Server (25 Oct 2024). Block TCP 445 inbound from the internet and outbound to the internet at the corporate firewall; use SMB over QUIC for edge access; inventory shares; use host firewall rules against lateral SMB; disable the SMB Server service where it is not needed.
- Microsoft: Block NTLM connections on SMB (25 Oct 2024). Windows 11 24H2 and Windows Server 2025 SMB clients can block NTLM for outbound connections, which stops clients being tricked into sending NTLM to malicious servers and counters cracking and pass-the-hash.
- Microsoft: SMB over QUIC (24 Jul 2025). A TLS 1.3 tunnel over UDP 443 instead of TCP 445. Server: Windows Server 2022 Datacenter: Azure Edition or any edition of Windows Server 2025; client: Windows 11. Microsoft says not to allow TCP/445 inbound to the file server.
- Samba: Samba 4.11.0 release notes (17 Sep 2019). SMB1 is disabled by default from Samba 4.11: the default server and client minimum protocol became SMB2_02.
- Samba: CVE-2017-7494 security advisory (24 May 2017). Samba 3.5.0 and later allowed a client with write access to a share to upload a shared library and have the server load and run it. Fixed in 4.6.4, 4.5.10 and 4.4.14.
- Microsoft: Windows 10 Home and Pro lifecycle (14 Oct 2025). Windows 10 support ended on 14 October 2025; devices no longer get security updates unless enrolled in Extended Security Updates.
Educational guidance. Test firewall, signing and NTLM changes on a pilot group before rolling them out, and only scan addresses you own or are authorised to test.
More security tools
The tools people use most on PlayCISO.
Catch injected instructions hiding in content your AI agent should only read.
Score your readiness against the first international standard for AI security threats.
Critical CVEs across 21 major vendors, month by month — and what the 2026 surge means.
Build an ordered ruleset, replay labelled packets and catch shadowed and any-to-any rules.
Self-assess all six Functions, from Govern to Recover, and see your weakest one.
Search 172 threat actors across Microsoft, CrowdStrike, Mandiant and community names.