Coder Social home page Coder Social logo

dalakatt / pe_to_shellcode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hasherezade/pe_to_shellcode

2.0 0.0 0.0 114 KB

Converts PE into a shellcode

Home Page: https://www.youtube.com/watch?v=WQCiM0X11TA

License: BSD 2-Clause "Simplified" License

CMake 11.62% C++ 31.96% C 0.14% Assembly 55.95% Batchfile 0.33%

pe_to_shellcode's Introduction

pe_to_shellcode

Build status GitHub release Github All Releases Github Latest Release

Converts PE so that it can be then injected just like a normal shellcode.
(At the same time, the output file remains to be a valid PE).
Supports both 32 and 64 bit PEs

Authors: @hasherezade & @hh86

Objective

The goal of this project is to provide a possibility to generate PE files that can be injected with minimal effort. It is inspired by Stephen Fewer's ReflectiveDLLInjection - but the difference is that with pe2shc you can add the reflective loading stub post-compilation. Also, the header of the PE file is modified in such a way, that you can start executing the injected buffer from the very beginning - just like you would do with a shellcode. It will automatically find the stub, and continue loading the full PE.

Builds

๐Ÿ“ฆ โš™๏ธ Download the latest release.

Clone

Use recursive clone to get the repo together with all the submodules:

git clone --recursive https://github.com/hasherezade/pe_to_shellcode.git

How to use it

  1. Use pe2shc.exe to convert a PE of your choice:
pe2shc.exe <path to your PE> [output path*]
* - optional

If the PE was successfuly converted, pe2shc will let you know where the output was saved:

[+] Saved to file: <converted file>

i.e.

[+] Saved to file: test_file.shc.exe
  1. Use runshc.exe(*) to run the output file and check if the conversion went fine.
runshc.exe <converted file>

(*)Warning: remember to use the version of runshc with a bitness appropriate to your converted application (32 or 64 bit) - otherwise the application will crash!

  1. If the file runs as the original PE, it confirms that the conversion was successful!
    Now you can use the converted PE just like you would use a shellcode: inject it to a target and execute from the beginning of the buffer. No additional PE loaders are required.
    At the same time, you can keep using the converted file as a regular PE.

pe_to_shellcode's People

Contributors

86hh avatar hasherezade avatar

Stargazers

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