数据包拦截软件
谁能给我推荐一款数据包拦截软件?
我的要求是阻止局域网内的数据包。(互联网不出现)。
假设CLIENT_A与CLIENT_B在同一网络(LAN)中通信。
我想要 CLIENT_C (位于同一网络中)捕获(我可以使用 jpcap 库的嗅探器来实现此目的)并阻止 CLIENT_A 发送到 CLIENT_B 的数据包。
我如何阻止 LAN 上的数据包..?
先感谢您。
问候, 维尼特·沙阿
Can any one suggest me a packet blocking software ??
My requirement is to block packets within the LAN.(Internet does not come into picture).
Supposing CLIENT_A communicating to CLIENT_B in the same network(LAN).
I want a CLIENT_C (who is in the same network) to capture(I can use jpcap library's sniffer for this purpose) and block packets sent by CLIENT_A to CLIENT_B.
How do i block packets over LAN..?
Thank you in advance.
Regards,
Veenit Shah
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可能需要一些 arp 攻击工具将数据包从 CLIENT-A 重定向到 Client-C 而不是 CLIent-B。
我认为这不是一个好主意。
You may need some arp attack things to redirect packets from CLIENT-A to Client-C instead of CLIent-B.
I don't think this is a good idea.
如果您正在客户端 C 上读取网络上的数据包,则客户端 B 已经收到该数据包,因此阻止它为时已晚。如果您使用交换以太网,那么客户端 C 甚至不会看到发送到 B 的数据包。
实现此目的的唯一方法是让 A 通过 C 与 B 通信,然后 C 可以决定是否应发送数据包。这称为防火墙。您可以使用 Linux 上的 iptables 来完成此操作,而不是编写一个。
但要利用它,您需要了解网络是如何工作的,根据您的问题,我不确定您现在是否了解。因此,您将需要了解很多有关以太网(假设您正在使用以太网)和不同网络层的知识。我不确定这方面的资源。
If you are reading the packet on the network on Client C, Client B has already received it so it is too late to block it. If you are using switched ethernet, then Client C wouldn't even see the packet that was sent to B anyway.
The only way to do this is to have A communicate to B through C then C can decide if packets should be sent. This is called a firewall. Instead of writing one, you could use iptables on Linux to do this.
But to make use of this, you need to understand how the network works and I'm not sure you do at this point based on your question. So you will need to learn a lot about ethernet (assuming you are using ethernet) and the different networking layers. I'm not sure of a resource for this.
这种事情通常是使用单独的防火墙(例如在路由器或网关盒中)或在一台或两台客户端计算机上运行的防火墙软件来完成的。
这不是用 Java 实现的明智之举。
编辑 - 回应此后续行动
让我们假设您正在讨论在 Linux 计算机上实现客户端防火墙。我可以想到两种方法:
您可以使用
Process.execute()
和朋友来运行Linuxiptables(8)
管理实用程序来操纵操作系统内核的网络数据包过滤器。这是最简单的基于 Java 的方法。但它要求您的 Java 应用程序以root
身份运行。您可以对
iptables(8)
正在执行的操作进行反向工程,以操作数据包过滤器并在 Java 中编写相同的功能。这将需要更多的编码工作,包括通过 JNI 或 JNA 在 C 中实现部分功能。并且您的应用需要以root
身份运行。但更简单的方法是简单地从命令行运行 iptables(8) ,或者使用基于 GUI 的精美管理工具进行更改。
请注意,在上述场景中,防火墙本身并不是用 Java 实现的。您所做的就是从 Java 应用程序管理防火墙。我想不出任何在 Java 中实际进行过滤/阻止的方法,甚至是远程实用的。
This kind of thing is normally done using a separate firewall (e.g. in a router or gateway box) or firewall software running on one or both of the client machines.
This is not the sort of thing that it is sensible to implement in Java.
EDIT - in response to this followup
Let us assume that you are talking about implementing a client-side firewall on a Linux machine. I can think of two approaches:
You could use
Process.execute()
and friends to run the Linuxiptables(8)
admin utility which manipulates the OS kernel's network packet filters. This is the simplest Java-based approach. But it requires that your Java app runs asroot
.You could reverse engineer what
iptables(8)
is doing to manipulate the packet filters and code the same functionality in Java. That would be more coding work, including implementing parts of the functionality in C via JNI or JNA. And your app needs to run asroot
.But a far, far simpler approach is to simply run
iptables(8)
from the command line, or make your changes using the fancy GUI-based admin tools.Note that in the scenarios above, the firewall itself is not implemented in Java. All you are doing is administering the firewall from a Java application. I cannot think of ANY way to actually do the filtering / blocking in Java that is even remotely practical.