Index > Malware > 2021-02-02: Persistence
What does this registry key do?
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
It runs things at startup! If malware authors can create a value in this subkey, they can start their malware when the computer starts.
The ApppInit_DLLs are loaded into every program that uses User32.dll. This is another persistence method, but authors need to be careful - to avoid running multiple copies of the malware, they need to check the name of the process, commonly in DllMain
.
32 means 64 bits - they wanted to keep the same names. 64 means 32 bits, running in the windows for windows subsystem :facepalm:
This is a registry key that is checked when certain events happen:
It’s another persistence method.
Your friendly neighborhood malware might install itself as a service.
On Linux, it’s called a Daemon. Linux Services generally start services
Services live here:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\<Service Name Goes Here>
There are a bunch of keys under that service name that define what it is and how to run it.
There are a lot of services - to make group management easier, windows puts a lot of services under a single process: SvcHost
. Creating a new group under SvcHost wouldn’t be very covert (Each group runs under its own process) - but malware can easily add more DLLs to an existing group.
pusha
to save the state of the registerspopa
to put the registers back togetherWe’re looking at an example in class:
My best guess is that it doesn’t know the address of the more evil code - but it can take it’s own address (via the call) and then add an offset to it.
Windows searches for DLLs in a specific order. If a malicious copy is placed in a directory that is searched before the directory with the original, then the malicious one is used.
I missed this section :(
The “trampoline” refers to how control execution falls into the malware, then bounces back.
Control, intended for a function, instead goes to the malware, which then jumps back to the function when its done.