Detection rules › Kusto

Imperva - Possible command injection

Status
available
Severity
high
Time window
10m
Source
github.com/Azure/Azure-Sentinel

'Detects requests with commands in URI.'

MITRE ATT&CK coverage

Rule body kusto

id: 6214f187-5840-4cf7-a174-0cf9a72bfd29
name: Imperva - Possible command injection
description: |
  'Detects requests with commands in URI.'
severity: High
status: Available
requiredDataConnectors:
  - connectorId: ImpervaWAFCloudAPI
    dataTypes:
      - ImpervaWAFCloud
queryFrequency: 10m
queryPeriod: 10m
triggerOperator: gt
triggerThreshold: 0
tactics:
  - InitialAccess
relevantTechniques:
  - T1190
  - T1133
query: |
  let cmd_lst = dynamic(['%2fetc%2fpasswd', '%2fetc%2fshadow', 'ping', 'whoami', 'phpinfo', '%2fbin%2fbash', 'curl', 'exec(', 'wget', 'python', 'gcc' , 'uname', 'systeminfo', 'rout', 'hostname', 'ifconfig']);
  ImpervaWAFCloud
  | where QueryString has_any (cmd_lst)
  | extend IPCustomEntity = SrcIpAddr
entityMappings:
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: IPCustomEntity
version: 1.0.1
kind: Scheduled

Stages and Predicates

Let binding: cmd_lst

let cmd_lst = dynamic(['%2fetc%2fpasswd', '%2fetc%2fshadow', 'ping', 'whoami', 'phpinfo', '%2fbin%2fbash', 'curl', 'exec(', 'wget', 'python', 'gcc' , 'uname', 'systeminfo', 'rout', 'hostname', 'ifconfig']);

Stage 1: source

ImpervaWAFCloud

Stage 2: where

| where QueryString has_any (cmd_lst)

References cmd_lst (defined above).

Stage 3: extend

| extend IPCustomEntity = SrcIpAddr

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
QueryStringmatch
  • %2fbin%2fbash
  • %2fetc%2fpasswd
  • %2fetc%2fshadow
  • curl
  • exec(
  • gcc
  • hostname
  • ifconfig
  • phpinfo
  • ping
  • python
  • rout
  • systeminfo
  • uname
  • wget
  • whoami

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
IPCustomEntityextend