Posted: Sun Nov 17, 2013 4:45 am Post subject: A wierd dll injection thechnique
I recently encounter an injection method that i'v never seen..
i'll try to explain what i have figured from it
from a kernel mode driver it gets the entry of ntdll, allocates a buffer at 71b00000 and write the loading routine that uses LdrLoadDll there.
now i'm guessing it redirecting the entry of ntdll to it's loading routine?
I'm pretty confused here
I don't have any code to show here, but does any of you familiar with that kind of method? _________________
Well.. no
it has the address of LdrLoadDll already
and after it allocates memory for the loading routine it writes it (There's a call to ZwWriteVirtualMemory)
i believe it changes the the entry for ntdll so the loading routine will be called and then return it to it's original offset
does that make any sense?!? >_< _________________
Joined: 12 Dec 2012 Posts: 340 Location: Somewhere....
Posted: Sun Nov 17, 2013 6:44 am Post subject: Re: A wierd dll injection thechnique
Stylo wrote:
from a kernel mode driver it gets the entry of ntdll, allocates a buffer at 71b00000 and write the loading routine that uses LdrLoadDll there.
now i'm guessing it redirecting the entry of ntdll to it's loading routine?
so do you mean it copies the entire function LdrLoadDll to that allocated memory, then calls the copy instead of directly calling ntdll's ?
if so, are you sure that this driver is not a part of any malicious software (virus, trojan,....etc) ?, it's really weird why would it do this.
No no no..
the loading routine contain a call to LdrLoadDll within it.
the driver copies that loading routine to the virtual memory of the desired process.
it's really wierd
@edit:
it turns out i was right
the driver overwrites the entry point offset field at the PE Header of ntdll
then when ntdll is initialized and the entry point is called, the hook is called where there's a call to the original entry point
and right after that a call to LdrLoadDll.
awesome and sick at the same level _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum