Port 139: NetBIOS session
TCP 139 is the port for NetBIOS Session Service (SMB over NetBIOS). Never on the internet.
| Service | NetBIOS Session Service (SMB over NetBIOS) |
|---|---|
| Protocol | TCP |
| Exposure risk | High: do not expose to the internet |
| Range | Well-known (0–1023): binding needs root/admin on Unix |
What port 139 does
Older SMB file sharing ran over NetBIOS on port 139. Windows still listens on it for compatibility, but direct SMB on 445 has replaced it.
Should port 139 be open?
Never on the internet.
Find what's listening on port 139
- Linux:
sudo ss -tulpn | grep :139 - macOS:
sudo lsof -nP -i :139 - Windows:
netstat -ano | findstr :139, then look up the PID in Task Manager.
Open or block it in a firewall
- ufw:
sudo ufw allow 139/tcp(ordeny) - firewalld:
sudo firewall-cmd --add-port=139/tcp --permanent && sudo firewall-cmd --reload - Windows:
New-NetFirewallRule -DisplayName "Port 139" -Direction Inbound -Protocol TCP -LocalPort 139 -Action Allow
Port assignment per the IANA Service Name and Transport Protocol Port Number Registry. Test several ports at once with the port scanner, or any port with the open port checker.
Questions about port 139
What is port 139 used for?
NetBIOS Session Service (SMB over NetBIOS). Older SMB file sharing ran over NetBIOS on port 139. Windows still listens on it for compatibility, but direct SMB on 445 has replaced it.
Is port 139 TCP or UDP?
TCP. NetBIOS session uses TCP port 139.
Is it safe to open port 139?
High: do not expose to the internet. Never on the internet.
How do I check if port 139 is open?
Use the checker on this page: it connects to your host on TCP 139 from the internet. Locally, run
nc -vz host 139 (macOS/Linux) or Test-NetConnection host -Port 139 (PowerShell). To see what is listening on your own machine, run ss -tulpn | grep :139 (Linux) or netstat -ano | findstr :139 (Windows).