WinpCap 阻止互联网访问
我想阻止特定网站(如 yahoo 或 gmail 或任何其他网站)的互联网访问。我在谷歌上做了很多研究,并提出了提供数据包嗅探和操作的库。我可以读取数据包并获取服务器和客户端计算机的目标 IP 和源 IP 地址。据我与该主题相关的理解,要阻止任何 url,我需要将 FIN 数据包发送到服务器,这向服务器表明我不再需要任何数据包。所以我需要创建一个带有目标IP地址的数据包并将其发送到服务器(如雅虎等)。你能帮我解决这个问题吗?一些代码片段或解决方法,或者任何其他正确的方法来完成此任务。
对此的任何帮助将不胜感激。
谢谢
I want to block internet access for the particular website like yahoo or gmail or any other. I researched a lot on google and came up with the library which offer packet sniffing and manipulation. I can read packet and get the destination ip and source ip address of the server and the client computer. as far as my understanding related to the topic is, to block the any url i need to send the FIN packet to the server which indicates to the server that I don't want any more packets. so I need to create a packet with destination ip address and send it to the server (like yahoo etc). can you help me on this, some code snippet or way around, or any other correct approach for this task.
Any help on this would be much appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
http://www.winpcap.org/docs/docs_40_2/html/main.html
首先了解如何“跟踪”数据包、读取过滤的数据包、什么是原始 IP,然后尝试阻止/修改数据包。 WinPcap 功能强大,但可能不太容易适应。
http://www.winpcap.org/docs/docs_40_2/html/main.html
Start with understanding on how to "trace" the packets, read filtered packets, what Raw IP is and then attempt on blocking/modifiying the packets. WinPcap is powerful, but may not be easy to adapt.
我已经成功使用 http://netfiltersdk.com/ 。这是一个商业项目,但他们有一个演示版本,您可以将其用于作业。
I've used http://netfiltersdk.com/ successfully. Its a commercial project but they have a demo version which you could use for your homework.
请记住,您可以对流经管道的互联网流量应用阻止规则。关键是引导所有流量通过您的管道,并且在该管道上运行的应用程序决定通过什么和阻止什么。但这里我们有 Winpcap,它用于嗅探、数据包注入、统计数据收集等,就像一个旁观者观看正在发生的事情。它不用于阻止来自互联网的数据包。
Remember you can apply your blocking rules on the Internet traffic which flows through your pipe. The key is to direct all traffic to pass through your pipe and your application which operates on that pipe decides what to pass and what to block. But here we have Winpcap which is used for sniffing, packet injection, statistics gathering e.t.c just like a spectator watching whats going on. Its not used to block a packet coming from Internet.