Persistence via ELF backdooring through codecave or new section - #21839
Open
dledda-r7 wants to merge 2 commits into
Open
Persistence via ELF backdooring through codecave or new section#21839dledda-r7 wants to merge 2 commits into
dledda-r7 wants to merge 2 commits into
Conversation
dledda-r7
commented
Aug 28, 2026
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new ELF injector utility to enable payload injection into Linux ELF executables, supporting x86, x64, and AArch64 architectures.
New ELF Injector Implementation:
ElfInjectorclass inlib/msf/core/exe/elf_injector.rbthat parses ELF headers, locates code caves or reusable program headers, and injects a payload with a trampoline to preserve original execution flow. Supports both code cave and new segment injection techniques, with thorough validation of ELF structures.AArch64trampoline inelf_injector/a_arch64.rbfor ARM64, saving/restoring registers and branching logic for parent/child afterclone.X64trampoline inelf_injector/x64.rbfor x86_64, using Metasm assembly to fork and resume execution.X86trampoline inelf_injector/x86.rbfor 32-bit x86, using Metasm assembly for similar logic.Documentation:
documentation/modules/exploit/linux/persistence/elf.mdwith an overview of the module, supported targets, verification steps, options, limitations, and usage scenarios. This guides users through safe testing and highlights operational constraints.