Detection rules › Elastic

LSASS Access Attempt from Unbacked Memory

Time window
3m
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies attempt to access the Local Security Authority Subsystem Service (LSASS) and from a call stack containing unbacked code. Adversaries may attempt to access credential material stored in the process memory of LSASS.

MITRE ATT&CK coverage

TacticTechniques
Credential Access

Rule body

[rule]
description = """
Identifies attempt to access the Local Security Authority Subsystem Service (LSASS) and from a call stack containing
unbacked code. Adversaries may attempt to access credential material stored in the process memory of LSASS.
"""
id = "03efdaab-72af-4714-83ce-3abc10cab8d5"
license = "Elastic License v2"
name = "LSASS Access Attempt from Unbacked Memory"
os_list = ["windows"]
version = "1.0.17"

query = '''
sequence by process.entity_id with maxspan=3m
[process where event.action == "start" and
  process.parent.name != null and
 (
   process.executable : ("?:\\Windows\\system32\\*", "?:\\Windows\\SysWOW64\\*") or
   process.parent.executable : "?:\\Windows\\system32\\wsmprovhost.exe" or
   process.executable regex~ """c:\\windows\\[a-z0-9\-\_\.]+\.exe"""
  ) and
  not (process.executable : "?:\\Windows\\system32\\svchost.exe" and process.parent.name : "services.exe") and
  not (process.executable : "?:\\Windows\\System32\\MRT.exe" and process.parent.executable : "?:\\Windows\\SoftwareDistribution\\*.exe") and
  process.Ext.protection != "PsProtectedSignerAntimalware-Light" and
  not (process.executable : "?:\\Windows\\System32\\msiexec.exe" and process.args : "/V") and
  not (process.parent.executable : "?:\\Windows\\System32\\msiexec.exe" and process.parent.args : "/V") and
  not (process.executable : ("?:\\Windows\\System32\\wbem\\WmiPrvSE.exe", "?:\\Windows\\SysWOW64\\wbem\\WmiPrvSE.exe") and
       process.args : "-Embedding" and process.parent.name : "svchost.exe") and
  not (process.executable : "?:\\Windows\\system32\\netstat.exe" and user.id == "S-1-5-18" and process.args : ("-a", "/a")) and
  not (process.executable : "?:\\Windows\\system32\\tasklist.exe" and process.args : "/M") and
  not (process.name : "powershell.exe" and process.args : "'C:\\ProgramData\\CentraStage\\AEMAgent\\Temp\\*.ps1'" and
   process.parent.executable : "C:\\ProgramData\\CentraStage\\AEMAgent\\AEMAgent.exe") and
  not (user.id == "S-1-5-18" and process.executable : "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" and
       process.parent.command_line : ("cmd /c \"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -File -\"",
                                      "cmd /d /c \"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -File -\"") and
       process.working_directory : ("C:\\Program Files (x86)\\Tanium\\Tanium Client\\extensions\\comply\\data\\results\\*", "c:\\Program Files\\Nodeware\\"))
]
[credential_access where
  Target.process.name : "lsass.exe" and
  process.thread.Ext.call_stack_contains_unbacked == true and
  not _arraysearch(process.thread.Ext.call_stack, $entry,
                   $entry.module_path : ("?:\\Program Files\\*",
                                         "?:\\Program Files (x86)\\*",
                                         "?:\\Windows\\assembly\\NativeImages*",
                                         "?:\\Windows\\System32\\DriverStore*"))]
'''

min_endpoint_version = "8.7.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 = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[threat.technique.subtechnique]]
id = "T1003.001"
name = "LSASS Memory"
reference = "https://attack.mitre.org/techniques/T1003/001/"



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

[internal]
min_endpoint_version = "8.7.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 3m, correlated by process.entity_id.

Stage 1: process

