Rather primitive Malware using Python3 and similar already available software on the victim's machine (which can also be compiled using PyInstaller/pycom if not) has the capability to override the user's processes in memory while they're running.
There's even a library for that. You can of course even use integrated standard library commands from Python3 to do the similar, but pymem
makes it easier in my opinion. To quote:
"Python can call any Microsoft API and perform process injection using the classic VirtualAlloc(), CreateRemoteThreat(), etc."
So it seems this attack vector is a subcategory of process injection called Process Hollowing. The issue seems only to be on Windows, since it was a design choice for antiviruses and etc to be possible to inject into processes.
So my questions are:
- Can malware override and then execute from any memory location of a process or it has to be specific?
- Since the possibility to do this (please correct me if I'm wrong) only exists on Windows (according to the MITRE ATT&CK page too), how do I mitigate/protect against this threat vector on a Windows machine?
- Also when we're talking about "hijacking" the process for nefarious purposes are we talking here about virtual or physical memory?
- How do you successfully monitor against process manipulation? (yes, MITRE ATT&CK, mentions it but that's about it)