Operating System - HP-UX
1819814 Members
4155 Online
109607 Solutions
New Discussion юеВ

Re: How to find the port number of a server application

 
blal
Frequent Advisor

How to find the port number of a server application

Hi

I have a IDS(Intruder detection system) server process running on a Unix server.

The IDS system is not functioning now , I doubt some problem in the server process.

As per IDS documentation it says process runs on port number 45000.

Now for testing I did a "telnet ipaddress 45000" from a PC on the same network.It says connection refused.

Now my query is how to find out the port number of the server process running on the server.Is there is any command to find out.

Netstat -a only says information about established connections.

Pls help me.

Regds,
baiju
Live and let live.
9 REPLIES 9
Massimo Bianchi
Honored Contributor

Re: How to find the port number of a server application

Hi,
if you know the process name, the better way is using lsof to see what port it holds:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.67/

or run a port mapper againt the server:

http://hpux.connect.org.uk/hppd/hpux/Networking/Admin/nmap-2.53/

Massimo
twang
Honored Contributor

Re: How to find the port number of a server application

I think you can only find out what app is 'using' a port, if you have lsof installed, you can issue 'lsof -i TCP:45000; and it will show exactly which process has the port open.
blal
Frequent Advisor

Re: How to find the port number of a server application


Sorry,

This IDS is on sun server, and client from which i am running is hp L class.

Is there any thing like lsof in Solaris.

Thank you,
Baiju.
Live and let live.
Robert-Jan Goossens
Honored Contributor

Re: How to find the port number of a server application

Hi Baiju,

Yes there is,

http://www.sunfreeware.com/

Click on your OS version and search for lsof.

Hope it helps,

Robert-Jan.
Yogeeraj_1
Honored Contributor

Re: How to find the port number of a server application

hi,

try to download the source and compile the source on the Solaris server.

http://hpux.connect.org.uk/ftp/hpux/Sysadmin/lsof-4.67/lsof-4.67-ss-11.00.tar.gz

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Massimo Bianchi
Honored Contributor

Re: How to find the port number of a server application

You can use nmap the same, against she Sun server from the Lclass :)

Massimo
Yogeeraj_1
Honored Contributor

Re: How to find the port number of a server application

hi,

see also:
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/README/

and

ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
RAJESH GANGADHARAN
Regular Advisor

Re: How to find the port number of a server application

Hi Baiju,
You can use a utility called multiscan. You download this in your HP machine and from HP machine you can scan any system for the opened ports.

-RG
Let the choices you make today be the choices you can live with tomorrow.
Mark Greene_1
Honored Contributor

Re: How to find the port number of a server application

Most unix systems have the netstat command, I don't know if Sun does or not.

netstat -a will give you a list of all open tcp ports. Some unix implementations have an option, -p, which will map the tcp port to a PID in the ps listing.

mark
the future will be a lot like now, only later