Detection rules › Elastic

Privilege Escalation via NTLMRelay2Self

Source
github.com/elastic/protections-artifacts

Identifies attempt to coerce a local NTLM authentication via HTTP using Printer Spooler service as a target. An adversary may use this primitive in combination with others to elevate privileges on a compromised system.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies attempt to coerce a local NTLM authentication via HTTP using Printer Spooler service as a target. An
adversary may use this primitive in combination with others to elevate privileges on a compromised system.
"""
id = "cabd7f21-70ff-429b-8818-f210ba603461"
license = "Elastic License v2"
name = "Privilege Escalation via NTLMRelay2Self"
os_list = ["windows"]
reference = ["https://github.com/med0x2e/NTLMRelay2Self"]
version = "1.0.27"

query = '''
process where event.action == "start" and
  process.name : "rundll32.exe" and 
  
  /* Rundll32 WbeDav Client  */
  process.args : ("?:\\Windows\\System32\\davclnt.dll,DavSetCookie", "?:\\Windows\\SysWOW64\\davclnt.dll,DavSetCookie") and 
  
  /* Access to named pipe via http */
  process.args : ("http*/print/pipe/*", "http*/pipe/spoolss", "http*/pipe/srvsvc")
'''

min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"


[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1558"
name = "Steal or Forge Kerberos Tickets"
reference = "https://attack.mitre.org/techniques/T1558/"


[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  process.name : "rundll32.exe" and
  process.args : ("?:\\Windows\\System32\\davclnt.dll,DavSetCookie", "?:\\Windows\\SysWOW64\\davclnt.dll,DavSetCookie") and
  process.args : ("http*/print/pipe/*", "http*/pipe/spoolss", "http*/pipe/srvsvc")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.argswildcard
  • ?:\Windows\SysWOW64\davclnt.dll,DavSetCookie corpus 2 (elastic 2)
  • ?:\Windows\System32\davclnt.dll,DavSetCookie corpus 2 (elastic 2)
  • http*/pipe/spoolss corpus 2 (elastic 2)
  • http*/pipe/srvsvc corpus 2 (elastic 2)
  • http*/print/pipe/* corpus 2 (elastic 2)
field:"process.args" kind:wildcard
process.namewildcard
  • rundll32.exe corpus 126 (elastic 100, splunk 26)
field:"process_name" kind:wildcard value:"rundll32.exe"