>I need to monitor access (data such as IP, file, SID, success/failure) to SMB server, that’s why I’m
interested in \Device\LanmanServer.
\Device\LanmanServer is just plain not used in accessing the SMB server from the network.
This name is the management interface to SRV, called by the user-mode stuff like the LanmanServer (srvsvc.dll) service which provides DCE RPC-based remoting to manage SRV remotely.
The RPC client for this RPC interface is in netapi32.dll, the calls of NetXxxDoSomething which manage SRV.
The UI control panels/applets are calling netapi32.dll.
failed (with incorrect credentials) connections? If that’s the case, that’s not good.
Then monitor the network traffic using WFP (or TDI filter on pre-Vista), and parse all SMB protocol yourself.
No other ways. You cannot dig into the internals of SRV.
I could try with legacy filter driver to attach to SRV module
You cannot. This driver will not see the real SMB traffic.
SRV is, actually, a consumer/client of 2 interfaces: a) TDI or WSK b) filesystems. Note that b) is not using the usual NtRead/WriteFile syscalls, and using some optimized paths, for instance, the FastIo MDL IO.
You can filter a) using TDI filter or WFP, yes, with the need of parsing the SMB itself.
Also, you can filter b) using FltMgr’s minifilter.
b) is much easier, but you will not see the failed connection events using b).
You can, though, filter all file accesses using b) (note: you will not know any share names, only the local pathname there) and filter SRV logons using some LSA notify packages and such.
available only in the paid IFS Kit
Long ago deceased and merged to a free WDK.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com