Preventing SMB traffic from lateral connections and entering or leaving the network (2024)

Summary

Server Message Block (SMB) is a network file sharing and data fabric protocol. SMB is used by billions of devices in a diverse set of operating systems, including Windows, MacOS, iOS, Linux, and Android. Clients use SMB to access data on servers. Thisallows sharing of files, centralized data management, and lowered storage capacity needs for mobile devices. Servers also use SMB as part of the Software-defined Data Center for workloads such as clustering and replication.

Because SMB is a remote file system, it requires protection from attacks inwhich a Windows computer might be tricked into contacting a malicious server that's running inside a trusted network or to a remote server outside the network perimeter. Firewall best practices and configurations can enhance security and preventmalicious traffic from leaving the computer or its network.

Effect of changes

Blocking connectivity to SMB mightprevent various applications or services from functioning. For a list of Windows and Windows Server applications and services that may stop functioning in this situation, seeService overview and network port requirements for Windows

More information

Perimeter firewall approaches

Perimeter hardware and appliance firewalls that are positioned at the edge of the network should block unsolicited communication (from the internet) and outgoing traffic (to the internet) to the following ports.

Application protocol

Protocol

Port

SMB

TCP

445

NetBIOS Name Resolution

UDP

137

NetBIOS Datagram Service

UDP

138

NetBIOS Session Service

TCP

139


It is unlikely that any SMB communication originating from the internet or destined for the internet is legitimate. The primary case might be for a cloud-based server or service such as Azure Files. You should create IP address-based restrictions in your perimeter firewall to allow only those specific endpoints. Organizations can allow port 445 access to specific Azure Datacenter and O365 IP ranges to enable hybrid scenarios in which on-premises clients (behind an enterprise firewall) use the SMB port to talk to Azure file storage. You should also allow only SMB 3.x traffic and require SMB AES-128 encryption. See the "References" sectionfor more information.

NoteThe use of NetBIOS for SMB transport ended in Windows Vista, Windows Server 2008, and in all later Microsoft operating systems when Microsoft introduced SMB 2.02. However, you may have software and devices other than Windows in your environment. You should disable and remove SMB1 if you have not already done so because it still uses NetBIOS. Later versions of Windows Server and Windows no longer install SMB1 by default and will automatically remove it if allowed.

Windows Defender firewall approaches

All supported versions of Windows and Windows Server include the Windows Defender Firewall (previously named the Windows Firewall). This firewall provides additional protection for devices, especially when devices move outside a network or when they runwithin one.

The Windows Defender Firewall has distinct profiles for certain types of networks: Domain, Private, and Guest/Public. The Guest/Public network typically gets much more restrictive settings by default than the more trustworthy Domain or Private networks. You may find yourself having different SMB restrictions for these networks based on your threat assessment versus operational needs.

Inbound connections to a computer

For Windows clients and servers that do not host SMB shares, you can block all inbound SMB traffic by using the Windows Defender Firewall to prevent remote connections from malicious or compromised devices. In the Windows Defender Firewall, this includes the following inbound rules.

Name

Profile

Enabled

File and Printer Sharing (SMB-In)

All

No

Netlogon Service (NP-In)

All

No

Remote Event Log Management (NP-In)

All

No

Remote Service Management (NP-In)

All

No


You should also create a new blocking rule to override any other inbound firewall rules. Use the following suggested settings for any Windows clients or servers that do not host SMB Shares:

You must not globally block inbound SMB traffic to domain controllers or file servers. However, you canrestrict access to them from trusted IP ranges and devices to lower their attack surface. They should also be restricted to Domain or Private firewall profiles and not allow Guest/Public traffic.

NoteThe Windows Firewall has blocked all inbound SMB communications by default since Windows XP SP2 and Windows Server 2003 SP1. Windows devices will allow inbound SMB communication only if an administrator createsan SMB share or altersthe firewall default settings. You should not trust the default out-of-box experience to still be in-place on devices, regardless. Always verify and actively manage the settings and their desired state by using Group Policy or other management tools.

For more information, seeDesigning a Windows Defender Firewall with Advanced Security Strategy and Windows Defender Firewall with Advanced Security Deployment Guide

