HELK/docker/helk-jupyter/notebooks/sigma/win_susp_msmpeng_crash.ipynb

136 lines
3.2 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Microsoft Malware Protection Engine Crash\n",
"This rule detects a suspicious crash of the Microsoft Malware Protection Engine"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rule Content\n",
"```\n",
"- title: Microsoft Malware Protection Engine Crash\n",
" id: 6c82cf5c-090d-4d57-9188-533577631108\n",
" description: This rule detects a suspicious crash of the Microsoft Malware Protection\n",
" Engine\n",
" tags:\n",
" - attack.defense_evasion\n",
" - attack.t1089\n",
" - attack.t1211\n",
" status: experimental\n",
" date: 2017/05/09\n",
" references:\n",
" - https://bugs.chromium.org/p/project-zero/issues/detail?id=1252&desc=5\n",
" - https://technet.microsoft.com/en-us/library/security/4022344\n",
" author: Florian Roth\n",
" logsource:\n",
" product: windows\n",
" service: application\n",
" category: null\n",
" detection:\n",
" selection1:\n",
" Source: Application Error\n",
" EventID: 1000\n",
" selection2:\n",
" Source: Windows Error Reporting\n",
" EventID: 1001\n",
" keywords:\n",
" Message:\n",
" - '*MsMpEng.exe*'\n",
" - '*mpengine.dll*'\n",
" condition: 1 of selection* and all of keywords\n",
" falsepositives:\n",
" - MsMpEng.exe can crash when C:\\ is full\n",
" level: high\n",
"\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Querying Elasticsearch"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Import Libraries"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from elasticsearch import Elasticsearch\n",
"from elasticsearch_dsl import Search\n",
"import pandas as pd"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Initialize Elasticsearch client"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"es = Elasticsearch(['http://helk-elasticsearch:9200'])\n",
"searchContext = Search(using=es, index='logs-endpoint-winevent-application-*', doc_type='doc')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Run Elasticsearch Query"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"s = searchContext.query('query_string', query='(((source_name:\"Application\\ Error\" AND event_id:\"1000\") OR (source_name:\"Windows\\ Error\\ Reporting\" AND event_id:\"1001\")) AND Message.keyword:(*MsMpEng.exe* OR *mpengine.dll*))')\n",
"response = s.execute()\n",
"if response.success():\n",
" df = pd.DataFrame((d.to_dict() for d in s.scan()))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Show Results"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df.head()"
]
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 4
}