问题原文
原帖链接 · chell · CC BY-SA 3.0
Given an external IP address and target port, in Linux, is there any way to use something like ngrep or tcpdump to identify the process and/or user that is sometimes sending traffic to it? Or iptables rules? Is there a recommended way to run an ongoing monitor that's not too resource intensive?
已采纳解答
原帖链接 · chell · CC BY-SA 3.0
Rich Alloway - RogueWave's answer had some promising suggestions, but each package falls short in one way or another. The only option I could find that satisfied all my needs was sysdig
There's many ways to use it, such as:
sysdig -p "*%evt.num %evt.datetime %evt.cpu (%user.name) %proc.name (%thread.tid) %evt.dir %evt.type %evt.info" '(fd.rnet=1.2.0.0/16 or fd.rnet=3.4.5.0/24) and fd.rport=443' | tee outputfile
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
