Run remote Linux ELF binaries directly from memory. Rust port of MikhailProg/elf: download an ELF over HTTP(S), map it in memory, patch auxv/argv, and jump to its entry point without writing to disk.
elf-rs downloads a Linux ELF executable over HTTP(S), maps it into memory using mmap, patches the initial process auxv entries, fixes argv/argc so arguments are correctly forwarded, and finally transfers control to the ELF entry point (or its PT_INTERP dynamic linker).
This makes the loaded program behave like it was executed normally via execve, but without writing the executable to disk.
- ✅ Download & run ELF binaries from HTTP(S) URLs
- ✅ Loads ELF directly from memory (no temp file)
- ✅ Supports both:
- statically linked ELF (no PT_INTERP)
- dynamically linked ELF (PT_INTERP → loads system dynamic linker)
- ✅ Correctly patches important
auxventries:AT_PHDR,AT_PHNUM,AT_PHENT,AT_ENTRY,AT_EXECFN,AT_BASE
- ✅ Correctly forwards program arguments:
elf-rs <url> [args...]→ loaded program receives[args...]
- ✅ Works on:
x86_64-unknown-linux-gnuaarch64-unknown-linux-gnu
- Download ELF bytes into memory
- Parse ELF header + program headers (PT_LOAD segments, optional PT_INTERP)
mmapeach PT_LOAD into the correct virtual memory location- If PT_INTERP exists: load the interpreter ELF (dynamic loader) too
- Patch initial stack vectors (
auxv) so the dynamic linker and libc see correct metadata - Shift
argvand decrementargcso the loaded program sees the intended args - Jump to entry point with a trampoline (
jmp/br) while restoring the original stack pointer
cargo build --releaseelf-rs <http[s]://host/path/to/binary> [args...]./elf-rs https://example.com/hello -f --verboseargv[0] = "hello"
argv[1] = "-f"
argv[2] = "--verbose"