开发者

capturing dns packets using java

开发者 https://www.devze.com 2022-12-28 12:16 出处:网络
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 fi

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 开发者_StackOverflowwill be able to log the websites.

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


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


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 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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号