Detection rules › Sigma

Suspicious WebDav Client Execution Via Rundll32.EXE

Status
test
Severity
high
Log source
category process_creation, product windows
Author
Nasreddine Bencherchali (Nextron Systems), Florian Roth (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects "svchost.exe" spawning "rundll32.exe" with command arguments like C:\windows\system32\davclnt.dll,DavSetCookie. This could be an indicator of exfiltration or use of WebDav to launch code (hosted on WebDav Server) or potentially a sign of exploitation of CVE-2023-23397

MITRE ATT&CK coverage

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Suspicious WebDav Client Execution Via Rundll32.EXE
id: 982e9f2d-1a85-4d5b-aea4-31f5e97c6555
status: test
description: |
    Detects "svchost.exe" spawning "rundll32.exe" with command arguments like C:\windows\system32\davclnt.dll,DavSetCookie. This could be an indicator of exfiltration or use of WebDav to launch code (hosted on WebDav Server) or potentially a sign of exploitation of CVE-2023-23397
references:
    - https://twitter.com/aceresponder/status/1636116096506818562
    - https://www.mdsec.co.uk/2023/03/exploiting-cve-2023-23397-microsoft-outlook-elevation-of-privilege-vulnerability/
    - https://www.pwndefend.com/2023/03/15/the-long-game-persistent-hash-theft/
    - https://www.microsoft.com/en-us/security/blog/wp-content/uploads/2023/03/Figure-7-sample-webdav-process-create-event.png
    - https://www.microsoft.com/en-us/security/blog/2023/03/24/guidance-for-investigating-attacks-using-cve-2023-23397/
author: Nasreddine Bencherchali (Nextron Systems), Florian Roth (Nextron Systems)
date: 2023-03-16
modified: 2023-09-18
tags:
    - attack.exfiltration
    - attack.t1048.003
    - cve.2023-23397
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        ParentImage|endswith: '\svchost.exe'
        ParentCommandLine|contains: '-s WebClient'
        Image|endswith: '\rundll32.exe'
        CommandLine|contains: 'C:\windows\system32\davclnt.dll,DavSetCookie'
        CommandLine|re: '://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'
    filter_local_ips:
        CommandLine|contains:
            - '://10.' # 10.0.0.0/8
            - '://192.168.' # 192.168.0.0/16
            - '://172.16.' # 172.16.0.0/12
            - '://172.17.'
            - '://172.18.'
            - '://172.19.'
            - '://172.20.'
            - '://172.21.'
            - '://172.22.'
            - '://172.23.'
            - '://172.24.'
            - '://172.25.'
            - '://172.26.'
            - '://172.27.'
            - '://172.28.'
            - '://172.29.'
            - '://172.30.'
            - '://172.31.'
            - '://127.' # 127.0.0.0/8
            - '://169.254.' # 169.254.0.0/16
    condition: selection and not 1 of filter_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_*

Stage 1: selection

selection:
    ParentImage|endswith: '\svchost.exe'
    ParentCommandLine|contains: '-s WebClient'
    Image|endswith: '\rundll32.exe'
    CommandLine|contains: 'C:\windows\system32\davclnt.dll,DavSetCookie'
    CommandLine|re: '://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'

Stage 2: not filter_local_ips

filter_local_ips:
    CommandLine|contains:
        - '://10.'
        - '://192.168.'
        - '://172.16.'
        - '://172.17.'
        - '://172.18.'
        - '://172.19.'
        - '://172.20.'
        - '://172.21.'
        - '://172.22.'
        - '://172.23.'
        - '://172.24.'
        - '://172.25.'
        - '://172.26.'
        - '://172.27.'
        - '://172.28.'
        - '://172.29.'
        - '://172.30.'
        - '://172.31.'
        - '://127.'
        - '://169.254.'

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
CommandLinematch://10.excludes:CommandLine field:"CommandLine" value:"://10."
CommandLinematch://127.excludes:CommandLine field:"CommandLine" value:"://127."
CommandLinematch://169.254.excludes:CommandLine field:"CommandLine" value:"://169.254."
CommandLinematch://172.16.excludes:CommandLine field:"CommandLine" value:"://172.16."
CommandLinematch://172.17.excludes:CommandLine field:"CommandLine" value:"://172.17."
CommandLinematch://172.18.excludes:CommandLine field:"CommandLine" value:"://172.18."
CommandLinematch://172.19.excludes:CommandLine field:"CommandLine" value:"://172.19."
CommandLinematch://172.20.excludes:CommandLine field:"CommandLine" value:"://172.20."
CommandLinematch://172.21.excludes:CommandLine field:"CommandLine" value:"://172.21."
CommandLinematch://172.22.excludes:CommandLine field:"CommandLine" value:"://172.22."
CommandLinematch://172.23.excludes:CommandLine field:"CommandLine" value:"://172.23."
CommandLinematch://172.24.excludes:CommandLine field:"CommandLine" value:"://172.24."
CommandLinematch://172.25.excludes:CommandLine field:"CommandLine" value:"://172.25."
CommandLinematch://172.26.excludes:CommandLine field:"CommandLine" value:"://172.26."
CommandLinematch://172.27.excludes:CommandLine field:"CommandLine" value:"://172.27."
CommandLinematch://172.28.excludes:CommandLine field:"CommandLine" value:"://172.28."
CommandLinematch://172.29.excludes:CommandLine field:"CommandLine" value:"://172.29."
CommandLinematch://172.30.excludes:CommandLine field:"CommandLine" value:"://172.30."
CommandLinematch://172.31.excludes:CommandLine field:"CommandLine" value:"://172.31."
CommandLinematch://192.168.excludes:CommandLine field:"CommandLine" value:"://192.168."

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • C:\windows\system32\davclnt.dll,DavSetCookie corpus 3 (sigma 3)
field:"CommandLine" kind:match value:"C:\windows\system32\davclnt.dll,DavSetCookie"
CommandLineregex_match
  • ://\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} corpus 2 (sigma 2)
field:"CommandLine" kind:regex_match value:"://\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}"
Imageends_with
  • \rundll32.exe corpus 94 (sigma 94)
field:"Image" kind:ends_with value:"\rundll32.exe"
ParentCommandLinematch
  • -s WebClient
field:"ParentCommandLine" kind:match value:"-s WebClient"
ParentImageends_with
  • \svchost.exe corpus 15 (sigma 14, kusto 1)
field:"ParentImage" kind:ends_with value:"\svchost.exe"