Skip to content
Pro tool · self-check, no scanning

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.

This does not scan anything. No connection is made to your network or IP addresses; the rating comes only from your answers, and they stay in your browser. The plan ends with how to check from outside yourself.
Your answers

How SMB is set up today

Rating High6 findings
1. Is TCP port 445 reachable from the internet?
2. Is SMBv1 enabled anywhere?
3. Is SMB signing required?
4. How do SMB connections authenticate?
5. What serves or uses SMB? (pick all)
6. How fast do critical patches reach SMB hosts?
7. Who uses the file shares? (pick all)
8. How do remote users reach shares?
9. Is outbound 445 to the internet blocked?
10. Is workstation-to-workstation SMB blocked?

SMB exposure rating

High46 / 100

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

Block-or-harden plan

Built from your answers. Test each change on a pilot group first.

Block (today)
  1. 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

Harden (this week)
  1. 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 SMB1Protocol

    Source: Microsoft: Detect, enable, and disable SMBv1, SMBv2, and SMBv3 in Windows, Microsoft: Security Bulletin MS17-010 (Critical)

  2. 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 RequireSecuritySignature

    Source: Microsoft: Control SMB signing behavior

  3. Cut 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 $true

    Source: Microsoft: Block NTLM connections on SMB, Microsoft: Control SMB signing behavior

  4. 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 -Force

    Source: Microsoft: Secure SMB Traffic in Windows Server, CISA: Alert TA17-132A: Indicators Associated With WannaCry Ransomware

  5. 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 intent
    deny  outbound  tcp  internal -> internet  port 445
    # exception, only if needed: allow to the cloud file service's published ranges

    Source: Microsoft: Secure SMB Traffic in Windows Server

  6. Encrypt 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 $true

    Source: Microsoft: Detect, enable, and disable SMBv1, SMBv2, and SMBv3 in Windows

Verify and keep it closed
  1. 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 exposed

    Source: Microsoft: Secure SMB Traffic in Windows Server

  2. Keep 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.

    PowerShell
    Get-SmbShare
    Get-SmbSession | Select ClientComputerName, ClientUserName, Dialect

    Source: Microsoft: Secure SMB Traffic in Windows Server

  3. Alert 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;DR

The 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.

TCP 445
SMB direct over TCP
Windows file and printer sharing, named pipes and RPC, domain controller SYSVOL, Samba
Never open to the internet. Allow internally only to file servers and domain controllers.
TCP 139
NetBIOS session service
SMB over NetBIOS, used by SMB1-era systems
Block at the edge; Windows 11 24H2 and Server 2025 no longer open it in the built-in sharing rules.
UDP 137
NetBIOS name service
Legacy name resolution
Block at the edge.
UDP 138
NetBIOS datagram service
Legacy browsing and announcements
Block at the edge.
UDP 443
SMB over QUIC
Encrypted SMB for remote users (Windows Server 2025, Windows 11)
The supported way to offer SMB at the edge, with a server certificate.

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.

The tools people use most on PlayCISO.

All tools
🎉 New here? Use code WELCOME10 for 10% off any plan at checkout