All ports
Port138/TCP
netbios-dgmPort
138
Protocol
TCP
Category
Well-Known
Service
netbios-dgm
What is port 138?
Port 138/TCP is a Well-Known port, assigned by IANA for widely recognized services. It is associated with the netbios-dgm service.
NETBIOS Datagram Service
Useful commands
nmapnmap -p 138 -sV example.comnetcatnc -zv example.com 138curlcurl -v http://example.com:138/telnettelnet example.com 138bash(echo > /dev/tcp/example.com/138) 2>/dev/nullFirewall commands
UFWAllow
sudo ufw allow 138/tcpDeny
sudo ufw deny 138/tcpiptablesAllow
sudo iptables -A INPUT -p tcp --dport 138 -j ACCEPTDeny
sudo iptables -D INPUT -p tcp --dport 138 -j ACCEPTfirewalldAllow
sudo firewall-cmd --permanent --add-port=138/tcpWindowsAllow
netsh advfirewall firewall add rule name="Open Port 138" dir=in action=allow protocol=TCP localport=138Security Risks
- Unauthorized access to the service
- Data exposure if the service is unauthenticated
- Outdated versions with vulnerabilities
- Incorrect service configuration
Frequently Asked Questions
What service runs on port 138/TCP?
Port 138/TCP is associated with the netbios-dgm service. NETBIOS Datagram Service
Is it safe to expose port 138 to the Internet?
It depends on the service and configuration. Port 138 (netbios-dgm) is a Well-Known port. If you need to expose it, keep the service updated, use strong authentication, and configure a firewall. It's always recommended to restrict access by IP when possible.
How do I check if port 138 is open?
You can use nmap: `nmap -p 138 -sV example.com`, netcat: `nc -zv example.com 138`, or the bash command: `(echo > /dev/tcp/example.com/138) 2>/dev/null && echo "Open" || echo "Closed"`.
How do I open or close port 138 on my firewall?
On Linux with UFW: `sudo ufw allow 138/tcp` (open) or `sudo ufw deny 138/tcp` (close). With iptables: `sudo iptables -A INPUT -p tcp --dport 138 -j ACCEPT`. On Windows: `netsh advfirewall firewall add rule name="Open Port 138" dir=in action=allow protocol=TCP localport=138`.
What applications and services use port 138?
Port 138/TCP is used by the netbios-dgm service. Specific uses depend on the software and configuration. Check our related tools section for more information.