Stop NTLM hash leaks: block outbound SMB (445/139) to the internet with Windows Firewall
Windows is helpful in a dangerous way: when something points it to a file path on another computer, it tries to sign in there automatically – with the user's NTLM credentials. If that "other computer" is an attacker's server on the internet, the attacker receives a hash they can crack or relay. The patch fixes each individual trick. One outbound firewall rule closes the road that most of them use.
- What: Microsoft Outlook Spoofing Vulnerability, CVSS 6.5, rated Moderate. Per Microsoft, a specially crafted message file opened in Outlook can make Outlook connect to an attacker-controlled network location without the usual external-content warning, disclosing the user's NTLMv2 hash. The Preview Pane is not an attack vector – the user has to open the file.
- Exploited: yes, Microsoft marks it "Exploitation Detected". CISA added it to the Known Exploited Vulnerabilities catalog on 10 November 2026, remediation due 24 November 2026 for US federal agencies.
- Fix: released on Patch Tuesday, 10 November 2026, in the Office updates (Microsoft 365 Apps for Enterprise, Office LTSC 2021 and 2024) – not in the Windows cumulative update. A PC with this month's Windows update can still be exposed if Office has not updated.
- Sources: Microsoft Security Update Guide · CISA KEV catalog
- Patch first – Windows and Office. That is the real fix for each bug.
- Block outbound TCP 445 and 139 to public addresses with Windows Firewall, on every PC and Server – especially laptops that leave the office.
- Roll it out by Group Policy (or Intune), and keep your own networks, VPN and Azure Files in mind.
- Restrict outgoing NTLM (audit first), use SMB signing and EPA against relaying, and put admins in Protected Users.
- Test it:
Test-NetConnectionto a public host on port 445 must fail.
1. Why Windows sends hashes to strangers
When Windows opens a UNC path such as \\203.0.113.7\share\x.png, the SMB client connects to TCP port 445 of that address and, if the server asks, authenticates with the signed-in user's credentials using NTLM. The attacker's server does not need a valid share. It only needs to ask for authentication and record the answer: a NetNTLMv2 challenge-response. The attacker can then:
- crack it offline – weak and medium passwords fall quickly, or
- relay it in real time to another service that accepts NTLM (a file Server without SMB signing, LDAP, a web application without Extended Protection) and act as that user.
The trick is always the same: get Windows to touch a remote path without the user noticing. Known ways include:
- Outlook: crafted messages, meeting reminders or message files that reference a remote path (CVE-2023-23397 in 2023, CVE-2026-124194 now).
- Explorer: just browsing a folder or extracting an archive that contains a
.url,.lnk,.library-msor.searchConnector-msfile whose icon or target points to\\attacker\.... Windows fetches the icon – and authenticates. - Office documents and other files that load a template, image or link from a UNC path.
New variants appear every few months. Patching closes each one after it is known; an outbound block works against the ones that are not known yet, as long as they go over SMB.
2. The patch is the primary fix
- Install the Windows cumulative update and the Office update every month. For Microsoft 365 Apps, check File › Office Account › Update Options › Update Now; managed fleets: check your update channel and deadline.
- A firewall rule does not replace the patch: a bug may use another protocol (for example WebDAV over HTTP) or a server inside your network.
3. Block outbound SMB to the internet with Windows Firewall
SMB to the internet is almost never needed. Microsoft itself recommends blocking outbound TCP 445 to the internet (Secure SMB traffic in Windows Server). Your company firewall may already do this at the edge – but a laptop in a hotel, at home or on a phone hotspot is not behind it. So the rule belongs on every computer.
The important detail: in Windows Firewall, a block rule always wins over an allow rule (Microsoft: rule precedence). You cannot write "block 445 to everything" plus "allow 445 to the LAN" – the block would win and break your own file shares. Instead, the block rule must list only public addresses, leaving out the private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), loopback, link-local and 100.64.0.0/10 (carrier-grade NAT, also used by some VPNs).
PowerShell (Windows 8 / Server 2012 and later)
In PowerShell as administrator:
$public = @(
'1.0.0.0-9.255.255.255',
'11.0.0.0-100.63.255.255',
'100.128.0.0-126.255.255.255',
'128.0.0.0-169.253.255.255',
'169.255.0.0-172.15.255.255',
'172.32.0.0-192.167.255.255',
'192.169.0.0-223.255.255.255',
'2000::/3'
)
New-NetFirewallRule -DisplayName 'Block SMB to the internet (TCP 445, 139)' `
-Direction Outbound -Action Block -Protocol TCP -RemotePort 445,139 `
-RemoteAddress $public -Profile Any `
-Description 'Stops NTLM hash leaks to SMB servers on the internet. LAN, VPN and private ranges are not affected.'
The IPv4 ranges are everything from 1.0.0.0 to 223.255.255.255 except the private, loopback, link-local and carrier-grade NAT ranges. 2000::/3 is all global IPv6 unicast; IPv6 link-local (fe80::/10) and unique local addresses (fc00::/7) stay open.
Why not -RemoteAddress Internet? The keyword exists, but what it matches depends on how the computer's network isolation (intranet ranges) is configured, so the result is hard to predict. Explicit ranges do exactly what they say.
netsh (any Windows version, including Windows 7 / Server 2008 R2)
One line in an administrator command prompt:
netsh advfirewall firewall add rule name="Block SMB to the internet (TCP 445, 139)" dir=out action=block protocol=TCP remoteport=445,139 profile=any remoteip=1.0.0.0-9.255.255.255,11.0.0.0-100.63.255.255,100.128.0.0-126.255.255.255,128.0.0.0-169.253.255.255,169.255.0.0-172.15.255.255,172.32.0.0-192.167.255.255,192.169.0.0-223.255.255.255,2000::/3
Check it: netsh advfirewall firewall show rule name="Block SMB to the internet (TCP 445, 139)". Remove it again: netsh advfirewall firewall delete rule name="Block SMB to the internet (TCP 445, 139)".
Click by click (wf.msc)
- Press Windows+R, type
wf.msc, Enter. Select Outbound Rules › New Rule. - Custom › All programs › Protocol TCP, Remote port Specific Ports: 445, 139.
- Scope: Which remote IP addresses › These IP addresses › add each range from the list above (This IP address range).
- Block the connection › all three profiles › give it a clear name.
4. Roll it out with Group Policy
- In Group Policy Management, create a GPO (e.g. Firewall - Block outbound SMB to internet) and link it to the OUs with your PCs and Servers.
- Edit it: Computer Configuration › Policies › Windows Settings › Security Settings › Windows Defender Firewall with Advanced Security › Windows Defender Firewall with Advanced Security › Outbound Rules, and create the rule exactly as in the click-by-click steps.
- Or write the rule straight into the GPO from PowerShell, using the
$publiclist from above:New-NetFirewallRule -PolicyStore 'corp.example.com\Firewall - Block outbound SMB to internet' ` -DisplayName 'Block SMB to the internet (TCP 445, 139)' -Direction Outbound -Action Block ` -Protocol TCP -RemotePort 445,139 -RemoteAddress $public -Profile Any - Test on a pilot group (your IT team's laptops first), then widen. With Intune, the same rule goes into an Endpoint security › Firewall rules policy.
5. Restrict NTLM itself – and make stolen hashes less useful
The firewall rule stops hashes going to the internet over SMB. These settings go further:
- Network security: Restrict NTLM: Outgoing NTLM traffic to remote servers (Computer Configuration › Windows Settings › Security Settings › Local Policies › Security Options). Values: Allow all, Audit all, Deny all. Start with Audit all and read Applications and Services Logs › Microsoft › Windows › NTLM › Operational for a few weeks: every Server that still receives NTLM from this computer shows up there. Then switch to Deny all and list the Servers that still need NTLM in Restrict NTLM: Add remote server exceptions for NTLM authentication. Deny all also covers NTLM over other protocols (for example WebDAV over HTTP), which a port block does not. Careful: shares opened by IP address (
\\10.0.0.5\share) use NTLM, not Kerberos. (Microsoft documentation) - SMB client NTLM blocking (Windows 11 24H2 and Windows Server 2025):
Set-SmbClientConfiguration -BlockNTLM $true, or the Group Policy Network › Lanman Workstation › Block NTLM (LM, NTLM, NTLMv2), with an exception list for Servers that are not in your domain. The SMB client then refuses NTLM over SMB altogether. (Microsoft documentation) - SMB signing required on file Servers and domain controllers. It does not stop a hash from leaking, but it stops the hash from being relayed to your SMB Servers. Windows 11 24H2 and Windows Server 2025 require signing by default; older versions need it set by policy (Microsoft Security Baseline).
- Extended Protection for Authentication (EPA) and LDAP signing / channel binding on web services (IIS, Exchange, certificate enrollment) and domain controllers, so a relayed hash cannot be used there either.
- Protected Users group for administrators: its members cannot authenticate with NTLM at all.
- Long passwords: a leaked NetNTLMv2 hash of a long, unique password is practically uncrackable.
- If nobody uses WebDAV, consider disabling the WebClient service: it is how Windows reaches remote paths over HTTP when SMB is blocked.
6. Check that it works
- Confirm the rule is active:
Get-NetFirewallRule -DisplayName 'Block SMB to the internet*' | Select-Object DisplayName, Enabled, Direction, Action, PrimaryStatus - Try to reach a public host on port 445. A public test service that answers on any port (for example
portquiz.net) works:
Expected with the rule:Test-NetConnection -ComputerName portquiz.net -Port 445TcpTestSucceeded : False. For comparison,Test-NetConnection -ComputerName portquiz.net -Port 8080should beTrue– so the internet works, only SMB is stopped. - Note: many internet providers already block port 445, so False alone does not prove your rule did it. To be sure, switch on logging of dropped packets (
Set-NetFirewallProfile -All -LogBlocked True) and look for the address and port 445 in%windir%\System32\LogFiles\Firewall\pfirewall.log, or disable the rule for a moment and compare. - Then check what must keep working: your file shares, mapped drives, printers and domain logon in the office and over VPN.
7. Caveats: what can break
- VPN to a remote office: works as long as the office file Servers have private addresses. If a site uses public address space internally, add those exact ranges as exceptions by leaving them out of the block list – an allow rule would not override the block.
- Azure Files over SMB (port 445): blocked by this rule, by design. Microsoft recommends reaching Azure Files through a VPN or private endpoint (then it is a private address), or SMB over QUIC on UDP 443. If you must reach it directly, leave the storage account's address ranges out of the block list.
- Partners or hosting providers reached by SMB over the internet without VPN: this rule stops it – and it should, because that traffic is exactly what attackers want.
- SMB over QUIC (UDP 443) and WebDAV (TCP 80/443) are not covered by a TCP 445/139 rule. Use the NTLM restrictions in section 5 for those paths.
- Servers that must accept SMB from the internet are a different question (inbound) – and the answer is almost always: do not; see the Windows Server hardening checklist.
8. The same rule in Coinetic AI Security
Coinetic AI Security manages the built-in Windows Firewall – no driver, next to Defender or any EDR – and makes rules like this one easier to build and to keep:
- Port groups and IP groups: put 445 and 139 in a port group, and your own networks or file Servers in an IP group, and use them in rules instead of typing ranges into every rule.
- Right-click the live firewall log: on an SMB connection, choose Make a rule matching this packet or Edit the matching rule to see which rule decided it.
- Firewall change watch: every change another program makes to the firewall is reported with the program and the rule, so a removed or weakened block rule does not go unnoticed; a switched-off firewall is switched back on.
- Ask AI (Pro + AI): right-click a log line and ask what it means, e.g. “Did this PC try to reach port 445 on the internet this week, and which program was it?” – answered from this computer's own Coinetic data.
Download Coinetic AI Security, install, done. 30 days free with all features, no payment details. From $20 per computer per year.
More guides: all Coinetic guides.
Frequently asked
Is blocking outbound port 445 enough to stop NTLM hash leaks?
It stops the most common path – SMB to a server on the internet. It does not cover WebDAV over HTTP, SMB over QUIC or an attacker's machine inside your own network. Patch, block outbound SMB, and restrict outgoing NTLM together.
Will the rule break my mapped drives?
Not if your file Servers use private addresses (10.x, 172.16-31.x, 192.168.x) – directly or over VPN. Those ranges are left out of the block list.
Why also block port 139?
139 is SMB over NetBIOS. Modern Windows prefers 445, but can fall back to 139, so blocking both leaves no SMB path to the internet.
Do I still need the patch if I have the rule?
Yes. The patch removes the bug; the rule only blocks one way to exploit it. Each is a layer.
Coinetic AI Security - https://coinetic.io