Potential RDP exploit CVE-2019-0708

Detect suspicious error on protocol RDP, potential CVE-2019-0708

Rule Content

- title: Potential RDP exploit CVE-2019-0708
  id: aaa5b30d-f418-420b-83a0-299cb6024885
  description: Detect suspicious error on protocol RDP, potential CVE-2019-0708
  references:
  - https://github.com/zerosum0x0/CVE-2019-0708
  - https://github.com/Ekultek/BlueKeep
  tags:
  - attack.initial_access
  - attack.lateral_movement
  - attack.t1210
  - attack.t1190
  - car.2013-07-002
  status: experimental
  author: Lionel PRAT, Christophe BROCAS, @atc_project (improvements)
  logsource:
    product: windows
    service: system
    category: null
  detection:
    selection:
      EventID:
      - 56
      - 50
      Source: TermDD
    condition: selection
  falsepositives:
  - Bad connections or network interruptions
  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-system-*', doc_type='doc')

Run Elasticsearch Query


In [ ]:
s = searchContext.query('query_string', query='(event_id:("56" OR "50") AND source_name:"TermDD")')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()