Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!purdue!mentor.cc.purdue.edu!mace.cc.purdue.edu!abe From: abe@mace.cc.purdue.edu (Vic Abell) Newsgroups: comp.unix.wizards Subject: Re: What processes are on the ends of a TCP connection? Summary: netstat -aA to PID in four+ easy steps Message-ID: <1914@mace.cc.purdue.edu> Date: 3 Mar 89 21:54:32 GMT References: <190@heart-of-goldmitre.org> Organization: Purdue University Lines: 68 In article <190@heart-of-goldmitre.org>, jc@heart-of-goldmitre.org (John M Chambers) writes: > OK all you BSD networking wizards, here's a simple one (;-): > > When I run "netstat -a", I can see a lot of TCP connections, as well as > a bunch of ports (both TCP and UDP) being listened on. How do I identify > the processes that are involved? Here are the 4+ easy steps for 4.3BSD, ULTRIX 2.2 and DYNIX 3.1[24] hosts. 1. Use -aA on the netstat command and record the TCP Protocol Control Block address that is displayed for the entry whose PID you want: netstat -aA 2. Run adb on the kernel: adb -k /vmunix /dev/mem a) Display the TCPCB at the address that netstat displayed: $$$ 4. For each process, look up its associated user structure and match its file structure addresses to the file structure address you got from pstat and grep. *proc$$$