Detection rules › Elastic

Suspicious Access to LSA Secrets Registry

Source
github.com/elastic/protections-artifacts

Identifies access to the LSA Secrets policy registry hive by an unusual process. Adversaries with SYSTEM access to a host may attempt to access Local Security Authority (LSA) secrets, which can contain a variety of different credential materials, such as credentials for service accounts.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies access to the LSA Secrets policy registry hive by an unusual process. Adversaries with SYSTEM access to a
host may attempt to access Local Security Authority (LSA) secrets, which can contain a variety of different credential
materials, such as credentials for service accounts.
"""
id = "c5ee8453-bc89-42e7-a414-1ba4bec85119"
license = "Elastic License v2"
name = "Suspicious Access to LSA Secrets Registry"
os_list = ["windows"]
reference = [
    "https://www.ired.team/offensive-security/credential-access-and-credential-dumping/dumping-lsa-secrets",
    "https://github.com/gtworek/PSBits/tree/master/LSASecretDumper",
]
version = "1.0.43"

query = '''
registry where event.action != "modification" and
 registry.path : ("HKLM\\SECURITY\\Policy\\Secrets\\*", "HKLM\\SECURITY\\CACHE*") and process.executable != null and
 user.id : "S-1-5-18" and
 not process.executable : ("?:\\Windows\\System32\\lsass.exe",
                           "\\Device\\HarddiskVolume?\\Windows\\System32\\lsass.exe",
                           "\\Device\\HarddiskVolume??\\Windows\\System32\\lsass.exe",
                           "?:\\Program Files (x86)\\DesktopCentral_Agent\\bin\\ToolsIQ.exe",
                           "?:\\Program Files\\Citrix\\PvsVm\\Service\\PvsVmAgent.exe",
                           "?:\\Windows\\Provisioning\\Autopilot\\DiagonsticAnalysis.pif",
                           "?:\\Program Files\\RepairTech\\LiveAgent\\SyncroLive.Agent.Runner.exe",
                           "?:\\Program Files\\Common Files\\Adobe\\Creative Cloud Libraries\\CCLibrary.exe",
                           "?:\\Windows\\System32\\SpecopsClient\\SecuredBrowserNet\\SecuredBrowserDotNetLauncher.exe",
                           "?:\\Program Files (x86)\\Tripwire\\TFS\\Bin\\tripwire.exe",
                           "?:\\Windows\\regedit.exe",
                           "?:\\Program Files\\Dell\\Dell Data Protection\\Encryption\\EmsService.exe",
                           "?:\\Program Files (x86)\\Imperva\\RemoteAgent\\RemoteAgentCtrl.exe",
                           "?:\\Program Files (x86)\\Lenovo\\System Update\\UACSdk.exe",
                           "?:\\Program Files (x86)\\CentraStage\\CagService.exe",
                           "?:\\Program Files\\McAfee\\Endpoint Security\\Adaptive Threat Protection\\mfeatp.exe",
                           "?:\\Program Files\\Bitdefender\\Endpoint Security\\EPSecurityService.exe",
                           // SenseIR.exe spawning powershell
                           "?:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
                           "?:\\Program Files\\Neverfail\\R2\\bin\\NFServerR2.exe",
                           "C:\\Program Files (x86)\\AutoElevate\\AutoElevateAgent.exe",
                           "C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-*\\components\\osqueryd.exe") and
 not (process.executable : "?:\\Windows\\System32\\dsregcmd.exe" and registry.path : "HKLM\\SECURITY\\Policy\\Secrets\\DSREGCMD\\MutexName") and
 not (process.executable : "?:\\Windows\\LTSvc\\LTSVC.exe" and registry.path : "HKLM\\SECURITY\\Cache\\NL$1") and
 not (process.executable : ("?:\\Program Files (x86)\\*.exe", "?:\\Program Files\\*.exe") and
      registry.path : "HKLM\\SECURITY\\Policy\\Secrets\\$MACHINE.ACC\\CupdTime\\") and
 not registry.path : "HKLM\\SECURITY\\Policy\\Secrets\\DSREGCMD\\MutexName" and
 not (process.code_signature.subject_name :
            ("Musarubra US LLC", "Bitdefender SRL", "Illusive Networks LTD", "Comodo Security Solutions, Inc.",
             "Proofpoint, Inc.", "Portnox Security LLC", "Urs Beckmann") and
      process.code_signature.trusted == true) and

 /* 8.6+ logs also failed attempts which generate some noise */
 not event.outcome == "failure" and

 not registry.path : ("HKLM\\SECURITY\\Policy\\Secrets\\_SC_Citrix Encryption Service\\*",
                      "HKLM\\SECURITY\\Policy\\Secrets\\$MACHINE.ACC\\CupdTime\\")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[threat.technique.subtechnique]]
id = "T1003.004"
name = "LSA Secrets"
reference = "https://attack.mitre.org/techniques/T1003/004/"

[[threat.technique.subtechnique]]
id = "T1003.005"
name = "Cached Domain Credentials"
reference = "https://attack.mitre.org/techniques/T1003/005/"



[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
 registry.path : ("HKLM\\SECURITY\\Policy\\Secrets\\*", "HKLM\\SECURITY\\CACHE*") and process.executable != null and
 user.id : "S-1-5-18" and
 not process.executable : ("?:\\Windows\\System32\\lsass.exe",
                           "\\Device\\HarddiskVolume?\\Windows\\System32\\lsass.exe",
                           "\\Device\\HarddiskVolume??\\Windows\\System32\\lsass.exe",
                           "?:\\Program Files (x86)\\DesktopCentral_Agent\\bin\\ToolsIQ.exe",
                           "?:\\Program Files\\Citrix\\PvsVm\\Service\\PvsVmAgent.exe",
                           "?:\\Windows\\Provisioning\\Autopilot\\DiagonsticAnalysis.pif",
                           "?:\\Program Files\\RepairTech\\LiveAgent\\SyncroLive.Agent.Runner.exe",
                           "?:\\Program Files\\Common Files\\Adobe\\Creative Cloud Libraries\\CCLibrary.exe",
                           "?:\\Windows\\System32\\SpecopsClient\\SecuredBrowserNet\\SecuredBrowserDotNetLauncher.exe",
                           "?:\\Program Files (x86)\\Tripwire\\TFS\\Bin\\tripwire.exe",
                           "?:\\Windows\\regedit.exe",
                           "?:\\Program Files\\Dell\\Dell Data Protection\\Encryption\\EmsService.exe",
                           "?:\\Program Files (x86)\\Imperva\\RemoteAgent\\RemoteAgentCtrl.exe",
                           "?:\\Program Files (x86)\\Lenovo\\System Update\\UACSdk.exe",
                           "?:\\Program Files (x86)\\CentraStage\\CagService.exe",
                           "?:\\Program Files\\McAfee\\Endpoint Security\\Adaptive Threat Protection\\mfeatp.exe",
                           "?:\\Program Files\\Bitdefender\\Endpoint Security\\EPSecurityService.exe",
                           "?:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
                           "?:\\Program Files\\Neverfail\\R2\\bin\\NFServerR2.exe",
                           "C:\\Program Files (x86)\\AutoElevate\\AutoElevateAgent.exe",
                           "C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-*\\components\\osqueryd.exe") and
 not (process.executable : "?:\\Windows\\System32\\dsregcmd.exe" and registry.path : "HKLM\\SECURITY\\Policy\\Secrets\\DSREGCMD\\MutexName") and
 not (process.executable : "?:\\Windows\\LTSvc\\LTSVC.exe" and registry.path : "HKLM\\SECURITY\\Cache\\NL$1") and
 not (process.executable : ("?:\\Program Files (x86)\\*.exe", "?:\\Program Files\\*.exe") and
      registry.path : "HKLM\\SECURITY\\Policy\\Secrets\\$MACHINE.ACC\\CupdTime\\") and
 not registry.path : "HKLM\\SECURITY\\Policy\\Secrets\\DSREGCMD\\MutexName" and
 not (process.code_signature.subject_name :
            ("Musarubra US LLC", "Bitdefender SRL", "Illusive Networks LTD", "Comodo Security Solutions, Inc.",
             "Proofpoint, Inc.", "Portnox Security LLC", "Urs Beckmann") and
      process.code_signature.trusted == true) and
 not event.outcome == "failure" and
 not registry.path : ("HKLM\\SECURITY\\Policy\\Secrets\\_SC_Citrix Encryption Service\\*",
                      "HKLM\\SECURITY\\Policy\\Secrets\\$MACHINE.ACC\\CupdTime\\")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqMusarubra US LLC, Bitdefender SRL, Illusive Networks LTD, Comodo Security Solutions, Inc., Proofpoint, Inc., Portnox Security LLC, Urs Beckmannexcludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executableeq?:\Windows\LTSvc\LTSVC.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\LTSvc\LTSVC.exe"
registry.patheqHKLM\SECURITY\Cache\NL$1excludes:registry.path field:"registry.path" value:"HKLM\SECURITY\Cache\NL$1"
process.executableeq?:\Windows\System32\dsregcmd.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\dsregcmd.exe"
registry.patheqHKLM\SECURITY\Policy\Secrets\DSREGCMD\MutexNameexcludes:registry.path field:"registry.path" value:"HKLM\SECURITY\Policy\Secrets\DSREGCMD\MutexName"
process.executablewildcard?:\Program Files (x86)\*.exe, ?:\Program Files\*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\*.exe" field:"process.executable" value:"?:\Program Files\*.exe"
registry.patheqHKLM\SECURITY\Policy\Secrets\$MACHINE.ACC\CupdTime\excludes:registry.path field:"registry.path" value:"HKLM\SECURITY\Policy\Secrets\$MACHINE.ACC\CupdTime\"
event.outcomeeqfailureexcludes:event.outcome field:"event.outcome" value:"failure"
process.executablewildcard?:\Windows\System32\lsass.exe, \Device\HarddiskVolume?\Windows\System32\lsass.exe, \Device\HarddiskVolume??\Windows\System32\lsass.exe, ?:\Program Files (x86)\DesktopCentral_Agent\bin\ToolsIQ.exe, ?:\Program Files\Citrix\PvsVm\Service\PvsVmAgent.exe, ?:\Windows\Provisioning\Autopilot\DiagonsticAnalysis.pif, ?:\Program Files\RepairTech\LiveAgent\SyncroLive.Agent.Runner.exe, ?:\Program Files\Common Files\Adobe\Creative Cloud Libraries\CCLibrary.exe, ?:\Windows\System32\SpecopsClient\SecuredBrowserNet\SecuredBrowserDotNetLauncher.exe, ?:\Program Files (x86)\Tripwire\TFS\Bin\tripwire.exe, ?:\Windows\regedit.exe, ?:\Program Files\Dell\Dell Data Protection\Encryption\EmsService.exe, ?:\Program Files (x86)\Imperva\RemoteAgent\RemoteAgentCtrl.exe, ?:\Program Files (x86)\Lenovo\System Update\UACSdk.exe, ?:\Program Files (x86)\CentraStage\CagService.exe, ?:\Program Files\McAfee\Endpoint Security\Adaptive Threat Protection\mfeatp.exe, ?:\Program Files\Bitdefender\Endpoint Security\EPSecurityService.exe, ?:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe, ?:\Program Files\Neverfail\R2\bin\NFServerR2.exe, C:\Program Files (x86)\AutoElevate\AutoElevateAgent.exe, C:\Program Files\Elastic\Agent\data\elastic-agent-*\components\osqueryd.exeexcludes:process.executable
registry.pathwildcardHKLM\SECURITY\Policy\Secrets\_SC_Citrix Encryption Service\*, HKLM\SECURITY\Policy\Secrets\$MACHINE.ACC\CupdTime\excludes:registry.path field:"registry.path" value:"HKLM\SECURITY\Policy\Secrets\_SC_Citrix Encryption Service\*" field:"registry.path" value:"HKLM\SECURITY\Policy\Secrets\$MACHINE.ACC\CupdTime\"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionne
  • modification
field:"EventType" kind:ne value:"modification"
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
registry.pathwildcard
  • HKLM\SECURITY\CACHE* corpus 2 (elastic 2)
  • HKLM\SECURITY\Policy\Secrets\* corpus 2 (elastic 2)
field:"TargetObject" kind:wildcard
user.idwildcard
  • S-1-5-18 corpus 13 (elastic 13)
field:"user.id" kind:wildcard value:"S-1-5-18"