How to defend against TCP port 445 and other SMB exploits | TechTarget (2024)

Answer

Keeping TCP port 445 and other SMB ports open is necessary for resource sharing, yet this can create an easy target for attackers without the proper protections in place.

When ports are being discussed, the focus most of the time is on the well-known web ports 80 and 443. But, as security admins know, many other Internet Assigned Numbers Authority ports are in use. One that got a lot of attention just a few years ago is port 445, which was exploited as part of the WannaCry and NotPetya ransomware attacks.

Let's look at what port 445 is, why it can pose risks to organizations, how to detect a port 445 attack and how security professionals can support file sharing without putting company assets and information at risk.

What is port 445 and what is it used for?

Port 445 is a traditional Microsoft networking port with tie-ins to the original NetBIOS service found in earlier versions of Windows OSes. Today, port 445 is used by Microsoft Directory Services for Active Directory (AD) and for the Server Message Block (SMB) protocol over TCP/IP.

SMB traffic is important to the functionality of a network not only because it enables resource sharing, including printers and files on the LAN, but also because it is important to the operation of AD. If you're in an office and printing to a printer on another floor, you're probably using SMB.

SMBv1 was introduced in 1984. It has been updated many times, with the most recent version, SMBv3.1.1, being released in 2020. Since resource sharing is one of the main reasons for networking, it's common for companies running Windows to have port 445 open and available on both clients, such as laptops, and servers.

Other ports

SMB is available directly over TCP (port 445) and over NetBIOS over TCP/IP (port 139). Other ports you may see connected with NetBIOS communications are port 137 (nbname) and port 138 (nbdatagram) over User Datagram Protocol. Microsoft Remote Procedure Call (RPC), used for client-server communication, requires an endpoint mapper that is accessible through port 135 or over SMB on port 445.

RPC and SMB exploit examples

For resource sharing and communication to work, ports must be open and accessible. This means they are open for legitimate resource sharing but also become open and always-on targets for attackers.

While RPC and SMB attacks are numerous, the most well-known example is EternalBlue (CVE-2017-0144). This is the vulnerability behind two of the most infamous ransomware attacks: WannaCry and NotPetya. Any system using the Windows SMBv1 protocol is vulnerable. In addition to Windows desktops and servers, some other equipment, such as medical devices, also use the protocol.

EternalBlue has been used both as the initial vector of attack and as a way to perform lateral movement after a network has been infiltrated. The exploit works when attackers send crafted packets to a system running SMBv1. By doing so, they can run code remotely on that system. In the case of WannaCry, attackers exploited the vulnerability by loading malware on the vulnerable target system and then spreading that malware via the same vulnerability to other systems on the network. EternalBlue was also used in the NotPetya attacks and as part of the TrickBot malware Trojan.

In addition to EternalBlue, SMBv1 is vulnerable to DDoS attacks, which can lead to system outages. Race condition issues, such as those in Eternal Champion, where an attacker overwrites the SMB session to execute commands as the privileged user, also plague SMBv1.

How to detect port 445 attacks

Most internet-facing systems get port-scanned every day. A port scan involves a series of messages sent to learn which computer network services a given computer provides. A port scan also identifies which ports and services are open or closed on an internet-connected device. Port scanning does not necessarily indicate an attack, but it is important to monitor for scans to detect any abnormal or suspicious behavior that may be trying to exploit the system. For example, multiple port scanning requests could indicate a brute-force attack attempt.

Monitor ports with tools or services that can detect changes in configuration. Also, stay up to date with the latest vulnerabilities and patches to ensure the most secure software versions are installed.

Many security technologies can detect whether port 445 -- or any port -- has been potentially exploited, including intrusion detection and prevention systems, SIEM systems, firewalls, and threat detection and response tools. Also, use antimalware to detect potential infections.

How to detect SMB vulnerabilities with penetration testing

Performing pen tests is another way security admins can test for SMB vulnerabilities and uncover any issues that must be addressed.

Most pen tests start with a port scan, which can indicate whether port 445 is available and, if it is, whether it's running a vulnerable implementation of SMBv1.

