- title: Possible Ransomware or unauthorized MBR modifications
id: c9fbe8e9-119d-40a6-9b59-dd58a5d84429
status: experimental
description: Detects, possibly, malicious unauthorized usage of bcdedit.exe
references:
- https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/bcdedit--set
author: '@neu5ron'
date: 2019/02/07
tags:
- attack.defense_evasion
- attack.t1070
- attack.persistence
- attack.t1067
logsource:
category: process_creation
product: windows
service: null
detection:
selection:
NewProcessName: '*\bcdedit.exe'
ProcessCommandLine:
- '*delete*'
- '*deletevalue*'
- '*import*'
condition: selection
level: medium
In [ ]:
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
import pandas as pd
In [ ]:
es = Elasticsearch(['http://helk-elasticsearch:9200'])
searchContext = Search(using=es, index='logs-*', doc_type='doc')
In [ ]:
s = searchContext.query('query_string', query='(process_path.keyword:*\\bcdedit.exe AND process_command_line.keyword:(*delete* OR *deletevalue* OR *import*))')
response = s.execute()
if response.success():
df = pd.DataFrame((d.to_dict() for d in s.scan()))
In [ ]:
df.head()