SMB is the protocol attackers use to move between Windows hosts, relay stolen authentication and push ransomware across a network, and most estates still run it with settings chosen for compatibility rather than security. This guide covers the whole SMB security surface on Windows: dialects and SMBv1 removal, signing and encryption, guest access, NTLM blocking and rate limiting, SMB over QUIC for remote access, and the firewall design that limits who can reach TCP 445 at all. It is written for Windows infrastructure engineers, security architects and detection engineers who need exact settings, a safe rollout order and ways to measure progress. Signing alone has its own deeper page, the SMB Signing Guide; this page sets signing in the context of the full protocol hardening programme.
Key takeaways
- Remove SMBv1 first. It is not installed by default on Windows 11, Windows Server 2019 and later, and Windows 10 from 1709 (except Home and Pro), yet it survives on upgraded hosts, appliances and old images; audit with event ID 3000 before you remove it.
- Signing is now the default on new builds. From Windows 11 24H2 and Windows Server 2025, Microsoft states that all inbound and outbound SMB connections require signing by default, which breaks the classic SMB relay but also breaks guest access and unsigned third-party devices.
- NTLM is the weak link, not SMB itself. Connections by IP address or CNAME fall back to NTLM; the SMB client NTLM blocking setting and the authentication rate limiter on 24H2 and Server 2025 reduce relay, cracking and brute-force exposure.
- TCP 445 should never cross the internet edge. Microsoft guidance is to block it inbound and outbound at the corporate firewall and to use SMB over QUIC (UDP 443, TLS 1.3) where remote file access is genuinely needed.
- Measure with the built-in audit logs. The SMBServer and SMBClient Audit logs report SMBv1 use, clients and servers that cannot sign or encrypt, and event 5140 shows who reaches each share, so the programme can be driven by data rather than guesswork.
Why SMB hardening matters
SMB (Server Message Block) carries file shares, the SYSVOL and NETLOGON shares that Group Policy depends on, named pipes for remote administration and printer traffic. That breadth is why it appears so often in intrusions. The MITRE ATT&CK techniques below describe the main abuse paths; each one has a matching configuration control.
| ATT&CK technique | How SMB is involved | Primary control |
|---|---|---|
| T1021.002 SMB/Windows Admin Shares | Attackers with valid credentials use admin shares (C$, ADMIN$) to copy tools and run services on remote hosts | Restrict inbound 445 between workstations, tiered admin accounts, disable the Server service where unused |
| T1557.001 Name Resolution Poisoning and SMB Relay | Poisoned name resolution makes a victim authenticate to an attacker, who relays the NTLM exchange to another SMB server | Require signing on client and server, block NTLM for SMB, disable LLMNR and NetBIOS name resolution |
| T1187 Forced Authentication | A crafted file or link makes a client send NTLM authentication to an external SMB server | Block outbound TCP 445 to the internet, SMB client NTLM blocking |
| T1210 Exploitation of Remote Services | Exploitation of SMB server flaws, for example the SMBv1 remote code execution flaw CVE-2017-0144, listed in the CISA KEV catalog with known ransomware use | Remove SMBv1, patch, block 445 at segment boundaries |
| T1550.002 Pass the Hash | Captured NTLM hashes are reused to authenticate over SMB | NTLM reduction, Kerberos by name, local admin password uniqueness |
| T1570 Lateral Tool Transfer | SMB copies payloads between hosts during spread | Segmentation, share auditing (event 5140), EDR on file writes to admin shares |
For the wider picture of how these techniques chain together see the Lateral Movement Guide, and for relay specifically the NTLM Relay Guide.
Dialects and SMBv1 removal
SMB has several dialects with very different security properties. SMBv1 signs with MD5, has no pre-authentication integrity and cannot encrypt. SMB 3.1.1 adds mandatory pre-authentication integrity, which hashes the Negotiate and Session Setup messages into key derivation and stops downgrade to SMB 2.x (though not to SMB 1.0, which is another reason to remove it).
| Dialect | Signing algorithm | Encryption | Security notes |
|---|---|---|---|
| SMB 1.0 | MD5 | None | Deprecated; remove. Rejected by encrypted shares by default |
| SMB 2.0.2 / 2.1 | HMAC-SHA-256 | None | No unencrypted access to encrypted shares by default |
| SMB 3.0 / 3.0.2 | AES-CMAC | AES-128-CCM | First dialects with SMB Encryption |
| SMB 3.1.1 | AES-CMAC, AES-128-GMAC (Windows Server 2022 and Windows 11) | AES-128-GCM default; AES-256-GCM and AES-256-CCM on Windows Server 2022 and Windows 11 | Mandatory pre-authentication integrity; downgrade attempts disconnect and log event 1005 |
Finding and removing SMBv1
- Inventory: run
Get-WindowsOptionalFeature -Online -FeatureName SMB1ProtocolandGet-SmbServerConfiguration | Format-List EnableSMB1Protocolacross the estate through your configuration management tool. - Audit use: set
Set-SmbServerConfiguration -AuditSmb1Access $trueon servers that still have it, then collect event ID 3000 from the Microsoft-Windows-SMBServer/Audit log for at least one business cycle (month end, backups, scanners). - Fix the clients, not the server: the events name the client; update or replace the device (multifunction printers, NAS units and old embedded systems are the usual sources). Microsoft advises updating the product rather than reinstalling SMBv1.
- Remove:
Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocolremoves the feature (restart required);Set-SmbServerConfiguration -EnableSMB1Protocol $falsedisables the server component without a restart and is the faster first step. - Set a dialect floor where you can: on Windows Server 2025 and Windows 11 24H2 and later,
Set-SmbServerConfiguration -Smb2DialectMin SMB300(or SMB311 for a modern-only segment) and the equivalentSet-SmbClientConfigurationparameters restrict negotiation. Verify the negotiated dialect with a packet capture before broad rollout.
Signing, encryption and guest access
Signing gives integrity and peer authentication for each SMB message using a key derived from the authenticated session. That is what defeats SMB relay: a relaying attacker does not have the session key, so cannot produce valid signatures. Encryption adds confidentiality and, through AES-CMAC or AES-GMAC, integrity of its own, regardless of signing settings.
| Control | Setting | Default (Windows 11 24H2 / Server 2025) | Watch out for |
|---|---|---|---|
| Require signing (client) | GPO "Microsoft network client: Digitally sign communications (always)"; registry LanManWorkstation\Parameters\RequireSecuritySignature = 1 | Required for outbound connections | Third-party NAS and appliances that cannot sign |
| Require signing (server) | GPO "Microsoft network server: Digitally sign communications (always)"; registry LanManServer\Parameters\RequireSecuritySignature = 1 | Required for inbound connections | Older clients, scanners writing to shares |
| Encrypt a share | Set-SmbShare -Name <share> -EncryptData $true or server-wide Set-SmbServerConfiguration -EncryptData $true | Off | CPU cost; SMB 2.x clients rejected while RejectUnencryptedAccess is true (event 1003) |
| Client encryption mandate | New-SmbMapping -RequirePrivacy $true or NET USE /REQUIREPRIVACY; client-wide mandate available on new builds | Off | Servers that cannot encrypt will fail |
| Insecure guest logons | Client guest connections and guest fallback | Blocked on Enterprise, Education and Pro for Workstation, and now on Windows 11 Pro | Consumer NAS units relying on guest shares |
- EnableSecuritySignature is legacy: Microsoft documents that it is ignored for SMB2 and later. Only RequireSecuritySignature matters; signing is used unless both sides set it to 0.
- Audit before enforcing on older builds:
Set-SmbServerConfiguration -AuditClientDoesNotSupportSigning $trueand-AuditClientDoesNotSupportEncryption $truelog events 3021 and 3022 in the SMBServer/Audit log; the client-side equivalents log 31998 and 31999 in SMBClient/Audit. - Guest cannot be signed: guest logons have no password and do not support signing or encryption, so mandatory signing also ends guest fallback. Plan replacement storage for anything still using guest shares.
- Encryption is in transit only: it does not protect data at rest (use BitLocker or the storage layer) and is unrelated to EFS.
Authentication: Kerberos, NTLM blocking and rate limiting
Signing protects the session, but the session key is only as good as the authentication that produced it. Microsoft notes that connecting to a server by IP address or by a CNAME alias causes a fallback from Kerberos to NTLM. NTLM exposes hashes to relay, offline cracking and pass-the-hash, so the SMB programme should push towards Kerberos by name.
- SMB client NTLM blocking: on Windows Server 2025 and Windows 11 24H2 and later, enable Computer Configuration > Administrative Templates > Network > Lanman Workstation > "Block NTLM (LM, NTLM, NTLMv2)". List genuine exceptions, such as non-domain servers, in "Block NTLM Server Exception List" by IP, NetBIOS name or FQDN. Per mapping,
NET USE \\server\share /BLOCKNTLMorNew-SmbMapping -BlockNTLM $true. Microsoft positions this as a step that can be taken without disabling NTLM domain-wide. Earlier versions need NTLM restricted through general Group Policy instead; see the NTLM Deprecation and Elimination Guide. - Authentication rate limiter: enabled by default on the same builds, it inserts 2,000 ms between failed NTLM or PKU2U attempts. Microsoft's worked example: a brute force of 90,000 guesses that would take five minutes without the delay takes about 50 hours with it. Configure with
Set-SmbServerConfiguration -InvalidAuthenticationDelayTimeInMs(0 to 10,000, multiples of 100; 0 disables). It does not affect domain Kerberos. - Use names, not addresses: fix mapped drives, scripts and application connection strings that use \\10.x.x.x paths or CNAMEs without matching SPNs, because each one is an NTLM dependency.
- Disable the legacy name protocols: LLMNR and NetBIOS over TCP/IP are the usual poisoning vectors for T1557.001. Signing removes the relay payoff, but removing the poisoning surface removes the hash capture too.
Network exposure and firewall design
The strongest SMB control is not letting unnecessary hosts talk SMB at all. Microsoft's own guidance on securing SMB traffic is specific.
- Internet edge: block TCP 445 inbound from the internet and outbound to the internet at the corporate firewall. The documented exceptions are cloud file services such as Azure Files, where outbound should be restricted to the published service IP ranges, ideally over a VPN.
- Inventory who needs inbound SMB: file servers and domain controllers do; most workstations do not. Enable the audit policy Object Access > File Share to generate event 5140 and learn which clients reach which shares.
- Workstation to workstation: block inbound 445 on client endpoints with Windows Defender Firewall, and disable the Server (LanmanServer) service where no application needs it, using Group Policy Preferences.
- Allow-if-secure for servers: Microsoft describes outbound rules that allow SMB only to listed domain controllers and file servers, backed by a connection security rule (Isolation, request authentication inbound and outbound, Computer and User Kerberos V5). Test carefully: a wrong rule cuts users off from their data. See the IPsec Security Guide for stronger IPsec options than null encapsulation.
- Roaming devices: apply stricter outbound rules on the Public profile, because laptops on hotel and home networks are where forced authentication is easiest.
- NetBIOS ports: from Windows 11 24H2 and Windows Server 2025 the built-in File and Printer Sharing rules no longer open inbound 137 to 139, which only SMB1 needed. Do not add them back unless a documented legacy dependency exists.
For the segmentation model these rules sit in, see the Network Segmentation Guide; for the full port reference see the Network Ports and Protocols Security Guide.
SMB over QUIC for remote file access
SMB over QUIC replaces the TCP transport with QUIC on UDP 443, with the handshake authenticated by TLS 1.3 and all SMB traffic, including authentication, inside the encrypted tunnel. Microsoft describes it as an "SMB VPN" for remote users. It is off by default and the client cannot force a server to enable it.
| Aspect | Detail from Microsoft documentation |
|---|---|
| Availability | Windows Server 2025 (all editions), Windows Server 2022 Datacenter: Azure Edition, Windows 11 clients |
| Certificate | CA-issued, Server Authentication EKU (1.3.6.1.5.5.7.3.1), SHA-256 or stronger, ECDSA P-256 or RSA 2048 bit minimum, SAN DNS entry per name used; no IP addresses in the SAN because that forces NTLM |
| Authentication | NTLMv2 inside the tunnel by default; KDC Proxy over HTTPS 443 recommended so Kerberos can be used without direct DC access |
| Client access control | Allow and block lists, with clients presenting their own certificate (Windows Server 2025) |
| Client behaviour | Tries TCP first, then QUIC, unless /TRANSPORT:QUIC or -TransportType QUIC is specified |
| Disable | Set-SmbServerConfiguration -EnableSMBQUIC $false; client Set-SmbClientConfiguration -EnableSMBQUIC $false |
Decision guidance: choose SMB over QUIC where remote users need a small number of file servers and you want to avoid a full network VPN; keep a VPN or a zero trust access broker where users need many internal services. Either way, never publish TCP 445. Certificate renewal changes the thumbprint, so the mapping (Set-SmbServerCertificateMapping) must be updated, which belongs in the certificate lifecycle runbook. See the Secure Remote Access Beyond VPN Guide.
Where identity fits
Much SMB traffic is machine to machine: backup agents, scanners writing to share folders, application servers reading configuration shares and service accounts running scheduled jobs. These non-human identities are where NTLM dependencies, IP-based paths and over-broad share permissions hide. Map each service account to the shares it touches (event 5140 gives this), move it to a group managed service account where possible so the password is long and rotated automatically, and remove share permissions it does not need. See the Windows Services and Service Account Security Guide.
Phased rollout and rollback
- Phase 0, baseline (weeks 1 to 2): enable SMBv1 auditing, signing and encryption capability auditing, and File Share auditing on servers; collect into the SIEM. Inventory SMB-dependent devices.
- Phase 1, edge and workstations (weeks 2 to 4): confirm TCP 445 is blocked at the internet edge both ways; block inbound 445 on workstations in a pilot ring (IT first, as Microsoft suggests), then department by department.
- Phase 2, SMBv1 (weeks 4 to 8): disable the SMB1 server component on servers with no event 3000 hits; replace or isolate devices that do generate them; then remove the feature.
- Phase 3, signing (weeks 6 to 12): on pre-24H2 builds, require signing on servers first for a pilot set of shares, then clients. New 24H2 and Server 2025 builds already enforce it; track exceptions as risk acceptances with an expiry.
- Phase 4, authentication: enable SMB NTLM blocking on 24H2 clients with an exception list, fix IP and CNAME paths, and disable LLMNR and NetBIOS name resolution.
- Phase 5, encryption and dialect floor: encrypt shares holding sensitive data and set a minimum dialect where all clients are SMB 3.x.
Rollback: every step is a single setting (GPO, registry value or Set-SmbServerConfiguration parameter), so record the prior value in the change ticket. Prefer scoped exceptions (the NTLM exception list, a separate GPO for a device VLAN) over reverting the estate-wide control. Re-enabling SMBv1 should require a security sign-off and a dated removal plan.
Small versus large organisations: a small organisation on current Windows builds may need little more than confirming the defaults, blocking 445 at the router and replacing one old NAS. A large estate needs the audit-first approach above, an exceptions register and per-segment rules, because the long tail of appliances is where breakage happens.
Detection and measurement
| Signal | Source | Use |
|---|---|---|
| Event 3000 | Microsoft-Windows-SMBServer/Audit | SMBv1 connection attempt; names the client |
| Events 3021, 3022 | Microsoft-Windows-SMBServer/Audit | Clients that do not support signing or encryption |
| Events 31998, 31999 | Microsoft-Windows-SMBClient/Audit | Servers that do not support signing or encryption |
| Event 1003 | Microsoft-Windows-SmbServer/Operational | Non-SMB 3.x client denied an encrypted share |
| Event 1005 | Microsoft-Windows-SmbServer/Operational | Pre-authentication integrity failure, possible downgrade or tampering |
| Event 5140 | Security log, File Share audit policy | Who accessed which share; baseline admin share use (ADMIN$, C$) and alert on new sources |
| Firewall logs on 445 | Perimeter and internal firewalls | Any outbound 445 to the internet, workstation to workstation 445 |
Metrics:
- Percentage of Windows hosts with the SMB1Protocol feature removed (target 100 percent, exceptions isolated).
- Count of distinct clients generating event 3000 per month (trend to zero).
- Percentage of servers and clients requiring signing, from configuration reporting.
- Number of open SMB exceptions (NTLM, signing, SMBv1) past their expiry date.
- Outbound TCP 445 connection attempts to the internet blocked per week (should be low and investigated).
- Number of workstations reachable on inbound 445 from other workstations, from internal scanning.
Common failure patterns
- Setting EnableSecuritySignature and assuming signing is on: it only affects SMB1. Without RequireSecuritySignature on at least one side, relay remains possible on older builds.
- Removing SMBv1 from servers but leaving it on clients and appliances: the vulnerable component moves rather than disappears. Inventory both features and non-Windows devices.
- Granting permanent exceptions: a NAS that cannot sign gets an exception, the exception becomes a GPO for a whole OU, and the control is effectively off. Exceptions need an owner, a scope and an expiry.
- IP-based paths in scripts and backup jobs: these silently force NTLM and break when NTLM blocking arrives. Search scripts and scheduled tasks for \\ followed by an address.
- Publishing 445 for remote staff or partners: exposed SMB attracts exploitation and forced-authentication abuse. Use SMB over QUIC, a VPN or an access broker instead.
- Flat workstation networks: with inbound 445 open between all clients, one compromised laptop with admin credentials can reach every other, which is how ransomware spreads through admin shares.
Framework mapping
| Framework | Reference | How SMB hardening supports it |
|---|---|---|
| NIST CSF 2.0 | PR.PS-01, PR.DS-02, PR.AA-03 | Configuration baselines, protecting data in transit, authenticating users and services |
| NIST SP 800-53 Rev. 5 | CM-7 Least Functionality; SC-8 Transmission Confidentiality and Integrity; SC-23 Session Authenticity; AC-17 Remote Access | SMBv1 and Server service removal; signing and encryption; QUIC or VPN for remote access |
| CIS Controls v8.1 | Control 4 Secure Configuration of Enterprise Assets and Software; Control 12 Network Infrastructure Management; Control 13 Network Monitoring and Defense | Baselines, port filtering, SMB audit logging |
| ISO/IEC 27001:2022 Annex A | A.8.9 Configuration management; A.8.20 Networks security | Documented SMB configuration standard and network controls |
| MITRE ATT&CK v20 | T1021.002, T1557.001, T1187, T1210, T1550.002, T1570 | Threat coverage for detection engineering |
Practitioner checklist
- Confirm TCP 445 is blocked inbound from and outbound to the internet at every edge, with documented cloud exceptions only.
- Enable SMBv1 access auditing, collect event 3000 for a full business cycle, then remove the SMB1Protocol feature.
- Require signing on clients and servers (RequireSecuritySignature = 1) on all builds older than Windows 11 24H2 and Server 2025.
- Run signing and encryption capability auditing (events 3021, 3022, 31998, 31999) and register every exception with an owner and expiry.
- Enable SMB client NTLM blocking on 24H2 and later with a minimal exception list; fix IP and CNAME based paths.
- Keep the authentication rate limiter at its default or higher on Windows Server 2025 and Windows 11 24H2.
- Block inbound 445 between workstations and disable the Server service where it is not needed.
- Encrypt shares that hold sensitive data and set a minimum dialect where every client supports SMB 3.x.
- Use SMB over QUIC with a CA-issued certificate, KDC Proxy and client access control instead of exposing 445 for remote users.
- Alert on new sources of ADMIN$ and C$ access (event 5140) and on any event 1005.
Standards and references
- Microsoft Learn: SMB security hardening
- Microsoft Learn: Overview of SMB signing
- Microsoft Learn: SMB security enhancements
- Microsoft Learn: How to detect, enable and disable SMBv1, SMBv2 and SMBv3
- Microsoft Learn: Secure SMB traffic in Windows Server
- Microsoft Learn: Block NTLM connections on SMB
- Microsoft Learn: SMB over QUIC
- MITRE ATT&CK: Name Resolution Poisoning and SMB Relay
Related NHI Mgmt Group resources: SMB Signing Guide · NTLM Relay Guide · NTLM Deprecation and Elimination Guide · Windows Server Hardening Guide · Lateral Movement Guide