我最近使用 ETW 从内置提供程序收集事件。我使用 logman 来消费事件并将它们保存到 .etl 文件中,如下所示:
logman create trace evt -p Microsoft-Windows-RPC -ets
...经过一些操作
logman stop evt -ets
然后我得到一个 evt.etl 文件,其中包含来自该提供者的事件。
PS > Get-WinEvent -Path .\evt.etl -Oldest | Select-Object Id, Message
Id Message
---------
0
5 Client RPC call started. InterfaceUuid: {e60c73e6-88f9-11cf-9af1-0020af6e72f4} OpNum: 0x8 Protocol: LRPC N...
4 RPC Log Event. ...
...
但是当我对“Microsoft-Windows-Security-Auditing”做同样的事情时,停止会话后,我在 evt.etl 文件中什么也没有。
PS > logman start trace evt -p Microsoft-Windows-Security-Auditing -ets
The command completed successfully.
然后注销并登录以产生事件
PS C:\Advs> logman stop evt -ets
The command completed successfully.
但是我在生成的 evt.etl 文件中什么也没有。
PS \> Get-WinEvent -Path .\evt.etl -Oldest
Get-WinEvent : No events were found that match the specified selection criteria.
At line:1 char:1
+ Get-WinEvent -Path .\\evt.etl -Oldest
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-WinEvent], Exception
+ FullyQualifiedErrorId : NoMatchingEventsFound,Microsoft.PowerShell.Comma
nds.GetWinEventCommand`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
但是,我可以在 eventvwr 中看到事件,在“Windows 日志”-“安全”中,事件详细信息显示它们的来源是“Microsoft-Windows-Security-Auditing”。
System
Provider
[ Name] Microsoft-Windows-Security-Auditing
[ Guid] {54849625-5478-4994-A5BA-3E3B0328C30D}
...
我搜索并找到了一些解决方案,但它们不起作用。
在带有 ETW(Windows 事件跟踪)的实时消费者中使用“Microsoft Windows 安全审核”提供程序
https://serverfault.com/questions/599169/how-can-i-get-sesecurityprivilege-enabled
http://support.microsoft.com/kb/2000257 ...
我认为这可能是一个特权问题,所以我参考了上面的问题,以系统运行并启用了我的 SeSecurityPrivilege(以及列出的所有其他特权)。
PS \> whoami
nt authority\\system
PS \> whoami /priv
...
SeSecurityPrivilege Manage auditing and security log Enabled
... Enabled
# All privileges enabled
但是在做了这些之后,我仍然没有事件。
这是一台 Windows Server 2012 R2 机器。失败后,我在另一台 Windows 10 机器上尝试了完全相同的事情,得到了相同的结果。
感谢您的帮助。