Giter Site home page Giter Site logo

ratandc2-features / coff-loader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ap3x/coff-loader

0.0 0.0 0.0 1.86 MB

A reimplementation of Cobalt Strike's Beacon Object File (BOF) Loader

License: MIT License

C++ 56.34% C 43.48% Makefile 0.18%

coff-loader's Introduction

COFF-Loader

This is a reimplementation of TrustedSec COFF Loader. I decided to create this repo to challenge my understanding of the Windows PE Format. This technique was originally used in Cobalt Strike. This project utilizes Visual Studio 2022 for those who wish to employ the VS Debugger and trace the execution of its memory operations loader.

While coding this I mainly used the following resources:

Usage

COFFLoader.exe <function name> <COFF file path>

The function name is the name BOF function entry name. This is typically "go"

Example:

COFFLoader.exe "go" C:\Github\COFF-Loader\BOF\test64.out

BOF Arguments

In order to pass arguments to the BOF I used the exact same code that Otterhacker's COFF Loader uses. The struct is as follows:

typedef struct _Arg {
    char* value;
    size_t size;
    BOOL includeSize;
} Arg;

You can see an example of this used here on line 25.

Example

In the example below I used the BOF file that I modified from TrustedSec BOF example. This simple BOF shows that the COFF loader was able to successfully was able to relocate all the symbols in different formats. Included in this I included the modified BOF in BOF/test.c directory. You can use the make file to compile it with gcc or run the following command:

x86_64-w64-mingw32-gcc -c test.c -o test64.out

demo

References

coff-loader's People

Contributors

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