[process where event.action == "start" and
  process.parent.name != null and
 (
   process.executable : ("?:\\Windows\\system32\\*", "?:\\Windows\\SysWOW64\\*") or
   process.parent.executable : "?:\\Windows\\system32\\wsmprovhost.exe" or
   process.executable regex~ """c:\\windows\\[a-z0-9\-\_\.]+\.exe"""
  ) and
  not (process.executable : "?:\\Windows\\system32\\svchost.exe" and process.parent.name : "services.exe") and
  not (process.executable : "?:\\Windows\\System32\\MRT.exe" and process.parent.executable : "?:\\Windows\\SoftwareDistribution\\*.exe") and
  process.Ext.protection != "PsProtectedSignerAntimalware-Light" and
  not (process.executable : "?:\\Windows\\System32\\msiexec.exe" and process.args : "/V") and
  not (process.parent.executable : "?:\\Windows\\System32\\msiexec.exe" and process.parent.args : "/V") and
  not (process.executable : ("?:\\Windows\\System32\\wbem\\WmiPrvSE.exe", "?:\\Windows\\SysWOW64\\wbem\\WmiPrvSE.exe") and
       process.args : "-Embedding" and process.parent.name : "svchost.exe") and
  not (process.executable : "?:\\Windows\\system32\\netstat.exe" and user.id == "S-1-5-18" and process.args : ("-a", "/a")) and
  not (process.executable : "?:\\Windows\\system32\\tasklist.exe" and process.args : "/M") and
  not (process.name : "powershell.exe" and process.args : "'C:\\ProgramData\\CentraStage\\AEMAgent\\Temp\\*.ps1'" and
   process.parent.executable : "C:\\ProgramData\\CentraStage\\AEMAgent\\AEMAgent.exe") and
  not (user.id == "S-1-5-18" and process.executable : "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" and
       process.parent.command_line : ("cmd /c \"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -File -\"",
                                      "cmd /d /c \"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -File -\"") and
       process.working_directory : ("C:\\Program Files (x86)\\Tanium\\Tanium Client\\extensions\\comply\\data\\results\\*", "c:\\Program Files\\Nodeware\\"))
]

Stage 2: credential_access

[credential_access where
  Target.process.name : "lsass.exe" and
  process.thread.Ext.call_stack_contains_unbacked == true and
  not _arraysearch(process.thread.Ext.call_stack, $entry,
                   $entry.module_path : ("?:\\Program Files\\*",
                                         "?:\\Program Files (x86)\\*",
                                         "?:\\Windows\\assembly\\NativeImages*",
                                         "?:\\Windows\\System32\\DriverStore*"))]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq-Embeddingexcludes:process.args field:"process.args" value:"-Embedding"
process.executableeq?:\Windows\System32\wbem\WmiPrvSE.exe, ?:\Windows\SysWOW64\wbem\WmiPrvSE.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\wbem\WmiPrvSE.exe" field:"process.executable" value:"?:\Windows\SysWOW64\wbem\WmiPrvSE.exe"
process.parent.nameeqsvchost.exeexcludes:process.parent.name field:"process.parent.name" value:"svchost.exe"
process.argseq-a, /aexcludes:process.args field:"process.args" value:"-a" field:"process.args" value:"/a"
process.executableeq?:\Windows\system32\netstat.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\system32\netstat.exe"
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"
process.argseq/Mexcludes:process.args field:"process.args" value:"/M"
process.executableeq?:\Windows\system32\tasklist.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\system32\tasklist.exe"
process.argseq/Vexcludes:process.args field:"process.args" value:"/V"
process.executableeq?:\Windows\System32\msiexec.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\msiexec.exe"
process.argswildcard'C:\ProgramData\CentraStage\AEMAgent\Temp\*.ps1'excludes:process.args field:"process.args" value:"'C:\ProgramData\CentraStage\AEMAgent\Temp\*.ps1'"
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.parent.executableeqC:\ProgramData\CentraStage\AEMAgent\AEMAgent.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\ProgramData\CentraStage\AEMAgent\AEMAgent.exe"
process.executableeq?:\Windows\System32\MRT.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\MRT.exe"
process.parent.executablewildcard?:\Windows\SoftwareDistribution\*.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\SoftwareDistribution\*.exe"
process.executableeq?:\Windows\system32\svchost.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\system32\svchost.exe"
process.parent.nameeqservices.exeexcludes:process.parent.name field:"process.parent.name" value:"services.exe"
process.executableeqC:\Windows\System32\WindowsPowerShell\v1.0\powershell.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
process.parent.command_lineeqcmd /c "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -File -", cmd /d /c "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -File -"excludes:process.parent.command_line
process.working_directorywildcardC:\Program Files (x86)\Tanium\Tanium Client\extensions\comply\data\results\*, c:\Program Files\Nodeware\excludes:process.working_directory field:"process.working_directory" value:"C:\Program Files (x86)\Tanium\Tanium Client\extensions\comply\data\results\*" field:"process.working_directory" value:"c:\Program Files\Nodeware\"
process.parent.argseq/Vexcludes:process.parent.args field:"process.parent.args" value:"/V"
process.parent.executableeq?:\Windows\System32\msiexec.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\msiexec.exe"
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack

Indicators

These rows show field, operator, and value matches.