The whole mechanism on how to traverse the process list and deal with the synchronization issues is described by the book “Rootkits: Subverting the Windows Kernel” from Greg Hoglund and James Butler.
I haven’t tried the suggestions from that book, so I don’t know how well they work, however according to the book:
- In order to prevent the “hidden” process (i.e. a process that was removed from the operating system’s process list) from crashing, when you terminate it, you need to change the Flink and the Blink to point to its own Flink.
- In order to traverse the list without causing any synchronization issues, you need to prevent context switching by setting all CPUs to DISPATCH_LEVEL. This can be done by raising the current processor’s IRQL to DISPATCH_LEVEL and then sending DPCs to the rest of the processors.
The book has way more details on that and I suggest reading it, unless somebody else from the list thinks that this solution won’t work (as I said, I just point out what I read in the book, since I haven’t tried it, so I don’t know how well it works).
Ilias
From: xxxxx@lists.osr.com [xxxxx@lists.osr.com] On Behalf Of Dan Kyler [xxxxx@privtek.com]
Sent: Sunday, March 16, 2008 6:58 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Process Termination with Antirootkit gives BSOD
The discussion on the process list, synchronization thereto, etc, while
somewhat interesting is pretty irrelevant. While I wholeheartedly agree
with those that say you shouldn’t do what you’re doing, I’m sure you’re
going to do it anyway.
So, have you tried the painfully simple what-the-hell-are-you-thinking
obvious? If process termination is doing a RemoveEntryList on the EPROCESS,
why don’t you put it in a damn list before you kill it? Any list should do;
try a locally declared LIST_ENTRY.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com
Sent: Friday, March 14, 2008 12:35 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Process Termination with Antirootkit gives BSOD
Hi All,
I am working in Quick Heal Techonologies Pvt. Ltd., which is a security
company. We have developed a AntiRootkit product which is capable of finding
processes hidden by system call hooking or Direct Kernel Object
Manipulation.
But the problem is when we terminate the process kernel gives BSOD if the
process is hidden by Direct Kernel Object Manipulation technique.
I found that this is due to following reason…
Rootkit alters linklist of active processes to remove the node(EPROCESS) of
the process to be hidden. It adjust the pointers in link list to make it
consistent but leave the pointers in EPROCESS of the process to be hidden as
it is. That means pointers in EPROCESS are invalid, but when we terminate
the process the system call trys to remove the process from active link
list, which is not there. Thus, these manupulations creates inconsistency in
link list and result in BSOD.
Is there any solution to this problem?
Thanks & Regards,
Amit.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer