8000 GitHub - hippich/linux_injector: A simple ptrace-less shared library injector for x64 Linux
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A simple ptrace-less shared library injector for x64 Linux

License

Notifications You must be signed in to change notification settings

hippich/linux_injector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linux_injector

A simple ptrace-less shared library injector for x64 Linux.

Usage

linux_injector <pid> <module>

pid

Target process id. Must have ptrace rights to it (required for accessing /proc/$pid/mem).

module

Module to inject, will be dlopened in the remote process. Should probably be a full path, because the remote LD_LIBRARY_PATH is used otherwise for resolution.

Modification

For control flow hijacking, this program needs a hijacking candidate. The code presented here uses malloc, this can be changed by editing FUN_NAME and recompiling. Make sure the hooked function can run under 100ms, so that it won't be overwritten while it executes. This means calls like sleep or wait are bad candidates for the initial shellcode. The function in question also needs to be more than 0x50 long for the shellcode not to overwrite other functions.

Shortcomings

The code expects that the target uses the same libc as available to us. If it does not, then the remote symbols won't be found. This could be fixed by reading the remote libraries and scanning for our symbols in them.

Supported OS

Most Linuxes that use glibc should be supported. Tested only on Oracle Linux 8.7.

License

MIT License

About

A simple ptrace-less shared library injector for x64 Linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.0%
  • CMake 2.0%
0