Latest alertCVE-2018-11776 in Apache Struts Confirmed Exploited in the WildRead
Search all news in the platform

Detection rule

Potential Privilege Escalation To LOCAL SYSTEM

HighTest-data validatedSigmaHQ (community)T1587.001

Overview

Detects unknown program using commandline flags usually used by tools such as PsExec and PAExec to start programs with SYSTEM Privileges

Rule id
207b0396-3689-42d9-8399-4222658efc99
ATT&CK techniques
T1587.001 Develop Capabilities: Malware
Severity
High
Confidence
Low
Origin
SigmaHQ (community)
SigmaHQ status
test
Used in defense packs
qilin, safepay, rhysida, Play, nightspire

Validation

  1. ExperimentalSyntax checked only. Not yet tested on events.
  2. Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
  3. SIEM-validatedRun in a real SIEM, with a recorded result.

1 of 1 positive test events matched; 2 of 2 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.

Detection logic and queries

Queries are shown exactly as generated. Test them in your environment before you deploy them.

Sigma

Sigma (YAML) · 207b0396-3689-42d9-8399-4222658efc99

Download
title: Potential Privilege Escalation To LOCAL SYSTEM
id: 207b0396-3689-42d9-8399-4222658efc99
related:
    - id: 8834e2f7-6b4b-4f09-8906-d2276470ee23 # PsExec specific rule
      type: similar
status: test
description: Detects unknown program using commandline flags usually used by tools such as PsExec and PAExec to start programs with SYSTEM Privileges
references:
    - https://learn.microsoft.com/en-us/sysinternals/downloads/psexec
    - https://www.poweradmin.com/paexec/
    - https://www.fireeye.com/blog/threat-research/2020/10/kegtap-and-singlemalt-with-a-ransomware-chaser.html
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2021-05-22
modified: 2024-03-05
tags:
    - attack.resource-development
    - attack.t1587.001
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        # Escalation to LOCAL_SYSTEM
        CommandLine|contains|windash:
            # Note that you don't need to add the ".exe" part when using psexec/paexec
            # The "-" can also be replaced with "/"
            # The order of args isn't important
            # "cmd" can be replaced by "powershell", "pwsh" or any other console like software
            - ' -s cmd'
            - ' -s -i cmd'
            - ' -i -s cmd'
            # Pwsh (For PowerShell 7)
            - ' -s pwsh'
            - ' -s -i pwsh'
            - ' -i -s pwsh'
            # PowerShell (For PowerShell 5)
            - ' -s powershell'
            - ' -s -i powershell'
            - ' -i -s powershell'
    filter_main_exclude_coverage:
        # This filter exclude strings covered by 8834e2f7-6b4b-4f09-8906-d2276470ee23
        CommandLine|contains:
            - 'paexec'
            - 'PsExec'
            - 'accepteula'
    condition: selection and not 1 of filter_main_*
falsepositives:
    - Weird admins that rename their tools
    - Software companies that bundle PsExec/PAExec with their software and rename it, so that it is less embarrassing
level: high

QRadar AQL

IBM QRadar AQL (hunting query)Hunting query

Hunting search for the Log Activity tab or the API. It is not a QRadar rule.

AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).

SELECT * FROM events WHERE devicetype=12 AND (LOWER(Command) LIKE '% -s cmd%' OR LOWER(Command) LIKE '% /s cmd%' OR LOWER(Command) LIKE '% –s cmd%' OR LOWER(Command) LIKE '% —s cmd%' OR LOWER(Command) LIKE '% ―s cmd%' OR LOWER(Command) LIKE '% -s -i cmd%' OR LOWER(Command) LIKE '% -s /i cmd%' OR LOWER(Command) LIKE '% -s –i cmd%' OR LOWER(Command) LIKE '% -s —i cmd%' OR LOWER(Command) LIKE '% -s ―i cmd%' OR LOWER(Command) LIKE '% /s -i cmd%' OR LOWER(Command) LIKE '% /s /i cmd%' OR LOWER(Command) LIKE '% /s –i cmd%' OR LOWER(Command) LIKE '% /s —i cmd%' OR LOWER(Command) LIKE '% /s ―i cmd%' OR LOWER(Command) LIKE '% –s -i cmd%' OR LOWER(Command) LIKE '% –s /i cmd%' OR LOWER(Command) LIKE '% –s –i cmd%' OR LOWER(Command) LIKE '% –s —i cmd%' OR LOWER(Command) LIKE '% –s ―i cmd%' OR LOWER(Command) LIKE '% —s -i cmd%' OR LOWER(Command) LIKE '% —s /i cmd%' OR LOWER(Command) LIKE '% —s –i cmd%' OR LOWER(Command) LIKE '% —s —i cmd%' OR LOWER(Command) LIKE '% —s ―i cmd%' OR LOWER(Command) LIKE '% ―s -i cmd%' OR LOWER(Command) LIKE '% ―s /i cmd%' OR LOWER(Command) LIKE '% ―s –i cmd%' OR LOWER(Command) LIKE '% ―s —i cmd%' OR LOWER(Command) LIKE '% ―s ―i cmd%' OR LOWER(Command) LIKE '% -i -s cmd%' OR LOWER(Command) LIKE '% -i /s cmd%' OR LOWER(Command) LIKE '% -i –s cmd%' OR LOWER(Command) LIKE '% -i —s cmd%' OR LOWER(Command) LIKE '% -i ―s cmd%' OR LOWER(Command) LIKE '% /i -s cmd%' OR LOWER(Command) LIKE '% /i /s cmd%' OR LOWER(Command) LIKE '% /i –s cmd%' OR LOWER(Command) LIKE '% /i —s cmd%' OR LOWER(Command) LIKE '% /i ―s cmd%' OR LOWER(Command) LIKE '% –i -s cmd%' OR LOWER(Command) LIKE '% –i /s cmd%' OR LOWER(Command) LIKE '% –i –s cmd%' OR LOWER(Command) LIKE '% –i —s cmd%' OR LOWER(Command) LIKE '% –i ―s cmd%' OR LOWER(Command) LIKE '% —i -s cmd%' OR LOWER(Command) LIKE '% —i /s cmd%' OR LOWER(Command) LIKE '% —i –s cmd%' OR LOWER(Command) LIKE '% —i —s cmd%' OR LOWER(Command) LIKE '% —i ―s cmd%' OR LOWER(Command) LIKE '% ―i -s cmd%' OR LOWER(Command) LIKE '% ―i /s cmd%' OR LOWER(Command) LIKE '% ―i –s cmd%' OR LOWER(Command) LIKE '% ―i —s cmd%' OR LOWER(Command) LIKE '% ―i ―s cmd%' OR LOWER(Command) LIKE '% -s pwsh%' OR LOWER(Command) LIKE '% /s pwsh%' OR LOWER(Command) LIKE '% –s pwsh%' OR LOWER(Command) LIKE '% —s pwsh%' OR LOWER(Command) LIKE '% ―s pwsh%' OR LOWER(Command) LIKE '% -s -i pwsh%' OR LOWER(Command) LIKE '% -s /i pwsh%' OR LOWER(Command) LIKE '% -s –i pwsh%' OR LOWER(Command) LIKE '% -s —i pwsh%' OR LOWER(Command) LIKE '% -s ―i pwsh%' OR LOWER(Command) LIKE '% /s -i pwsh%' OR LOWER(Command) LIKE '% /s /i pwsh%' OR LOWER(Command) LIKE '% /s –i pwsh%' OR LOWER(Command) LIKE '% /s —i pwsh%' OR LOWER(Command) LIKE '% /s ―i pwsh%' OR LOWER(Command) LIKE '% –s -i pwsh%' OR LOWER(Command) LIKE '% –s /i pwsh%' OR LOWER(Command) LIKE '% –s –i pwsh%' OR LOWER(Command) LIKE '% –s —i pwsh%' OR LOWER(Command) LIKE '% –s ―i pwsh%' OR LOWER(Command) LIKE '% —s -i pwsh%' OR LOWER(Command) LIKE '% —s /i pwsh%' OR LOWER(Command) LIKE '% —s –i pwsh%' OR LOWER(Command) LIKE '% —s —i pwsh%' OR LOWER(Command) LIKE '% —s ―i pwsh%' OR LOWER(Command) LIKE '% ―s -i pwsh%' OR LOWER(Command) LIKE '% ―s /i pwsh%' OR LOWER(Command) LIKE '% ―s –i pwsh%' OR LOWER(Command) LIKE '% ―s —i pwsh%' OR LOWER(Command) LIKE '% ―s ―i pwsh%' OR LOWER(Command) LIKE '% -i -s pwsh%' OR LOWER(Command) LIKE '% -i /s pwsh%' OR LOWER(Command) LIKE '% -i –s pwsh%' OR LOWER(Command) LIKE '% -i —s pwsh%' OR LOWER(Command) LIKE '% -i ―s pwsh%' OR LOWER(Command) LIKE '% /i -s pwsh%' OR LOWER(Command) LIKE '% /i /s pwsh%' OR LOWER(Command) LIKE '% /i –s pwsh%' OR LOWER(Command) LIKE '% /i —s pwsh%' OR LOWER(Command) LIKE '% /i ―s pwsh%' OR LOWER(Command) LIKE '% –i -s pwsh%' OR LOWER(Command) LIKE '% –i /s pwsh%' OR LOWER(Command) LIKE '% –i –s pwsh%' OR LOWER(Command) LIKE '% –i —s pwsh%' OR LOWER(Command) LIKE '% –i ―s pwsh%' OR LOWER(Command) LIKE '% —i -s pwsh%' OR LOWER(Command) LIKE '% —i /s pwsh%' OR LOWER(Command) LIKE '% —i –s pwsh%' OR LOWER(Command) LIKE '% —i —s pwsh%' OR LOWER(Command) LIKE '% —i ―s pwsh%' OR LOWER(Command) LIKE '% ―i -s pwsh%' OR LOWER(Command) LIKE '% ―i /s pwsh%' OR LOWER(Command) LIKE '% ―i –s pwsh%' OR LOWER(Command) LIKE '% ―i —s pwsh%' OR LOWER(Command) LIKE '% ―i ―s pwsh%' OR LOWER(Command) LIKE '% -s powershell%' OR LOWER(Command) LIKE '% /s powershell%' OR LOWER(Command) LIKE '% –s powershell%' OR LOWER(Command) LIKE '% —s powershell%' OR LOWER(Command) LIKE '% ―s powershell%' OR LOWER(Command) LIKE '% -s -i powershell%' OR LOWER(Command) LIKE '% -s /i powershell%' OR LOWER(Command) LIKE '% -s –i powershell%' OR LOWER(Command) LIKE '% -s —i powershell%' OR LOWER(Command) LIKE '% -s ―i powershell%' OR LOWER(Command) LIKE '% /s -i powershell%' OR LOWER(Command) LIKE '% /s /i powershell%' OR LOWER(Command) LIKE '% /s –i powershell%' OR LOWER(Command) LIKE '% /s —i powershell%' OR LOWER(Command) LIKE '% /s ―i powershell%' OR LOWER(Command) LIKE '% –s -i powershell%' OR LOWER(Command) LIKE '% –s /i powershell%' OR LOWER(Command) LIKE '% –s –i powershell%' OR LOWER(Command) LIKE '% –s —i powershell%' OR LOWER(Command) LIKE '% –s ―i powershell%' OR LOWER(Command) LIKE '% —s -i powershell%' OR LOWER(Command) LIKE '% —s /i powershell%' OR LOWER(Command) LIKE '% —s –i powershell%' OR LOWER(Command) LIKE '% —s —i powershell%' OR LOWER(Command) LIKE '% —s ―i powershell%' OR LOWER(Command) LIKE '% ―s -i powershell%' OR LOWER(Command) LIKE '% ―s /i powershell%' OR LOWER(Command) LIKE '% ―s –i powershell%' OR LOWER(Command) LIKE '% ―s —i powershell%' OR LOWER(Command) LIKE '% ―s ―i powershell%' OR LOWER(Command) LIKE '% -i -s powershell%' OR LOWER(Command) LIKE '% -i /s powershell%' OR LOWER(Command) LIKE '% -i –s powershell%' OR LOWER(Command) LIKE '% -i —s powershell%' OR LOWER(Command) LIKE '% -i ―s powershell%' OR LOWER(Command) LIKE '% /i -s powershell%' OR LOWER(Command) LIKE '% /i /s powershell%' OR LOWER(Command) LIKE '% /i –s powershell%' OR LOWER(Command) LIKE '% /i —s powershell%' OR LOWER(Command) LIKE '% /i ―s powershell%' OR LOWER(Command) LIKE '% –i -s powershell%' OR LOWER(Command) LIKE '% –i /s powershell%' OR LOWER(Command) LIKE '% –i –s powershell%' OR LOWER(Command) LIKE '% –i —s powershell%' OR LOWER(Command) LIKE '% –i ―s powershell%' OR LOWER(Command) LIKE '% —i -s powershell%' OR LOWER(Command) LIKE '% —i /s powershell%' OR LOWER(Command) LIKE '% —i –s powershell%' OR LOWER(Command) LIKE '% —i —s powershell%' OR LOWER(Command) LIKE '% —i ―s powershell%' OR LOWER(Command) LIKE '% ―i -s powershell%' OR LOWER(Command) LIKE '% ―i /s powershell%' OR LOWER(Command) LIKE '% ―i –s powershell%' OR LOWER(Command) LIKE '% ―i —s powershell%' OR LOWER(Command) LIKE '% ―i ―s powershell%') AND (NOT((LOWER(Command) LIKE '%paexec%' OR LOWER(Command) LIKE '%psexec%' OR LOWER(Command) LIKE '%accepteula%')))

