ETW-Microsoft-Windows-Kernel-File
前言
由于ETW的事件非常多,并且事件名有些类似,因此记录一下文件操作所对应的事件
Microsoft-Windows-Kernel-File
该provider主要负责内核的文件操作的事件
获取与关闭文件句柄
该例子主要是测试文件句柄的获取与关闭所触发的事件
1 |
|
可以看到获取与关闭文件句柄会触发Create与Close事件。触发序列为Create->Close
provider | event_id | version | event(fields) | opcode | keywords | task | level |
---|---|---|---|---|---|---|---|
Microsoft-Windows-Kernel-File | 12 | 0 | Create(Pointer Irp, Pointer ThreadId, Pointer FileObject, UInt32 CreateOptions, UInt32 CreateAttributes, UInt32 ShareAccess, UnicodeString FileName) | KERNEL_FILE_KEYWORD_FILEIO或KERNEL_FILE_KEYWORD_CREATE | Create | Informational | |
Microsoft-Windows-Kernel-File | 12 | 1 | Create_V1(Pointer Irp, Pointer FileObject, UInt32 IssuingThreadId, UInt32 CreateOptions, UInt32 CreateAttributes, UInt32 ShareAccess, UnicodeString FileName) | KERNEL_FILE_KEYWORD_FILEIO KERNEL_FILE_KEYWORD_CREATE | Create | Informational | |
Microsoft-Windows-Kernel-File | 14 | 0 | Close(Pointer Irp, Pointer ThreadId, Pointer FileObject, Pointer FileKey) | KERNEL_FILE_KEYWORD_FILEIO | Close | Informational | |
Microsoft-Windows-Kernel-File | 14 | 1 | Close_V1(Pointer Irp, Pointer FileObject, Pointer FileKey, UInt32 IssuingThreadId) | KERNEL_FILE_KEYWORD_FILEIO | Close | Informational |
删除文件
该例子主要是测试删除文件所触发的事件
1 |
|
可以看到删除文件会触发Create、SetDelete以及Namedelete的事件。触发序列为Create->SetDelete->Namedelete
provider | event_id | version | event(fields) | opcode | keywords | task | level |
---|---|---|---|---|---|---|---|
Microsoft-Windows-Kernel-File | 11 | 0 | NameDelete(Pointer FileKey, UnicodeString FileName) | KERNEL_FILE_KEYWORD_FILENAME | NameDelete | Informational | |
Microsoft-Windows-Kernel-File | 12 | 0 | Create(Pointer Irp, Pointer ThreadId, Pointer FileObject, UInt32 CreateOptions, UInt32 CreateAttributes, UInt32 ShareAccess, UnicodeString FileName) | KERNEL_FILE_KEYWORD_FILEIO或KERNEL_FILE_KEYWORD_CREATE | Create | Informational | |
Microsoft-Windows-Kernel-File | 12 | 1 | Create_V1(Pointer Irp, Pointer FileObject, UInt32 IssuingThreadId, UInt32 CreateOptions, UInt32 CreateAttributes, UInt32 ShareAccess, UnicodeString FileName) | KERNEL_FILE_KEYWORD_FILEIO KERNEL_FILE_KEYWORD_CREATE | Create | Informational | |
Microsoft-Windows-Kernel-File | 18 | 0 | SetDelete(Pointer Irp, Pointer ThreadId, Pointer FileObject, Pointer FileKey, Pointer ExtraInformation, UInt32 InfoClass) | KERNEL_FILE_KEYWORD_FILEIO | SetDelete | Informational | |
Microsoft-Windows-Kernel-File | 18 | 1 | SetDelete_V1(Pointer Irp, Pointer FileObject, Pointer FileKey, Pointer ExtraInformation, UInt32 IssuingThreadId, UInt32 InfoClass) | KERNEL_FILE_KEYWORD_FILEIO | SetDelete | Informational |
读写文件
该例子主要是测试读写文件所触发的事件
1 |
|
可以看到读写事件会触发Read和Write事件以及SetInformation事件,而获取文件句柄是读写的前提因此Create事件也会被触发,但是关闭文件句柄则是代码规范问题,如果不调用的话则不会触发Close事件。触发序列为Create->Read->Write->SetInformation->Close
这里可以看到Write事件会触发多次。这是因为即使不写入文件有时候也会触发写事件。
provider | event_id | version | event(fields) | opcode | keywords | task | level |
---|---|---|---|---|---|---|---|
Microsoft-Windows-Kernel-File | 12 | 0 | Create(Pointer Irp, Pointer ThreadId, Pointer FileObject, UInt32 CreateOptions, UInt32 CreateAttributes, UInt32 ShareAccess, UnicodeString FileName) | KERNEL_FILE_KEYWORD_FILEIO或KERNEL_FILE_KEYWORD_CREATE | Create | Informational | |
Microsoft-Windows-Kernel-File | 12 | 1 | Create_V1(Pointer Irp, Pointer FileObject, UInt32 IssuingThreadId, UInt32 CreateOptions, UInt32 CreateAttributes, UInt32 ShareAccess, UnicodeString FileName) | KERNEL_FILE_KEYWORD_FILEIO KERNEL_FILE_KEYWORD_CREATE | Create | Informational | |
Microsoft-Windows-Kernel-File | 14 | 0 | Close(Pointer Irp, Pointer ThreadId, Pointer FileObject, Pointer FileKey) | KERNEL_FILE_KEYWORD_FILEIO | Close | Informational | |
Microsoft-Windows-Kernel-File | 14 | 1 | Close_V1(Pointer Irp, Pointer FileObject, Pointer FileKey, UInt32 IssuingThreadId) | KERNEL_FILE_KEYWORD_FILEIO | Close | Informational | |
Microsoft-Windows-Kernel-File | 15 | 0 | Read(UInt64 ByteOffset, Pointer Irp, Pointer ThreadId, Pointer FileObject, Pointer FileKey, UInt32 IOSize, UInt32 IOFlags) | KERNEL_FILE_KEYWORD_FILEIO KERNEL_FILE_KEYWORD_READ | Read | Informational | |
Microsoft-Windows-Kernel-File | 15 | 1 | Read_V1(UInt64 ByteOffset, Pointer Irp, Pointer FileObject, Pointer FileKey, UInt32 IssuingThreadId, UInt32 IOSize, UInt32 IOFlags, UInt32 ExtraFlags) | KERNEL_FILE_KEYWORD_FILEIO KERNEL_FILE_KEYWORD_READ | Read | Informational | |
Microsoft-Windows-Kernel-File | 16 | 0 | Write(UInt64 ByteOffset, Pointer Irp, Pointer ThreadId, Pointer FileObject, Pointer FileKey, UInt32 IOSize, UInt32 IOFlags) | KERNEL_FILE_KEYWORD_FILEIO KERNEL_FILE_KEYWORD_WRITE | Write | Informational | |
Microsoft-Windows-Kernel-File | 16 | 1 | Write_V1(UInt64 ByteOffset, Pointer Irp, Pointer FileObject, Pointer FileKey, UInt32 IssuingThreadId, UInt32 IOSize, UInt32 IOFlags, UInt32 ExtraFlags) | KERNEL_FILE_KEYWORD_FILEIO KERNEL_FILE_KEYWORD_WRITE | Write | Informational | |
Microsoft-Windows-Kernel-File | 17 | 0 | SetInformation(Pointer Irp, Pointer ThreadId, Pointer FileObject, Pointer FileKey, Pointer ExtraInformation, UInt32 InfoClass) | KERNEL_FILE_KEYWORD_FILEIO | SetInformation | Informational | |
Microsoft-Windows-Kernel-File | 17 | 1 | SetInformation_V1(Pointer Irp, Pointer FileObject, Pointer FileKey, Pointer ExtraInformation, UInt32 IssuingThreadId, UInt32 InfoClass) | KERNEL_FILE_KEYWORD_FILEIO | SetInformation | Informational |
重命名文件
该例子主要是测试重命名文件所触发的事件
1 |
|
可以看到文件名的修改会触发Create、Rename、Namedelete以及Close事件。触发序列为Create->Rename->Namedelete->Close
provider | event_id | version | event(fields) | opcode | keywords | task | level |
---|---|---|---|---|---|---|---|
Microsoft-Windows-Kernel-File | 11 | 0 | NameDelete(Pointer FileKey, UnicodeString FileName) | KERNEL_FILE_KEYWORD_FILENAME | NameDelete | Informational | |
Microsoft-Windows-Kernel-File | 12 | 0 | Create(Pointer Irp, Pointer ThreadId, Pointer FileObject, UInt32 CreateOptions, UInt32 CreateAttributes, UInt32 ShareAccess, UnicodeString FileName) | KERNEL_FILE_KEYWORD_FILEIO或KERNEL_FILE_KEYWORD_CREATE | Create | Informational | |
Microsoft-Windows-Kernel-File | 12 | 1 | Create_V1(Pointer Irp, Pointer FileObject, UInt32 IssuingThreadId, UInt32 CreateOptions, UInt32 CreateAttributes, UInt32 ShareAccess, UnicodeString FileName) | KERNEL_FILE_KEYWORD_FILEIO KERNEL_FILE_KEYWORD_CREATE | Create | Informational | |
Microsoft-Windows-Kernel-File | 14 | 0 | Close(Pointer Irp, Pointer ThreadId, Pointer FileObject, Pointer FileKey) | KERNEL_FILE_KEYWORD_FILEIO | Close | Informational | |
Microsoft-Windows-Kernel-File | 14 | 1 | Close_V1(Pointer Irp, Pointer FileObject, Pointer FileKey, UInt32 IssuingThreadId) | KERNEL_FILE_KEYWORD_FILEIO | Close | Informational | |
Microsoft-Windows-Kernel-File | 19 | 0 | Rename(Pointer Irp, Pointer ThreadId, Pointer FileObject, Pointer FileKey, Pointer ExtraInformation, UInt32 InfoClass) | KERNEL_FILE_KEYWORD_FILEIO | Rename | Informational | |
Microsoft-Windows-Kernel-File | 19 | 1 | Rename_V1(Pointer Irp, Pointer FileObject, Pointer FileKey, Pointer ExtraInformation, UInt32 IssuingThreadId, UInt32 InfoClass) | KERNEL_FILE_KEYWORD_FILEIO | Rename | Informational |
ETW-Microsoft-Windows-Kernel-File
https://h0pe-ay.github.io/ETW-Microsoft-Windows-Kernel-File/