Small utility to track connections via /proc/net/tcp
.
This is the first, naive implementation that considers the direction of connection to always be REMOTE -> LOCAL (which is obviously not true). I'll extend it later to use the listening ports to identify in what direction the socket was opened.
go get github.com/kbence/conndetect
or
git clone https://github.com/kbence/conndetect.git
cd conndetect
go get .
If you have installed it with go get
(given you have $GOPATH/bin
on your $PATH
), just execute:
conndetect
Or you can also run it directly using go
(from the root directory):
go run .
First, build the docker image:
docker build -t conndetect .
Then run the container with the following command. Make sure to pass --network host
to get access to all the network activity.
docker run -it --rm --network host conndetect