Outbound connections from a computer

Windows clients and servers require outbound SMB connections in order to apply group policy from domain controllers and for users and applications to access data on file servers, so care must be taken when creating firewall rules to prevent malicious lateral or internet connections. By default, there are no outbound blocks on a Windows client or server connecting to SMB shares, so you will have to create new blocking rules.

You should also create a new blocking rule to override any other inbound firewall rules.Use the following suggested settings for any Windows clients or servers that do not host SMB Shares.

Guest/Public (untrusted) networks

  • Name: Block outbound Guest/Public SMB 445

  • Description: Blocksall outbound SMB TCP 445 traffic when on an untrusted network

  • Action: Block the connection

  • Programs: All

  • Remote Computers: Any

  • Protocol Type: TCP

  • Local Port: Any

  • Remote Port: 445

  • Profiles: Guest/Public

  • Scope (Local IP Address): Any

  • Scope (Remote IP Address): Any

  • Edge Traversal: Block edge traversal

Note Small office and home office users, or mobile users who work in corporate trusted networks and then connect to their home networks, should use caution before they block the public outbound network. Doing this may prevent access to their local NAS devices or certain printers.

Private/Domain (trusted) networks

  • Name: Allow outbound Domain/Private SMB 445

  • Description: Allowsoutbound SMB TCP 445 traffic to only DCs and file servers when on a trusted network

  • Action: Allow the connection if it is secure

  • Customize Allow if Secure Settings: pick one of the options, set Override block rules = ON

  • Programs: All

  • Protocol Type: TCP

  • Local Port: Any

  • Remote Port: 445

  • Profiles: Private/Domain

  • Scope (Local IP Address): Any

  • Scope (Remote IP Address): <list of domain controller and file server IP addresses>

  • Edge Traversal: Block edge traversal

NoteYou can also use the Remote Computers instead of Scope remote IP addresses, if the secured connection uses authentication that carries the computer’s identity. Review the Defender Firewall documentation for more information about“Allow the connection if is secure” and the Remote Computer options.

  • Name: Block outbound Domain/Private SMB 445

  • Description: Blocks outbound SMB TCP 445 traffic. Override by usingthe “Allow outbound Domain/Private SMB 445” rule

  • Action: Block the connection

  • Programs: All

  • Remote Computers: N/A

  • Protocol Type: TCP

  • Local Port: Any

  • Remote Port: 445

  • Profiles: Private/Domain

  • Scope (Local IP Address): Any

  • Scope (Remote IP Address): N/A

  • Edge Traversal: Block edge traversal

You must not globally block outbound SMB traffic from computers to domain controllers or file servers. However, you canrestrict access to them from trusted IP ranges and devices to lower their attack surface.

For more information, seeDesigning a Windows Defender Firewall with Advanced Security Strategy and Windows Defender Firewall with Advanced Security Deployment Guide

Security connection rules

You must use a security connection ruleto implementthe outbound firewall rule exceptions for the "Allow the connection if it is secure" and "Allow the connection to use null encapsulation" settings. If you do not set thisruleon all Windows-based and Windows Server-based computers, authentication will fail, and SMB will be blocked outbound.

For example, the following settings are required:

  • Rule type: Isolation

  • Requirements: Request authentication for inbound and outbound connections

  • Authentication method: Computer and user (Kerberos V5)

  • Profile:Domain, Private, Public

  • Name: Isolation ESP Authentication for SMB overrides

For more information about security connection rules, see the following articles:

  • Designing a Windows Defender Firewall with Advanced Security Strategy

  • Checklist: Configuring Rules for an Isolated Server Zone

Windows Workstation and Server Service

For consumer or highly isolated, managed computers that do not require SMB at all, you can disable the Server or Workstation services. You can do this manually by using the “Services” snap-in (Services.msc) and the PowerShell Set-Service cmdlet, or by using Group Policy Preferences. When you stop and disable these services, SMB can no longer make outbound connections or receive inbound connections.

You must not disable the Server service on domain controllers or file servers or no clients will be able to apply group policy or connect to their data anymore. You must not disable the Workstation service on computers that are members of an Active Directory domain or they will no longer apply group policy.

References

