Skip to content

Instantly share code, notes, and snippets.

View ktemkin's full-sized avatar

Kate Temkin ktemkin

View GitHub Profile
# USBKeyboard.py
#
# Contains class definitions to implement a USB keyboard.
import greatfet
import random
from facedancer.USB import *
from facedancer.USBDevice import *
from facedancer.USBConfiguration import *
@ktemkin
ktemkin / glitchkit_tablet.py
Created December 26, 2017 13:38
reproduces @scanlime's tablet work using GlitchKit instead of the FaceWhisperer
#!/usr/bin/env python2
import sys
import binascii
from greatfet import GreatFET
from greatfet.protocol import vendor_requests as vr
gf = GreatFET()
I spent a couple of hours spinning back up on this today, and got the VMware debug stub working (and with symbols!) for both the Linux kernel and for Bareflank. Thought I'd share, as this seems like it'll be really useful-- included below. I'll probably throw this on the Wiki once I'm sure the instructions are all sensical.
#Install homebrew, if you haven't already.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#Add a repository of cross compilers to your existing Homebrew installation.
brew tap sevki/homebrew-gcc_cross_compilers
#Install GDB for x86_64, which should allow us to debug Bareflank.
brew install x86_64-elf-gdb
@ktemkin
ktemkin / demo_trampoline_xen.c
Created September 9, 2016 00:37
Tampoline E0->EL2 PoC
/**
* Stuck inside the Xen domain-setup code...
*/
static struct mmio_handler_ops poc_mmio_ops;
static void memory_trampoline_demo(struct domain *d)
{
/*
* Remove domain permissions for the guest-physical memory address
@ktemkin
ktemkin / mockup.py
Last active February 6, 2023 19:49
# Creating a GreatFET object implicitly opens the USB connection to the device.
try:
device = GreatFET() # Optionally accepts serialNo= to select between multiple GreatFETs.
except DeviceNotFoundException:
print("No device found!")
sys.exit()
# Once a connection is made, the board's ID is queried, and used to make the board's peripherals available.
# (This either would be a factory method that produces an appropriate class, or a run-time mixin.)
# For now, this would mean that objects are present on 'device' that allow access to each of the Azalea board's peripherals.
From d686351d8ea4a1ea1d755d0a10f6f14d1c870911 Mon Sep 17 00:00:00 2001
From: Kyle Temkin <[email protected]>
Date: Wed, 8 Apr 2015 00:58:24 -0400
Subject: [PATCH] Add thorough reset interface to pciback's sysfs.
--------------------------------------------------------------------------------
SHORT DESCRIPTION:
--------------------------------------------------------------------------------
Adds an interface that allows "more thorough" resets to be performed
on devices which don't support Function Level Resets (FLRs). This
@ktemkin
ktemkin / wat
Last active August 29, 2015 14:18 — forked from alexisvl/wat
Open On-Chip Debugger 0.9.0-dev-00358-gd3c2679 (2015-04-02-20:03)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : If you need SWD support, flash KT-Link buffer from https://github.com/bharrisau/busblaster
and use dp_busblaster_kt-link.cfg instead
Warn : Interface already configured, ignoring
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
adapter speed: 500 kHz
adapter_nsrst_delay: 100
=== Overlayed recipes ===
base-files:
xenclient-oe 3.0.14
meta 3.0.14
console-tools:
xenclient-oe 0.3.2
meta 0.3.2
consolekit:
xenclient-oe 0.4.5
meta 0.4.5
@ktemkin
ktemkin / fizzbuzz.c
Last active April 17, 2024 04:16
As a snark: fizzbuzz as a kernel module. (for extra snark credit: mknod /dev/fizzbuzz1 c <major> 0)
/**
* This is all your fault, Baljem.
*/
#include <linux/version.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/types.h>
@ktemkin
ktemkin / gist:af6ba522b88825dc0f7b
Created November 4, 2014 04:33
fastcgi_params for Moodle
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# A handy function that became available in 0.7.31 that breaks down
# The path information based on the provided regex expression
# This is handy for requests such as file.php/some/paths/here/
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUERY_STRING $query_string;