WMIとsysmon v6.10
Sysmon v6.10 が 9/11 にリリースされ、WMI Filterとconsumersがモニタリング出来るようになったようです。 3つのイベントIDが追加されています、登録を検出するようですね。
Sysmon - Windows Sysinternals | Microsoft Docs より引用
Event ID 19: WmiEvent (WmiEventFilter activity detected)
When a WMI event filter is registered, which is a method used by malware to execute, this event logs the WMI namespace, filter name and filter expression.
Event ID 20: WmiEvent (WmiEventConsumer activity detected)
This event logs the registration of WMI consumers, recording the consumer name, log, and destination.
Event ID 21: WmiEvent (WmiEventConsumerToFilter activity detected)
When a consumer binds to a filter, this event logs the consumer name and filter path.
Windows 10環境にsysmon 6.10をインストールし、WMI モニタリングを確認してみます。Sysmon にはテスト用として下記設定を行います。
<Sysmon schemaversion="3.40">
<!-- Capture all hashes -->
<HashAlgorithms>md5</HashAlgorithms>
<EventFiltering>
<WmiEvent onmatch="exclude" />
</EventFiltering>
</Sysmon>
WMIの登録には、下記ページで紹介されているWMIGhost のスクリプト wmi_raw_formated.js を利用します。
スクリプトファイル wmi_raw_formated.js を実行後、Autorus ツールで WMI に自動起動が登録されている事を確認します。
イベントログにWmiEventConsumerの登録が記録されています。
その他
EventID 19
Get-WMIObject -Namespace root\Subscription -Class __EventFilter
Get-WMIObject -Namespace root\Subscription -Class __EventConsumer
Get-WMIObject -Namespace root\Subscription -Class __FilterToConsumerBinding
PyWMIPersistenceFinder.py
CCM_RUA_Finder.py
参考URL:
WMI Event Subscription Persistence
https://www.rapid7.com/db/modules/exploit/windows/local/wmi_persistence