![]() |
Closing FileHandles with KMD's |
Post Reply
|
| Author | |||
3h1337
Newbie
Joined: 24 December 2005 Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Topic: Closing FileHandles with KMD'sPosted: 19 March 2009 at 6:50pm |
||
|
Hi (first of all: iam new in Kernel things
)i got a systemwide Handlelist (NtQuerySystemInformation|SystemHandleInformation) there is a FileHandle (PID 4 (System Process) FileHandle = 0xA14) that i wish to close from a Kernel Mode Driver.... but how??? I got a method for Ring3(LocalSystem): CreateRemoteThread|CloseHandle (works with all Processes except System (PID 4). (because of that the Kernel Mode Driver).
(VISTA) regards |
|||
![]() |
|||
molotov
Moderator Group
Joined: 04 October 2006 Status: Offline Points: 17506 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 March 2009 at 6:58pm |
||
|
Hi 3h1337,
Have you tried DuplicateHandle with the DUPLICATE_CLOSE_SOURCE flag? |
|||
|
Daily affirmation:
net helpmsg 4006 |
|||
![]() |
|||
3h1337
Newbie
Joined: 24 December 2005 Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 March 2009 at 7:10pm |
||
ok ... then i need the ProcessHandle.... OpenProcess IMHO dont work inside a KMD i need a Example with ZwOpenProcess. |
|||
![]() |
|||
GamingMasteR
Senior Member
Joined: 10 August 2008 Status: Offline Points: 245 |
Post Options
Thanks(0)
Quote Reply
Posted: 20 March 2009 at 12:33am |
||
|
Hi, You may try this : ExAcquireRundownProtection KeStackAttachProcess ZwCloseHandle KeUnstackDetachProcess ExReleaseRundownProtection |
|||
![]() |
|||
molotov
Moderator Group
Joined: 04 October 2006 Status: Offline Points: 17506 |
Post Options
Thanks(0)
Quote Reply
Posted: 20 March 2009 at 3:16am |
||
|
|||
|
Daily affirmation:
net helpmsg 4006 |
|||
![]() |
|||
3h1337
Newbie
Joined: 24 December 2005 Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 March 2009 at 11:54am |
||
|
I try to code this function ->
![]() like a unlocker...
ok i will try this, thx
ProcessID 4 (System) cant opened by OpenProcess in usermode -> Access Denied |
|||
![]() |
|||
molotov
Moderator Group
Joined: 04 October 2006 Status: Offline Points: 17506 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 March 2009 at 4:31pm |
||
|
|||
|
Daily affirmation:
net helpmsg 4006 |
|||
![]() |
|||
wj32
Senior Member
Joined: 16 January 2009 Location: Australia Status: Offline Points: 1016 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 March 2009 at 6:19am |
||
This will work for Windows XP, but will not work for Vista since System is protected. I think a better idea would be to use ObCloseHandle in kernel mode. |
|||
|
PH, a free and open source process viewer.
|
|||
![]() |
|||
3h1337
Newbie
Joined: 24 December 2005 Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 March 2009 at 6:44pm |
||
THX, works perfect! |
|||
![]() |
|||
volvorine
Senior Member
Joined: 19 September 2008 Location: India Status: Offline Points: 104 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 March 2009 at 2:53pm |
||
|
why do you want to close it from kernel mode driver ?
this might crash your application
|
|||
|
sainath IRP_MJ_CREATE
|
|||
![]() |
|||
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |