MsiExec Web Install

Detects suspicious msiexec process starts with web addreses as parameter

Rule Content

- title: MsiExec Web Install
  id: f7b5f842-a6af-4da5-9e95-e32478f3cd2f
  status: experimental
  description: Detects suspicious msiexec process starts with web addreses as parameter
  references:
  - https://blog.trendmicro.com/trendlabs-security-intelligence/attack-using-windows-installer-msiexec-exe-leads-lokibot/
  tags:
  - attack.defense_evasion
  author: Florian Roth
  date: 2018/02/09
  modified: 2012/12/11
  logsource:
    category: process_creation
    product: windows
    service: null
  detection:
    selection:
      CommandLine:
      - '* msiexec*://*'
    condition: selection
  falsepositives:
  - False positives depend on scripts and administrative tools used in the monitored
    environment
  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='process_command_line.keyword:(*\ msiexec*\:\/\/*)')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()