Iniciar sesión

Credential access

12 min · 1 ejercicio(s)

After the initial access the attacker wants credentials. On Windows they live in the memory of lsass.exe. A well-known living-off-the-land technique dumps it with a DLL that ships with Windows (MITRE ATT&CK T1003.001):

rundll32.exe C:\Windows\System32\comsvcs.dll, MiniDump <lsass pid> C:\Windows\Temp\lsass.dmp full

A robust detection does not rely on the output file name (easy to change) but on the technique:

process where process.name : "rundll32.exe" and
  process.command_line : "*comsvcs*" and
  process.command_line : "*MiniDump*"

Detection engineering checklist

  1. What is the behaviour? Not "the file is called lsass.dmp" but "rundll32 calls the MiniDump export of comsvcs".
  2. How could the attacker vary it? Upper/lower case, renamed binaries (process.pe.original_file_name), ordinal instead of name (#24).
  3. What is legitimate? Run the query over a long period and look at the false positives before you turn it into a rule.

🔎 Profundiza: funciones, errores habituales y práctica

LSASS dumping variants

Technique What to look for
comsvcs.dll MiniDump via rundll32 command line contains comsvcs and MiniDump or ordinal #24
ProcDump procdump*.exe with -ma and lsass
Task Manager "Create dump file" file creation lsass*.dmp by taskmgr.exe
Direct memory access (Mimikatz etc.) API events: handle to lsass.exe with read access (Elastic Defend api events)

Make the rule robust

process where event.type == "start" and
  (process.name : "rundll32.exe" or ?process.pe.original_file_name : "RUNDLL32.EXE") and
  process.command_line : ("*comsvcs*MiniDump*", "*comsvcs*#24*", "*comsvcs*#+24*")
  • process.pe.original_file_name catches renamed binaries.
  • Several patterns in one : list cover syntax variants.

Validate before you deploy

  1. Run the query over the last 30 days. Every hit is either a true positive or needs an exception.
  2. Add exceptions for known tools (backup agents, EDR), never broad wildcard exceptions.
  3. Map the rule to MITRE ATT&CK and set a severity. In Elastic Security this drives prioritisation.

Ejercicios prácticos de esta lección

Resuelve estos ejercicios con una consulta en el laboratorio Elasticsearch real. Inicia sesión gratis para acceder al laboratorio, las pistas y la corrección automática.

  1. 1. Who dumped LSASS?

    Detect the comsvcs MiniDump technique. Under which user.name did it run?