Detection rules › Elastic
Suspicious Windows Authentication Registry Modification
Identifies registry modification that may affect the Windows Logon or the Local Security Authority (LSA) service behaviors for persistence or credential access such as installing a rogue password filter or notification packages.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Credential Access |
Rule body
[rule]
description = """
Identifies registry modification that may affect the Windows Logon or the Local Security Authority (LSA) service
behaviors for persistence or credential access such as installing a rogue password filter or notification packages.
"""
id = "8eb2906a-9878-448d-807a-08fbe27b7d2d"
license = "Elastic License v2"
name = "Suspicious Windows Authentication Registry Modification"
os_list = ["windows"]
reference = [
"https://blog.xpnsec.com/exploring-mimikatz-part-1/",
"https://pentestlab.blog/2019/10/21/persistence-security-support-provider/",
"https://github.com/gtworek/PSBits/tree/master/PasswordStealing/NPPSpy",
]
version = "1.0.19"
query = '''
registry where event.action == "modification" and
process.executable : ("?:\\*", "\\Device\\Mup*") and registry.data.strings != null and
registry.path : ("HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Security Packages*",
"HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\OSConfig\\Security Packages*",
"HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Notification Packages",
"HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Authentication Packages",
"HKLM\\SYSTEM\\*ControlSet*\\Services\\NTDS\\DirectoryServiceExtPt",
"HKLM\\SYSTEM\\*ControlSet*\\Services\\NTDS\\LsaDbExtPt",
"HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Notify\\*",
"HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\NetworkProvider\\ProviderPath") and
not process.executable :
("?:\\Windows\\System32\\msiexec.exe",
"?:\\Windows\\SysWOW64\\msiexec.exe",
"?:\\Windows\\Sys*\\drvinst.exe",
"?:\\Windows\\Sys*\\poqexec.exe",
"?:\\Windows\\System32\\lsass.exe",
"?:\\Windows\\SysWOW64\\regsvr32.exe",
"?:\\Windows\\system32\\regsvr32.exe",
"?:\\Windows\\WinSxS\\*\\TiWorker.exe",
"C:\\Windows\\System32\\svchost.exe",
"?:\\Windows\\Sys*\\config\\systemprofile\\*",
"?:\\Program Files\\*.exe",
"C:\\Windows\\regedit.exe",
"?:\\Program Files (x86)\\*.exe") and
/* excluding signed and non Microsoft binaries */
not (process.code_signature.trusted == true and not process.code_signature.subject_name : "Microsoft*") and
not registry.value : ("SmartCardLogonNotify", "Asynchronous", "Enabled", "Impersonate", "Startup", "Logoff", "Logon", "Shutdown") and
not registry.data.strings : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*", "?:\\Windows\\system32\\cbfsShellHelper20.dll") and
not (registry.value : "notification packages" and registry.data.strings : ("kdcsvc", "rassfm", "scecli") and
process.executable : "?:\\Windows\\System32\\services.exe") and
not (registry.value : "ProviderPath" and registry.data.strings : "?:\\Program Files (x86)\\Citrix\\ICA Client\\x64\\pnsson.dll")
'''
min_endpoint_version = "8.0.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 = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[threat.technique.subtechnique]]
id = "T1547.002"
name = "Authentication Package"
reference = "https://attack.mitre.org/techniques/T1547/002/"
[[threat.technique.subtechnique]]
id = "T1547.005"
name = "Security Support Provider"
reference = "https://attack.mitre.org/techniques/T1547/005/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"
[[threat.technique.subtechnique]]
id = "T1556.002"
name = "Password Filter DLL"
reference = "https://attack.mitre.org/techniques/T1556/002/"
[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[internal]
min_endpoint_version = "8.0.0"
Stages and Predicates
Stage 1: registry
registry where event.action == "modification" and
process.executable : ("?:\\*", "\\Device\\Mup*") and registry.data.strings != null and
registry.path : ("HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Security Packages*",
"HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\OSConfig\\Security Packages*",
"HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Notification Packages",
"HKLM\\SYSTEM\\*ControlSet*\\Control\\Lsa\\Authentication Packages",
"HKLM\\SYSTEM\\*ControlSet*\\Services\\NTDS\\DirectoryServiceExtPt",
"HKLM\\SYSTEM\\*ControlSet*\\Services\\NTDS\\LsaDbExtPt",
"HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Notify\\*",
"HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\NetworkProvider\\ProviderPath") and
not process.executable :
("?:\\Windows\\System32\\msiexec.exe",
"?:\\Windows\\SysWOW64\\msiexec.exe",
"?:\\Windows\\Sys*\\drvinst.exe",
"?:\\Windows\\Sys*\\poqexec.exe",
"?:\\Windows\\System32\\lsass.exe",
"?:\\Windows\\SysWOW64\\regsvr32.exe",
"?:\\Windows\\system32\\regsvr32.exe",
"?:\\Windows\\WinSxS\\*\\TiWorker.exe",
"C:\\Windows\\System32\\svchost.exe",
"?:\\Windows\\Sys*\\config\\systemprofile\\*",
"?:\\Program Files\\*.exe",
"C:\\Windows\\regedit.exe",
"?:\\Program Files (x86)\\*.exe") and
not (process.code_signature.trusted == true and not process.code_signature.subject_name : "Microsoft*") and
not registry.value : ("SmartCardLogonNotify", "Asynchronous", "Enabled", "Impersonate", "Startup", "Logoff", "Logon", "Shutdown") and
not registry.data.strings : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*", "?:\\Windows\\system32\\cbfsShellHelper20.dll") and
not (registry.value : "notification packages" and registry.data.strings : ("kdcsvc", "rassfm", "scecli") and
process.executable : "?:\\Windows\\System32\\services.exe") and
not (registry.value : "ProviderPath" and registry.data.strings : "?:\\Program Files (x86)\\Citrix\\ICA Client\\x64\\pnsson.dll")
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.subject_name | starts_with | Microsoft | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | eq | ?:\Windows\System32\services.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\services.exe" |
registry.data.strings | eq | kdcsvc, rassfm, scecli | excludes:registry.data.strings field:"registry.data.strings" value:"kdcsvc" field:"registry.data.strings" value:"rassfm" field:"registry.data.strings" value:"scecli" |
registry.value | eq | notification packages | excludes:registry.value field:"registry.value" value:"notification packages" |
registry.data.strings | eq | ?:\Program Files (x86)\Citrix\ICA Client\x64\pnsson.dll | excludes:registry.data.strings field:"registry.data.strings" value:"?:\Program Files (x86)\Citrix\ICA Client\x64\pnsson.dll" |
registry.value | eq | ProviderPath | excludes:registry.value field:"registry.value" value:"ProviderPath" |
process.executable | wildcard | ?:\Windows\System32\msiexec.exe, ?:\Windows\SysWOW64\msiexec.exe, ?:\Windows\Sys*\drvinst.exe, ?:\Windows\Sys*\poqexec.exe, ?:\Windows\System32\lsass.exe, ?:\Windows\SysWOW64\regsvr32.exe, ?:\Windows\system32\regsvr32.exe, ?:\Windows\WinSxS\*\TiWorker.exe, C:\Windows\System32\svchost.exe, ?:\Windows\Sys*\config\systemprofile\*, ?:\Program Files\*.exe, C:\Windows\regedit.exe, ?:\Program Files (x86)\*.exe | excludes:process.executable |
registry.data.strings | wildcard | *:\Program Files\*, *:\Program Files (x86)\*, ?:\Windows\system32\cbfsShellHelper20.dll | excludes:registry.data.strings field:"registry.data.strings" value:"*:\Program Files\*" field:"registry.data.strings" value:"*:\Program Files (x86)\*" field:"registry.data.strings" value:"?:\Windows\system32\cbfsShellHelper20.dll" |
registry.value | eq | SmartCardLogonNotify, Asynchronous, Enabled, Impersonate, Startup, Logoff, Logon, Shutdown | excludes:registry.value |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"modification" |
process.code_signature.subject_name | wildcard |
| field:"Signature" kind:wildcard value:"Microsoft*" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
registry.data.strings | is_not_null | field:"Details" kind:is_not_null | |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard |