Detection rules › Kusto

Cloudflare - Unexpected POST requests

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

'Detects post requests to unusual extensions.'

MITRE ATT&CK coverage

TacticTechniques
Persistence
Command & Control

Rule body

id: 7313352a-09f6-4a84-88bd-6f17f1cbeb88
name: Cloudflare - Unexpected POST requests
description: |
  'Detects post requests to unusual extensions.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: CloudflareDataConnector
    dataTypes:
      - Cloudflare
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - Persistence
  - CommandAndControl
relevantTechniques:
  - T1505
  - T1071
query: |
  Cloudflare
  | where HttpRequestMethod in~ ('POST', 'PUT')
  | where tostring(HttpStatusCode) startswith '2'
  | where DstBytes != 0 or SrcBytes != 0
  | extend fe = extract(@'.*(\.\w+)$', 1, ClientRequestURI)
  | where fe in~ ('.jpg', '.jpeg', '.gif', '.png', '.icon', '.ico', '.xml', '.swf', '.svg', '.ppt', '.pttx', '.doc', '.docx', '.rtf', '.pdf', '.tif', '.zip', '.mov')
entityMappings:
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: SrcIpAddr
version: 1.0.1
kind: Scheduled

Stages and Predicates

Stage 1: source

Cloudflare

Stage 2: where

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

Stage 3: where

| where tostring(HttpStatusCode) startswith '2'

Stage 4: where

| where DstBytes != 0 or SrcBytes != 0

Stage 5: extend

| extend fe = extract(@'.*(\.\w+)$', 1, ClientRequestURI)

Stage 6: where

| where fe in~ ('.jpg', '.jpeg', '.gif', '.png', '.icon', '.ico', '.xml', '.swf', '.svg', '.ppt', '.pttx', '.doc', '.docx', '.rtf', '.pdf', '.tif', '.zip', '.mov')

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
DstBytesne
  • 0
field:"DstBytes" kind:ne value:"0"
HttpRequestMethodin
  • POST
  • PUT
field:"HttpRequestMethod" kind:in
HttpStatusCodestarts_with
  • 2 transforms: tostring
field:"HttpStatusCode" kind:starts_with value:"2"
SrcBytesne
  • 0
field:"SrcBytes" kind:ne value:"0"
fein
  • .doc
  • .docx
  • .gif
  • .ico
  • .icon
  • .jpeg
  • .jpg
  • .mov
  • .pdf
  • .png
  • .ppt
  • .pttx
  • .rtf
  • .svg
  • .swf
  • .tif
  • .xml
  • .zip
field:"fe" kind:in

Output fields

These fields are emitted when the rule matches.

FieldSource
feextend