- title: Shellshock Expression
id: c67e0c98-4d39-46ee-8f6b-437ebf6b950e
description: Detects shellshock expressions in log files
references:
- http://rubular.com/r/zxBfjWfFYs
logsource:
product: linux
service: null
category: null
detection:
expression:
- /\(\)\s*\t*\{.*;\s*\}\s*;/
condition: expression
falsepositives:
- Unknown
level: high
In [ ]:
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
import pandas as pd
In [ ]:
es = Elasticsearch(['http://helk-elasticsearch:9200'])
searchContext = Search(using=es, index='logs-*', doc_type='doc')
In [ ]:
s = searchContext.query('query_string', query='\/\\\(\\\)\\s*\\t*\\\{.*;\\s*\\\}\\s*;\/')
response = s.execute()
if response.success():
df = pd.DataFrame((d.to_dict() for d in s.scan()))
In [ ]:
df.head()