TCP port scanning is performed via network scanner tools, such as the popular and free Nmap scanner, as well as commercial scanners, such as NetScanTools Pro. Network vulnerability scanners, such as Nessus and Qualys, also incorporate TCP port scanning. Regardless of what tools a tester uses, TCP port scanning is an integral step in the vulnerability and pen testing process.

How to defend against TCP port 445 and other SMB exploits | TechTarget (2)

How to defend against port 445 exploits

The best way to improve security is to disable SMBv1 and patch to the latest version of SMB. The vulnerabilities discussed above affect SMBv1; using later, nonvulnerable versions of SMB prevents SMBv1-dependent attacks. Note that Microsoft disabled SMBv1 on Windows 10. Upgrading to the latest version of Windows is also advised.

Another way to prevent SMB exploits is to turn the protocol off and close port 445. This is not a solution for many organizations, however, because it can break network communications and take some Windows services offline. Before disabling or blocking port 445 on Windows systems, perform an in-depth analysis of how it will affect the services and programs running on them.

Actions that can be taken to improve security while still running SMB include the following:

  • Block TCP port 445 at the network perimeter only if critical services will not be interrupted.
  • Shore up endpoint detection with an integrated product that includes advanced antimalware defense and endpoint detection and response functionality. This helps prevent malicious connections from known bad actors.
  • Implement segmentation and isolation wherever possible to prevent lateral movement.
  • Enforce strong passwords across the AD domain and for local Windows accounts.
  • Maintain a proper inventory of the services and applications running on your systems.
  • Enable strong file and share permissions to keep sensitive information locked down.
  • Perform proactive system monitoring and alerting, especially for critical Windows systems.
  • Create firewall rules that only allow trusted IP addresses to access SMB ports.
  • Stay abreast of any and all vulnerabilities, and patch them as soon as possible.

Related Resources

Dig Deeper on Threat detection and response

  • WannaCry ransomwareBy: AlexanderGillis
  • NFS vs. CIFS vs. SMB: What are the differences?By: GarryKranz
  • Microsoft issues 129 fixes for June Patch TuesdayBy: TomWalat
  • CISA warns Microsoft SMB v3 vulnerability is under attackBy: AlexanderCulafi
How to defend against TCP port 445 and other SMB exploits | TechTarget (2024)

FAQs

How do I block TCP 445 SMB? ›

Step 1: Open the Control Panel Step 2: Click on Windows Firewall/ Windows Defender firewall Step 3: Navigate to advanced settings. Step 4:Right click on inbound rules and click on new rule. Step 6:Select port and press next Step 7:Specify the port 445 under specific local ports, select TCP and press next.

How to protect SMB port? ›

Use the following sections to configure SMB traffic segmentation and endpoint isolation to help prevent outbound and lateral network communications.
  1. Block inbound SMB access. ...
  2. Block outbound SMB access. ...
  3. Inventory SMB usage and shares. ...
  4. Configure Windows Defender Firewall. ...
  5. Disable SMB Server if unused.
Mar 6, 2024

Is it safe to block port 445? ›

The best way to keep SMB secure is to disable port 445 in your firewall. While this will prevent devices outside of your network from remotely connecting to devices inside it over the port, they can still do so by using a VPN.

What are the vulnerabilities in port 445? ›

What is SMB Listens on Port?
Vulnerability Name:SMB Listens on Port
Summary:Ports 139 and 445 are used for 'NetBIOS' communication between two Windows 2000 hosts. In the case of port 445 an attacker may use this to perform NetBIOS attacks as it would on port 139.
Impact:All NetBIOS attacks are possible on this host.
9 more rows

How do I secure SMB traffic? ›

One of the simplest and most important steps to secure the SMB protocol is to update it to the latest version available. Older versions of SMB, such as SMBv1 and SMBv2, have known vulnerabilities that can be exploited by attackers to compromise your network.

How to encrypt SMB traffic? ›

Enable SMB Encryption with Windows Admin Center
  1. Download and install Windows Admin Center.
  2. Connect to the file server.
  3. Select Files & file sharing.
  4. Select the File shares tab.
  5. To require encryption on a share, select the share name and choose Enable SMB encryption.
May 18, 2023

How can we mitigate SMB vulnerability? ›

Use a VPN, especially when connecting to an unsecured public network. A VPN can increase your protection from various cyber threats, such as man-in-the-middle attacks, which could be used to exploit SMB vulnerabilities.

