Suspicious Process Start Locations

Detects suspicious process run from unusual locations

Rule Content

- title: Suspicious Process Start Locations
  id: 15b75071-74cc-47e0-b4c6-b43744a62a2b
  description: Detects suspicious process run from unusual locations
  status: experimental
  references:
  - https://car.mitre.org/wiki/CAR-2013-05-002
  author: juju4
  tags:
  - attack.defense_evasion
  - attack.t1036
  - car.2013-05-002
  logsource:
    category: process_creation
    product: windows
    service: null
  detection:
    selection:
      Image:
      - '*:\RECYCLER\\*'
      - '*:\SystemVolumeInformation\\*'
      - C:\\Windows\\Tasks\\*
      - C:\\Windows\\debug\\*
      - C:\\Windows\\fonts\\*
      - C:\\Windows\\help\\*
      - C:\\Windows\\drivers\\*
      - C:\\Windows\\addins\\*
      - C:\\Windows\\cursors\\*
      - C:\\Windows\\system32\tasks\\*
    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_path.keyword:(*\:\\RECYCLER\\* OR *\:\\SystemVolumeInformation\\* OR C\:\\Windows\\Tasks\\* OR C\:\\Windows\\debug\\* OR C\:\\Windows\\fonts\\* OR C\:\\Windows\\help\\* OR C\:\\Windows\\drivers\\* OR C\:\\Windows\\addins\\* OR C\:\\Windows\\cursors\\* OR C\:\\Windows\\system32\\tasks\\*)')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()