Chafer Malware URL Pattern

Detects HTTP requests used by Chafer malware

Rule Content

- title: Chafer Malware URL Pattern
  id: fb502828-2db0-438e-93e6-801c7548686d
  status: experimental
  description: Detects HTTP requests used by Chafer malware
  references:
  - https://securelist.com/chafer-used-remexi-malware/89538/
  author: Florian Roth
  date: 2019/01/31
  logsource:
    category: proxy
    product: null
    service: null
  detection:
    selection:
      c-uri: '*/asp.asp?ui=*'
    condition: selection
  fields:
  - ClientIP
  - c-uri
  - c-useragent
  falsepositives:
  - Unknown
  level: critical

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='c-uri.keyword:*\/asp.asp?ui\=*')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()