There are many rootkits, viruses, backdoors, and other tools out there that can be used to infect a system's userland memory. We will now name and describe a few of these.
LD_PRELOAD injection userland rootkit for Linux that is based on its predecessor rootkit named Jynx. LD_PRELOAD rootkits will preload a shared object into the program that you want to infect. Typically, such a rootkit will hijack functions such as open, read, write, and so on. These hijacked functions will show up as PLT hooks (modified GOT). For more information, visit https://github.com/chokepoint/azazel.sshd_fucker is the software that comes with the Phrack 59 paper Runtime process infection. The software infects the sshd process and hijacks PAM functions that usernames and passwords are passed through. For more information, visit http://phrack.org/issues/59/8.htmlWhat does process infection mean? For our purposes, it means describing ways of injecting code into a process, hijacking functions, hijacking control flow, and anti-forensics tricks to make analysis more difficult. Many of these techniques were covered in Chapter 4, ELF Virus Technology – Linux/Unix Viruses, but we will recapitulate some of these here.
ptrace() system call and shellcode that uses either the mmap() or __libc_dlopen_mode() function to load the shared library file. A shared object might not be a shared object at all; it may be a PIE executable, as with the Saruman infection technique, which is a form of anti-forensics for allowing a program to run inside of an existing process address space. This technique is what I call process cloaking.ptrace(), such as GDB) can be used to inject shellcode into the process, which in turn memory-maps the object file to the memory.ET_DYN and ET_REL files) into the process.jmp instruction that transfers control to a malicious function. This can be detected easily by scanning the initial byte code in every function.ptrace(PTRACE_SYSCALL, …) to locate this code and then replace the %rax register with the system call number that they want to invoke. This allows a clever attacker to invoke any system call that they want to in a process without having to inject shellcode. Check out this paper I wrote in 2009; it describes the technique in detail at http://vxheaven.org/lib/vrn00.html.