Coder Social home page Coder Social logo

elfinject's Introduction

x64 ELF code injector

A simple ELF code injector for x64. Uses segment padding to infect a file and will run the code on binary startup. For educational purposes only!

Getting Started

These instructions will set up all prerequisites to use the ELF injector.

Prerequisites

The program relies on gcc and objdump. The following command installs these on Ubuntu:

sudo apt-get install gcc binutils

Building

Simply cd into this directory and type:

make

Usage

The following command takes a assembly file and outputs a the dumped code section as file:

./create_injectable_file.sh input output

The injector has to be used as follows:

Usage:
        -I/-i input_file  : the file used as input
        -O/-o output_file : the file to infect
        -C/-c input_file  : the raw binary with the code to inject

Example

As an example, the injected_asm.S file can be used. Type:

./create_injectable_file.sh injected_asm.S inject
./elfinjector -i /bin/nc -o /home/user/bin/nc -c inject -P
./nc

This example will infect the /bin/nc file and print the letter "I" at startup of the binary. The output file can be found in /home/user/bin/nc.

elfinject's People

Contributors

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