使用java捕获dns数据包

发布于 2024-08-30 18:21:25 字数 129 浏览 3 评论 0原文

我想记录系统中访问的网站。所以我决定记录系统发送的数据包。我正在使用 Jpcap API。我能够记录很多数据包。现在我想做的是只过滤 DNS 数据包。我想这样就能登录网站了。

我想要一种过滤 DNS 数据包的方法。我该怎么做呢?

I want to log the websites visited in a system. So i decided to record the packets send by the system. I am using Jpcap API. I am able to record a lot of packets. Now what i want to do is i want to filter only DNS packets. I think that will be able to log the websites.

I want a way to filter the DNS packets. How can I do it?

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

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

发布评论

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

评论(3

朮生 2024-09-06 18:21:25

一种更丑陋的方法是在端口 53 上扫描 UDP。
然而,从实施方面来看,之前的答案看起来更干净。

One uglier approach is to scan on port 53 for UDP.
However, previous answer looks cleaner from implementation aspect.

何时共饮酒 2024-09-06 18:21:25

这里

您可以查看以下主页
有关过滤器的更多详细信息
表达。设计捕获滤波器
适用于 Ethereal/Wireshark

因此,我相信

captor.setFilter("dns", true);

应该可以

Here it says

You can check the following homepage
for more details about filter
expression. Designing Capture Filters
for Ethereal/Wireshark

Thus, I believe

captor.setFilter("dns", true);

should work

冷心人i 2024-09-06 18:21:25

我发现处理端口 53 中的所有数据包很容易,所以我使用了这个过滤器

udp 目标端口 53

tanx 插孔用于提示

i found it easy processing all the packets in port 53 and so i used this filter

udp dst port 53

tanx jack for ur hint

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