Need help with drow?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

188 Stars 36 Forks MIT License 25 Commits 0 Opened issues


Injects code into ELF executables post-build

Services available


Need anything else?

Contributors list

No Data

drow Build Status

demo ich



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 contianing an embedded user-supplied payload that executes at runtime.

Slightly more detail ...

Drow takes the following steps to create the new patched ELF:

  1. Map in the umodified target ELF executable and the user-supplied payload, a position-independent blob
  2. Locate the first executable segment by parsing program headers
  3. Locate the last section in the executable segment by parsing section headers
  4. Expand the last section (in the segment) section header's
    and program header's
    by the size of the user-supplied payload
  5. Fixup section headers'
    's and program headers'
    's (move down sections and segments to make room for the payload and a small "stager stub")
  6. Fix offsets in the ELF header (
    , etc..)
  7. Modify the ELF header
    (ELF entrypoint offset) to point to the injected code
  8. Create a new ELF containing the injected code and modified ELF headers

In 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

, restoring execution so the program can run as intended.



. Then run
from the root of the directory.

Other Information

In addition to building drow, this project also builds a Linux x86-64 payload named

that simply prints to
. 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:

  • The Cerberus ELF Interface:
  • The Backdoor Factory:
  • ELFSH:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.