Apache Threading Error

Detects an issue in apache logs that reports threading related errors

Rule Content

- title: Apache Threading Error
  id: e9a2b582-3f6a-48ac-b4a1-6849cdc50b3c
  status: experimental
  description: Detects an issue in apache logs that reports threading related errors
  author: Florian Roth
  date: 2019/01/22
  references:
  - https://github.com/hannob/apache-uaf/blob/master/README.md
  logsource:
    product: apache
    service: null
    category: null
  detection:
    keywords:
    - '__pthread_tpp_change_priority: Assertion `new_prio == -1 || (new_prio >= fifo_min_prio
      && new_prio <= fifo_max_prio)'
    condition: keywords
  falsepositives:
  - https://bz.apache.org/bugzilla/show_bug.cgi?id=46185
  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='__pthread_tpp_change_priority\:\ Assertion\ `new_prio\ \=\=\ \-1\ \||\ \(new_prio\ \=\ fifo_min_prio\ \&&\ new_prio\ \=\ fifo_max_prio\)')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()