This is a tool for calling netstat at a chosen interval. Set it to run every minute, every 15 minutes, every half hour or hourly.
xattr -d com.apple.quarantine ~/Downloads/thewatcher
(Assuming it's downloaded into your Downloads folder. Change the path to suit.)
Download and run the right program for your operating system:
- Windows: Download here
- MacOS Silicon: Download here
- MacOS Intel: Download here
- Linux AMD64: Download here
- Linux ARM64: Download here
The bulk of the work was by Cihangir Akturk's go-netstat
library. Find the original go-netstat repository here. I was just missing a way to call netstat programatically for infosec clients.
The netstat
folder is a near 1:1 mirror of go-netstat
. The only difference is a _darwin module included here for running and developing on MacOS.
Feel free to remove the cli
package from main.go
and implement your own CLI prompts, if you want to write it as your own program.