Detection rules › Kusto

Corelight - Possible Webshell

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

'Detects post requests to unusual extensions.'

MITRE ATT&CK coverage

TacticTechniques
PersistenceT1505 Server Software Component

Rule body kusto

id: f3245aa1-1ca1-471c-a0b7-97ea6b791d5d
name: Corelight - Possible Webshell
description: |
  'Detects post requests to unusual extensions.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: Corelight
    dataTypes:
      - Corelight_v2_http
      - corelight_http
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - Persistence
relevantTechniques:
  - T1505
query: |
  corelight_http
  | where method in~ ('POST', 'PUT')
  | where toint(status_code) between (200 .. 299)
  | where request_body_len != 0 or response_body_len != 0
  | extend fe = extract(@'.*(\.\w+)$', 1, uri)
  | 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: id_orig_h
version: 2.1.0
kind: Scheduled

Stages and Predicates

Stage 1: source

corelight_http

Stage 2: where

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

Stage 3: where

| where toint(status_code) between (200 .. 299)

Stage 4: where

| where request_body_len != 0 or response_body_len != 0

Stage 5: extend

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

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

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
fein
  • .doc
  • .docx
  • .gif
  • .ico
  • .icon
  • .jpeg
  • .jpg
  • .mov
  • .pdf
  • .png
  • .ppt
  • .pttx
  • .rtf
  • .svg
  • .swf
  • .tif
  • .xml
  • .zip
methodin
  • POST
  • PUT
request_body_lenne
  • 0 transforms: cased
response_body_lenne
  • 0 transforms: cased

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
feextend