GithubHelp home page GithubHelp logo

anthrax3 / shellcodetemplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cracked5pider/shellcodetemplate

0.0 1.0 0.0 146 KB

A easily modifiable shellcode template for Windows x64/x86

C 63.12% Makefile 17.27% Python 11.39% Assembly 8.23%

shellcodetemplate's Introduction

Shellcode Template

A easily modifiable shellcode template for Windows x64/x86

How does it work?

This 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 entrypoint 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 );
        } 
    }
    
    // ------ Code ------
    Instance.Win32.MessageBoxA( NULL, GET_SYMBOL( "Hello World" ), GET_SYMBOL( "MessageBox Title" ), MB_OK );
}

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()

Preview

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

Credit

Huge credit goes to Austin Hudson (aka SecIdiot)!!!

shellcodetemplate's People

Contributors

cracked5pider avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.