Forging and sending packets with pcap.
- Loopback
- Ethernet
- Ipv4
- Arp (request/reply)
- Have Npcap installed on your computer. If you have Wireshark installed you likely already have it.
- Add a reference to this project on your app.
- Create a PcapModule object:
PcapModule module = new PcapModule()
m.ListNetworkDevices()
returns the list of network devices.module.Open(deviceName)
opens a device to send data. Returns a IntPtr referencing the device.module.Send(deviceReference, byte[] packet, int size)
sends data down the interface.BinaryConverter
andDatagramProvider
helps you with creating and converting data structures to bytes.