Password Dumper Activity on LSASS

Detects process handle on LSASS process with certain access mask and object type SAM_DOMAIN

Rule Content

- title: Password Dumper Activity on LSASS
  id: aa1697b7-d611-4f9a-9cb2-5125b4ccfd5c
  description: Detects process handle on LSASS process with certain access mask and
    object type SAM_DOMAIN
  status: experimental
  references:
  - https://twitter.com/jackcr/status/807385668833968128
  tags:
  - attack.credential_access
  - attack.t1003
  logsource:
    product: windows
    service: security
    category: null
  detection:
    selection:
      EventID: 4656
      ProcessName: C:\Windows\System32\lsass.exe
      AccessMask: '0x705'
      ObjectType: SAM_DOMAIN
    condition: selection
  falsepositives:
  - Unkown
  level: high

Querying Elasticsearch

Import Libraries


In [ ]:
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
import pandas as pd

Initialize Elasticsearch client


In [ ]:
es = Elasticsearch(['http://helk-elasticsearch:9200'])
searchContext = Search(using=es, index='logs-endpoint-winevent-security-*', doc_type='doc')

Run Elasticsearch Query


In [ ]:
s = searchContext.query('query_string', query='(event_id:"4656" AND process_path:"C\:\\Windows\\System32\\lsass.exe" AND object_access_mask_requested:"0x705" AND object_type:"SAM_DOMAIN")')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()