Skip to content
RU

Port 139: NetBIOS-SSN — Complete Guide

Office tower file server and network switch linked by blue ethernet cables on a shelf
TL;DR:

Legacy Windows protocol. Replaced by SMB over 445. Close on the internet. Standard TCP port for NetBIOS-SSN.

Check your host & ports →

What is port 139

Port 139 is reserved for NetBIOS-SSN. Legacy Windows protocol. Replaced by SMB over 445. Close on the internet.

Check port openness

Check port 139 →

Security

Close the port if the service isn't used. For admin ports, require IP whitelist or VPN. Monitor connection attempts via fail2ban.

Understanding the Role of Port 139 in Networking

Port 139 is primarily associated with the NetBIOS Session Service (NetBIOS-SSN), which facilitates the communication between networked devices in a Windows environment. This port is part of the legacy NetBIOS protocol suite, which was originally designed for file sharing and printer access over local area networks (LANs). While modern systems have largely transitioned to using the Server Message Block (SMB) protocol over TCP port 445, port 139 remains relevant in certain configurations, particularly in mixed environments with older Windows systems.

NetBIOS operates on top of the TCP/IP stack and allows applications on separate computers to communicate over a local network. Port 139 specifically handles sessions and establishes a connection between two NetBIOS-enabled devices. This connection facilitates the transfer of data, such as files and printer requests, and is critical for legacy systems that have not been updated to use SMB over port 445.

However, due to its association with outdated protocols, port 139 poses significant security risks. Attackers often exploit vulnerabilities in the NetBIOS protocol to gain unauthorized access to sensitive information or to launch other attacks, such as man-in-the-middle or denial-of-service attacks. Therefore, it is crucial for network administrators to understand the implications of keeping port 139 open and to evaluate whether it is necessary for their network operations.

Securing Port 139: Best Practices

To mitigate the security risks associated with port 139, organizations should implement several best practices. The first and most critical step is to close port 139 on devices that do not require it. This can be achieved using firewall rules or by disabling the NetBIOS protocol entirely on systems that are not using legacy applications. Here are some specific measures to enhance security:

  • Use Firewalls: Configure firewalls to block incoming and outgoing traffic on port 139. This can prevent unauthorized access attempts from external sources.
  • Disable NetBIOS: On Windows systems, NetBIOS can be disabled through the network adapter settings. Navigate to Control Panel > Network and Sharing Center > Change adapter settings, right-click the network connection, select Properties, and uncheck File and Printer Sharing for Microsoft Networks.
  • Employ Network Segmentation: Isolate legacy systems that require NetBIOS from the rest of the network. This minimizes the potential attack surface and limits exposure to external threats.
  • Regular Updates: Ensure that all systems, especially those using legacy protocols, are regularly updated with the latest security patches to protect against known vulnerabilities.

By following these best practices, organizations can significantly reduce the risks associated with port 139 and enhance their overall network security posture.

Practical Examples: Configuring Port 139 on Windows Systems

In some scenarios, you may need to configure or troubleshoot port 139 on Windows systems. Below are practical examples of commands and configurations that demonstrate how to manage NetBIOS over TCP/IP and monitor port 139 activity.

1. **Check if NetBIOS is enabled:** You can use the following command in the Command Prompt to check the NetBIOS setting:

wmic nicconfig where (IPEnabled=TRUE) get SettingID, NetBIOSOptions

This command will return the current NetBIOS options for all network interfaces. A value of 0 indicates that NetBIOS is enabled.

2. **Enable or Disable NetBIOS:** To modify the NetBIOS settings, navigate to the network adapter properties:

  • Open Control Panel.
  • Select Network and Sharing Center.
  • Click on Change adapter settings.
  • Right-click your active connection and select Properties.
  • Highlight Internet Protocol Version 4 (TCP/IPv4) and click Properties.
  • Click on Advanced, then go to the WINS tab to enable or disable NetBIOS.

3. **Monitor Port 139 Activity:** To monitor traffic on port 139, you can use the following PowerShell command:

Get-NetTCPConnection -LocalPort 139

This command will display all TCP connections currently using port 139, helping you identify any unauthorized access attempts.

By utilizing these commands and configurations, network administrators can effectively manage port 139 on Windows systems, ensuring proper functionality while maintaining a secure environment.

Learn more

Sources

Frequently Asked Questions

Why close port 139?

Every open port is a potential entry point. If the service isn't used — close it.

Try the live tool that powered this guide

Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.