Relevant ClamAV Message

Detects relevant ClamAV messages

Rule Content

- title: Relevant ClamAV Message
  id: 36aa86ca-fd9d-4456-814e-d3b1b8e1e0bb
  description: Detects relevant ClamAV messages
  references:
  - https://github.com/ossec/ossec-hids/blob/master/etc/rules/clam_av_rules.xml
  logsource:
    product: linux
    service: clamav
    category: null
  detection:
    keywords:
    - Trojan*FOUND
    - VirTool*FOUND
    - Webshell*FOUND
    - Rootkit*FOUND
    - Htran*FOUND
    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:(*Trojan*FOUND* OR *VirTool*FOUND* OR *Webshell*FOUND* OR *Rootkit*FOUND* OR *Htran*FOUND*)')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()