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
*
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup()
{
Serial.begin(9600);
myservo.attach(9); // attaches the servo on pin 9 to the servo object
@kkevlar
kkevlar / packing.c
Created May 19, 2018 18:48
Packing for mytar
#define UID_PACKING_LEN 8
int header_insert_special_int(char* where, size_t size, int32_t val)
{
int err = 0;
if (val < 0 || size < sizeof(val))
{
err++;
}
@kkevlar
kkevlar / goonhelp.c
Created May 19, 2018 00:57
noahs a goon
int header_set_uid_itsbig(char* where, size_t size, int32_t val)
{
int err = 0;
if (val < 0 || size < sizeof(val))
{
err++;
}
else
{
memset(where, 0, size);