Potentially Suspicious Call To Win32_NTEventlogFile Class - PSScript
Detects usage of the WMI class "Win32_NTEventlogFile" in a potentially suspicious way (delete, backup, change permissions, etc.) from a PowerShell script
Detection logic
selection_class
ScriptBlockText|contains: Win32_NTEventlogFileselection_function
ScriptBlockText|contains:
- .BackupEventlog(
- .ChangeSecurityPermissions(
- .ChangeSecurityPermissionsEx(
- .ClearEventLog(
- .Delete(
- .DeleteEx(
- .Rename(
- .TakeOwnerShip(
- .TakeOwnerShipEx(Condition
all of selection_*Raw YAML
title: Potentially Suspicious Call To Win32_NTEventlogFile Class - PSScript
id: e2812b49-bae0-4b21-b366-7c142eafcde2
status: test
description: Detects usage of the WMI class "Win32_NTEventlogFile" in a potentially suspicious way (delete, backup, change permissions, etc.) from a PowerShell script
references:
- https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/aa394225(v=vs.85)
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-07-13
tags:
- attack.defense-impairment
logsource:
category: ps_script
product: windows
definition: bade5735-5ab0-4aa7-a642-a11be0e40872
detection:
selection_class:
ScriptBlockText|contains: 'Win32_NTEventlogFile'
selection_function:
ScriptBlockText|contains:
- '.BackupEventlog('
- '.ChangeSecurityPermissions('
- '.ChangeSecurityPermissionsEx('
- '.ClearEventLog('
- '.Delete('
- '.DeleteEx('
- '.Rename('
- '.TakeOwnerShip('
- '.TakeOwnerShipEx('
condition: all of selection_*
falsepositives:
- Legitimate administration and backup scripts
level: mediumFalse positives
- Legitimate administration and backup scripts
References
Similar rules
AMSI Bypass Pattern Assembly GetType
highwindows · Same logsource category (ps_script)
Disable of ETW Trace - Powershell
highwindows · Same logsource category (ps_script)
Disable-WindowsOptionalFeature Command PowerShell
highwindows · Same logsource category (ps_script)
Modify Group Policy Settings - ScriptBlockLogging
mediumwindows · Same logsource category (ps_script)