Designing a Windows Defender Firewall with Advanced Security Strategy
Windows Defender Firewall with Advanced Security Deployment Guide
Azure remote apps
Azure datacenter IP addresses
Microsoft O365 IP addresses

Preventing SMB traffic from lateral connections and entering or leaving the network (2024)

FAQs

How to block SMB traffic? ›

You can do this manually by using the “Services” snap-in (Services. msc) and the PowerShell Set-Service cmdlet, or by using Group Policy Preferences. When you stop and disable these services, SMB can no longer make outbound connections or receive inbound connections.

How do I secure SMB traffic? ›

Securing SMB protocols is most important for network security.
  1. Update SMB: Use the latest SMB version for security features.
  2. Encrypt SMB: Enable SMB encryption for data protection.
  3. Strong Authentication: Use robust authentication methods.
  4. Firewall Rules: Restrict SMB access via firewalls to trusted IPs.
Sep 29, 2023

Should I block SMB? ›

Blocking outbound SMB traffic prevents devices inside your network from sending data using SMB to the internet. It is unlikely you need to allow any outbound SMB using TCP port 445 to the internet unless you require it as part of a public cloud offering.

What is SMB lateral movement? ›

Lateral movement in cyber security refers to the tactics, techniques, and procedures that cyber adversaries use to progress through a network, as they seek to access and exploit valuable resources.

How do I stop SMB? ›

Step 1: Open control panel Step 2: Navigate to programs and features. Step 3: Click on "Turn Windows features on or off. Step 4: Disable "(Server Message Block) SMB v1"Step 5 : Click ok.

What is SMB network traffic? ›

Server Message Block (SMB) enables file sharing, printer sharing, network browsing, and inter-process communication (through named pipes) over a computer network. SMB serves as the basis for Microsoft's Distributed File System implementation. SMB relies on the TCP and IP protocols for transport.

How can we mitigate SMB vulnerability? ›

There are several direct mitigations for securing SMB, many of which are low or no cost to an organization: Update and Patch Against SMB Vulnerabilities. Block SMB at the Network Level. Restrict and Protect SMB at the Host Level.

What is SMB protection? ›

SMB Encryption provides SMB data end-to-end encryption and protects data from eavesdropping occurrences on untrusted networks. You can deploy SMB Encryption with minimal effort, but it might require other costs for specialized hardware or software.

What are the possible ways of securing network traffic? ›

Consider these simple means of computer network security:
  • Password and access control. Reliance on strong passwords and multi-factor authentication to access devices and accounts.
  • Firewall deployment. ...
  • Regular software updates and patch management. ...
  • Securing Wi-Fi networks. ...
  • Use of VPNs.

How do I know if my SMB is being used? ›

SMB1 - Audit Active Usage using Message Analyzer

I would check on your servers , if they have got it then turn it off. Give it about 10 mins or so , then you will find out what devices are using it. I usually check the active SMB sessions on the servers to try and determine what might be affected.

Should you disable SMB? ›

SMBv1 should be disabled on all systems that do not have a business justification to warrant continued use. For instructions, see: How to detect, enable and disable SMBv1, SMBv2, and SMBv3 in Windows.

What is more secure than SMB? ›

So SFTP is far more secure overall thanks to its use of SSH encryption. SMB versions earlier than 3.0 lack encryption by design but can be secured by layering the proper tools.

What is the 1 10 60 rule? ›

When an attack is in progress, you have on average of one minute to detect it, 10 minutes to understand it and one hour to contain it.

What are lateral movement techniques? ›

Common Lateral Movement Techniques
  • Keyloggers. ...
  • Pass-the-Hash (PtH) Attacks. ...
  • Pass-the-Ticket (PtT) Attacks (Gold and Silver Tickets) ...
  • Kerberoasting. ...
  • Remote Desktop Protocol (RDP) ...
  • Server Message Block (SMB) and Windows Management Instrumentation (WMI) ...
  • SSH Hijacking. ...
  • Living off the Land (LotL)

How do you identify lateral movement? ›

Principally, users logging in at strange times or after hours, or multiple logins on a single device may be indicators of lateral movement. Identify port scans and abnormal network protocols. Hackers perform port scans as part of their reconnaissance, but these scans can be detected by intrusion detection systems.

