(01-30-2014, 09:44 PM)mrpassword Wrote: I'm researching on DLL injection right now, and my mind was rambling about some things, so I got curious, googled for a bit, but couldn't find what i needed so my questions are:
1.) Does DLL injection inherit the privileges (like administrative rights) of the process it injects to?
2.) if so; are there default windows processes that run with administrative privileges?
3.) if so; does that mean you could get into any windows machine unnoticed?
thank you in advance,
~MrPassword
1. That depends on what process loaded the DLL, and the permissions of that process
2. You don't have to have your DLL loaded via a default Windows program
3. Depends on how the DLL injection is done
The registry and startup locations for persistence are too easy to detect, and they are also far too common to be undetected by a trained power user as well. DLL injection without leaving a forensic footprint can be done by taking advantage of the DLL search order for when DLL's are loaded.. Look here:
http://msdn.microsoft.com/en-us/library/...S.85).aspx
The trivial part of the information embedded in that link is that the first priority is the directory of the executable itself for first search, unless the DLL name is listed within the registry in the KnownDLLs object... However, certain dll's are loaded when these KnownDLLs are loaded by a process, and because they aren't listed in the KnownDLLs object, they can be placed within the directory of the executable which calls to load a dll listed in the registry, and have it load the malicious dll when the program starts. Combine this theory with a startup program and you've got a dangerous combination. This doesn't come without a bit of maintenance though, because you still need to load the proper DLL for the program to function correctly.
Because DLL's are loaded from the System32 directory from the KnownDLLs object, this means that the executables within System32 are not vulnerable to such strategies...
The retarded part about Windows is that not all startup executables that are default for Windows reside under System32; explorer.exe, among others...
The last thing here to note is an obvious one, but the DLL placed in the executable's directory, cannot already exist.
Other than that, the extent of this issue on Windows is phenomenally vast. Vulnerable processes are not limited to Windows executables, however the inherited permissions from the process which is attached to the loaded dll vary.