Operating System - HP-UX
1819927 Members
3146 Online
109607 Solutions
New Discussion юеВ

how to check the open ports

 
SOLVED
Go to solution
Azaru
Regular Advisor

how to check the open ports

Dear all,

Is any one know how to check the open port in our system?

azaru
9 REPLIES 9
Paul Sperry
Honored Contributor

Re: how to check the open ports

Well first check your /etc/services file.

For ports not listed there use lsof.

You cna also use netstat.
Paul Sperry
Honored Contributor

Re: how to check the open ports

Well first check your /etc/services file.

For ports not listed there use lsof.

You can also use netstat.
Paul Sperry
Honored Contributor

Re: how to check the open ports

Azaru
Regular Advisor

Re: how to check the open ports

Dea paul,

is there any other way other than lsof? Like to display the whole output(opened ports) in an single command.
VK2COT
Honored Contributor
Solution

Re: how to check the open ports

Hello,

Many ways to check it on the local server.
For example:

a) Run:

netstat -an

b) Install tools like nmap:

http://www.insecure.org/

c) Or even:

telnet localhost portnumber

There are many Shell and Perl script
that can automate task in c). I have
one that specifically opens SMTP port 25
but it can easily be modified for other
ports:

http://www.circlingcycle.com.au/Unix-sources/scan-subnet-smtp-servers.txt

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Laurent Menase
Honored Contributor

Re: how to check the open ports

ndd -get /dev/ip ip_udp_status
ndd -get /dev/ip ip_tcp_status
DavidJ
Regular Advisor

Re: how to check the open ports

netstat -an will show all ports in use on your system.
Everyday I beat my own previous record for number of consecutive days I've stayed alive.
Sp4admin
Trusted Contributor

Re: how to check the open ports

You can check the open ports in the /etc/services or you can check the ports that are established using the "netstat -a" command.

sp,
Azaru
Regular Advisor

Re: how to check the open ports

thanks everyone

azaru