How do I know which ports an application opens
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > How do I know which ports an application opens




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How do I know which ports an application opens  
Sting


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:18 PM

Hello,
I ran a unix application ; I want to know which ports
these application opens.
(This application simply opens sockets with 2 or 3 ports).

How can I do it ?

I of course can do it indirectly.
For example, run nmap before starting the application and
after starting it , and see the difference in ports.
but is there a direct way ?
regards,
sting





[ Post a follow-up to this message ]



    Re: How do I know which ports an application opens  
Nils O. examnotes


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:18 PM

In article <2ff4a208.0312100516.1d384887@posting.google.com>, Sting wrote:
quote:
> Hello, > I ran a unix application ; I want to know which ports > these application opens. > (This application simply opens sockets with 2 or 3 ports). > > How can I do it ? > > I of course can do it indirectly. > For example, run nmap before starting the application and > after starting it , and see the difference in ports. > but is there a direct way ?
try netstat , depending on which OS your on, it might show you pid<->port relations. -- Vennlig hilsen/Best Regards Nils Olav Selåsdal <NOS at Utel.no> System Engineer UtelSystems a/s




[ Post a follow-up to this message ]



    Re: How do I know which ports an application opens  
HR


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:18 PM

Nils O. Selåsdal wrote:
[QUOTE]
> In article <2ff4a208.0312100516.1d384887@posting.google.com>, Sting wrote:
 

Look up this program: http://freshmeat.net/projects/lsof/

It's *very* handy for doing this kind of thing. It shows all open file
descriptors for a process. You can just grep the output for the socket
connections.





[ Post a follow-up to this message ]



    Re: How do I know which ports an application opens  
Stephane CHAZELAS


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:18 PM

2003-12-10, 05:16(-08), Sting:
quote:
> I ran a unix application ; I want to know which ports > these application opens. > (This application simply opens sockets with 2 or 3 ports).
[...] lsof -ai -c <cmd-name> or lsof -ai -p <pid> List the opened sockets (either listening or connected ones, TCP or UDP). lsof -i lists every opened socket on your system. -- Stéphane ["Stephane.Chazelas" at "free.fr"]




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:26 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register