Detection rules › Elastic

Potential Privilege Escalation via LocalPotato Exploit

Time window
1m
Source
github.com/elastic/protections-artifacts

Identifies a privilege escalation attempt via local NTLM relay attack targeting the local SMB server via exploiting a context swapping vulnerability during the authentication process. The LocalPotato attack is a type of NTLM reflection attack that targets local authentication. This attack allows for arbitrary file read/write and elevation of privilege.

MITRE ATT&CK coverage

TacticTechniques
Privilege Escalation

Rule body

[rule]
description = """
Identifies a privilege escalation attempt via local NTLM relay attack targeting the local SMB server via exploiting a
context swapping vulnerability during the authentication process. The LocalPotato attack is a type of NTLM reflection
attack that targets local authentication. This attack allows for arbitrary file read/write and elevation of privilege.
"""
id = "27a3e57c-d5ae-42bd-99de-052f29dbfb13"
license = "Elastic License v2"
name = "Potential Privilege Escalation via LocalPotato Exploit"
os_list = ["windows"]
reference = [
    "https://www.localpotato.com/localpotato_html/LocalPotato.html",
    "https://github.com/decoder-it/LocalPotato",
]
version = "1.0.17"

query = '''
sequence with maxspan=1m
 [network where destination.port == 445 and process.pid != 4 and
  destination.address : ("127.*", "::1") and not user.id : "S-1-5-18"]
 [file where process.pid == 4 and file.path : ("?:\\Windows\\*", "?:\\Program Files*", "?:\\ProgramData\\Microsoft\\*") and
  Effective_process.name == "svchost.exe" and user.id : "S-1-5-18" and (file.Ext.header_bytes : "4d5a*" or file.extension : "dll")]
'''

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

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

[[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/"

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Stage 1: network

[network where destination.port == 445 and process.pid != 4 and
  destination.address : ("127.*", "::1") and not user.id : "S-1-5-18"]

Stage 2: file

[file where process.pid == 4 and file.path : ("?:\\Windows\\*", "?:\\Program Files*", "?:\\ProgramData\\Microsoft\\*") and
  Effective_process.name == "svchost.exe" and user.id : "S-1-5-18" and (file.Ext.header_bytes : "4d5a*" or file.extension : "dll")]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Effective_process.nameeq
  • svchost.exe
field:"Effective_process.name" kind:eq value:"svchost.exe"
destination.addresswildcard
  • 127.*
  • ::1
field:"destination.address" kind:wildcard
destination.porteq
  • 445 transforms: number corpus 10 (elastic 7, splunk 2, sigma 1)
field:"DestinationPort" kind:eq value:"445"
file.Ext.header_byteswildcard
  • 4d5a* corpus 46 (elastic 46)
field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*"
file.extensionwildcard
  • dll corpus 33 (elastic 33)
field:"file.extension" kind:wildcard value:"dll"
file.pathwildcard
  • ?:\Program Files*
  • ?:\ProgramData\Microsoft\*
  • ?:\Windows\*
field:"TargetFilename" kind:wildcard
process.pideq
  • 4 transforms: number corpus 19 (elastic 19)
field:"process_id" kind:eq value:"4"
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"
user.idwildcard
  • S-1-5-18 corpus 13 (elastic 13)
field:"user.id" kind:wildcard value:"S-1-5-18"