Can you encrypt SMB traffic? ›

You can deploy SMB Encryption with minimal effort, but it might require other costs for specialized hardware or software. It has no requirements for Internet Protocol security (IPsec) or WAN accelerators. SMB Encryption can be configured on a per share basis, for the entire file server, or when mapping drives.

Do ISPS block SMB? ›

There are good technical reasons why an ISP would seek to block port 445 - realtime tracking shows that SMB based attacks are one of the primary vectors of malware and ransomware attacks.

How do I enable SMB firewall? ›

To add a firewall rule to allow TCP/445 (SMB/CIFS) and TCP/135 (RPC): Go to Computer Configuration > Policies > Windows Settings > Security Settings > Windows Firewall with Advanced Security > Windows Firewall with Advanced Security - LDAP > Inbound Rules. Right-click and choose New Rule. Choose Port and click Next.

Can I disable SMB direct? ›

Disabling and enabling SMB Direct features

As SMB Direct is enabled by default, once disabled, it needs to be manually re-enabled whenever needed. Typically, you won't need to disable SMB Direct, however, you can disable it along with its features, by running the following Windows PowerShell commands.

Top Articles
What Are the Average ETF Fees?
Surprise! Here's the Average Net Worth for Americans in Your Age Group | The Motley Fool
Maxtrack Live
His Lost Lycan Luna Chapter 5
Google Sites Classroom 6X
Acts 16 Nkjv
35105N Sap 5 50 W Nit
Unlocking the Enigmatic Tonicamille: A Journey from Small Town to Social Media Stardom
2022 Apple Trade P36
Unraveling The Mystery: Does Breckie Hill Have A Boyfriend?
Waive Upgrade Fee
Jet Ski Rental Conneaut Lake Pa
Theycallmemissblue
Sivir Urf Runes
Telegram Scat
Justified Official Series Trailer
Chastity Brainwash
Costco Gas Foster City
Gemita Alvarez Desnuda
Rondom Ajax: ME grijpt in tijdens protest Ajax-fans bij hoofdbureau politie
We Discovered the Best Snow Cone Makers for Carnival-Worthy Desserts
eHerkenning (eID) | KPN Zakelijk
Dwc Qme Database
Understanding Gestalt Principles: Definition and Examples
Haunted Mansion Showtimes Near Epic Theatres Of West Volusia
The Creator Showtimes Near R/C Gateway Theater 8
Delectable Birthday Dyes
The 15 Best Sites to Watch Movies for Free (Legally!)
Dexter Gomovies
Meggen Nut
Kleinerer: in Sinntal | markt.de
Nurtsug
Martin Village Stm 16 & Imax
Kstate Qualtrics
One Credit Songs On Touchtunes 2022
Tamil Play.com
Cox Outage in Bentonville, Arkansas
What Is Kik and Why Do Teenagers Love It?
Linda Sublette Actress
All-New Webkinz FAQ | WKN: Webkinz Newz
Doublelist Paducah Ky
Here's Everything You Need to Know About Baby Ariel
How to Install JDownloader 2 on Your Synology NAS
Sara Carter Fox News Photos
New Starfield Deep-Dive Reveals How Shattered Space DLC Will Finally Fix The Game's Biggest Combat Flaw
Das schönste Comeback des Jahres: Warum die Vengaboys nie wieder gehen dürfen
Unpleasant Realities Nyt
Kenmore Coldspot Model 106 Light Bulb Replacement
Chitterlings (Chitlins)
683 Job Calls
Bob Wright Yukon Accident
Latest Posts
Article information

Author: Tuan Roob DDS

Last Updated:

Views: 6071

Rating: 4.1 / 5 (62 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Tuan Roob DDS

Birthday: 1999-11-20

Address: Suite 592 642 Pfannerstill Island, South Keila, LA 74970-3076

Phone: +9617721773649

Job: Marketing Producer

Hobby: Skydiving, Flag Football, Knitting, Running, Lego building, Hunting, Juggling

Introduction: My name is Tuan Roob DDS, I am a friendly, good, energetic, faithful, fantastic, gentle, enchanting person who loves writing and wants to share my knowledge and understanding with you.