Based on this answer, I tried to close an open port, the problem is that nmap says that there are 5 open ports, but lsof says there is no current process using those ports, so my question is how can I close those.
This is the output from nmap
Nmap scan report for 192.168.0.15
Host is up (0.022s latency).
Not shown: 995 closed ports
PORT STATE SERVICE
80/tcp open http
5000/tcp open upnp
49153/tcp open unknown
49154/tcp open unknown
50000/tcp open ibm-db2
and when I try every lsof -i:port they print nothing.
I also tried netstat -apn | grep ':port' to see the process attached to the port, but there was no output.
EDIT:
Yes, my computer is 192.168.0.15.
EDIT2:
I'm running ubuntu 16.04. I didn't install XAMP or any local servers (maybe ubuntu comes with one of it?), but the port 80 may be used because of chromium. But I don't have any idea where those other 4 ports come from and I would really like to close them.
I did disable upnp by going to 192.168.0.1->Administration->upnp->disable->save changes (on a cisco router). But if I restart the router upnp keeps enabling it. And if for disabling upnp one has not the need to restart the router, then nmap shows open ports which are not really opened. The output of nmap is the same after changing upnp.