Hacktool Ruler

This events that are generated when using the hacktool Ruler by Sensepost

Rule Content

- title: Hacktool Ruler
  id: 24549159-ac1b-479c-8175-d42aea947cae
  description: This events that are generated when using the hacktool Ruler by Sensepost
  author: Florian Roth
  date: 2017/05/31
  modified: 2019/07/26
  references:
  - https://github.com/sensepost/ruler
  - https://github.com/sensepost/ruler/issues/47
  - https://github.com/staaldraad/go-ntlm/blob/master/ntlm/ntlmv1.go#L427
  - https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4776
  - https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4624
  tags:
  - attack.discovery
  - attack.execution
  - attack.t1087
  - attack.t1075
  - attack.t1114
  - attack.t1059
  logsource:
    product: windows
    service: security
    category: null
  detection:
    selection1:
      EventID:
      - 4776
      Workstation: RULER
    selection2:
      EventID:
      - 4624
      - 4625
      WorkstationName: RULER
    condition: (1 of selection*)
  falsepositives:
  - Go utilities that use staaldraad awesome NTLM library
  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='(src_host_name:"RULER" AND (event_id:("4776") OR event_id:("4624" OR "4625")))')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()