Detection rules › Sigma

Ruby Inline Command Execution

Severity
medium
Author
Nasreddine Bencherchali (Nextron Systems)
Source
upstream

Detects execution of ruby using the "-e" flag. This is could be used as a way to launch a reverse shell or execute live ruby code.

MITRE ATT&CK coverage

TacticTechniques
ExecutionT1059 Command and Scripting Interpreter

Event coverage

ProviderEvent IDTitle
Sysmon1Process creation

Stages and Predicates

Stage 1: all of selection_img

or:
Image|endswith: '\ruby.exe'
OriginalFileName: ruby.exe

Stage 2: all of selection_cli

CommandLine|contains: ' -e'

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
  • -e corpus 4 (sigma 4)
Imageends_with
  • \ruby.exe corpus 2 (sigma 2)
OriginalFileNameeq
  • ruby.exe