如何识别 Linux 上哪个进程正在发送 UDP 流量?
我的机器不断发出 udp dns 流量请求。我需要知道的是生成此流量的进程的 PID。
TCP 连接中的正常方法是使用 netstat/lsof 并获取与 pid 关联的进程。
UDP 连接是无状态的,因此,当我调用 netastat/lsof 时,只有当 UDP 套接字打开并且正在发送流量时,我才能看到它。
我尝试过使用 lsof -i UDP 和 netstat -anpue ,但我无法找到哪个进程正在执行该请求,因为我需要调用 lsof/netstat确切地说,当 udp 流量发送时,如果我在发送 udp 数据报之前/之后调用 lsof/netstat ,则无法查看打开的 UDP 套接字。
在发送 3/4 udp 数据包时准确调用 netstat/lsof 是不可能的。
我如何识别臭名昭著的过程?
我已经检查了流量,试图从数据包的内容中识别发送的 PID,但无法从流量的内容中识别它。
有人可以帮助我吗?
我是这台机器上的 root FEDORA 12 Linux Noise.company.lan 2.6.32.16-141.fc12.x86_64 #1 SMP Wed Jul 7 04:49:59 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
编辑:
我在超级用户平台上问过同样的问题。 当然还有与此类问题更多相关的地方!
My machine is continuously making udp dns traffic request. What I need to know is the PID of the process generating this traffic.
The normal way in TCP connection is to use netstat/lsof and get the process associated at the pid.
Is UDP the connection is stateless, so, when I call netastat/lsof I can see it only if the UDP socket is opened and it's sending traffic.
I have tried with lsof -i UDP
and with netstat -anpue
but I can't be able to find which process is doing that request because I need to call lsof/netstat exactly when the udp traffic is sent, if I call lsof/netstat before/after the udp datagram is sent is impossible to view the opened UDP socket.
call netstat/lsof exactly when 3/4 udp packet is sent is IMPOSSIBLE.
how I can identify the infamous process?
I have already inspected the traffic to try to identify the sent PID from the content of the packet, but is not possible to identify it from the content of the traffic.
anyone can help me?
I'm root on this machine FEDORA 12 Linux noise.company.lan 2.6.32.16-141.fc12.x86_64 #1 SMP Wed Jul 7 04:49:59 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
EDIT:
I have asked the same question on superuser platform.
More related place to this kind of question OF COURSE!
Click here, You can find the right answer in the right place
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
流程在最后一栏
The process is at the last column
这些 UDP DNS 请求是否会发送到您的 Fedora 盒子配置使用的名称服务器?只需打开 Firefox 并访问 http://www.google.com 就会生成 UDP 数据包流作为名称解析发生。在终端窗口中运行 tcpdump port 53,打开 Firefox 并访问某个网站,您就会明白我的意思。
Are these UDP DNS requests going to the name servers your Fedora box is configured to use? Just opening Firefox and going to http://www.google.com will generate a stream of UDP packets as name resolution happens. Run
tcpdump port 53
in a terminal window, open Firefox and go to some website, you'll see what I mean.Linux Socket Monitor 可以跟踪网络套接字的更改。当新套接字打开时它应该提醒您。
Linux Socket Monitor can track changes to network sockets. It should alert you when new socket is opened.