I ran rkhunter and found an open hidden port. How do I close a port that is not listed with the netstat or fuser command? It is hidden from these which is why it was flagged. Aside from blocking the port with ufw or iptables, how can I remove or close this port?
Starting TCP checking
Found Hidden port that not appears in netstat: 38598
Starting UDP checking
To simply close the port
38598
you can use UFW (Uncomplicated Firewall)UFW is used by default by Ubuntu as it's firewall and is easy to customize and has a easy to use syntax.
Just type the following in the terminal.
sudo ufw status
If it's inactive then enable it using the command
sudo ufw enable
2.Close the port
to close a particular port number use
sudo ufw deny port-number
where port-number is the port number you want to disable access to.
To re enable closed port use:
sudo ufw allow port-number
for more info see here.