How do I protect my TCP ports? ›

To ensure port security, it is recommended to perform port scanning regularly, prioritize monitoring services, disable ports that are not being used, and perform port traffic filtering in order to block or allow incoming and outgoing packets on the network.

Is there a secure version of SMB? ›

Prefer SMB3 or later whenever possible. Of the 3 major SMB versions, SMB3 — particularly SMB 3.1. 1 — offers the most security. For example, SMB3's secure dialect negotiation limits susceptibility to man-in-the-middle (MITM) attacks and SMB 3.1.

What happens if I disable port 445? ›

Note that blocking TCP 445 will prevent file and printer sharing, including over apps – if this is required for business, you may need to leave the port open on some internal firewalls or use encryption keys.

What happens if I close port 445? ›

about the port 445

I recommend blocking port 445 on internal firewall to segment your network. this will prevent internal spreading of the ransomware. Note that blocking TCP 445 will prevent file and printer sharing.

Why do ISPS block port 445? ›

The reason some services decide to block port 445 is due to historical reasons of vulnerabilities found in lower SMB versions. Ideally, the port should be blocked for only for SMB 1.0 traffic and SMB 1.0 should be turned off on all clients.

What ports do hackers use? ›

Here are some common vulnerable ports you need to know.
  • FTP (20, 21) FTP stands for File Transfer Protocol. ...
  • SSH (22) SSH stands for Secure Shell. ...
  • SMB (139, 137, 445) SMB stands for Server Message Block. ...
  • DNS (53) DNS stands for Domain Name System. ...
  • HTTP / HTTPS (443, 80, 8080, 8443) ...
  • Telnet (23) ...
  • SMTP (25) ...
  • TFTP (69)
Mar 29, 2022

What is SMB exploit? ›

SMB relay attacks exploit SMB's NTLM authentication, potentially allowing attackers to impersonate users and gain unauthorized access. This attack is facilitated by specific prerequisites such as SMB signing disabled on the target, local network access, and user credentials with remote login permissions.

What ports are most often scanned by hackers? ›

Commonly hacked TCP port numbers include port 21 (FTP), port 22 (SSH), port 23 (Telnet), port 25 (Simple Mail Transfer Protocol or SMTP), port 110 (POP3), and port 443 (HTTP and Hypertext Transfer Protocol Secure or HTTPS).

How do I disable port 445? ›

How to Close Port 445 in Windows 11, 10, 7
  1. Go Start > Control Panel > Windows Firewall and find Advanced settings on the left side.
  2. Click Inbound Rules > New rule. ...
  3. Choose Block the connection > Next. ...
  4. Check if you have created the rule by Properties > Protocols and Ports > Local Port.
Apr 6, 2023

How do I block TCP connection? ›

Block or allow TCP/IP port in Windows Firewall
  1. Step 1: Block port in Windows Firewall. ...
  2. Step 2: Select Inbound Rules. ...
  3. Step 3: Select the 'New Rule' option. ...
  4. Step 4: Select 'Port' ...
  5. Step 5: Click Next. ...
  6. Step 6: Select 'Block the connection' ...
  7. Step 7: Select all the profiles available.
Jan 17, 2019

How do you stop a TCP connection? ›

The common way of terminating a TCP connection is by using the TCP header's FIN flag. This mechanism allows each host to release its own side of the connection individually.

How to check if port 445 is blocked? ›

Answer: Open the Run command and type cmd to open the command prompt. Type: “netstat –na” and hit enter. Find port 445 under the Local Address and check the State.

Top Articles
Financial Education for All Aspects of Life
Tastytrade Help Center
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Melvina Ondricka

Last Updated:

Views: 5880

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Melvina Ondricka

Birthday: 2000-12-23

Address: Suite 382 139 Shaniqua Locks, Paulaborough, UT 90498

Phone: +636383657021

Job: Dynamic Government Specialist

Hobby: Kite flying, Watching movies, Knitting, Model building, Reading, Wood carving, Paintball

Introduction: My name is Melvina Ondricka, I am a helpful, fancy, friendly, innocent, outstanding, courageous, thoughtful person who loves writing and wants to share my knowledge and understanding with you.