RottenPotato Like Attack Pattern

Detects logon events that have characteristics of events generated during an attack with RottenPotato and the like

Rule Content

- title: RottenPotato Like Attack Pattern
  id: 16f5d8ca-44bd-47c8-acbe-6fc95a16c12f
  status: experimental
  description: Detects logon events that have characteristics of events generated
    during an attack with RottenPotato and the like
  references:
  - https://twitter.com/SBousseaden/status/1195284233729777665
  author: '@SBousseaden, Florian Roth'
  date: 2019/11/15
  tags:
  - attack.privilege_escalation
  - attack.credential_access
  - attack.t1171
  logsource:
    product: windows
    service: security
    category: null
  detection:
    selection:
      EventID: 4624
      LogonType: 3
      TargetUserName: ANONYMOUS_LOGON
      WorkstationName: '-'
      SourceNetworkAddress: 127.0.0.1
    condition: selection
  falsepositives:
  - Unknown
  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:"4624" AND logon_type:"3" AND TargetUserName:"ANONYMOUS_LOGON" AND src_host_name:"\-" AND SourceNetworkAddress:"127.0.0.1")')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()