Skip to content

Instantly share code, notes, and snippets.

View benheise's full-sized avatar

Benjamin Heise benheise

View GitHub Profile
@benheise
benheise / shellBigInt.cs
Created February 11, 2022 16:37
Shellcode Stuffed in BigInteger
sing System;
using System.Diagnostics;
using System.Reflection;
using System.Configuration.Install;
using System.Runtime.InteropServices;
/*
Author: Casey Smith, Twitter: @subTee
@benheise
benheise / AllTheThings.cs
Created February 11, 2022 16:37
DynWrapit - Arbitrary .NET load Any Assembly from configurable path
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.InteropServices;
public class Program
{
public static void Main()
{
@benheise
benheise / type.cs
Created February 11, 2022 16:36
Experiments - Event ID 007: No Image loaded Event
using System;
using System.EnterpriseServices;
using System.Runtime.InteropServices;
public sealed class MyAppDomainManager : AppDomainManager
{
public override void InitializeNewDomain(AppDomainSetup appDomainInfo)
{
@benheise
benheise / client-ipv6-generic.c
Created January 24, 2022 02:16 — forked from mhaskar/client-ipv6-generic.c
DNSStager v1.0 beta agent to inject the retrived shellcode in notepad.exe and using Early Bird APC
#include <stdint.h>
#include <inttypes.h>
#include <winsock2.h>
#include <windns.h>
#include <windows.h>
#include <stdio.h>
#include <tlhelp32.h>
@benheise
benheise / KbdclassFltrDriver.c
Created December 15, 2021 00:59 — forked from Barakat/KbdclassFltrDriver.c
Kbdclass kernel filter driver to log scan-codes
#include <wdm.h>
#include <ntddkbd.h>
//
// Per-device object extension
//
typedef struct _DEVICE_EXTENSTION
{
//
// Driver must not be deleted as long as there is a pending IRP
@benheise
benheise / Quick
Last active February 12, 2022 07:23
Quick and easy Wireguard VPN
This guide assumes the DigitalOcean provider will be used, and a droplet will be generated on a Windows 10/11 host with WSL2 installed, using a Debian VM. Terraform and Ansible will be used to create and destroy the VPN droplet. After that, the Wireguard client configuration in "wg0.conf" can be used on your desktop, laptop, mobile device, etc. You should generate a new Wireguard client per each device, rather than reusing the same one across multiple.
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install unzip wget git apt-add-repository software-properties-common gnupg
wget https://releases.hashicorp.com/terraform/1.0.11/terraform_1.0.11_linux_amd64.zip -O terraform.zip; unzip terraform.zip
sudo mv terraform /usr/local/bin; rm terraform.zip
sudo apt-add-repository ppa:ansible/ansible
git clone https://github.com/P0ssuidao/terraguard.git
cd terraguard/DigitalOcean/
terraform init
@benheise
benheise / laps.py
Created August 6, 2021 15:10 — forked from jstnkndy/laps.py
Modified version of https://github.com/n00py/LAPSDumper to allow cross domain targeting
#!/usr/bin/env python3
from ldap3 import ALL, Server, Connection, NTLM, extend, SUBTREE
import argparse
parser = argparse.ArgumentParser(description='Dump LAPS Passwords')
parser.add_argument('-u','--username', help='username for LDAP', required=True)
parser.add_argument('-p','--password', help='password for LDAP (or LM:NT hash)',required=True)
parser.add_argument('-l','--ldapserver', help='LDAP server (or domain)', required=False)
parser.add_argument('-d','--domain', help='Domain', required=True)
parser.add_argument('-t', '--target', help="Target Domain", required=False)
@benheise
benheise / gist:ad7f2adb605a7ec216a506e821705a06
Last active June 17, 2022 23:29
C++ execution guardrail process name
// quick and dirty C++ execution guardrail on executing process file name, inspired by @0xHop av evasion post
// https://0xhop.github.io/evasion/2021/04/19/evasion-pt1/
#include <Windows.h>
#include <string>
#define MAX_PATH 512
// check if our program has been renamed, if so may be in a sandbox or being analyzed
@benheise
benheise / gist:c94558dafbfdb2d05dd089350ac0c9a2
Last active August 7, 2019 16:31
nc with https in powershell
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}

Keybase proof

I hereby claim:

  • I am benheise on github.
  • I am benheise (https://keybase.io/benheise) on keybase.
  • I have a public key whose fingerprint is ECCE D854 CEAB 2375 7573 72EE 7B44 EE76 3D3E 6E0E

To claim this, I am signing this object: