Sending my own ARP package using SharpPcap and Packet.Net

I'm still unsuccessfully trying to send the ARP packet that I created using Packet.Net using SharpPcap. The problem is even that I am sending the package using device.SendPacket , it is not actually being sent, and I have no idea why.

This is my code:

 ARPPacket arpPacket = new ARPPacket(ARPOperation.Request, PhysicalAddress.Parse("000000000000"), targetIpAddress, device.Interface.MacAddress, myIpAddress); EthernetPacket ethPacket = new EthernetPacket(device.Interface.MacAddress, PhysicalAddress.Parse("FFFFFFFFFFFF"), EthernetPacketType.Arp); ethPacket.PayloadPacket = arpPacket; device.Open(); device.SendPacket(ethPacket); device.Close(); 

By the way, it is important that I send my own ARP packages, and not just use the SharpPcap ARP class.

+6
source share
2 answers
 public static void ARP(IPAddress ipAddress , LivePcapDevice device) { if (ipAddress == null ) throw new Exception("ARP IP address Cannot be null"); var ethernetPacket = new PacketDotNet.EthernetPacket(device.Addresses[1].Addr.hardwareAddress, PhysicalAddress.Parse("FF-FF-FF-FF-FF-FF"), PacketDotNet.EthernetPacketType.Arp); var arpPacket = new PacketDotNet.ARPPacket(PacketDotNet.ARPOperation.Request, PhysicalAddress.Parse("00-00-00-00-00-00"), ipAddress , device.Addresses[1].Addr.hardwareAddress, device.Addresses[0].Addr.ipAddress ); ethernetPacket.PayloadPacket = arpPacket; device.SendPacket(ethernetPacket); } 

Try this function: http://stolenpackets.net/?p=29

+4
source

looking at this code the ethernetpacket packet is not involved

 ARPPacket arpPacket = new ARPPacket(ARPOperation.Request, PhysicalAddress.Parse("000000000000"), targetIpAddress, device.Interface.MacAddress, myIpAddress); arpPacket.ARPTargetProtoAddress = destIP; arpPacket.DestinationHwAddress = PhysicalAddress.Parse("FF-FF-FF-FF-FF-FF"); device.Open(); device.SendPacket(arpPacket); device.Close(); 
+2
source

All Articles