Detection rules › Sigma

EventLog Query Requests By Builtin Utilities

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Ali Alwashali, Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detect attempts to query the contents of the event log using command line utilities. Attackers use this technique in order to look for sensitive information in the logs such as passwords, usernames, IPs, etc.

MITRE ATT&CK coverage

TacticTechniques
Credential AccessT1552 Unsecured Credentials

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: EventLog Query Requests By Builtin Utilities
id: 9cd55b6c-430a-4fa9-96f4-7cadf5229e9f
related:
    - id: beaa66d6-aa1b-4e3c-80f5-e0145369bfaf
      type: derived
status: test
description: |
    Detect attempts to query the contents of the event log using command line utilities. Attackers use this technique in order to look for sensitive information in the logs such as passwords, usernames, IPs, etc.
references:
    - https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.diagnostics/get-winevent?view=powershell-7.3
    - https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-eventlog?view=powershell-5.1
    - http://www.solomonson.com/posts/2010-07-09-reading-eventviewer-command-line/
    - https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/wevtutil
author: Ali Alwashali, Nasreddine Bencherchali (Nextron Systems)
date: 2023-11-20
modified: 2024-01-24
tags:
    - attack.t1552
    - attack.credential-access
    - detection.threat-hunting
logsource:
    product: windows
    category: process_creation
detection:
    selection_wmi:
        CommandLine|contains|all:
            - 'Select'
            - 'Win32_NTLogEvent'
    selection_wevtutil_img:
        - Image|endswith: '\wevtutil.exe'
        - OriginalFileName: 'wevtutil.exe'
    selection_wevtutil_cli:
        CommandLine|contains:
            - ' qe '
            - ' query-events '
    selection_wmic_img:
        - Image|endswith: '\wmic.exe'
        - OriginalFileName: 'wmic.exe'
    selection_wmic_cli:
        CommandLine|contains: ' ntevent'
    selection_cmdlet:
        CommandLine|contains:
            - 'Get-WinEvent '
            - 'get-eventlog '
    condition: selection_wmi or all of selection_wevtutil_* or all of selection_wmic_* or selection_cmdlet
falsepositives:
    - Legitimate log access by administrators or troubleshooting tools
level: medium

Stages and Predicates

Stage 0: condition

selection_wmi or all of selection_wevtutil_* or all of selection_wmic_* or selection_cmdlet

Stage 1: selection_wmi

selection_wmi:
    CommandLine|contains|all:
        - 'Select'
        - 'Win32_NTLogEvent'

Stage 2: selection_wevtutil_img

selection_wevtutil_img:
    - Image|endswith: '\wevtutil.exe'
    - OriginalFileName: 'wevtutil.exe'

Stage 3: selection_wevtutil_cli

selection_wevtutil_cli:
    CommandLine|contains:
        - ' qe '
        - ' query-events '

Stage 4: selection_wmic_img

selection_wmic_img:
    - Image|endswith: '\wmic.exe'
    - OriginalFileName: 'wmic.exe'

Stage 5: selection_wmic_cli

selection_wmic_cli:
    CommandLine|contains: ' ntevent'

Stage 6: selection_cmdlet

selection_cmdlet:
    CommandLine|contains:
        - 'Get-WinEvent '
        - 'get-eventlog '

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • ntevent corpus 2 (sigma 2)
  • qe corpus 2 (sigma 2)
  • query-events corpus 2 (sigma 2)
  • Get-WinEvent corpus 2 (sigma 2)
  • Select corpus 4 (sigma 4)
  • Win32_NTLogEvent corpus 3 (sigma 2, splunk 1)
  • get-eventlog corpus 2 (sigma 2)
Imageends_with
  • \wevtutil.exe corpus 9 (sigma 9)
  • \wmic.exe corpus 60 (sigma 60)
OriginalFileNameeq
  • wevtutil.exe corpus 7 (sigma 5, elastic 1, splunk 1)
  • wmic.exe corpus 61 (sigma 36, splunk 18, elastic 7)