Coder Social home page Coder Social logo

startroutine's Introduction

StartRoutine

A library with four different methods to execute shellcode in a process. All methods support x86, x64 and wow64 shellcode execution. All methods will call GetLastError if the to be executed shellcode returns anything other than ERROR_SUCCESS. The methods will consider the shellcode execution failed if execution time is longer than SR_REMOTE_TIMEOUT (default 2000ms).


The following methods can be used:

  • NtCreateThreadEx
  • Thread hijacking
  • SetWindowsHookEx
  • QueueUserAPC

NtCreateThreadEx

This method simply spawn a new thread in the specified target process. The thread can be cloaked. This option disables DLL_THREAD_ATTACH and DLL_THREAD_DETACH calls to loaded modules, fakes the thread entry point and enables the THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER flag. Since NtCreateThreadEx ignores session seperation this can be used to execute code in session 0 processes.

Thread hijacking

This method hijacks a thread by suspending it and redirecting it to shellcode. After the shellcode has been executed normal flow of execution is restored. This method works cross session.

SetWindowsHookEx

This methods attempts to execute the shellcode by redirecting the WH_CALLWNDPROC calls of the target process' windows to the shellcode using SetWindowsHookEx. This method is not cross session compatible.

QueueUserAPC

This method executes the shellcode by queueing APCs to the target process' threads. Shellcode will prevent the execution from happening more than once. RtlQueueApcWow64Thread is used when dealing with a wow64.


Getting started

Include "Start Routine.h" and the compiled library or this project, map your shellcode and call StartRoutine or StartRoutine_WOW64 depending on the architecture of the target process. An indepth description of the StartRoutine(_WOW64) arguments can be found in "Start Routine.h". "Error.h" contains all possible error values and their respective meanings.

startroutine's People

Contributors

broihon 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.