Security Basics mailing list archives

Re: see which programs are opening ports


From: Juan Pablo <jpablovilla () spymac com>
Date: Tue, 8 Mar 2005 21:16:27 -0300

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

this may work

for i in $( netstat -anp tcp | grep -v Active | grep -v Proto | grep -v \* | sed -e 's/\./\ /g' | awk '{ printf $8 "\n"}' ) ; do

        echo Puerto $i
        sudo lsof -i:$i
done
On Mar 8, 2005, at 7:11 PM, Danux wrote:

Hi, its so easy,  check if you have installed lsof or install it, then
use it this way:
lsof -i TCP:PORT

where PORT is the one you need to know about the program behind it.


On Tue, 8 Mar 2005 13:27:11 +0200, Tahis Vera <tahis.vera () gmail com> wrote:
Hi all,
I'm using Linux Debian.  I ran nmap on my machine and saw some strange
ports opened.
How can i check which programs are opening which ports, in order to
kill some of them (with ps -aux or top i couldn't see the ports
programs are using)?

thanks



--
Danux

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFCLkBepKiAaLlj5fURAlEGAKCEwPC9kZMrS+xrs0ufDe0zwd0pgQCeMw9o
1HKKP4WJQhjSrpOE5KATTRQ=
=EkHC
-----END PGP SIGNATURE-----



Current thread: