Detection rules › Kusto

Cloudflare - XSS probing pattern in request

Status
available
Severity
medium
Time window
1h
Source
github.com/Azure/Azure-Sentinel

'Detects XSS probing patterns.'

MITRE ATT&CK coverage

Rule body

id: 4d9d00b9-31a6-49e4-88c1-9e68277053ac
name: Cloudflare - XSS probing pattern in request
description: |
  'Detects XSS probing patterns.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: CloudflareDataConnector
    dataTypes:
      - Cloudflare
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - InitialAccess
relevantTechniques:
  - T1190
  - T1133
query: |
  let s_threshold = 3;
  Cloudflare
  | where HttpRequestMethod in~ ('POST', 'PUT')
  | extend susp_ch = countof(ClientRequestURI, '%00')
  | where ClientRequestURI matches regex @'(alert\()|(alert\%28)|(String\.fromCharCode\()|(expression\(alert)' or susp_ch > s_threshold 
  | extend CompleteUrl = strcat(HttpRequestHeaderHost,ClientRequestPath)
entityMappings:
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: SrcIpAddr
  - entityType: URL
    fieldMappings:
      - identifier: Url
        columnName: CompleteUrl
version: 1.0.1
kind: Scheduled

Stages and Predicates

Parameters

let s_threshold = 3;

Stage 1: source

Cloudflare

Stage 2: where

| where HttpRequestMethod in~ ('POST', 'PUT')

Stage 3: extend

| extend susp_ch = countof(ClientRequestURI, '%00')

Stage 4: where

| where ClientRequestURI matches regex @'(alert\()|(alert\%28)|(String\.fromCharCode\()|(expression\(alert)' or susp_ch > s_threshold

Stage 5: extend

| extend CompleteUrl = strcat(HttpRequestHeaderHost,ClientRequestPath)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
ClientRequestURIregex_match
    • (alert()
    • (alert\%28)
    • (String.fromCharCode()
    • (expression(alert)
field:"ClientRequestURI" kind:regex_match
HttpRequestMethodin
  • POST
  • PUT
field:"HttpRequestMethod" kind:in
susp_chgt
  • 3
field:"susp_ch" kind:gt value:"3"

Output fields

These fields are emitted when the rule matches.

FieldSource
susp_chextend
CompleteUrlextend