Detection rules › Splunk

Microsoft Diagnostic Tool "DogWalk" Package Path Traversal (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

The vulnerability lies in the Microsoft Diagnostic Tool's sdiageng.dll library, which takes the attacker-supplied folder path from the package configuration XML file inside the diagcab archive, and copies all files from that folder to a local temporary folder. During this process, it enumerates files in attacker's folder, gets the file name for each of them, then glues together the local temporary path and that file name to generate the local path on the computer where the file is to be created.

MITRE ATT&CK coverage

TacticTechniques
Execution

References

Telemetry coverage

Rule body

id: '11280.15742'
title: Microsoft Diagnostic Tool "DogWalk" Package Path Traversal
description: The vulnerability lies in the Microsoft Diagnostic Tool's sdiageng.dll
  library, which takes the attacker-supplied folder path from the package configuration
  XML file inside the diagcab archive, and copies all files from that folder to a
  local temporary folder. During this process, it enumerates files in attacker's folder,
  gets the file name for each of them, then glues together the local temporary path
  and that file name to generate the local path on the computer where the file is
  to be created.
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) ("msdt.exe" OR TERM(msdt)) AND ("/cab" OR ".diagcab")
  | table _time, host, user process, process_*, parent_*, signature_id, trun_cmd |
  bin span=1s | stats values(*) as * by _time, host | where match(process, "(?i)cab|diagcab") '
techniques:
- execution:user execution
technique_id: 
- T1204
data_category:
- Windows event logs
references:
- https://blog.0patch.com/2022/06/microsoft-diagnostic-tools-dogwalk.html

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) ("msdt.exe" OR TERM(msdt)) AND ("/cab" OR ".diagcab")

Stage 2: table

| table _time, host, user process, process_*, parent_*, signature_id, trun_cmd

Stage 3: bucket

| bin span=1s

Stage 4: stats

| stats values(*) as * by _time, host

Stage 5: where

| where match(process, "(?i)cab|diagcab")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq value:"4688"
processregex_match
    • "(?i)cab
    • diagcab"
    corpus 2 (splunk 2)
field:"CommandLine" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4688<"
1"msdt.exe"
1msdt
1"/cab"
1".diagcab"