Anton,
This metod does work under Vista.
And the PID is the one we might expect.
Under XP we do not use this approach, so I have not tested this technique.
Inaki.
-----Mensaje original-----
De: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] En nombre de xxxxx@hotmail.com
Enviado el: martes, 04 de septiembre de 2007 0:31
Para: Windows File Systems Devs Interest List
Asunto: RE:[ntfsd] IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION for stopping module loading
Note that there is a serious issue with this approach. Most executable starts
result in multiple (and a variable number too) >IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION callbacks. It is not easily possible
therefore to figure out if it’s a new launch of the same binary as opposed to
bits and pieces of the previous launch.
In my experience, this is just a part of the problem - I tried to register a callback for section synchronization, but it just does not seem to get invoked when you create a new process, at least not under XP. What you have mentioned is another side of the same story. In general, there does not seem to be one-to-one correspondence between callback invocation and ZwCreateSection() call that has to be made when a process gets launched. Furthermore, even if there was the above mentioned one-to-one correspondence, you still would have no chance to discover an ID of the process that tries to launch an executable - your callback is invoked in context of another thread, and no PID/TID of ZwCreateSection() caller is provided to it.
The funniest thing here is that the suggestion about blocking executable section creation comes from MSFT itself. In actuality, there is nothing new about this approach to blocking process creation. I even wrote an article about it - I did it by hooking ZwCreateSection() in SSDT, and in one of our discussions in MSFT newsgroup, Don suggested that the same thing can probably be done “properly” by registering IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION callback. I tested Don’s proposal, but, unfortunately, it just does not seem to work (which, I believe, is 100% MSFT’s fault). Therefore, when I see MSFT’s suggestion to do it, my only reaction to the whole thing is a sarcastic smile - after all, they did everything they possibly could to make sure that this approach does not work properly…
Anton Bassov
NTFSD is sponsored by OSR
For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
You are currently subscribed to ntfsd as: xxxxx@pandasecurity.com
To unsubscribe send a blank email to xxxxx@lists.osr.com