Free tech learning for everyone, from basics to pro

Port 445: SMB (Server Message Block)

What port 445 (TCP) does, the security risks of leaving it open, and how to secure and test it.

Port445
TransportTCP
ServiceServer Message Block (SMB)
EncryptedOptional (SMB 3 encryption)

What is port 445?

SMB is Windows file and printer sharing. It runs directly over TCP 445.

Common uses

  • Shared drives and folders on Windows networks
  • Group Policy and logon scripts in Active Directory
  • NAS devices and Samba on Linux

Security risks

  • WannaCry and NotPetya spread through SMB vulnerabilities
  • Ransomware moving between computers over file shares
  • SMB relay attacks capturing and reusing credentials

How to secure port 445

  • Never expose TCP 445 to the internet
  • Disable SMBv1 everywhere
  • Require SMB signing, and use SMB 3 encryption for sensitive shares
  • Limit which computers can reach file servers

How to check if port 445 is open

WhereCommand
Scan from another machinenmap -p 445 <host>
Windows (PowerShell)Test-NetConnection <host> -Port 445
Linux (what is listening)sudo ss -tulpn | grep :445
Windows (what is listening)netstat -ano | findstr :445

Only scan systems you own or have permission to test.

Example: block it at the internet edge (Cisco)

For a service that should stay inside your network, deny it on the internet-facing interface. Put the rule before any broader permit statements:

ip access-list extended INTERNET-IN
 remark Block SMB from the internet
 deny   tcp any any eq 445
 permit ip any any
!
interface GigabitEthernet0/0
 ip access-group INTERNET-IN in

In a real network the final line would be your normal inbound policy, not "permit ip any any". Build and check rules with the ACL builder.

Related ports

Frequently asked questions

What is port 445 used for?

Port 445 (TCP) is used by Server Message Block (SMB). SMB is Windows file and printer sharing.

Is it safe to open port 445?

Only if the service needs to be reached and is configured securely. Never expose TCP 445 to the internet.

How do I check if port 445 is open?

From another computer, run nmap -p 445 followed by the host address. On the server itself, ss -tulpn on Linux or netstat -ano on Windows shows whether anything is listening on 445.

Learn more: TCP, UDP and ports explained and firewall basics.

Get free updates by email

New notes, tools, CCNA and Security+ tips and important security news from FM TecHub, explained simply. Free, about twice a month. Unsubscribe anytime; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesup

Free · no spam · past emails · powered by Buttondown