I am writing an app that enumerate every process's loaded DLLs and copy them to some remote directory for further examination. Using the EnumProcessModules API i suppose to get every module that's loaded at the target process, but what about those cases where the DLL is hiding itself by removing it's entry at the PEB (i.e CloakDLL, Ntllusion)?
I would like to get some more ideas on how to check for DLL injection in a given process, so that i can cover as much possible injected DLLs as i can.
My current knowledge are the following:
do you have any other ideas ?
BTW Since i am currently don't have any knowledge about kernel mode code i am intending to do all of these from user mode, BUT in case there is a way to do something from kernel mode code that i couldn't do from user mode don't hesitate to drop the method here (i will learn how to code kernel mode level code at some point).
I would like to get some more ideas on how to check for DLL injection in a given process, so that i can cover as much possible injected DLLs as i can.
My current knowledge are the following:
- Use EnumProcessModules (AFAIK it uses the PEB of the target process to enum the loaded DLLs)
- Check the memory of a given process using VirtualQuery (bruteforce, is it checking the VAD ?)
- Check the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs
- Hook LoadLibrary or CreateRemoteThread
do you have any other ideas ?
BTW Since i am currently don't have any knowledge about kernel mode code i am intending to do all of these from user mode, BUT in case there is a way to do something from kernel mode code that i couldn't do from user mode don't hesitate to drop the method here (i will learn how to code kernel mode level code at some point).