Pointer to the NtCreateNamedPipeFile?physically resides in service
table.
But there is not ZwCreateNamedPipeFile routine exported by ntoskrnl.exe
so you can’t simply obtain service index. The only method is to obtain
this
index from ntdll.dll, but the code to do this is too complicated. You
have to
open the dll, map it into address space, call your own
LdrGetProcedureAddress
routine to obtain pointer to ZwCreateNamedPipeFile, then obtain index,
unmap
and close the dll. Too complicated and too dirty - filtering npfs is
much more
simple and cleaner.
?
Paul
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Matteo Pelati
Sent: Friday, January 26, 2001 9:18 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Handling CreatePipe function
I was probably wrong… Pipe creation function aren’t in the Native API
system table? Cannot they be hooked there? (In fact they don’t seem to
be exported by ntoskrnl.exe)
?
Thanks
Matteo
----- Original Message -----
From: Hrdina Pavel
To: NT Developers Interest List
Sent: Friday, January 26, 2001 7:47 PM
Subject: [ntdev] RE: Handling CreatePipe function
On NT/2000 you have to use some more clear method.
You have to filter Named Pipe File System (NPFS) driver.
But there are some minor problems which should be solved.
-
Attaching to this driver
?? - probably something like cyclic checking for existence
??? \Device\NamedPipe and then attaching your filter device
??? to it
-
Special file types for IoCreateFile (CreateFileType is
??? CreateFileTypeNamedPipe or CreateFileTypeMailslot)
??? takes another argument ExtraCreateParameters which
??? is pointer to structure built either by NtCreateNamedPipeFile
??? or NtCreateMailslotFile. This structure is undocumented.
??? So you must find out it yourself.
-
IoCreateFile builds not IRP_MJ_CREATE but
??? IRP_MJ_CREATE_NAMED_PIPE when creating or opening
??? named pipe.
-
…
Hope this helps
Paul
PS: Here is also prototype for importatnt undocumented routine
NTSYSAPI
NTSTATUS
NTAPI
NtCreateNamedPipeFile (
??? OUT PHANDLE MailslotFileHandle,
??? IN ACCESS_MASK DesiredAccess,
??? IN POBJECT_ATTRIBUTES ObjectAttributes,
??? OUT PIO_STATUS_BLOCK IoStatusBlock,
??? IN ULONG ShareAccess,
??? IN ULONG Disposition,
??? IN ULONG CreateOptions,
??? IN ULONG NamedPipeType,
??? IN ULONG ReadMode,
??? IN ULONG CompletionMode,
??? IN ULONG MaximumInstances,
??? IN ULONG InputBufferSize,
??? IN ULONG OutputBufferSize,
??? IN PLARGE_INTEGER DefaultTimeout OPTIONAL
??? );
-----Original Message-----
From: xxxxx@lists.osr.com [
mailto:xxxxx@lists.osr.com]On Behalf Of Abel Mu?oz Alcaraz
Sent: Friday, January 26, 2001 6:27 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Handling CreatePipe function
Thanks Sean,
??? I will use it.
-Abel.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Sean O’Connor
Sent: viernes, 26 de enero de 2001 17:26
To: NT Developers Interest List
Subject: [ntdev] RE: Handling CreatePipe function
??? I do not think that there will be a documented way of doing
this.
But all of the fun stuff involves hacking anyway.? I once “hooked”
TerminateProcess in Win9x by getting the entry point of the function (
in
Kernel32.dll ), overwriting the entry point with a jmp instruction to my
own
system Dll ( system Dll’s are loaded in kernel space ), performing my
own
logic to see if I wanted to allow this call to continue.? If I wanted to
fail the call I just cleaned up the stack and failed it.? If I wanted to
allow it to continue I executed the instructions I overwrote with the
jmp (
previously saved ) and returned to the point in TerminateProcess just
beyond
the jmp.? This all had to be performed on the in memory images to make
it at
least partially immune to service packs.? Note that this approach
probably
would never work under NT.
Sean O’Connor
Spectra Logic
Boulder, CO
-----Original Message-----
From: Abel Munoz Alcaraz [mailto:xxxxx@trymedia.com]
Sent: Friday, January 26, 2001 4:49 AM
To: NT Developers Interest List
Subject: [ntdev] Handling CreatePipe function
Hi everybody,
??? I must hook the ‘CreatePipe’ function from kernel mode driver
(Windows 9x
and NT).
??? I must do this to disable this inter process communication
method.
??? Do you know how can I do this?
Thanks in advance.
-Abel.
You are currently subscribed to ntdev as: xxxxx@spectralogic.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@trymedia.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@compelson.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@dolce.it
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@compelson.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com