Adversaries may inject code into processes in order to evade process-based defenses as well as possibly elevate privileges. Process injection is a method of executing arbitrary code in the address space of a separate live process. Running code in the context of another process may allow access to the process's memory, system/network resources, and possibly elevated privileges. Execution via process injection may also evade detection from security products since the execution is masked under a legitimate process. 

There are many different ways to inject code into a process, many of which abuse legitimate functionalities. These implementations exist for every major OS but are typically platform specific. 

More sophisticated samples may perform multiple process injections to segment modules and further evade detection, utilizing named pipes or other inter-process communication (IPC) mechanisms as a communication channel. 
Process Injection
source_name: mitre-attack  url: https://attack.mitre.org/techniques/T1055  external_id: T1055     source_name: GNU Acct  description: GNU. (2010, February 5). The GNU Accounting Utilities. Retrieved December 20, 2017.  url: https://www.gnu.org/software/acct/     source_name: Elastic Process Injection July 2017  description: Hosseini, A. (2017, July 18). Ten Process Injection Techniques: A Technical Survey Of Common And Trending Process Injection Techniques. Retrieved December 7, 2017.  url: https://www.endgame.com/blog/technical-blog/ten-process-injection-techniques-technical-survey-common-and-trending-process     source_name: RHEL auditd  description: Jahoda, M. et al.. (2017, March 14). redhat Security Guide - Chapter 7 - System Auditing. Retrieved December 20, 2017.  url: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security_guide/chap-system_auditing     source_name: ArtOfMemoryForensics  description: Ligh, M.H. et al.. (2014, July). The Art of Memory Forensics: Detecting Malware and Threats in Windows, Linux, and Mac Memory. Retrieved December 20, 2017.     source_name: Microsoft Sysmon v6 May 2017  description: Russinovich, M. & Garnier, T. (2017, May 22). Sysmon v6.20. Retrieved December 13, 2017.  url: https://docs.microsoft.com/sysinternals/downloads/sysmon     source_name: Chokepoint preload rootkits  description: stderr. (2014, February 14). Detecting Userland Preload Rootkits. Retrieved December 20, 2017.  url: http://www.chokepoint.net/2014/02/detecting-userland-preload-rootkits.html     