Kali Linux

Shellcode Template : An Easily Modifiable Shellcode Template For Windows X64/X86

Shellcode Template is heavily based on Austin Hudson’s (aka SecIdiot) TitanLdr It compiles the project into a PE Executable and extracts the .text section

Example

The entry point of the shellcode looks like this. Of course, this can be changed for your need. First we need to initialize needed libraries and functions by using our custom written GetModuleHandle and GetProcAddress.

SEC( text, B ) VOID Entry( VOID )
{
INSTANCE Instance = { };
Instance.Modules.Kernel32 = TGetModuleHandle( HASH_KERNEL32 );
Instance.Modules.Ntdll = TGetModuleHandle( HASH_NTDLL );
if ( Instance.Modules.Kernel32 != NULL )
{
// Load needed functions
Instance.Win32.LoadLibraryA = TGetProcAddr( Instance.Modules.Kernel32, 0xb7072fdb );
// Load needed Libraries
Instance.Modules.User32 = Instance.Win32.LoadLibraryA( GET_SYMBOL( “User32” ) );
if ( Instance.Modules.User32 != NULL )
{
Instance.Win32.MessageBoxA = TGetProcAddr( Instance.Modules.User32, 0xb303ebb4 );
}
}

Btw as you can see we can use normal strings in our shellcode. This is because we include the .rdata section into our shellcode at linking time. And GET_SYMBOL gets the pointer to the function or string via its relative offset to GetRIP()

Get Started

Clone this project and you are ready to start

git clone https://www.github.com/Cracked5pider/ShellcodeTemplate

Next you would need to change the project name in the makefile from ShellcodeTemplate to whatever you want Then you can compile the project by using make

make // to compile x64 and x86
make x64 // to compile only x64
make x86 // to compile only x86

R K

Recent Posts

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

1 week ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

2 weeks ago

Red Team Certification – A Comprehensive Guide To Advancing In Cybersecurity Operations

Embark on the journey of becoming a certified Red Team professional with our definitive guide.…

3 weeks ago

CVE-2024-5836 / CVE-2024-6778 : Chromium Sandbox Escape via Extension Exploits

This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…

3 weeks ago

Rust BOFs – Unlocking New Potentials In Cobalt Strike

This took me like 4 days (+2 days for an update), but I got it…

3 weeks ago

MaLDAPtive – Pioneering LDAP SearchFilter Parsing And Security Framework

MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…

3 weeks ago