Whitespace Padding in Process Command Lineedit

Identifies process execution events where the command line value contains a long sequence of whitespace characters or multiple occurrences of contiguous whitespace. Attackers may attempt to evade signature-based detections by padding their malicious command with unnecessary whitespace characters. These observations should be investigated for malicious behavior.

Rule type: eql

Rule indices:

  • winlogbeat-*
  • logs-endpoint.events.*
  • logs-windows.*

Severity: medium

Risk score: 47

Runs every: 5 minutes

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100

References:

Tags:

  • Elastic
  • Host
  • Windows
  • Threat Detection
  • Defense Evasion

Version: 8 (version history)

Added (Elastic Stack release): 7.15.0

Last modified (Elastic Stack release): 8.2.0

Rule authors: Elastic

Rule license: Elastic License v2

Investigation guideedit

## Triage and analysis

- Analyze the command line of the process in question for evidence of malicious code execution.
- Review the ancestor and child processes spawned by the process in question for indicators of further malicious code execution.

## Config

If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.

Rule queryedit

process where event.type in ("start", "process_started") and
process.command_line regex ".*[ ]{20,}.*" or /* this will match
on 3 or more separate occurrences of 5+ contiguous whitespace
characters */ process.command_line regex ".*(.*[ ]{5,}[^ ]*){3,}.*"

Threat mappingedit

Framework: MITRE ATT&CKTM

Rule version historyedit

Version 8 (8.2.0 release)
  • Formatting only
Version 4 (8.0.0 release)
  • Formatting only
Version 2 (7.16.0 release)
  • Formatting only