Skip to content

Instantly share code, notes, and snippets.

View jjensn's full-sized avatar

jjensn jjensn

View GitHub Profile
@jjensn
jjensn / beep.cpp
Created January 21, 2021 02:27 — forked from uf0o/beep.cpp
Usage of 'NtOpenFile' to access a device driver that doesn't export any symlink
#include <Windows.h>
#include <stdio.h>
#include <winternl.h>
#pragma comment(lib, "ntdll")
#define IOCTL_BEEP CTL_CODE(FILE_DEVICE_BEEP, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
typedef struct _BEEP_SETTINGS {
ULONG ulFrequency;
@jjensn
jjensn / drvscan.cpp
Created July 18, 2019 20:18 — forked from adrianyy/drvscan.cpp
vulnerable driver scanner
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <filesystem>
#include <Windows.h>
#include <winternl.h>
static_assert( sizeof( void* ) == 8 );
@jjensn
jjensn / DmaHvBackdoor.c
Created May 17, 2018 20:24 — forked from Cr4sh/DmaHvBackdoor.c
Hyper-V backdoor for UEFI
/*
*********************************************************************
Part of UEFI DXE driver code that injects Hyper-V VM exit handler
backdoor into the Device Guard enabled Windows 10 Enterprise.
Execution starts from new_ExitBootServices() -- a hook handler
for EFI_BOOT_SERVICES.ExitBootServices() which being called by
winload!OslFwpKernelSetupPhase1(). After DXE phase exit winload.efi
transfers exeution to previously loaded Hyper-V kernel (hvix64.sys)
@jjensn
jjensn / rubix_cube.yaml
Last active January 18, 2017 17:04
Rubix Light Cube for Home Assistant
- alias: "Magic Cube"
hide_entity: false
trigger:
- platform: state
# this is a smartthings multisensor, connected via MQTT from a SmartThings hub to Home Assistant
entity_id: sensor.magic_cube
action:
- service: light.turn_on
entity_id:
# any lights you want to change would go here
@jjensn
jjensn / grouped_light.py
Last active March 6, 2018 19:47 — forked from hordurk/grouped_light.py
Grouped light platform for Home Assistant
import logging
# Import the device class from the component that you want to support
from homeassistant.components import light
from homeassistant.const import (STATE_OFF, STATE_ON, SERVICE_TURN_ON,
SERVICE_TURN_OFF, ATTR_ENTITY_ID)
from homeassistant.components.light import (SUPPORT_BRIGHTNESS,
SUPPORT_RGB_COLOR,
SUPPORT_COLOR_TEMP,
SUPPORT_TRANSITION)