HELK/docker/helk-jupyter/notebooks/sigma/win_rdp_potential_cve-2019-...

131 lines
2.9 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Potential RDP exploit CVE-2019-0708\n",
"Detect suspicious error on protocol RDP, potential CVE-2019-0708"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rule Content\n",
"```\n",
"- title: Potential RDP exploit CVE-2019-0708\n",
" id: aaa5b30d-f418-420b-83a0-299cb6024885\n",
" description: Detect suspicious error on protocol RDP, potential CVE-2019-0708\n",
" references:\n",
" - https://github.com/zerosum0x0/CVE-2019-0708\n",
" - https://github.com/Ekultek/BlueKeep\n",
" tags:\n",
" - attack.initial_access\n",
" - attack.lateral_movement\n",
" - attack.t1210\n",
" - attack.t1190\n",
" - car.2013-07-002\n",
" status: experimental\n",
" author: Lionel PRAT, Christophe BROCAS, @atc_project (improvements)\n",
" logsource:\n",
" product: windows\n",
" service: system\n",
" category: null\n",
" detection:\n",
" selection:\n",
" EventID:\n",
" - 56\n",
" - 50\n",
" Source: TermDD\n",
" condition: selection\n",
" falsepositives:\n",
" - Bad connections or network interruptions\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-system-*', 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='(event_id:(\"56\" OR \"50\") AND source_name:\"TermDD\")')\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
}