I am well acquainted with ASLR, but today I heard a new interesting fact about the implementation of ASLR in Windows.
To optimize performance, if process A and B load the same DLL, Windows will load only once in physical memory, and both processes will share the same instance through shared pages.
This is old news. But the interesting part is that both processes A and B load the shared library into the same virtual address (why?).
It seems to me that any local attack (for example, privilege escalation) can easily bypass ASLR as follows:
1. Create a new dummy process 2. Check the address of dlls of interest (kernel32, user32 ..) 3. Attack the privileged process and bypass ASLR with the information from step 2.
I did some simple tests with Olly and found that shared libraries actually loaded into the same virtual address.
If so, is ASLR useless for local use?
source share