Possible Shim Database Persistence via sdbinst.exe

Detects installation of a new shim using sdbinst.exe. A shim can be used to load malicious DLLs into applications.

Rule Content

- title: Possible Shim Database Persistence via sdbinst.exe
  id: 517490a7-115a-48c6-8862-1a481504d5a8
  status: experimental
  description: Detects installation of a new shim using sdbinst.exe. A shim can be
    used to load malicious DLLs into applications.
  references:
  - https://www.fireeye.com/blog/threat-research/2017/05/fin7-shim-databases-persistence.html
  tags:
  - attack.persistence
  - attack.t1138
  author: Markus Neis
  logsource:
    category: process_creation
    product: windows
    service: null
  detection:
    selection:
      Image:
      - '*\sdbinst.exe'
      CommandLine:
      - '*.sdb*'
    condition: selection
  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='(process_path.keyword:(*\\sdbinst.exe) AND process_command_line.keyword:(*.sdb*))')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()