Detection rules › Kusto

Apache - Requests to rare files

Status
available
Severity
medium
Time window
14d
Source
github.com/Azure/Azure-Sentinel

'Shows requests to rare files'

MITRE ATT&CK coverage

Rule body

id: 14d7e15e-3afb-11ec-8d3d-0242ac130003
name: Apache - Requests to rare files
description: |
  'Shows requests to rare files'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: CustomLogsAma
    datatypes:
      - ApacheHTTPServer_CL
queryFrequency: 1h
queryPeriod: 14d
triggerOperator: gt
triggerThreshold: 0
tactics:
  - InitialAccess
relevantTechniques:
  - T1190
  - T1133
query: |
  let lb_period_start = 14d;
  let lb_period_end = 1d;
  let known_files = ApacheHTTPServer
  | where TimeGenerated between (ago(lb_period_start) .. ago(lb_period_end))
  | extend File = extract(@"(.*\/)?(.*)", 2, tostring(UrlOriginal))
  | summarize makeset(File);
  ApacheHTTPServer
  | where TimeGenerated > ago(24h)
  | extend File = extract(@"(.*\/)?(.*)", 2, tostring(UrlOriginal))
  | where File in~ (known_files)
  | extend FileCustomEntity = File, UrlCustomEntity = UrlOriginal
entityMappings:
  - entityType: File
    fieldMappings:
      - identifier: Name
        columnName: FileCustomEntity
  - entityType: URL
    fieldMappings:
      - identifier: Url
        columnName: UrlCustomEntity
version: 1.0.2
kind: Scheduled

Stages and Predicates

Parameters

let lb_period_start = 14d;
let lb_period_end = 1d;

Let binding: known_files used in Stage 4

let known_files = ApacheHTTPServer
| where TimeGenerated between (ago(lb_period_start) .. ago(lb_period_end))
| extend File = extract(@"(.*\/)?(.*)", 2, tostring(UrlOriginal))
| summarize makeset(File);

Stage 1: source

ApacheHTTPServer

Stage 2: where

| where TimeGenerated > ago(24h)

Stage 3: extend

| extend File = extract(@"(.*\/)?(.*)", 2, tostring(UrlOriginal))

Stage 4: where

| where File in~ (known_files)

Stage 5: extend

| extend FileCustomEntity = File, UrlCustomEntity = UrlOriginal

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Filein
  • known_files
field:"File" kind:in value:"known_files"

Output fields

These fields are emitted when the rule matches.

FieldSource
Fileextend
FileCustomEntityextend
UrlCustomEntityextend