Skip to content

Instantly share code, notes, and snippets.

View kkevlar's full-sized avatar

Kevin Kellar kkevlar

View GitHub Profile
@kkevlar
kkevlar / packet-generator.cpp
Created September 26, 2022 15:00 — forked from jonhoo/packet-generator.cpp
Complete example code showing how to construct a UDP packet from scratch and inject it on a WiFi interface in Linux
/**
* Hello, and welcome to this brief, but hopefully complete, example file for
* wireless packet injection using pcap.
*
* Although there are various resources for this spread on the web, it is hard
* to find a single, cohesive piece that shows how everything fits together.
* This file aims to give such an example, constructing a fully valid UDP packet
* all the way from the 802.11 PHY header (through radiotap) to the data part of
* the packet and then injecting it on a wireless interface
*