Skip to content
statance
MenuClose
← All ports

Port 4444: Metasploit listener / Selenium Grid

Medium risk

Port 4444 is the default for Selenium Grid’s hub and for Metasploit’s reverse shell handler, which makes it a port worth noticing when it shows up unexpectedly. It should not be reachable from the public internet.

Port
4444
Protocol
TCP
Service
Metasploit listener / Selenium Grid
Expose to internet?
No
Also used by
Selenium Grid hub, Metasploit default reverse shell handler, I2P

Is port 4444 safe to open?

A Selenium Grid open to the internet lets anyone drive browsers on your infrastructure, which has been abused to run code and mine cryptocurrency. An unexpected outbound connection to a remote port 4444 can also be a sign of a reverse shell. Check which process owns it.

How to secure Metasploit listener / Selenium Grid

  • Bind Selenium Grid to an internal network and put authentication in front of it.
  • Investigate any unknown process listening on or connecting to 4444: sudo ss -tnp | grep 4444.
  • Block 4444 from the internet.

Check if port 4444 is open

Linux: what is listening on this port

sudo ss -tlpn | grep ':4444 '

Windows (PowerShell): what is listening

Get-NetTCPConnection -LocalPort 4444 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}

From another machine: is it reachable

nc -zv HOST 4444 # or nmap -p 4444 HOST # Windows Test-NetConnection HOST -Port 4444

Restrict port 4444 in the firewall

Replace 10.0.0.0/8 with the network or address that needs access. Docker publishes container ports through its own iptables rules, which bypass ufw; bind published ports to 127.0.0.1 (-p 127.0.0.1:4444:4444) instead of relying on the host firewall.

ufw: allow only your private network, deny everyone else

sudo ufw allow from 10.0.0.0/8 to any port 4444 proto tcp sudo ufw deny 4444/tcp

firewalld: allow one source network only

sudo firewall-cmd --permanent --remove-port=4444/tcp sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="4444" protocol="tcp" accept' sudo firewall-cmd --reload

iptables

sudo iptables -A INPUT -p tcp --dport 4444 -s 10.0.0.0/8 -j ACCEPT sudo iptables -A INPUT -p tcp --dport 4444 -j DROP

Windows Firewall (PowerShell, as Administrator)

New-NetFirewallRule -DisplayName "Block 4444 from internet" -Direction Inbound -Protocol TCP -LocalPort 4444 -RemoteAddress Internet -Action Block

Monitor port 4444

Run a TCP port monitor against your public IP on port 4444: here, a failed connection is the healthy result, so you know the firewall is still doing its job. On Linux, the Statance agent also reports every listening port on the server. TCP port monitoring.

Related ports

Port 5000Flask / Docker Registry / AirPlayMedium risk
Port 8080HTTP alternateMedium risk
Port 22SSHMedium risk

FAQ

What is port 4444 used for?

Port 4444 is the default for Selenium Grid’s hub and for Metasploit’s reverse shell handler, which makes it a port worth noticing when it shows up unexpectedly. It is also used by Selenium Grid hub, Metasploit default reverse shell handler, I2P.

Is it safe to open port 4444?

Not to the public internet. A Selenium Grid open to the internet lets anyone drive browsers on your infrastructure, which has been abused to run code and mine cryptocurrency. An unexpected outbound connection to a remote port 4444 can also be a sign of a reverse shell. Check which process owns it.

Is port 4444 TCP or UDP?

Metasploit listener / Selenium Grid uses TCP on port 4444.

How do I check if port 4444 is open?

On the server, run sudo ss -tulpn | grep ':4444 ' (Linux) or Get-NetTCPConnection -LocalPort 4444 (Windows) to see what is listening. From another machine, run nc -zv HOST 4444 or Test-NetConnection HOST -Port 4444.

All ports →

Know the moment a port stops answering.

TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.