Drow is a command-line utility that is used to inject code and hook the entrypoint of ELF executables (post-build). It takes unmodified ELF executables as input and exports a modified ELF containing an embedded user-supplied payload that executes at runtime.
sh_size
and program header’s p_memsz
/p_filesz
by the size of the user-supplied payloadsh_offset
‘s and program headers’ p_offset
‘s (move down sections and segments to make room for the payload and a small “stager stub”)e_shoff
, e_phoff
, etc..)e_entry
(ELF entrypoint offset) to point to the injected codeIn addition to injecting the user-supplied payload, drow injects a small code stub that is prepended to the beginning of the payload. This stub is designed to call into the payload. If the payload is written to return to the caller, after the payload returns the stager then tailcalls into _start
, restoring execution so the program can run as intended.
Building
Install gcc
and scons
. Then run scons
from the root of the directory.
Other Information
In addition to building drow, this project also builds a Linux x86-64 payload named rappers_delight.bin
that simply prints to stdout
. This can be used for testing. Currently, drow only works with ELF64 files targetting x86-64.
Other Work
There has been a lot of open source work done in this domain. I encourage you to also check out the following projects and associated publications:
Starship is a powerful, minimal, and highly customizable cross-shell prompt designed to enhance the terminal…
Lemmy is an innovative, open-source platform designed for link aggregation and discussion, providing a decentralized…
The latest release of ImHex v1.37.0 introduces a host of exciting features and improvements, enhancing…
Ghauri is a cutting-edge, cross-platform tool designed to automate the detection and exploitation of SQL…
Writing tools have become indispensable for individuals looking to enhance their writing efficiency, accuracy, and…
PatchWerk is a proof-of-concept (PoC) tool designed to clean NTDLL syscall stubs by patching syscall…