3 releases

0.1.3 Sep 8, 2024
0.1.2 Sep 8, 2024
0.1.1 Dec 25, 2022
0.1.0 Dec 21, 2022

#95 in Memory management

Download history 233/week @ 2024-09-05 74/week @ 2024-09-12 13/week @ 2024-09-19 15/week @ 2024-09-26 13/week @ 2024-10-03 4/week @ 2024-10-10

96 downloads per month

MIT license

12KB
165 lines

shellexec

Build Status Latest Version

Cross-platform shellcode executor in rwx memory

Usage: shellexec <binary>

Executes shellcode

Positional Arguments:
  binary            path to binary file

Options:
  --help            display usage information

Implementation

virtual-memory is used to execute shellcode. This helper crates allocates rwx memory using the system functions that is described here:

Then the contents of the file are copied into this memory, the address of this memory is converted into a function and called

Installing from crates.io

cargo install shellexec

Building

cargo build --release

Usage

# linux
cargo run --release -- shellexec/test_input/linux

# windows
cargo run --release -- shellexec/test_input/windows

# output
hello from shellcode!

Dependencies

~0.5–7.5MB
~59K SLoC