我如何找到产生大量网络流量的过程?


10

我的机器正在生成大量网络流量,这些流量全部来自同一源端口,并且目的地很多(通过运行iftop -P和从我的路由器日志中发现)。

如何找到产生此流量的过程?

Answers:


9

我会用:

netstat -punta | grep <src port>

它将为您提供每个的PID和二进制名称


如果指定了-a,那么指定-t和-u有什么意义?
天衣

3
@tink,这样您就不会得到UNIX域套接字,因此会在连接或侦听状态下获得UDP和TCP
h3rrmiller 2012年

我发现键入-atup和-atunp更快:)
XTL

2
@XTL -punta对我来说更容易记住,因为它非常接近西班牙语中的一个顽皮词:D
h3rrmiller 2012年

4

您可以尝试以下操作(对于端口80):

netstat -p --numeric-ports | grep :80

这不是最佳解决方案,但应提供所需的信息。


0

我使用nethogs运气很好,它有一个活跃的github存储库

sudo apt-get install nethogs

或从源代码编译

git clone https://github.com/raboof/nethogs.git
cd nethogs
make
sudo make install

...然后查看流量,在WiFi接口上说:

sudo nethogs wlan0
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.