Possible Application Whitelisting Bypass via WinDbg/CDB as a shellcode runner

Launch 64-bit shellcode from the x64_calc.wds file using cdb.exe.

Rule Content

- title: Possible Application Whitelisting Bypass via WinDbg/CDB as a shellcode runner
  id: b5c7395f-e501-4a08-94d4-57fe7a9da9d2
  status: experimental
  description: Launch 64-bit shellcode from the x64_calc.wds file using cdb.exe.
  references:
  - https://github.com/LOLBAS-Project/LOLBAS/blob/master/yml/OtherMSBinaries/Cdb.yml
  - http://www.exploit-monday.com/2016/08/windbg-cdb-shellcode-runner.html
  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: \cdb.exe
      CommandLine|contains: -cf
    condition: selection
  falsepositives:
  - Legitimate use of debugging tools

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

Show Results


In [ ]:
df.head()