Suspicious Named Error

Detects suspicious DNS error messages that indicate a fatal or suspicious error that could be caused by exploiting attempts

Rule Content

- title: Suspicious Named Error
  id: c8e35e96-19ce-4f16-aeb6-fd5588dc5365
  status: experimental
  description: Detects suspicious DNS error messages that indicate a fatal or suspicious
    error that could be caused by exploiting attempts
  references:
  - https://github.com/ossec/ossec-hids/blob/master/etc/rules/named_rules.xml
  author: Florian Roth
  date: 2018/02/20
  logsource:
    product: linux
    service: syslog
    category: null
  detection:
    keywords:
    - '* dropping source port zero packet from *'
    - '* denied AXFR from *'
    - '* exiting (due to fatal error)*'
    condition: keywords
  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-*', doc_type='doc')

Run Elasticsearch Query


In [ ]:
s = searchContext.query('query_string', query='\*.keyword:(*\ dropping\ source\ port\ zero\ packet\ from\ * OR *\ denied\ AXFR\ from\ * OR *\ exiting\ \(due\ to\ fatal\ error\)*)')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()