Detection rule
Potentially Suspicious Execution Of PDQDeployRunner
Overview
Detects suspicious execution of "PDQDeployRunner" which is part of the PDQDeploy service stack that is responsible for executing commands and packages on a remote machines
- Rule id
12b8e9f5-96b2-41e1-9a42-8c6779a5c184- ATT&CK techniques
- T1072 Software Deployment Tools
- Severity
- Medium
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- The Gentlemen, nightspire
Validation
- ExperimentalSyntax checked only. Not yet tested on events.
- Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
- SIEM-validatedRun in a real SIEM, with a recorded result.
2 of 2 positive test events matched; 1 of 1 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) · 12b8e9f5-96b2-41e1-9a42-8c6779a5c184
title: Potentially Suspicious Execution Of PDQDeployRunner
id: 12b8e9f5-96b2-41e1-9a42-8c6779a5c184
related:
- id: d679950c-abb7-43a6-80fb-2a480c4fc450
type: similar
status: test
description: Detects suspicious execution of "PDQDeployRunner" which is part of the PDQDeploy service stack that is responsible for executing commands and packages on a remote machines
references:
- https://twitter.com/malmoeb/status/1550483085472432128
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-07-22
modified: 2024-05-02
tags:
- attack.execution
logsource:
category: process_creation
product: windows
detection:
selection_parent:
ParentImage|contains: '\PDQDeployRunner-'
selection_child:
# Improve this section by adding other suspicious processes, commandlines or paths
- Image|endswith:
# If you use any of the following processes legitimately comment them out
- '\bash.exe'
- '\certutil.exe'
- '\cmd.exe'
- '\csc.exe'
- '\cscript.exe'
- '\dllhost.exe'
- '\mshta.exe'
- '\msiexec.exe'
- '\regsvr32.exe'
- '\rundll32.exe'
- '\scriptrunner.exe'
- '\wmic.exe'
- '\wscript.exe'
- '\wsl.exe'
- Image|contains:
- ':\ProgramData\'
- ':\Users\Public\'
- ':\Windows\TEMP\'
- '\AppData\Local\Temp'
- CommandLine|contains:
- ' -decode '
- ' -enc '
- ' -encodedcommand '
- ' -w hidden'
- 'DownloadString'
- 'FromBase64String'
- 'http'
- 'iex '
- 'Invoke-'
condition: all of selection_*
falsepositives:
- Legitimate use of the PDQDeploy tool to execute these commands
level: mediumQRadar 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("Parent Process Path") LIKE '%\pdqdeployrunner-%' AND (((LOWER("Process Path") LIKE '%\bash.exe' OR LOWER("Process Path") LIKE '%\certutil.exe' OR LOWER("Process Path") LIKE '%\cmd.exe' OR LOWER("Process Path") LIKE '%\csc.exe' OR LOWER("Process Path") LIKE '%\cscript.exe' OR LOWER("Process Path") LIKE '%\dllhost.exe' OR LOWER("Process Path") LIKE '%\mshta.exe' OR LOWER("Process Path") LIKE '%\msiexec.exe' OR LOWER("Process Path") LIKE '%\regsvr32.exe' OR LOWER("Process Path") LIKE '%\rundll32.exe' OR LOWER("Process Path") LIKE '%\scriptrunner.exe' OR LOWER("Process Path") LIKE '%\wmic.exe' OR LOWER("Process Path") LIKE '%\wscript.exe' OR LOWER("Process Path") LIKE '%\wsl.exe') OR (LOWER("Process Name") LIKE '%\bash.exe' OR LOWER("Process Name") LIKE '%\certutil.exe' OR LOWER("Process Name") LIKE '%\cmd.exe' OR LOWER("Process Name") LIKE '%\csc.exe' OR LOWER("Process Name") LIKE '%\cscript.exe' OR LOWER("Process Name") LIKE '%\dllhost.exe' OR LOWER("Process Name") LIKE '%\mshta.exe' OR LOWER("Process Name") LIKE '%\msiexec.exe' OR LOWER("Process Name") LIKE '%\regsvr32.exe' OR LOWER("Process Name") LIKE '%\rundll32.exe' OR LOWER("Process Name") LIKE '%\scriptrunner.exe' OR LOWER("Process Name") LIKE '%\wmic.exe' OR LOWER("Process Name") LIKE '%\wscript.exe' OR LOWER("Process Name") LIKE '%\wsl.exe')) OR ((LOWER("Process Path") LIKE '%:\programdata\%' OR LOWER("Process Path") LIKE '%:\users\public\%' OR LOWER("Process Path") LIKE '%:\windows\temp\%' OR LOWER("Process Path") LIKE '%\appdata\local\temp%') OR (LOWER("Process Name") LIKE '%:\programdata\%' OR LOWER("Process Name") LIKE '%:\users\public\%' OR LOWER("Process Name") LIKE '%:\windows\temp\%' OR LOWER("Process Name") LIKE '%\appdata\local\temp%')) OR (LOWER(Command) LIKE '% -decode %' OR LOWER(Command) LIKE '% -enc %' OR LOWER(Command) LIKE '% -encodedcommand %' OR LOWER(Command) LIKE '% -w hidden%' OR LOWER(Command) LIKE '%downloadstring%' OR LOWER(Command) LIKE '%frombase64string%' OR LOWER(Command) LIKE '%http%' OR LOWER(Command) LIKE '%iex %' OR LOWER(Command) LIKE '%invoke-%'))QRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: Potentially Suspicious Execution Of PDQDeployRunner- 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:Potentially Suspicious Execution Of PDQDeployRun:selection_parent(match)All test lines must match (AND).Parent Process Pathcontains:\PDQDeployRunner-
BB:OffSet7:Potentially Suspicious Execution Of PDQDeployRun:selection_child(match)Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.Process Path / Process Nameends with:\bash.exe,\certutil.exe,\cmd.exe,\csc.exe,\cscript.exe,\dllhost.exe,\mshta.exe,\msiexec.exe,\regsvr32.exe,\rundll32.exe,\scriptrunner.exe,\wmic.exe,\wscript.exe,\wsl.exeProcess Path / Process Namecontains::\ProgramData\,:\Users\Public\,:\Windows\TEMP\,\AppData\Local\TempCommandcontains:-decode,-enc,-encodedcommand,-w hidden,DownloadString,FromBase64String,http,iex,Invoke-
Main rule, option A (building blocks)
- 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 - when an event matches the condition built from these building blocks:
(ALL of [BB:OffSet7:Potentially Suspicious Execution Of PDQDeployRun:selection_parent, BB:OffSet7:Potentially Suspicious Execution Of PDQDeployRun:selection_child])
Main rule, option B (AQL filter test)
- when the event matches this AQL filter query:
devicetype=12 AND LOWER("Parent Process Path") LIKE '%\pdqdeployrunner-%' AND (((LOWER("Process Path") LIKE '%\bash.exe' OR LOWER("Process Path") LIKE '%\certutil.exe' OR LOWER("Process Path") LIKE '%\cmd.exe' OR LOWER("Process Path") LIKE '%\csc.exe' OR LOWER("Process Path") LIKE '%\cscript.exe' OR LOWER("Process Path") LIKE '%\dllhost.exe' OR LOWER("Process Path") LIKE '%\mshta.exe' OR LOWER("Process Path") LIKE '%\msiexec.exe' OR LOWER("Process Path") LIKE '%\regsvr32.exe' OR LOWER("Process Path") LIKE '%\rundll32.exe' OR LOWER("Process Path") LIKE '%\scriptrunner.exe' OR LOWER("Process Path") LIKE '%\wmic.exe' OR LOWER("Process Path") LIKE '%\wscript.exe' OR LOWER("Process Path") LIKE '%\wsl.exe') OR (LOWER("Process Name") LIKE '%\bash.exe' OR LOWER("Process Name") LIKE '%\certutil.exe' OR LOWER("Process Name") LIKE '%\cmd.exe' OR LOWER("Process Name") LIKE '%\csc.exe' OR LOWER("Process Name") LIKE '%\cscript.exe' OR LOWER("Process Name") LIKE '%\dllhost.exe' OR LOWER("Process Name") LIKE '%\mshta.exe' OR LOWER("Process Name") LIKE '%\msiexec.exe' OR LOWER("Process Name") LIKE '%\regsvr32.exe' OR LOWER("Process Name") LIKE '%\rundll32.exe' OR LOWER("Process Name") LIKE '%\scriptrunner.exe' OR LOWER("Process Name") LIKE '%\wmic.exe' OR LOWER("Process Name") LIKE '%\wscript.exe' OR LOWER("Process Name") LIKE '%\wsl.exe')) OR ((LOWER("Process Path") LIKE '%:\programdata\%' OR LOWER("Process Path") LIKE '%:\users\public\%' OR LOWER("Process Path") LIKE '%:\windows\temp\%' OR LOWER("Process Path") LIKE '%\appdata\local\temp%') OR (LOWER("Process Name") LIKE '%:\programdata\%' OR LOWER("Process Name") LIKE '%:\users\public\%' OR LOWER("Process Name") LIKE '%:\windows\temp\%' OR LOWER("Process Name") LIKE '%\appdata\local\temp%')) OR (LOWER(Command) LIKE '% -decode %' OR LOWER(Command) LIKE '% -enc %' OR LOWER(Command) LIKE '% -encodedcommand %' OR LOWER(Command) LIKE '% -w hidden%' OR LOWER(Command) LIKE '%downloadstring%' OR LOWER(Command) LIKE '%frombase64string%' OR LOWER(Command) LIKE '%http%' OR LOWER(Command) LIKE '%iex %' OR LOWER(Command) LIKE '%invoke-%'))
Rule response
- Severity 5, 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.
ParentImage="*\\PDQDeployRunner-*" (Image IN ("*\\bash.exe", "*\\certutil.exe", "*\\cmd.exe", "*\\csc.exe", "*\\cscript.exe", "*\\dllhost.exe", "*\\mshta.exe", "*\\msiexec.exe", "*\\regsvr32.exe", "*\\rundll32.exe", "*\\scriptrunner.exe", "*\\wmic.exe", "*\\wscript.exe", "*\\wsl.exe") OR Image IN ("*:\\ProgramData\\*", "*:\\Users\\Public\\*", "*:\\Windows\\TEMP\\*", "*\\AppData\\Local\\Temp*") OR CommandLine IN ("* -decode *", "* -enc *", "* -encodedcommand *", "* -w hidden*", "*DownloadString*", "*FromBase64String*", "*http*", "*iex *", "*Invoke-*"))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
[Potentially Suspicious Execution Of PDQDeployRunner]
description = Detects suspicious execution of "PDQDeployRunner" which is part of the PDQDeploy service stack that is responsible for executing commands and packages on a remote machines
search = ParentImage="*\\PDQDeployRunner-*" (Image IN ("*\\bash.exe", "*\\certutil.exe", "*\\cmd.exe", "*\\csc.exe", "*\\cscript.exe", "*\\dllhost.exe", "*\\mshta.exe", "*\\msiexec.exe", "*\\regsvr32.exe", "*\\rundll32.exe", "*\\scriptrunner.exe", "*\\wmic.exe", "*\\wscript.exe", "*\\wsl.exe") OR Image IN ("*:\\ProgramData\\*", "*:\\Users\\Public\\*", "*:\\Windows\\TEMP\\*", "*\\AppData\\Local\\Temp*") OR CommandLine IN ("* -decode *", "* -enc *", "* -encodedcommand *", "* -w hidden*", "*DownloadString*", "*FromBase64String*", "*http*", "*iex *", "*Invoke-*"))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 (ParentProcessName contains "\\PDQDeployRunner-" or ActingProcessName contains "\\PDQDeployRunner-") and ((TargetProcessName endswith "\\bash.exe" or TargetProcessName endswith "\\certutil.exe" or TargetProcessName endswith "\\cmd.exe" or TargetProcessName endswith "\\csc.exe" or TargetProcessName endswith "\\cscript.exe" or TargetProcessName endswith "\\dllhost.exe" or TargetProcessName endswith "\\mshta.exe" or TargetProcessName endswith "\\msiexec.exe" or TargetProcessName endswith "\\regsvr32.exe" or TargetProcessName endswith "\\rundll32.exe" or TargetProcessName endswith "\\scriptrunner.exe" or TargetProcessName endswith "\\wmic.exe" or TargetProcessName endswith "\\wscript.exe" or TargetProcessName endswith "\\wsl.exe") or (TargetProcessName contains ":\\ProgramData\\" or TargetProcessName contains ":\\Users\\Public\\" or TargetProcessName contains ":\\Windows\\TEMP\\" or TargetProcessName contains "\\AppData\\Local\\Temp") or (TargetProcessCommandLine contains " -decode " or TargetProcessCommandLine contains " -enc " or TargetProcessCommandLine contains " -encodedcommand " or TargetProcessCommandLine contains " -w hidden" or TargetProcessCommandLine contains "DownloadString" or TargetProcessCommandLine contains "FromBase64String" or TargetProcessCommandLine contains "http" or TargetProcessCommandLine contains "iex " or TargetProcessCommandLine contains "Invoke-"))Defender XDR
Microsoft Defender XDR KQLHunting query
Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.
DeviceProcessEvents
| where InitiatingProcessFolderPath contains "\\PDQDeployRunner-" and ((FolderPath endswith "\\bash.exe" or FolderPath endswith "\\certutil.exe" or FolderPath endswith "\\cmd.exe" or FolderPath endswith "\\csc.exe" or FolderPath endswith "\\cscript.exe" or FolderPath endswith "\\dllhost.exe" or FolderPath endswith "\\mshta.exe" or FolderPath endswith "\\msiexec.exe" or FolderPath endswith "\\regsvr32.exe" or FolderPath endswith "\\rundll32.exe" or FolderPath endswith "\\scriptrunner.exe" or FolderPath endswith "\\wmic.exe" or FolderPath endswith "\\wscript.exe" or FolderPath endswith "\\wsl.exe") or (FolderPath contains ":\\ProgramData\\" or FolderPath contains ":\\Users\\Public\\" or FolderPath contains ":\\Windows\\TEMP\\" or FolderPath contains "\\AppData\\Local\\Temp") or (ProcessCommandLine contains " -decode " or ProcessCommandLine contains " -enc " or ProcessCommandLine contains " -encodedcommand " or ProcessCommandLine contains " -w hidden" or ProcessCommandLine contains "DownloadString" or ProcessCommandLine contains "FromBase64String" or ProcessCommandLine contains "http" or ProcessCommandLine contains "iex " or ProcessCommandLine contains "Invoke-"))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.parent.executable:*\\PDQDeployRunner\-* AND ((process.executable:(*\\bash.exe OR *\\certutil.exe OR *\\cmd.exe OR *\\csc.exe OR *\\cscript.exe OR *\\dllhost.exe OR *\\mshta.exe OR *\\msiexec.exe OR *\\regsvr32.exe OR *\\rundll32.exe OR *\\scriptrunner.exe OR *\\wmic.exe OR *\\wscript.exe OR *\\wsl.exe)) OR (process.executable:(*\:\\ProgramData\\* OR *\:\\Users\\Public\\* OR *\:\\Windows\\TEMP\\* OR *\\AppData\\Local\\Temp*)) OR (process.command_line:(*\ \-decode\ * OR *\ \-enc\ * OR *\ \-encodedcommand\ * OR *\ \-w\ hidden* OR *DownloadString* OR *FromBase64String* OR *http* OR *iex\ * OR *Invoke\-*)))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.parent.executable:"*\\PDQDeployRunner-*" and ((process.executable like~ ("*\\bash.exe", "*\\certutil.exe", "*\\cmd.exe", "*\\csc.exe", "*\\cscript.exe", "*\\dllhost.exe", "*\\mshta.exe", "*\\msiexec.exe", "*\\regsvr32.exe", "*\\rundll32.exe", "*\\scriptrunner.exe", "*\\wmic.exe", "*\\wscript.exe", "*\\wsl.exe")) or (process.executable like~ ("*:\\ProgramData\\*", "*:\\Users\\Public\\*", "*:\\Windows\\TEMP\\*", "*\\AppData\\Local\\Temp*")) or (process.command_line like~ ("* -decode *", "* -enc *", "* -encodedcommand *", "* -w hidden*", "*DownloadString*", "*FromBase64String*", "*http*", "*iex *", "*Invoke-*")))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.parent.executable like "*\\\\PDQDeployRunner-*" and (ends_with(process.executable, "\\bash.exe") or ends_with(process.executable, "\\certutil.exe") or ends_with(process.executable, "\\cmd.exe") or ends_with(process.executable, "\\csc.exe") or ends_with(process.executable, "\\cscript.exe") or ends_with(process.executable, "\\dllhost.exe") or ends_with(process.executable, "\\mshta.exe") or ends_with(process.executable, "\\msiexec.exe") or ends_with(process.executable, "\\regsvr32.exe") or ends_with(process.executable, "\\rundll32.exe") or ends_with(process.executable, "\\scriptrunner.exe") or ends_with(process.executable, "\\wmic.exe") or ends_with(process.executable, "\\wscript.exe") or ends_with(process.executable, "\\wsl.exe") or process.executable like "*:\\\\ProgramData\\\\*" or process.executable like "*:\\\\Users\\\\Public\\\\*" or process.executable like "*:\\\\Windows\\\\TEMP\\\\*" or process.executable like "*\\\\AppData\\\\Local\\\\Temp*" or process.command_line like "* -decode *" or process.command_line like "* -enc *" or process.command_line like "* -encodedcommand *" or process.command_line like "* -w hidden*" or process.command_line like "*DownloadString*" or process.command_line like "*FromBase64String*" or process.command_line like "*http*" or process.command_line like "*iex *" or process.command_line like "*Invoke-*")Required telemetry
- Log source
product: windows · category: process_creation- Fields used
CommandLineImageParentImage
False positives
- Legitimate use of the PDQDeploy tool to execute these commands
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
- Nasreddine Bencherchali (Nextron Systems)
- Source
- SigmaHQ ·
rules/windows/process_creation/proc_creation_win_pdqdeploy_runner_susp_children.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2