Scanner PoC for CVE-2019-0708 RDP RCE vuln

Detects the use of a scanner by zerosum0x0 that discovers targets vulnerable to CVE-2019-0708 RDP RCE aka BlueKeep

Rule Content

- title: Scanner PoC for CVE-2019-0708 RDP RCE vuln
  id: 8400629e-79a9-4737-b387-5db940ab2367
  description: Detects the use of a scanner by zerosum0x0 that discovers targets vulnerable
    to  CVE-2019-0708 RDP RCE aka BlueKeep
  references:
  - https://twitter.com/AdamTheAnalyst/status/1134394070045003776
  - https://github.com/zerosum0x0/CVE-2019-0708
  tags:
  - attack.lateral_movement
  - attack.t1210
  - car.2013-07-002
  author: Florian Roth (rule), Adam Bradbury (idea)
  date: 2019/06/02
  logsource:
    product: windows
    service: security
    category: null
  detection:
    selection:
      EventID: 4625
      AccountName: AAAAAAA
    condition: selection
  falsepositives:
  - Unlikely
  level: critical

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:"4625" AND user_name:"AAAAAAA")')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()