psr.exe capture screenshots

The psr.exe captures desktop screenshots and saves them on the local machine

Rule Content

- title: psr.exe capture screenshots
  id: 2158f96f-43c2-43cb-952a-ab4580f32382
  status: experimental
  description: The psr.exe captures desktop screenshots and saves them on the local
    machine
  references:
  - https://github.com/LOLBAS-Project/LOLBAS/blob/master/yml/LOLUtilz/OSBinaries/Psr.yml
  - https://www.sans.org/summit-archives/file/summit-archive-1493861893.pdf
  author: Beyu Denis, oscd.community
  date: 2019/10/12
  modified: 2019/11/04
  tags:
  - attack.persistence
  - attack.t1218
  level: medium
  logsource:
    category: process_creation
    product: windows
    service: null
  detection:
    selection:
      Image|endswith: \Psr.exe
      CommandLine|contains: /start
    condition: selection
  falsepositives:
  - Unknown

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:*\\Psr.exe AND process_command_line.keyword:*\/start*)')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()