SSHD Error Message CVE-2018-15473

Detects exploitation attempt using public exploit code for CVE-2018-15473

Rule Content

- title: SSHD Error Message CVE-2018-15473
  id: 4c9d903d-4939-4094-ade0-3cb748f4d7da
  description: Detects exploitation attempt using public exploit code for CVE-2018-15473
  references:
  - https://github.com/Rhynorater/CVE-2018-15473-Exploit
  author: Florian Roth
  date: 2017/08/24
  logsource:
    product: linux
    service: sshd
    category: null
  detection:
    keywords:
    - 'error: buffer_get_ret: trying to get more bytes 1907 than in buffer 308 [preauth]'
    condition: keywords
  falsepositives:
  - Unknown
  level: medium

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-*', doc_type='doc')

Run Elasticsearch Query


In [ ]:
s = searchContext.query('query_string', query='error\:\ buffer_get_ret\:\ trying\ to\ get\ more\ bytes\ 1907\ than\ in\ buffer\ 308\ \[preauth\]')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()