像 Wireshark 这样的应用程序如何工作?

发布于 2024-09-27 17:09:22 字数 105 浏览 15 评论 0原文

我想知道wireshark 是如何工作的。可以监听给定机器所有端口上的流量的应用程序的设计是什么?这样的应用程序会产生什么样的窃听?编写一个监控流量的应用程序的好方法是什么?

谢谢

Im am wondering how wireshark functions. What would be the design of an application that could listen to the traffic on all ports of a given machine? What is the kind of overheard that such an application generates? What would be a good way to go about writing an app that monitors traffic?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

初见你 2024-10-04 17:09:22

Wireshark 在 Unix 平台上利用 libpcap,在 Windows 上利用其端口 WinPcap。这个库提供了一个API来捕获数据包(Wireshark也能够捕获帧,但我在pcap文档中没有发现pcap能够做到这一点)。

库如何做到这一点是特定于平台的,这就是为什么一个好方法是使用库来为您完成繁重的工作; unix 上的 libpcap 或 tcpdump(取决于您需要的级别有多低)以及 Windows 上的 WinPcap 或 Windows 过滤平台。

文档:
http://www.tcpdump.org/pcap3_man.html
http://www.winpcap.org/docs/docs_412/html/main.html

Wireshark leverages libpcap on unix platforms and its port WinPcap on Windows. This library provides an API to capture packets (Wireshark is also able to capture frames but I haven't found in pcap docs that pcap is able to do that).

How the library does that is platform-specific, that's why a good way would be to use the library to do the heavy lifting for you; libpcap or tcpdump on unix (depending on how low-level you need it to be) and WinPcap or Windows Filtering Platform on Windows.

Documentation:
http://www.tcpdump.org/pcap3_man.html
http://www.winpcap.org/docs/docs_412/html/main.html

倚栏听风 2024-10-04 17:09:22

一种方法是使用 Windows 过滤平台(适用于 Vista+ ,但 XP 中也可以实现类似的功能 - WFP 只是让事情变得更容易)。 WFP 允许您监听驱动程序中在数据包处理堆栈中的各个点调用代码的“调用”,以便您可以在数据移动时捕获、过滤甚至修改数据。

One way would be to use the Windows Filtering Platform (this is for Vista+, but a similar feature was possible in XP- - the WFP just makes things easier). The WFP lets you listen to "callouts" in the driver that call your code at various points in the packet-processing stack so that you can capture, filter, and even modify the data as it moves around.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文