This technique works by coercing a program to load an unused DLL, and then overwriting some part of the unused DLL to host our payload, and then starting a new thread to execute that DLL.
This will minimize our artifacts, because of the following reasons
Memory scanners will not scan DLLs for malicious signatures or compare DLLs in disk to memory as it will be very resource intensive for an EDR to scan every DLL loaded in a process
Our thread will map back to a legitimate DLL instead of a weirdly allocated piece of memory
We will have no RWX memory regions that are not backed up by any file
For the sake of this lab(ish), we will simply just allocate a block of memory in a benign DLL and execute that.
Let's first Load our library we want to overwrite: