如何跟踪哪个进程正在生成网络流量?

如何跟踪哪个进程正在生成网络流量?

新系统安装后,我在网络监视器上观察到奇怪的活动 - 某些应用程序正在生成少量网络流量(发送和接收数据)...如何跟踪哪个进程导致此网络流量?

答案1

网络猪可以做的工作:

网络猪

您可能希望使用该选项降低刷新率-d

自版本 0.8.5-2 起可用选项:

usage: nethogs [-V] [-h] [-b] [-d seconds] [-v mode] [-c count] [-t] [-p] [-s] [device [device [device ...]]]
        -V : prints version.
        -h : prints this help.
        -b : bughunt mode - implies tracemode.
        -d : delay for update refresh rate in seconds. default is 1.
        -v : view mode (0 = KB/s, 1 = total KB, 2 = total B, 3 = total MB). default is 0.
        -c : number of updates. default is 0 (unlimited).
        -t : tracemode.
        -p : sniff in promiscious mode (not recommended).
        -s : sort output by sent column.
   -a : monitor all devices, even loopback/stopped ones.
        device : device(s) to monitor. default is all interfaces up and running excluding loopback

答案2

当您观察此流量时,请注意使用的端口和协议。然后检查

netstat -tulpen

:第一列是协议,列中后面的数字Local Address是端口。最后一列显示PID/Program name

相关内容