Skip to content

This is a poc for getting a unix socket process without using netstat

Notifications You must be signed in to change notification settings

tomersa/find_unix_socket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

find_unix_socket

Instead of getting a unix socket by running: $ netstat -xp | grep

This script does it searching for the socket under /proc directory.

In the 1st terminal run: $ bind_socket.py test - Will create a socket named test and wait on it forever.

In the 2nd terminal run: $ find_socket.py test - The program will return the pid(process id) of the process holding the socket.

You may verify this by running: ps aux | grep <pid> and see it is acctualy the same process id in the output of netstat -xp | grep test

The idea for this project came up by looking at the netstat source code. Which can be found here: netstat.c

About

This is a poc for getting a unix socket process without using netstat

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages