Detection rules › Elastic
Potential Privilege Escalation via LocalPotato Exploit
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
| Tactic | Techniques |
|---|---|
| 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.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
user.id | eq | S-1-5-18 | excludes:user.id field:"user.id" value:"S-1-5-18" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
Effective_process.name | eq |
| field:"Effective_process.name" kind:eq value:"svchost.exe" |
destination.address | wildcard |
| field:"destination.address" kind:wildcard |
destination.port | eq |
| field:"DestinationPort" kind:eq value:"445" |
file.Ext.header_bytes | wildcard |
| field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*" |
file.extension | wildcard |
| field:"file.extension" kind:wildcard value:"dll" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
process.pid | eq |
| field:"process_id" kind:eq value:"4" |
process.pid | ne |
| field:"process_id" kind:ne value:"4" |
user.id | wildcard |
| field:"user.id" kind:wildcard value:"S-1-5-18" |