Application Whitelisting bypass via dxcap.exe

Detects execution of of Dxcap.exe

Rule Content

- title: Application Whitelisting bypass via dxcap.exe
  id: 60f16a96-db70-42eb-8f76-16763e333590
  status: experimental
  description: Detects execution of of Dxcap.exe
  references:
  - https://github.com/LOLBAS-Project/LOLBAS/blob/master/yml/OtherMSBinaries/Dxcap.yml
  - https://twitter.com/harr0ey/status/992008180904419328
  author: Beyu Denis, oscd.community
  date: 2019/10/26
  modified: 2019/11/04
  tags:
  - attack.defense_evasion
  - attack.execution
  - attack.t1218
  level: medium
  logsource:
    category: process_creation
    product: windows
    service: null
  detection:
    selection:
      Image|endswith: \dxcap.exe
      CommandLine|contains|all:
      - -c
      - .exe
    condition: selection
  falsepositives:
  - Legitimate execution of dxcap.exe by legitimate user

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

Show Results


In [ ]:
df.head()