CoCoineticBack to coinetic.io

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.

Why now: Outlook zero-day CVE-2026-124194 (November 2026)
  • 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
In short
  • 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-NetConnection to 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:

The trick is always the same: get Windows to touch a remote path without the user noticing. Known ways include:

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

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)

  1. Press Windows+R, type wf.msc, Enter. Select Outbound Rules › New Rule.
  2. Custom › All programs › Protocol TCP, Remote port Specific Ports: 445, 139.
  3. Scope: Which remote IP addresses › These IP addresses › add each range from the list above (This IP address range).
  4. Block the connection › all three profiles › give it a clear name.

4. Roll it out with Group Policy

  1. 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.
  2. 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.
  3. Or write the rule straight into the GPO from PowerShell, using the $public list 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
  4. 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:

6. Check that it works

  1. Confirm the rule is active:
    Get-NetFirewallRule -DisplayName 'Block SMB to the internet*' |
      Select-Object DisplayName, Enabled, Direction, Action, PrimaryStatus
  2. Try to reach a public host on port 445. A public test service that answers on any port (for example portquiz.net) works:
    Test-NetConnection -ComputerName portquiz.net -Port 445
    Expected with the rule: TcpTestSucceeded : False. For comparison, Test-NetConnection -ComputerName portquiz.net -Port 8080 should be True – so the internet works, only SMB is stopped.
  3. 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.
  4. 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

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:

Protect this Server or PC in 5 minutes

Download Coinetic AI Security, install, done. 30 days free with all features, no payment details. From $20 per computer per year.

Start the free 30-day trial →

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