Git Product home page Git Product logo

cpp_vs_payload_template's Introduction

cpp_vs_payload_template

Visual Studio (C++) Solution Template for Payloads

This is a Visual Studio (C++) Solution Template intended to save some time when developing custom payloads/shellcode. This solution creates 3 projects:

  1. A static library project (Core)

    All of your payload code goes in this project in the runme() function. Add as many headers/cpp files/references as you like, but runme() will be your entry point.

  2. A dynamic library project (DLL)

    This project simply wraps the functionality of the static library project into a DLL skeleton. Once built, this project can be run directly using rundll32 or it can be converted to PIC shellcode using something like ConvertTo-Shellcode.ps1 from Nick Landers avaialble here: https://github.com/monoxgas/sRDI/tree/master/PowerShell

  3. An application project (EXE)

    This project simply wraps the static library in an executable. This project can be used to debug your payload from the Visual Studio debugger and allows you to set breakpoints in the static library code.

Use Cases

I created this project for two reasons. First, it can be used to generate both an .exe and .dll payload simultaneously, saving time. Second, I grew tired of developing payloads as DLLs only to realize there would be a bug in there somewhere and dealing with the pain in the ass that is debugging a DLL file without being able to step through code line by line in VS. Rather than creating a new project w/ the buggy code as an application instead of a DLL to debug it directly from the IDE, now I have both at once.

Instructions

  1. Copy the contents of this repository to C:\Users<YOURUSERNAME>\Documents\Visual Studio 2017\Templates\ProjectTemplates\Visual C++ Project (adjust for differences in your environment/version)

  2. Open Visual Studio

  3. Click on File/New/Project/VisualC++ and select "CPP Core/EXE/DLL Solution Template"

  4. Name the solution, click OK

  5. Select the executable project (solutionnameEXE), right-click and select "Set as startup project"

  6. Select the solution at the top, right-click and select "Properties"

  7. Go to Common Properties/Project Dependencies. Select the DLL project and set the Core project as a dependency. Repeat this for the EXE project. Hit Apply/OK.

  8. Build your code from the runme() function in the Core project as the entry point. Select your arch/build-type and build the solution.

Inspiration

The inspiration for this template came from the way I saw Silent Break Security lay out one of their projects. I wanted a relatively painless way to replicate this layout without having to do all the manual work for each payload I write.

cpp_vs_payload_template's People

Contributors

dcept905 avatar 1881r 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.