QRadar CRE

Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.

Rule name
OffSet7: Potential Privilege Escalation To LOCAL SYSTEM
Rule type
Event rule (Local)
Log source types
Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1

Building blocks

  • BB:OffSet7:Potential Privilege Escalation To LOCAL SYSTEM:selection (match)
    All test lines must match (AND).
    • Command contains: -s cmd, -s -i cmd, -i -s cmd, -s pwsh, -s -i pwsh, -i -s pwsh, -s powershell, -s -i powershell, -i -s powershell
  • BB:OffSet7:Potential Privilege Escalation To LOCAL SYSTEM:filter_main_exclude_coverage (exclusion)
    All test lines must match (AND).
    • Command contains: paexec, PsExec, accepteula

Main rule, option A (building blocks)

  1. when the event(s) were detected by one or more of these log source types: Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1
  2. when an event matches the condition built from these building blocks: BB:OffSet7:Potential Privilege Escalation To LOCAL SYSTEM:selection AND NOT (ANY of [BB:OffSet7:Potential Privilege Escalation To LOCAL SYSTEM:filter_main_exclude_coverage])

Main rule, option B (AQL filter test)

  1. when the event matches this AQL filter query: devicetype=12 AND (LOWER(Command) LIKE '% -s cmd%' OR LOWER(Command) LIKE '% /s cmd%' OR LOWER(Command) LIKE '% –s cmd%' OR LOWER(Command) LIKE '% —s cmd%' OR LOWER(Command) LIKE '% ―s cmd%' OR LOWER(Command) LIKE '% -s -i cmd%' OR LOWER(Command) LIKE '% -s /i cmd%' OR LOWER(Command) LIKE '% -s –i cmd%' OR LOWER(Command) LIKE '% -s —i cmd%' OR LOWER(Command) LIKE '% -s ―i cmd%' OR LOWER(Command) LIKE '% /s -i cmd%' OR LOWER(Command) LIKE '% /s /i cmd%' OR LOWER(Command) LIKE '% /s –i cmd%' OR LOWER(Command) LIKE '% /s —i cmd%' OR LOWER(Command) LIKE '% /s ―i cmd%' OR LOWER(Command) LIKE '% –s -i cmd%' OR LOWER(Command) LIKE '% –s /i cmd%' OR LOWER(Command) LIKE '% –s –i cmd%' OR LOWER(Command) LIKE '% –s —i cmd%' OR LOWER(Command) LIKE '% –s ―i cmd%' OR LOWER(Command) LIKE '% —s -i cmd%' OR LOWER(Command) LIKE '% —s /i cmd%' OR LOWER(Command) LIKE '% —s –i cmd%' OR LOWER(Command) LIKE '% —s —i cmd%' OR LOWER(Command) LIKE '% —s ―i cmd%' OR LOWER(Command) LIKE '% ―s -i cmd%' OR LOWER(Command) LIKE '% ―s /i cmd%' OR LOWER(Command) LIKE '% ―s –i cmd%' OR LOWER(Command) LIKE '% ―s —i cmd%' OR LOWER(Command) LIKE '% ―s ―i cmd%' OR LOWER(Command) LIKE '% -i -s cmd%' OR LOWER(Command) LIKE '% -i /s cmd%' OR LOWER(Command) LIKE '% -i –s cmd%' OR LOWER(Command) LIKE '% -i —s cmd%' OR LOWER(Command) LIKE '% -i ―s cmd%' OR LOWER(Command) LIKE '% /i -s cmd%' OR LOWER(Command) LIKE '% /i /s cmd%' OR LOWER(Command) LIKE '% /i –s cmd%' OR LOWER(Command) LIKE '% /i —s cmd%' OR LOWER(Command) LIKE '% /i ―s cmd%' OR LOWER(Command) LIKE '% –i -s cmd%' OR LOWER(Command) LIKE '% –i /s cmd%' OR LOWER(Command) LIKE '% –i –s cmd%' OR LOWER(Command) LIKE '% –i —s cmd%' OR LOWER(Command) LIKE '% –i ―s cmd%' OR LOWER(Command) LIKE '% —i -s cmd%' OR LOWER(Command) LIKE '% —i /s cmd%' OR LOWER(Command) LIKE '% —i –s cmd%' OR LOWER(Command) LIKE '% —i —s cmd%' OR LOWER(Command) LIKE '% —i ―s cmd%' OR LOWER(Command) LIKE '% ―i -s cmd%' OR LOWER(Command) LIKE '% ―i /s cmd%' OR LOWER(Command) LIKE '% ―i –s cmd%' OR LOWER(Command) LIKE '% ―i —s cmd%' OR LOWER(Command) LIKE '% ―i ―s cmd%' OR LOWER(Command) LIKE '% -s pwsh%' OR LOWER(Command) LIKE '% /s pwsh%' OR LOWER(Command) LIKE '% –s pwsh%' OR LOWER(Command) LIKE '% —s pwsh%' OR LOWER(Command) LIKE '% ―s pwsh%' OR LOWER(Command) LIKE '% -s -i pwsh%' OR LOWER(Command) LIKE '% -s /i pwsh%' OR LOWER(Command) LIKE '% -s –i pwsh%' OR LOWER(Command) LIKE '% -s —i pwsh%' OR LOWER(Command) LIKE '% -s ―i pwsh%' OR LOWER(Command) LIKE '% /s -i pwsh%' OR LOWER(Command) LIKE '% /s /i pwsh%' OR LOWER(Command) LIKE '% /s –i pwsh%' OR LOWER(Command) LIKE '% /s —i pwsh%' OR LOWER(Command) LIKE '% /s ―i pwsh%' OR LOWER(Command) LIKE '% –s -i pwsh%' OR LOWER(Command) LIKE '% –s /i pwsh%' OR LOWER(Command) LIKE '% –s –i pwsh%' OR LOWER(Command) LIKE '% –s —i pwsh%' OR LOWER(Command) LIKE '% –s ―i pwsh%' OR LOWER(Command) LIKE '% —s -i pwsh%' OR LOWER(Command) LIKE '% —s /i pwsh%' OR LOWER(Command) LIKE '% —s –i pwsh%' OR LOWER(Command) LIKE '% —s —i pwsh%' OR LOWER(Command) LIKE '% —s ―i pwsh%' OR LOWER(Command) LIKE '% ―s -i pwsh%' OR LOWER(Command) LIKE '% ―s /i pwsh%' OR LOWER(Command) LIKE '% ―s –i pwsh%' OR LOWER(Command) LIKE '% ―s —i pwsh%' OR LOWER(Command) LIKE '% ―s ―i pwsh%' OR LOWER(Command) LIKE '% -i -s pwsh%' OR LOWER(Command) LIKE '% -i /s pwsh%' OR LOWER(Command) LIKE '% -i –s pwsh%' OR LOWER(Command) LIKE '% -i —s pwsh%' OR LOWER(Command) LIKE '% -i ―s pwsh%' OR LOWER(Command) LIKE '% /i -s pwsh%' OR LOWER(Command) LIKE '% /i /s pwsh%' OR LOWER(Command) LIKE '% /i –s pwsh%' OR LOWER(Command) LIKE '% /i —s pwsh%' OR LOWER(Command) LIKE '% /i ―s pwsh%' OR LOWER(Command) LIKE '% –i -s pwsh%' OR LOWER(Command) LIKE '% –i /s pwsh%' OR LOWER(Command) LIKE '% –i –s pwsh%' OR LOWER(Command) LIKE '% –i —s pwsh%' OR LOWER(Command) LIKE '% –i ―s pwsh%' OR LOWER(Command) LIKE '% —i -s pwsh%' OR LOWER(Command) LIKE '% —i /s pwsh%' OR LOWER(Command) LIKE '% —i –s pwsh%' OR LOWER(Command) LIKE '% —i —s pwsh%' OR LOWER(Comm

Rule response

  • Severity 7, credibility 6, relevance 7
  • Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
  • Respond no more than once per 30 minutes per Log Source (tune per environment)

Limitations

  • QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.

Splunk

Splunk SPLSearch

Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.

(CommandLine="* -s cmd*" OR CommandLine="* /s cmd*" OR CommandLine="* –s cmd*" OR CommandLine="* —s cmd*" OR CommandLine="* ―s cmd*" OR CommandLine="* -s -i cmd*" OR CommandLine="* -s /i cmd*" OR CommandLine="* -s –i cmd*" OR CommandLine="* -s —i cmd*" OR CommandLine="* -s ―i cmd*" OR CommandLine="* /s -i cmd*" OR CommandLine="* /s /i cmd*" OR CommandLine="* /s –i cmd*" OR CommandLine="* /s —i cmd*" OR CommandLine="* /s ―i cmd*" OR CommandLine="* –s -i cmd*" OR CommandLine="* –s /i cmd*" OR CommandLine="* –s –i cmd*" OR CommandLine="* –s —i cmd*" OR CommandLine="* –s ―i cmd*" OR CommandLine="* —s -i cmd*" OR CommandLine="* —s /i cmd*" OR CommandLine="* —s –i cmd*" OR CommandLine="* —s —i cmd*" OR CommandLine="* —s ―i cmd*" OR CommandLine="* ―s -i cmd*" OR CommandLine="* ―s /i cmd*" OR CommandLine="* ―s –i cmd*" OR CommandLine="* ―s —i cmd*" OR CommandLine="* ―s ―i cmd*" OR CommandLine="* -i -s cmd*" OR CommandLine="* -i /s cmd*" OR CommandLine="* -i –s cmd*" OR CommandLine="* -i —s cmd*" OR CommandLine="* -i ―s cmd*" OR CommandLine="* /i -s cmd*" OR CommandLine="* /i /s cmd*" OR CommandLine="* /i –s cmd*" OR CommandLine="* /i —s cmd*" OR CommandLine="* /i ―s cmd*" OR CommandLine="* –i -s cmd*" OR CommandLine="* –i /s cmd*" OR CommandLine="* –i –s cmd*" OR CommandLine="* –i —s cmd*" OR CommandLine="* –i ―s cmd*" OR CommandLine="* —i -s cmd*" OR CommandLine="* —i /s cmd*" OR CommandLine="* —i –s cmd*" OR CommandLine="* —i —s cmd*" OR CommandLine="* —i ―s cmd*" OR CommandLine="* ―i -s cmd*" OR CommandLine="* ―i /s cmd*" OR CommandLine="* ―i –s cmd*" OR CommandLine="* ―i —s cmd*" OR CommandLine="* ―i ―s cmd*" OR CommandLine="* -s pwsh*" OR CommandLine="* /s pwsh*" OR CommandLine="* –s pwsh*" OR CommandLine="* —s pwsh*" OR CommandLine="* ―s pwsh*" OR CommandLine="* -s -i pwsh*" OR CommandLine="* -s /i pwsh*" OR CommandLine="* -s –i pwsh*" OR CommandLine="* -s —i pwsh*" OR CommandLine="* -s ―i pwsh*" OR CommandLine="* /s -i pwsh*" OR CommandLine="* /s /i pwsh*" OR CommandLine="* /s –i pwsh*" OR CommandLine="* /s —i pwsh*" OR CommandLine="* /s ―i pwsh*" OR CommandLine="* –s -i pwsh*" OR CommandLine="* –s /i pwsh*" OR CommandLine="* –s –i pwsh*" OR CommandLine="* –s —i pwsh*" OR CommandLine="* –s ―i pwsh*" OR CommandLine="* —s -i pwsh*" OR CommandLine="* —s /i pwsh*" OR CommandLine="* —s –i pwsh*" OR CommandLine="* —s —i pwsh*" OR CommandLine="* —s ―i pwsh*" OR CommandLine="* ―s -i pwsh*" OR CommandLine="* ―s /i pwsh*" OR CommandLine="* ―s –i pwsh*" OR CommandLine="* ―s —i pwsh*" OR CommandLine="* ―s ―i pwsh*" OR CommandLine="* -i -s pwsh*" OR CommandLine="* -i /s pwsh*" OR CommandLine="* -i –s pwsh*" OR CommandLine="* -i —s pwsh*" OR CommandLine="* -i ―s pwsh*" OR CommandLine="* /i -s pwsh*" OR CommandLine="* /i /s pwsh*" OR CommandLine="* /i –s pwsh*" OR CommandLine="* /i —s pwsh*" OR CommandLine="* /i ―s pwsh*" OR CommandLine="* –i -s pwsh*" OR CommandLine="* –i /s pwsh*" OR CommandLine="* –i –s pwsh*" OR CommandLine="* –i —s pwsh*" OR CommandLine="* –i ―s pwsh*" OR CommandLine="* —i -s pwsh*" OR CommandLine="* —i /s pwsh*" OR CommandLine="* —i –s pwsh*" OR CommandLine="* —i —s pwsh*" OR CommandLine="* —i ―s pwsh*" OR CommandLine="* ―i -s pwsh*" OR CommandLine="* ―i /s pwsh*" OR CommandLine="* ―i –s pwsh*" OR CommandLine="* ―i —s pwsh*" OR CommandLine="* ―i ―s pwsh*" OR CommandLine="* -s powershell*" OR CommandLine="* /s powershell*" OR CommandLine="* –s powershell*" OR CommandLine="* —s powershell*" OR CommandLine="* ―s powershell*" OR CommandLine="* -s -i powershell*" OR CommandLine="* -s /i powershell*" OR CommandLine="* -s –i powershell*" OR CommandLine="* -s —i powershell*" OR CommandLine="* -s ―i powershell*" OR CommandLine="* /s -i powershell*" OR CommandLine="* /s /i powershell*" OR CommandLine="* /s –i powershell*" OR CommandLine="* /s —i powershell*" OR CommandLine="* /s ―i powershell*" OR CommandLine="* –s -i powershell*" OR CommandLine="* –s /i powershell*" OR CommandLine="* –s –i powershell*" OR CommandLine="* –s —i powershell*" OR CommandLine="* –s ―i powershell*" OR CommandLine="* —s -i powershell*" OR CommandLine="* —s /i powershell*" OR CommandLine="* —s –i powershell*" OR CommandLine="* —s —i powershell*" OR CommandLine="* —s ―i powershell*" OR CommandLine="* ―s -i powershell*" OR CommandLine="* ―s /i powershell*" OR CommandLine="* ―s –i powershell*" OR CommandLine="* ―s —i powershell*" OR CommandLine="* ―s ―i powershell*" OR CommandLine="* -i -s powershell*" OR CommandLine="* -i /s powershell*" OR CommandLine="* -i –s powershell*" OR CommandLine="* -i —s powershell*" OR CommandLine="* -i ―s powershell*" OR CommandLine="* /i -s powershell*" OR CommandLine="* /i /s powershell*" OR CommandLine="* /i –s powershell*" OR CommandLine="* /i —s powershell*" OR CommandLine="* /i ―s powershell*" OR CommandLine="* –i -s powershell*" OR CommandLine="* –i /s powershell*" OR CommandLine="* –i –s powershell*" OR CommandLine="* –i —s powershell*" OR CommandLine="* –i ―s powershell*" OR CommandLine="* —i -s powershell*" OR CommandLine="* —i /s powershell*" OR CommandLine="* —i –s powershell*" OR CommandLine="* —i —s powershell*" OR CommandLine="* —i ―s powershell*" OR CommandLine="* ―i -s powershell*" OR CommandLine="* ―i /s powershell*" OR CommandLine="* ―i –s powershell*" OR CommandLine="* ―i —s powershell*" OR CommandLine="* ―i ―s powershell*") NOT (CommandLine IN ("*paexec*", "*PsExec*", "*accepteula*"))

Splunk savedsearches.conf stanzaScheduled search template

Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.

[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now

[Potential Privilege Escalation To LOCAL SYSTEM]
description = Detects unknown program using commandline flags usually used by tools such as PsExec and PAExec to start programs with SYSTEM Privileges
search = (CommandLine="* -s cmd*" OR CommandLine="* /s cmd*" OR CommandLine="* –s cmd*" OR CommandLine="* —s cmd*" OR CommandLine="* ―s cmd*" OR CommandLine="* -s -i cmd*" OR CommandLine="* -s /i cmd*" OR CommandLine="* -s –i cmd*" OR CommandLine="* -s —i cmd*" OR CommandLine="* -s ―i cmd*" OR CommandLine="* /s -i cmd*" OR CommandLine="* /s /i cmd*" OR CommandLine="* /s –i cmd*" OR CommandLine="* /s —i cmd*" OR CommandLine="* /s ―i cmd*" OR CommandLine="* –s -i cmd*" OR CommandLine="* –s /i cmd*" OR CommandLine="* –s –i cmd*" OR CommandLine="* –s —i cmd*" OR CommandLine="* –s ―i cmd*" OR CommandLine="* —s -i cmd*" OR CommandLine="* —s /i cmd*" OR CommandLine="* —s –i cmd*" OR CommandLine="* —s —i cmd*" OR CommandLine="* —s ―i cmd*" OR CommandLine="* ―s -i cmd*" OR CommandLine="* ―s /i cmd*" OR CommandLine="* ―s –i cmd*" OR CommandLine="* ―s —i cmd*" OR CommandLine="* ―s ―i cmd*" OR CommandLine="* -i -s cmd*" OR CommandLine="* -i /s cmd*" OR CommandLine="* -i –s cmd*" OR CommandLine="* -i —s cmd*" OR CommandLine="* -i ―s cmd*" OR CommandLine="* /i -s cmd*" OR CommandLine="* /i /s cmd*" OR CommandLine="* /i –s cmd*" OR CommandLine="* /i —s cmd*" OR CommandLine="* /i ―s cmd*" OR CommandLine="* –i -s cmd*" OR CommandLine="* –i /s cmd*" OR CommandLine="* –i –s cmd*" OR CommandLine="* –i —s cmd*" OR CommandLine="* –i ―s cmd*" OR CommandLine="* —i -s cmd*" OR CommandLine="* —i /s cmd*" OR CommandLine="* —i –s cmd*" OR CommandLine="* —i —s cmd*" OR CommandLine="* —i ―s cmd*" OR CommandLine="* ―i -s cmd*" OR CommandLine="* ―i /s cmd*" OR CommandLine="* ―i –s cmd*" OR CommandLine="* ―i —s cmd*" OR CommandLine="* ―i ―s cmd*" OR CommandLine="* -s pwsh*" OR CommandLine="* /s pwsh*" OR CommandLine="* –s pwsh*" OR CommandLine="* —s pwsh*" OR CommandLine="* ―s pwsh*" OR CommandLine="* -s -i pwsh*" OR CommandLine="* -s /i pwsh*" OR CommandLine="* -s –i pwsh*" OR CommandLine="* -s —i pwsh*" OR CommandLine="* -s ―i pwsh*" OR CommandLine="* /s -i pwsh*" OR CommandLine="* /s /i pwsh*" OR CommandLine="* /s –i pwsh*" OR CommandLine="* /s —i pwsh*" OR CommandLine="* /s ―i pwsh*" OR CommandLine="* –s -i pwsh*" OR CommandLine="* –s /i pwsh*" OR CommandLine="* –s –i pwsh*" OR CommandLine="* –s —i pwsh*" OR CommandLine="* –s ―i pwsh*" OR CommandLine="* —s -i pwsh*" OR CommandLine="* —s /i pwsh*" OR CommandLine="* —s –i pwsh*" OR CommandLine="* —s —i pwsh*" OR CommandLine="* —s ―i pwsh*" OR CommandLine="* ―s -i pwsh*" OR CommandLine="* ―s /i pwsh*" OR CommandLine="* ―s –i pwsh*" OR CommandLine="* ―s —i pwsh*" OR CommandLine="* ―s ―i pwsh*" OR CommandLine="* -i -s pwsh*" OR CommandLine="* -i /s pwsh*" OR CommandLine="* -i –s pwsh*" OR CommandLine="* -i —s pwsh*" OR CommandLine="* -i ―s pwsh*" OR CommandLine="* /i -s pwsh*" OR CommandLine="* /i /s pwsh*" OR CommandLine="* /i –s pwsh*" OR CommandLine="* /i —s pwsh*" OR CommandLine="* /i ―s pwsh*" OR CommandLine="* –i -s pwsh*" OR CommandLine="* –i /s pwsh*" OR CommandLine="* –i –s pwsh*" OR CommandLine="* –i —s pwsh*" OR CommandLine="* –i ―s pwsh*" OR CommandLine="* —i -s pwsh*" OR CommandLine="* —i /s pwsh*" OR CommandLine="* —i –s pwsh*" OR CommandLine="* —i —s pwsh*" OR CommandLine="* —i ―s pwsh*" OR CommandLine="* ―i -s pwsh*" OR CommandLine="* ―i /s pwsh*" OR CommandLine="* ―i –s pwsh*" OR CommandLine="* ―i —s pwsh*" OR CommandLine="* ―i ―s pwsh*" OR CommandLine="* -s powershell*" OR CommandLine="* /s powershell*" OR CommandLine="* –s powershell*" OR CommandLine="* —s powershell*" OR CommandLine="* ―s powershell*" OR CommandLine="* -s -i powershell*" OR CommandLine="* -s /i powershell*" OR CommandLine="* -s –i powershell*" OR CommandLine="* -s —i powershell*" OR CommandLine="* -s ―i powershell*" OR CommandLine="* /s -i powershell*" OR CommandLine="* /s /i powershell*" OR CommandLine="* /s –i powershell*" OR CommandLine="* /s —i powershell*" OR CommandLine="* /s ―i powershell*" OR CommandLine="* –s -i powershell*" OR CommandLine="* –s /i powershell*" OR CommandLine="* –s –i powershell*" OR CommandLine="* –s —i powershell*" OR CommandLine="* –s ―i powershell*" OR CommandLine="* —s -i powershell*" OR CommandLine="* —s /i powershell*" OR CommandLine="* —s –i powershell*" OR CommandLine="* —s —i powershell*" OR CommandLine="* —s ―i powershell*" OR CommandLine="* ―s -i powershell*" OR CommandLine="* ―s /i powershell*" OR CommandLine="* ―s –i powershell*" OR CommandLine="* ―s —i powershell*" OR CommandLine="* ―s ―i powershell*" OR CommandLine="* -i -s powershell*" OR CommandLine="* -i /s powershell*" OR CommandLine="* -i –s powershell*" OR CommandLine="* -i —s powershell*" OR CommandLine="* -i ―s powershell*" OR CommandLine="* /i -s powershell*" OR CommandLine="* /i /s powershell*" OR CommandLine="* /i –s powershell*" OR CommandLine="* /i —s powershell*" OR CommandLine="* /i ―s powershell*" OR CommandLine="* –i -s powershell*" OR CommandLine="* –i /s powershell*" OR CommandLine="* –i –s powershell*" OR CommandLine="* –i —s powershell*" OR CommandLine="* –i ―s powershell*" OR CommandLine="* —i -s powershell*" OR CommandLine="* —i /s powershell*" OR CommandLine="* —i –s powershell*" OR CommandLine="* —i —s powershell*" OR CommandLine="* —i ―s powershell*" OR CommandLine="* ―i -s powershell*" OR CommandLine="* ―i /s powershell*" OR CommandLine="* ―i –s powershell*" OR CommandLine="* ―i —s powershell*" OR CommandLine="* ―i ―s powershell*") NOT (CommandLine IN ("*paexec*", "*PsExec*", "*accepteula*"))

Microsoft Sentinel

Microsoft Sentinel KQL (ASIM)Hunting query

Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.

imProcessCreate
| where (TargetProcessCommandLine contains " -s cmd" or TargetProcessCommandLine contains " /s cmd" or TargetProcessCommandLine contains " –s cmd" or TargetProcessCommandLine contains " —s cmd" or TargetProcessCommandLine contains " ―s cmd" or TargetProcessCommandLine contains " -s -i cmd" or TargetProcessCommandLine contains " -s /i cmd" or TargetProcessCommandLine contains " -s –i cmd" or TargetProcessCommandLine contains " -s —i cmd" or TargetProcessCommandLine contains " -s ―i cmd" or TargetProcessCommandLine contains " /s -i cmd" or TargetProcessCommandLine contains " /s /i cmd" or TargetProcessCommandLine contains " /s –i cmd" or TargetProcessCommandLine contains " /s —i cmd" or TargetProcessCommandLine contains " /s ―i cmd" or TargetProcessCommandLine contains " –s -i cmd" or TargetProcessCommandLine contains " –s /i cmd" or TargetProcessCommandLine contains " –s –i cmd" or TargetProcessCommandLine contains " –s —i cmd" or TargetProcessCommandLine contains " –s ―i cmd" or TargetProcessCommandLine contains " —s -i cmd" or TargetProcessCommandLine contains " —s /i cmd" or TargetProcessCommandLine contains " —s –i cmd" or TargetProcessCommandLine contains " —s —i cmd" or TargetProcessCommandLine contains " —s ―i cmd" or TargetProcessCommandLine contains " ―s -i cmd" or TargetProcessCommandLine contains " ―s /i cmd" or TargetProcessCommandLine contains " ―s –i cmd" or TargetProcessCommandLine contains " ―s —i cmd" or TargetProcessCommandLine contains " ―s ―i cmd" or TargetProcessCommandLine contains " -i -s cmd" or TargetProcessCommandLine contains " -i /s cmd" or TargetProcessCommandLine contains " -i –s cmd" or TargetProcessCommandLine contains " -i —s cmd" or TargetProcessCommandLine contains " -i ―s cmd" or TargetProcessCommandLine contains " /i -s cmd" or TargetProcessCommandLine contains " /i /s cmd" or TargetProcessCommandLine contains " /i –s cmd" or TargetProcessCommandLine contains " /i —s cmd" or TargetProcessCommandLine contains " /i ―s cmd" or TargetProcessCommandLine contains " –i -s cmd" or TargetProcessCommandLine contains " –i /s cmd" or TargetProcessCommandLine contains " –i –s cmd" or TargetProcessCommandLine contains " –i —s cmd" or TargetProcessCommandLine contains " –i ―s cmd" or TargetProcessCommandLine contains " —i -s cmd" or TargetProcessCommandLine contains " —i /s cmd" or TargetProcessCommandLine contains " —i –s cmd" or TargetProcessCommandLine contains " —i —s cmd" or TargetProcessCommandLine contains " —i ―s cmd" or TargetProcessCommandLine contains " ―i -s cmd" or TargetProcessCommandLine contains " ―i /s cmd" or TargetProcessCommandLine contains " ―i –s cmd" or TargetProcessCommandLine contains " ―i —s cmd" or TargetProcessCommandLine contains " ―i ―s cmd" or TargetProcessCommandLine contains " -s pwsh" or TargetProcessCommandLine contains " /s pwsh" or TargetProcessCommandLine contains " –s pwsh" or TargetProcessCommandLine contains " —s pwsh" or TargetProcessCommandLine contains " ―s pwsh" or TargetProcessCommandLine contains " -s -i pwsh" or TargetProcessCommandLine contains " -s /i pwsh" or TargetProcessCommandLine contains " -s –i pwsh" or TargetProcessCommandLine contains " -s —i pwsh" or TargetProcessCommandLine contains " -s ―i pwsh" or TargetProcessCommandLine contains " /s -i pwsh" or TargetProcessCommandLine contains " /s /i pwsh" or TargetProcessCommandLine contains " /s –i pwsh" or TargetProcessCommandLine contains " /s —i pwsh" or TargetProcessCommandLine contains " /s ―i pwsh" or TargetProcessCommandLine contains " –s -i pwsh" or TargetProcessCommandLine contains " –s /i pwsh" or TargetProcessCommandLine contains " –s –i pwsh" or TargetProcessCommandLine contains " –s —i pwsh" or TargetProcessCommandLine contains " –s ―i pwsh" or TargetProcessCommandLine contains " —s -i pwsh" or TargetProcessCommandLine contains " —s /i pwsh" or TargetProcessCommandLine contains " —s –i pwsh" or TargetProcessCommandLine contains " —s —i pwsh" or TargetProcessCommandLine contains " —s ―i pwsh" or TargetProcessCommandLine contains " ―s -i pwsh" or TargetProcessCommandLine contains " ―s /i pwsh" or TargetProcessCommandLine contains " ―s –i pwsh" or TargetProcessCommandLine contains " ―s —i pwsh" or TargetProcessCommandLine contains " ―s ―i pwsh" or TargetProcessCommandLine contains " -i -s pwsh" or TargetProcessCommandLine contains " -i /s pwsh" or TargetProcessCommandLine contains " -i –s pwsh" or TargetProcessCommandLine contains " -i —s pwsh" or TargetProcessCommandLine contains " -i ―s pwsh" or TargetProcessCommandLine contains " /i -s pwsh" or TargetProcessCommandLine contains " /i /s pwsh" or TargetProcessCommandLine contains " /i –s pwsh" or TargetProcessCommandLine contains " /i —s pwsh" or TargetProcessCommandLine contains " /i ―s pwsh" or TargetProcessCommandLine contains " –i -s pwsh" or TargetProcessCommandLine contains " –i /s pwsh" or TargetProcessCommandLine contains " –i –s pwsh" or TargetProcessCommandLine contains " –i —s pwsh" or TargetProcessCommandLine contains " –i ―s pwsh" or TargetProcessCommandLine contains " —i -s pwsh" or TargetProcessCommandLine contains " —i /s pwsh" or TargetProcessCommandLine contains " —i –s pwsh" or TargetProcessCommandLine contains " —i —s pwsh" or TargetProcessCommandLine contains " —i ―s pwsh" or TargetProcessCommandLine contains " ―i -s pwsh" or TargetProcessCommandLine contains " ―i /s pwsh" or TargetProcessCommandLine contains " ―i –s pwsh" or TargetProcessCommandLine contains " ―i —s pwsh" or TargetProcessCommandLine contains " ―i ―s pwsh" or TargetProcessCommandLine contains " -s powershell" or TargetProcessCommandLine contains " /s powershell" or TargetProcessCommandLine contains " –s powershell" or TargetProcessCommandLine contains " —s powershell" or TargetProcessCommandLine contains " ―s powershell" or TargetProcessCommandLine contains " -s -i powershell" or TargetProcessCommandLine contains " -s /i powershell" or TargetProcessCommandLine contains " -s –i powershell" or TargetProcessCommandLine contains " -s —i powershell" or TargetProcessCommandLine contains " -s ―i powershell" or TargetProcessCommandLine contains " /s -i powershell" or TargetProcessCommandLine contains " /s /i powershell" or TargetProcessCommandLine contains " /s –i powershell" or TargetProcessCommandLine contains " /s —i powershell" or TargetProcessCommandLine contains " /s ―i powershell" or TargetProcessCommandLine contains " –s -i powershell" or TargetProcessCommandLine contains " –s /i powershell" or TargetProcessCommandLine contains " –s –i powershell" or TargetProcessCommandLine contains " –s —i powershell" or TargetProcessCommandLine contains " –s ―i powershell" or TargetProcessCommandLine contains " —s -i powershell" or TargetProcessCommandLine contains " —s /i powershell" or TargetProcessCommandLine contains " —s –i powershell" or TargetProcessCommandLine contains " —s —i powershell" or TargetProcessCommandLine contains " —s ―i powershell" or TargetProcessCommandLine contains " ―s -i powershell" or TargetProcessCommandLine contains " ―s /i powershell" or TargetProcessCommandLine contains " ―s –i powershell" or TargetProcessCommandLine contains " ―s —i powershell" or TargetProcessCommandLine contains " ―s ―i powershell" or TargetProcessCommandLine contains " -i -s powershell" or TargetProcessCommandLine contains " -i /s powershell" or TargetProcessCommandLine contains " -i –s powershell" or TargetProcessCommandLine contains " -i —s powershell" or TargetProcessCommandLine contains " -i ―s powershell" or TargetProcessCommandLine contains " /i -s powershell" or TargetProcessCommandLine contains " /i /s powershell" or TargetProcessCommandLine contains " /i –s powershell" or TargetProcessCommandLine contains " /i —s powershell" or TargetProcessCommandLine contains " /i ―s powershell" or TargetProcessCommandLine contains " –i -s powershell" or TargetProcessCommandLine contains " –i /s powershell" or TargetProcessCommandLine contains " –i –s powershell" or TargetProcessCommandLine contains " –i —s powershell" or TargetProcessCommandLine contains " –i ―s powershell" or TargetProcessCommandLine contains " —i -s powershell" or TargetProcessCommandLine contains " —i /s powershell" or TargetProcessCommandLine contains " —i –s powershell" or TargetProcessCommandLine contains " —i —s powershell" or TargetProcessCommandLine contains " —i ―s powershell" or TargetProcessCommandLine contains " ―i -s powershell" or TargetProcessCommandLine contains " ―i /s powershell" or TargetProcessCommandLine contains " ―i –s powershell" or TargetProcessCommandLine contains " ―i —s powershell" or TargetProcessCommandLine contains " ―i ―s powershell") and (not((TargetProcessCommandLine contains "paexec" or TargetProcessCommandLine contains "PsExec" or TargetProcessCommandLine contains "accepteula")))

Defender XDR

Microsoft Defender XDR KQLHunting query

Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.

DeviceProcessEvents
| where (ProcessCommandLine contains " -s cmd" or ProcessCommandLine contains " /s cmd" or ProcessCommandLine contains " –s cmd" or ProcessCommandLine contains " —s cmd" or ProcessCommandLine contains " ―s cmd" or ProcessCommandLine contains " -s -i cmd" or ProcessCommandLine contains " -s /i cmd" or ProcessCommandLine contains " -s –i cmd" or ProcessCommandLine contains " -s —i cmd" or ProcessCommandLine contains " -s ―i cmd" or ProcessCommandLine contains " /s -i cmd" or ProcessCommandLine contains " /s /i cmd" or ProcessCommandLine contains " /s –i cmd" or ProcessCommandLine contains " /s —i cmd" or ProcessCommandLine contains " /s ―i cmd" or ProcessCommandLine contains " –s -i cmd" or ProcessCommandLine contains " –s /i cmd" or ProcessCommandLine contains " –s –i cmd" or ProcessCommandLine contains " –s —i cmd" or ProcessCommandLine contains " –s ―i cmd" or ProcessCommandLine contains " —s -i cmd" or ProcessCommandLine contains " —s /i cmd" or ProcessCommandLine contains " —s –i cmd" or ProcessCommandLine contains " —s —i cmd" or ProcessCommandLine contains " —s ―i cmd" or ProcessCommandLine contains " ―s -i cmd" or ProcessCommandLine contains " ―s /i cmd" or ProcessCommandLine contains " ―s –i cmd" or ProcessCommandLine contains " ―s —i cmd" or ProcessCommandLine contains " ―s ―i cmd" or ProcessCommandLine contains " -i -s cmd" or ProcessCommandLine contains " -i /s cmd" or ProcessCommandLine contains " -i –s cmd" or ProcessCommandLine contains " -i —s cmd" or ProcessCommandLine contains " -i ―s cmd" or ProcessCommandLine contains " /i -s cmd" or ProcessCommandLine contains " /i /s cmd" or ProcessCommandLine contains " /i –s cmd" or ProcessCommandLine contains " /i —s cmd" or ProcessCommandLine contains " /i ―s cmd" or ProcessCommandLine contains " –i -s cmd" or ProcessCommandLine contains " –i /s cmd" or ProcessCommandLine contains " –i –s cmd" or ProcessCommandLine contains " –i —s cmd" or ProcessCommandLine contains " –i ―s cmd" or ProcessCommandLine contains " —i -s cmd" or ProcessCommandLine contains " —i /s cmd" or ProcessCommandLine contains " —i –s cmd" or ProcessCommandLine contains " —i —s cmd" or ProcessCommandLine contains " —i ―s cmd" or ProcessCommandLine contains " ―i -s cmd" or ProcessCommandLine contains " ―i /s cmd" or ProcessCommandLine contains " ―i –s cmd" or ProcessCommandLine contains " ―i —s cmd" or ProcessCommandLine contains " ―i ―s cmd" or ProcessCommandLine contains " -s pwsh" or ProcessCommandLine contains " /s pwsh" or ProcessCommandLine contains " –s pwsh" or ProcessCommandLine contains " —s pwsh" or ProcessCommandLine contains " ―s pwsh" or ProcessCommandLine contains " -s -i pwsh" or ProcessCommandLine contains " -s /i pwsh" or ProcessCommandLine contains " -s –i pwsh" or ProcessCommandLine contains " -s —i pwsh" or ProcessCommandLine contains " -s ―i pwsh" or ProcessCommandLine contains " /s -i pwsh" or ProcessCommandLine contains " /s /i pwsh" or ProcessCommandLine contains " /s –i pwsh" or ProcessCommandLine contains " /s —i pwsh" or ProcessCommandLine contains " /s ―i pwsh" or ProcessCommandLine contains " –s -i pwsh" or ProcessCommandLine contains " –s /i pwsh" or ProcessCommandLine contains " –s –i pwsh" or ProcessCommandLine contains " –s —i pwsh" or ProcessCommandLine contains " –s ―i pwsh" or ProcessCommandLine contains " —s -i pwsh" or ProcessCommandLine contains " —s /i pwsh" or ProcessCommandLine contains " —s –i pwsh" or ProcessCommandLine contains " —s —i pwsh" or ProcessCommandLine contains " —s ―i pwsh" or ProcessCommandLine contains " ―s -i pwsh" or ProcessCommandLine contains " ―s /i pwsh" or ProcessCommandLine contains " ―s –i pwsh" or ProcessCommandLine contains " ―s —i pwsh" or ProcessCommandLine contains " ―s ―i pwsh" or ProcessCommandLine contains " -i -s pwsh" or ProcessCommandLine contains " -i /s pwsh" or ProcessCommandLine contains " -i –s pwsh" or ProcessCommandLine contains " -i —s pwsh" or ProcessCommandLine contains " -i ―s pwsh" or ProcessCommandLine contains " /i -s pwsh" or ProcessCommandLine contains " /i /s pwsh" or ProcessCommandLine contains " /i –s pwsh" or ProcessCommandLine contains " /i —s pwsh" or ProcessCommandLine contains " /i ―s pwsh" or ProcessCommandLine contains " –i -s pwsh" or ProcessCommandLine contains " –i /s pwsh" or ProcessCommandLine contains " –i –s pwsh" or ProcessCommandLine contains " –i —s pwsh" or ProcessCommandLine contains " –i ―s pwsh" or ProcessCommandLine contains " —i -s pwsh" or ProcessCommandLine contains " —i /s pwsh" or ProcessCommandLine contains " —i –s pwsh" or ProcessCommandLine contains " —i —s pwsh" or ProcessCommandLine contains " —i ―s pwsh" or ProcessCommandLine contains " ―i -s pwsh" or ProcessCommandLine contains " ―i /s pwsh" or ProcessCommandLine contains " ―i –s pwsh" or ProcessCommandLine contains " ―i —s pwsh" or ProcessCommandLine contains " ―i ―s pwsh" or ProcessCommandLine contains " -s powershell" or ProcessCommandLine contains " /s powershell" or ProcessCommandLine contains " –s powershell" or ProcessCommandLine contains " —s powershell" or ProcessCommandLine contains " ―s powershell" or ProcessCommandLine contains " -s -i powershell" or ProcessCommandLine contains " -s /i powershell" or ProcessCommandLine contains " -s –i powershell" or ProcessCommandLine contains " -s —i powershell" or ProcessCommandLine contains " -s ―i powershell" or ProcessCommandLine contains " /s -i powershell" or ProcessCommandLine contains " /s /i powershell" or ProcessCommandLine contains " /s –i powershell" or ProcessCommandLine contains " /s —i powershell" or ProcessCommandLine contains " /s ―i powershell" or ProcessCommandLine contains " –s -i powershell" or ProcessCommandLine contains " –s /i powershell" or ProcessCommandLine contains " –s –i powershell" or ProcessCommandLine contains " –s —i powershell" or ProcessCommandLine contains " –s ―i powershell" or ProcessCommandLine contains " —s -i powershell" or ProcessCommandLine contains " —s /i powershell" or ProcessCommandLine contains " —s –i powershell" or ProcessCommandLine contains " —s —i powershell" or ProcessCommandLine contains " —s ―i powershell" or ProcessCommandLine contains " ―s -i powershell" or ProcessCommandLine contains " ―s /i powershell" or ProcessCommandLine contains " ―s –i powershell" or ProcessCommandLine contains " ―s —i powershell" or ProcessCommandLine contains " ―s ―i powershell" or ProcessCommandLine contains " -i -s powershell" or ProcessCommandLine contains " -i /s powershell" or ProcessCommandLine contains " -i –s powershell" or ProcessCommandLine contains " -i —s powershell" or ProcessCommandLine contains " -i ―s powershell" or ProcessCommandLine contains " /i -s powershell" or ProcessCommandLine contains " /i /s powershell" or ProcessCommandLine contains " /i –s powershell" or ProcessCommandLine contains " /i —s powershell" or ProcessCommandLine contains " /i ―s powershell" or ProcessCommandLine contains " –i -s powershell" or ProcessCommandLine contains " –i /s powershell" or ProcessCommandLine contains " –i –s powershell" or ProcessCommandLine contains " –i —s powershell" or ProcessCommandLine contains " –i ―s powershell" or ProcessCommandLine contains " —i -s powershell" or ProcessCommandLine contains " —i /s powershell" or ProcessCommandLine contains " —i –s powershell" or ProcessCommandLine contains " —i —s powershell" or ProcessCommandLine contains " —i ―s powershell" or ProcessCommandLine contains " ―i -s powershell" or ProcessCommandLine contains " ―i /s powershell" or ProcessCommandLine contains " ―i –s powershell" or ProcessCommandLine contains " ―i —s powershell" or ProcessCommandLine contains " ―i ―s powershell") and (not((ProcessCommandLine contains "paexec" or ProcessCommandLine contains "PsExec" or ProcessCommandLine contains "accepteula")))

Elastic

Elastic Lucene (ECS)Hunting query

Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.

(process.command_line:(*\ \-s\ cmd* OR *\ \/s\ cmd* OR *\ –s\ cmd* OR *\ —s\ cmd* OR *\ ―s\ cmd*) OR process.command_line:(*\ \-s\ \-i\ cmd* OR *\ \-s\ \/i\ cmd* OR *\ \-s\ –i\ cmd* OR *\ \-s\ —i\ cmd* OR *\ \-s\ ―i\ cmd* OR *\ \/s\ \-i\ cmd* OR *\ \/s\ \/i\ cmd* OR *\ \/s\ –i\ cmd* OR *\ \/s\ —i\ cmd* OR *\ \/s\ ―i\ cmd* OR *\ –s\ \-i\ cmd* OR *\ –s\ \/i\ cmd* OR *\ –s\ –i\ cmd* OR *\ –s\ —i\ cmd* OR *\ –s\ ―i\ cmd* OR *\ —s\ \-i\ cmd* OR *\ —s\ \/i\ cmd* OR *\ —s\ –i\ cmd* OR *\ —s\ —i\ cmd* OR *\ —s\ ―i\ cmd* OR *\ ―s\ \-i\ cmd* OR *\ ―s\ \/i\ cmd* OR *\ ―s\ –i\ cmd* OR *\ ―s\ —i\ cmd* OR *\ ―s\ ―i\ cmd*) OR process.command_line:(*\ \-i\ \-s\ cmd* OR *\ \-i\ \/s\ cmd* OR *\ \-i\ –s\ cmd* OR *\ \-i\ —s\ cmd* OR *\ \-i\ ―s\ cmd* OR *\ \/i\ \-s\ cmd* OR *\ \/i\ \/s\ cmd* OR *\ \/i\ –s\ cmd* OR *\ \/i\ —s\ cmd* OR *\ \/i\ ―s\ cmd* OR *\ –i\ \-s\ cmd* OR *\ –i\ \/s\ cmd* OR *\ –i\ –s\ cmd* OR *\ –i\ —s\ cmd* OR *\ –i\ ―s\ cmd* OR *\ —i\ \-s\ cmd* OR *\ —i\ \/s\ cmd* OR *\ —i\ –s\ cmd* OR *\ —i\ —s\ cmd* OR *\ —i\ ―s\ cmd* OR *\ ―i\ \-s\ cmd* OR *\ ―i\ \/s\ cmd* OR *\ ―i\ –s\ cmd* OR *\ ―i\ —s\ cmd* OR *\ ―i\ ―s\ cmd*) OR process.command_line:(*\ \-s\ pwsh* OR *\ \/s\ pwsh* OR *\ –s\ pwsh* OR *\ —s\ pwsh* OR *\ ―s\ pwsh*) OR process.command_line:(*\ \-s\ \-i\ pwsh* OR *\ \-s\ \/i\ pwsh* OR *\ \-s\ –i\ pwsh* OR *\ \-s\ —i\ pwsh* OR *\ \-s\ ―i\ pwsh* OR *\ \/s\ \-i\ pwsh* OR *\ \/s\ \/i\ pwsh* OR *\ \/s\ –i\ pwsh* OR *\ \/s\ —i\ pwsh* OR *\ \/s\ ―i\ pwsh* OR *\ –s\ \-i\ pwsh* OR *\ –s\ \/i\ pwsh* OR *\ –s\ –i\ pwsh* OR *\ –s\ —i\ pwsh* OR *\ –s\ ―i\ pwsh* OR *\ —s\ \-i\ pwsh* OR *\ —s\ \/i\ pwsh* OR *\ —s\ –i\ pwsh* OR *\ —s\ —i\ pwsh* OR *\ —s\ ―i\ pwsh* OR *\ ―s\ \-i\ pwsh* OR *\ ―s\ \/i\ pwsh* OR *\ ―s\ –i\ pwsh* OR *\ ―s\ —i\ pwsh* OR *\ ―s\ ―i\ pwsh*) OR process.command_line:(*\ \-i\ \-s\ pwsh* OR *\ \-i\ \/s\ pwsh* OR *\ \-i\ –s\ pwsh* OR *\ \-i\ —s\ pwsh* OR *\ \-i\ ―s\ pwsh* OR *\ \/i\ \-s\ pwsh* OR *\ \/i\ \/s\ pwsh* OR *\ \/i\ –s\ pwsh* OR *\ \/i\ —s\ pwsh* OR *\ \/i\ ―s\ pwsh* OR *\ –i\ \-s\ pwsh* OR *\ –i\ \/s\ pwsh* OR *\ –i\ –s\ pwsh* OR *\ –i\ —s\ pwsh* OR *\ –i\ ―s\ pwsh* OR *\ —i\ \-s\ pwsh* OR *\ —i\ \/s\ pwsh* OR *\ —i\ –s\ pwsh* OR *\ —i\ —s\ pwsh* OR *\ —i\ ―s\ pwsh* OR *\ ―i\ \-s\ pwsh* OR *\ ―i\ \/s\ pwsh* OR *\ ―i\ –s\ pwsh* OR *\ ―i\ —s\ pwsh* OR *\ ―i\ ―s\ pwsh*) OR process.command_line:(*\ \-s\ powershell* OR *\ \/s\ powershell* OR *\ –s\ powershell* OR *\ —s\ powershell* OR *\ ―s\ powershell*) OR process.command_line:(*\ \-s\ \-i\ powershell* OR *\ \-s\ \/i\ powershell* OR *\ \-s\ –i\ powershell* OR *\ \-s\ —i\ powershell* OR *\ \-s\ ―i\ powershell* OR *\ \/s\ \-i\ powershell* OR *\ \/s\ \/i\ powershell* OR *\ \/s\ –i\ powershell* OR *\ \/s\ —i\ powershell* OR *\ \/s\ ―i\ powershell* OR *\ –s\ \-i\ powershell* OR *\ –s\ \/i\ powershell* OR *\ –s\ –i\ powershell* OR *\ –s\ —i\ powershell* OR *\ –s\ ―i\ powershell* OR *\ —s\ \-i\ powershell* OR *\ —s\ \/i\ powershell* OR *\ —s\ –i\ powershell* OR *\ —s\ —i\ powershell* OR *\ —s\ ―i\ powershell* OR *\ ―s\ \-i\ powershell* OR *\ ―s\ \/i\ powershell* OR *\ ―s\ –i\ powershell* OR *\ ―s\ —i\ powershell* OR *\ ―s\ ―i\ powershell*) OR process.command_line:(*\ \-i\ \-s\ powershell* OR *\ \-i\ \/s\ powershell* OR *\ \-i\ –s\ powershell* OR *\ \-i\ —s\ powershell* OR *\ \-i\ ―s\ powershell* OR *\ \/i\ \-s\ powershell* OR *\ \/i\ \/s\ powershell* OR *\ \/i\ –s\ powershell* OR *\ \/i\ —s\ powershell* OR *\ \/i\ ―s\ powershell* OR *\ –i\ \-s\ powershell* OR *\ –i\ \/s\ powershell* OR *\ –i\ –s\ powershell* OR *\ –i\ —s\ powershell* OR *\ –i\ ―s\ powershell* OR *\ —i\ \-s\ powershell* OR *\ —i\ \/s\ powershell* OR *\ —i\ –s\ powershell* OR *\ —i\ —s\ powershell* OR *\ —i\ ―s\ powershell* OR *\ ―i\ \-s\ powershell* OR *\ ―i\ \/s\ powershell* OR *\ ―i\ –s\ powershell* OR *\ ―i\ —s\ powershell* OR *\ ―i\ ―s\ powershell*)) AND (NOT (process.command_line:(*paexec* OR *PsExec* OR *accepteula*)))

Elastic EQL (ECS)Hunting query

EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.

any where (process.command_line like~ ("* -s cmd*", "* /s cmd*", "* –s cmd*", "* —s cmd*", "* ―s cmd*") or process.command_line like~ ("* -s -i cmd*", "* -s /i cmd*", "* -s –i cmd*", "* -s —i cmd*", "* -s ―i cmd*", "* /s -i cmd*", "* /s /i cmd*", "* /s –i cmd*", "* /s —i cmd*", "* /s ―i cmd*", "* –s -i cmd*", "* –s /i cmd*", "* –s –i cmd*", "* –s —i cmd*", "* –s ―i cmd*", "* —s -i cmd*", "* —s /i cmd*", "* —s –i cmd*", "* —s —i cmd*", "* —s ―i cmd*", "* ―s -i cmd*", "* ―s /i cmd*", "* ―s –i cmd*", "* ―s —i cmd*", "* ―s ―i cmd*") or process.command_line like~ ("* -i -s cmd*", "* -i /s cmd*", "* -i –s cmd*", "* -i —s cmd*", "* -i ―s cmd*", "* /i -s cmd*", "* /i /s cmd*", "* /i –s cmd*", "* /i —s cmd*", "* /i ―s cmd*", "* –i -s cmd*", "* –i /s cmd*", "* –i –s cmd*", "* –i —s cmd*", "* –i ―s cmd*", "* —i -s cmd*", "* —i /s cmd*", "* —i –s cmd*", "* —i —s cmd*", "* —i ―s cmd*", "* ―i -s cmd*", "* ―i /s cmd*", "* ―i –s cmd*", "* ―i —s cmd*", "* ―i ―s cmd*") or process.command_line like~ ("* -s pwsh*", "* /s pwsh*", "* –s pwsh*", "* —s pwsh*", "* ―s pwsh*") or process.command_line like~ ("* -s -i pwsh*", "* -s /i pwsh*", "* -s –i pwsh*", "* -s —i pwsh*", "* -s ―i pwsh*", "* /s -i pwsh*", "* /s /i pwsh*", "* /s –i pwsh*", "* /s —i pwsh*", "* /s ―i pwsh*", "* –s -i pwsh*", "* –s /i pwsh*", "* –s –i pwsh*", "* –s —i pwsh*", "* –s ―i pwsh*", "* —s -i pwsh*", "* —s /i pwsh*", "* —s –i pwsh*", "* —s —i pwsh*", "* —s ―i pwsh*", "* ―s -i pwsh*", "* ―s /i pwsh*", "* ―s –i pwsh*", "* ―s —i pwsh*", "* ―s ―i pwsh*") or process.command_line like~ ("* -i -s pwsh*", "* -i /s pwsh*", "* -i –s pwsh*", "* -i —s pwsh*", "* -i ―s pwsh*", "* /i -s pwsh*", "* /i /s pwsh*", "* /i –s pwsh*", "* /i —s pwsh*", "* /i ―s pwsh*", "* –i -s pwsh*", "* –i /s pwsh*", "* –i –s pwsh*", "* –i —s pwsh*", "* –i ―s pwsh*", "* —i -s pwsh*", "* —i /s pwsh*", "* —i –s pwsh*", "* —i —s pwsh*", "* —i ―s pwsh*", "* ―i -s pwsh*", "* ―i /s pwsh*", "* ―i –s pwsh*", "* ―i —s pwsh*", "* ―i ―s pwsh*") or process.command_line like~ ("* -s powershell*", "* /s powershell*", "* –s powershell*", "* —s powershell*", "* ―s powershell*") or process.command_line like~ ("* -s -i powershell*", "* -s /i powershell*", "* -s –i powershell*", "* -s —i powershell*", "* -s ―i powershell*", "* /s -i powershell*", "* /s /i powershell*", "* /s –i powershell*", "* /s —i powershell*", "* /s ―i powershell*", "* –s -i powershell*", "* –s /i powershell*", "* –s –i powershell*", "* –s —i powershell*", "* –s ―i powershell*", "* —s -i powershell*", "* —s /i powershell*", "* —s –i powershell*", "* —s —i powershell*", "* —s ―i powershell*", "* ―s -i powershell*", "* ―s /i powershell*", "* ―s –i powershell*", "* ―s —i powershell*", "* ―s ―i powershell*") or process.command_line like~ ("* -i -s powershell*", "* -i /s powershell*", "* -i –s powershell*", "* -i —s powershell*", "* -i ―s powershell*", "* /i -s powershell*", "* /i /s powershell*", "* /i –s powershell*", "* /i —s powershell*", "* /i ―s powershell*", "* –i -s powershell*", "* –i /s powershell*", "* –i –s powershell*", "* –i —s powershell*", "* –i ―s powershell*", "* —i -s powershell*", "* —i /s powershell*", "* —i –s powershell*", "* —i —s powershell*", "* —i ―s powershell*", "* ―i -s powershell*", "* ―i /s powershell*", "* ―i –s powershell*", "* ―i —s powershell*", "* ―i ―s powershell*")) and (not (process.command_line like~ ("*paexec*", "*PsExec*", "*accepteula*")))

Elastic ES|QL (ECS)Hunting query

ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.

from * metadata _id, _index, _version | where (process.command_line like "* -s cmd*" or process.command_line like "* /s cmd*" or process.command_line like "* –s cmd*" or process.command_line like "* —s cmd*" or process.command_line like "* ―s cmd*" or process.command_line like "* -s -i cmd*" or process.command_line like "* -s /i cmd*" or process.command_line like "* -s –i cmd*" or process.command_line like "* -s —i cmd*" or process.command_line like "* -s ―i cmd*" or process.command_line like "* /s -i cmd*" or process.command_line like "* /s /i cmd*" or process.command_line like "* /s –i cmd*" or process.command_line like "* /s —i cmd*" or process.command_line like "* /s ―i cmd*" or process.command_line like "* –s -i cmd*" or process.command_line like "* –s /i cmd*" or process.command_line like "* –s –i cmd*" or process.command_line like "* –s —i cmd*" or process.command_line like "* –s ―i cmd*" or process.command_line like "* —s -i cmd*" or process.command_line like "* —s /i cmd*" or process.command_line like "* —s –i cmd*" or process.command_line like "* —s —i cmd*" or process.command_line like "* —s ―i cmd*" or process.command_line like "* ―s -i cmd*" or process.command_line like "* ―s /i cmd*" or process.command_line like "* ―s –i cmd*" or process.command_line like "* ―s —i cmd*" or process.command_line like "* ―s ―i cmd*" or process.command_line like "* -i -s cmd*" or process.command_line like "* -i /s cmd*" or process.command_line like "* -i –s cmd*" or process.command_line like "* -i —s cmd*" or process.command_line like "* -i ―s cmd*" or process.command_line like "* /i -s cmd*" or process.command_line like "* /i /s cmd*" or process.command_line like "* /i –s cmd*" or process.command_line like "* /i —s cmd*" or process.command_line like "* /i ―s cmd*" or process.command_line like "* –i -s cmd*" or process.command_line like "* –i /s cmd*" or process.command_line like "* –i –s cmd*" or process.command_line like "* –i —s cmd*" or process.command_line like "* –i ―s cmd*" or process.command_line like "* —i -s cmd*" or process.command_line like "* —i /s cmd*" or process.command_line like "* —i –s cmd*" or process.command_line like "* —i —s cmd*" or process.command_line like "* —i ―s cmd*" or process.command_line like "* ―i -s cmd*" or process.command_line like "* ―i /s cmd*" or process.command_line like "* ―i –s cmd*" or process.command_line like "* ―i —s cmd*" or process.command_line like "* ―i ―s cmd*" or process.command_line like "* -s pwsh*" or process.command_line like "* /s pwsh*" or process.command_line like "* –s pwsh*" or process.command_line like "* —s pwsh*" or process.command_line like "* ―s pwsh*" or process.command_line like "* -s -i pwsh*" or process.command_line like "* -s /i pwsh*" or process.command_line like "* -s –i pwsh*" or process.command_line like "* -s —i pwsh*" or process.command_line like "* -s ―i pwsh*" or process.command_line like "* /s -i pwsh*" or process.command_line like "* /s /i pwsh*" or process.command_line like "* /s –i pwsh*" or process.command_line like "* /s —i pwsh*" or process.command_line like "* /s ―i pwsh*" or process.command_line like "* –s -i pwsh*" or process.command_line like "* –s /i pwsh*" or process.command_line like "* –s –i pwsh*" or process.command_line like "* –s —i pwsh*" or process.command_line like "* –s ―i pwsh*" or process.command_line like "* —s -i pwsh*" or process.command_line like "* —s /i pwsh*" or process.command_line like "* —s –i pwsh*" or process.command_line like "* —s —i pwsh*" or process.command_line like "* —s ―i pwsh*" or process.command_line like "* ―s -i pwsh*" or process.command_line like "* ―s /i pwsh*" or process.command_line like "* ―s –i pwsh*" or process.command_line like "* ―s —i pwsh*" or process.command_line like "* ―s ―i pwsh*" or process.command_line like "* -i -s pwsh*" or process.command_line like "* -i /s pwsh*" or process.command_line like "* -i –s pwsh*" or process.command_line like "* -i —s pwsh*" or process.command_line like "* -i ―s pwsh*" or process.command_line like "* /i -s pwsh*" or process.command_line like "* /i /s pwsh*" or process.command_line like "* /i –s pwsh*" or process.command_line like "* /i —s pwsh*" or process.command_line like "* /i ―s pwsh*" or process.command_line like "* –i -s pwsh*" or process.command_line like "* –i /s pwsh*" or process.command_line like "* –i –s pwsh*" or process.command_line like "* –i —s pwsh*" or process.command_line like "* –i ―s pwsh*" or process.command_line like "* —i -s pwsh*" or process.command_line like "* —i /s pwsh*" or process.command_line like "* —i –s pwsh*" or process.command_line like "* —i —s pwsh*" or process.command_line like "* —i ―s pwsh*" or process.command_line like "* ―i -s pwsh*" or process.command_line like "* ―i /s pwsh*" or process.command_line like "* ―i –s pwsh*" or process.command_line like "* ―i —s pwsh*" or process.command_line like "* ―i ―s pwsh*" or process.command_line like "* -s powershell*" or process.command_line like "* /s powershell*" or process.command_line like "* –s powershell*" or process.command_line like "* —s powershell*" or process.command_line like "* ―s powershell*" or process.command_line like "* -s -i powershell*" or process.command_line like "* -s /i powershell*" or process.command_line like "* -s –i powershell*" or process.command_line like "* -s —i powershell*" or process.command_line like "* -s ―i powershell*" or process.command_line like "* /s -i powershell*" or process.command_line like "* /s /i powershell*" or process.command_line like "* /s –i powershell*" or process.command_line like "* /s —i powershell*" or process.command_line like "* /s ―i powershell*" or process.command_line like "* –s -i powershell*" or process.command_line like "* –s /i powershell*" or process.command_line like "* –s –i powershell*" or process.command_line like "* –s —i powershell*" or process.command_line like "* –s ―i powershell*" or process.command_line like "* —s -i powershell*" or process.command_line like "* —s /i powershell*" or process.command_line like "* —s –i powershell*" or process.command_line like "* —s —i powershell*" or process.command_line like "* —s ―i powershell*" or process.command_line like "* ―s -i powershell*" or process.command_line like "* ―s /i powershell*" or process.command_line like "* ―s –i powershell*" or process.command_line like "* ―s —i powershell*" or process.command_line like "* ―s ―i powershell*" or process.command_line like "* -i -s powershell*" or process.command_line like "* -i /s powershell*" or process.command_line like "* -i –s powershell*" or process.command_line like "* -i —s powershell*" or process.command_line like "* -i ―s powershell*" or process.command_line like "* /i -s powershell*" or process.command_line like "* /i /s powershell*" or process.command_line like "* /i –s powershell*" or process.command_line like "* /i —s powershell*" or process.command_line like "* /i ―s powershell*" or process.command_line like "* –i -s powershell*" or process.command_line like "* –i /s powershell*" or process.command_line like "* –i –s powershell*" or process.command_line like "* –i —s powershell*" or process.command_line like "* –i ―s powershell*" or process.command_line like "* —i -s powershell*" or process.command_line like "* —i /s powershell*" or process.command_line like "* —i –s powershell*" or process.command_line like "* —i —s powershell*" or process.command_line like "* —i ―s powershell*" or process.command_line like "* ―i -s powershell*" or process.command_line like "* ―i /s powershell*" or process.command_line like "* ―i –s powershell*" or process.command_line like "* ―i —s powershell*" or process.command_line like "* ―i ―s powershell*") and not (process.command_line like "*paexec*" or process.command_line like "*PsExec*" or process.command_line like "*accepteula*")

Required telemetry

Log source
product: windows · category: process_creation
Fields used
CommandLine

False positives

  • Weird admins that rename their tools
  • Software companies that bundle PsExec/PAExec with their software and rename it, so that it is less embarrassing

Investigation and response

No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.

References

Author and attribution

Author
Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
Source
SigmaHQ · rules/windows/process_creation/proc_creation_win_sysinternals_susp_psexec_paexec_flags.yml
Upstream commit
9688134317a2
Licence
Detection Rule License (DRL) 1.1

Version history

  1. Version 1Imported from SigmaHQ
  2. OffSet7 build · SigmaHQ 9688134317a2

Related rules