On a centos box, I like to dump tcp connections – I would like to see if a server tries to send requests to a certain IP. Usually tcpdump would do the trick – but tcpdump is not installed, and installing software is not an option (because of company policy). I am afraid netstat will not show me a single request.
So I was wondering what other options I have. I do have root access on the server.
Best Answer
Surely you have
python
?This will exit with "GOT TARGET" providing the IP address coming back matches. Since TCP has to send something back during a handshake, this should catch anything from a specific target address. It doesn't care if the protocol is TCP or UDP though (nor do I check).
Dont forget to change TARGET and INTERFACE.