OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: Re: Associating Socket with Process
From: Peter C. Norton (spaceyLENIN.NU)
Date: Thu Jun 29 2000 - 00:01:15 CDT


You can either figure out how to grope through /proc, or you can get lsof.
lsof is "list open file descriptors" and includes info about sockets and
devices.

I don't know the source site, but if you do a lookup on freshmeat.net you'll
find it.

-Peter

On Wed, Jun 28, 2000 at 03:04:30PM -0700, Crist Clark wrote:
> My Solaris is a bit rusty. I have been pounding on http://doc.sun.com,
> but have not found the answer. Since the reason I am searching for this
> command is security related, I felt it appropriate to ask here.
>
> I am trying to match sockets with processes. A `netstat -a` tells me which
> sockets are open, but I want to know what process has it open. For example,
> say I want to see who is listening on 32771,
>
> % grep 32771 /etc/services /etc/inetd.conf
> % rpcinfo | grep 32771
> %
>
> And that's where I get stuck. I managed to find proc(1), but no commands
> there claim to do what I want. lsof seems to want privileges to run. I
> don't want to have to use root.
>
> Pointers much appreciated.
> --
> Crist J. Clark crist.clarkglobalstar.com
> Globalstar, L.P. (408) 933-4387

--
The 5 year plan:
In five years we'll make up another plan.
Or just re-use this one.