PINJECT is a seamless process injector for Linux, which inject your payload directly into other running process. It restore normal execution flow of the target program after payload injected.
PINJECT uses simple method to inject payload into the running process.
- Pass the target process name you want to inject.
- PINJECT itself recognize the pid of the target process and attach to it.
- It sets tracer option (PTRACE_O_TRACEFORK) to trace forks into target process.
- Saves the original registers, RIP and instruction.
- Inject shellcode that call fork() syscall.
- Catch that injected fork() syscall with getevent() for getting the child pid CPID.
- And, overwrites existing bytes of RIP with payload on that child process.
- Then, it restore the original instruction of target program.
For testing phase i use shellcode that prints "Injected: ar.p" but can use bind-shell or reverse-shell
:$ git clone https://github.com/0x00snape/pinject.git
:$ cd pinject
:$ cargo build --release
Works with target process having proper write permissions.
This project is licensed under MIT