All Projects → smx-smx → ezinject

smx-smx / ezinject

Licence: Zlib License
Modular binary injection framework, successor of libhooker

Programming Languages

c
50402 projects - #5 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to ezinject

Cs2cpp
C# to C++ transpiler (Cs2Cpp) (Powered by Roslyn)
Stars: ✭ 155 (+229.79%)
Mutual labels:  native, binary
ProcessInjector.NET
Learning Process Injection and Hollowing techniques
Stars: ✭ 23 (-51.06%)
Mutual labels:  hook, injection
basgo
basgo compiles BASIC-lang to Golang. Then 'go build' can translate code to native executable binary.
Stars: ✭ 31 (-34.04%)
Mutual labels:  native, binary
openjfx-docs
Getting started guide for JavaFX 11
Stars: ✭ 70 (+48.94%)
Mutual labels:  modular
universal-router
↩️ Router for every occasions
Stars: ✭ 64 (+36.17%)
Mutual labels:  modular
react-native-double-click
A Component Wrapper for Double Click/Tap
Stars: ✭ 42 (-10.64%)
Mutual labels:  native
SQL Injection Payload
SQL Injection Payload List
Stars: ✭ 62 (+31.91%)
Mutual labels:  injection
how-to-exploit-a-double-free
How to exploit a double free vulnerability in 2021. Use After Free for Dummies
Stars: ✭ 1,165 (+2378.72%)
Mutual labels:  binary
EVA2
Another version of EVA using anti-debugging techs && using Syscalls
Stars: ✭ 223 (+374.47%)
Mutual labels:  injection
asap
A cmake starter project for C++ with basic infrastructure including platform detection, compiler detection, assertions..., and a complete build lifecycle. Portable across Linux, OS X and Windows.
Stars: ✭ 39 (-17.02%)
Mutual labels:  modular
RouterService
💉Type-safe Navigation/Dependency Injection Framework for Swift
Stars: ✭ 212 (+351.06%)
Mutual labels:  modular
ng-qt
Build extremely powerful and efficient native cross-platform desktop applications using Angular and NodeGUI
Stars: ✭ 14 (-70.21%)
Mutual labels:  native
nosqlilab
A lab for playing with NoSQL Injection
Stars: ✭ 90 (+91.49%)
Mutual labels:  injection
titanium-paypal
💰 Use the PayPal iOS-SDK 2.x with Titanium Mobile.
Stars: ✭ 22 (-53.19%)
Mutual labels:  native
gulp-inject-partials
A recursive injection of partials based on their path name. Implementation of specific case of gulp-inject.
Stars: ✭ 26 (-44.68%)
Mutual labels:  injection
Modiy
Modiy is an open-source hardware interface for modular synthesis.
Stars: ✭ 21 (-55.32%)
Mutual labels:  modular
Organismo-Desktop
3D Virtual Environment for Mobile Devices. Electron Desktop Application.
Stars: ✭ 31 (-34.04%)
Mutual labels:  native
granblue-automation-android
Educational application written in Kotlin aimed at automating user-defined workflows for the mobile game, "Granblue Fantasy", using MediaProjection, AccessibilityService, and OpenCV.
Stars: ✭ 26 (-44.68%)
Mutual labels:  native
binary
package binary is a lightweight and high-performance serialization library to encode/decode between go data and []byte.
Stars: ✭ 20 (-57.45%)
Mutual labels:  binary
kotlinx-serialization-msgpack
MsgPack support for kotlinx.serialization -- msgpack.org[kotlinx.serialization]
Stars: ✭ 17 (-63.83%)
Mutual labels:  native

ezinject

Modular binary injection framework Join us on Discord

Supported Architectures:

  • Linux:

    • arm (arm+thumb)
    • aarch64
    • mips
    • x86
    • amd64
  • Windows: x64

  • FreeBSD: x86, amd64

  • Darwin: x64

Supported C Libraries:

  • Linux
    • glibc
    • uClibc (tested on ARM, MIPS)
    • Android (tested on Android 2.x - 10.x)
  • FreeBSD (tested on FreeBSD 12)
  • Windows
    • NT 6 (tested on Windows 10)
  • Darwin (tested on macOS 11)

How does it work

ezinject implements a single instrumentation primitive: remote calls

We proceed as following:

  • Create a remote memory segment (via shared memory or remote allocation), that will hold the payload
    • If using shared memory, use remote syscalls to attach the shared memory in the target process
  • Invoke the payload remotely, in shared memory.

The stack at entry will contain a pointer to the context, and a pointer to the function to call.

  • The payload pops the parameters and the function to call from the stack, then calls the function in C (thus emitting a proper call with a stack frame)
  • The payload implementation creates a mutex/event, then opens the target library and awaits for the thread to be created.
  • The ezinject's crt (linked in the library) creates a local copy of the context, then creates a new thread.
  • The crt signals that the thread is ready to be awaited
  • The newly created thread prepares argv, then invokes lib_preinit and lib_main functions in the library
  • The user code is invoked. It can call any function inside the target, replace or hook functions (with libhooker in userland)

Build

The following is an example on Debian and derivates, needs to be adjusted for each platform.

  1. Install dependencies
  • build-essential
  • cmake
  • libcapstone-dev
  • pkg-config
  1. Build the project
./build.sh

Sample usage

Linux .so injection

On Terminal 1

$ cd build/samples/dummy
$ ./target

On Terminal 2

$ cd build
$ sudo ./ezinject `pidof target` samples/dummy/libdummy.so

Expected output

return1() = 1

changes to

return1() = 13370

Python injection

echo "print('hello ' * 3 + 'from python');" > hello.py
export EZPY=`python -c "import sys; print(':'.join(sys.path))"`
echo "python path: $EZPY"

Find libpython:

find /usr/lib -name "libpython*"

Put correct libpython and paths in example below:

sudo ./ezinject `pidof target` samples/pyloader/libpyloader.so /usr/lib/x86_64-linux-gnu/libpython2.7.so.1 /usr/lib/python2.7 $EZPY hello.py
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].