HELK/docker/helk-jupyter/notebooks/sigma/web_pulsesecure_cve-2019-11...

125 lines
2.6 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Pulse Secure Attack CVE-2019-11510\n",
"Detects CVE-2019-11510 exploitation attempt - URI contains Guacamole"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rule Content\n",
"```\n",
"- title: Pulse Secure Attack CVE-2019-11510\n",
" id: 2dbc10d7-a797-49a8-8776-49efa6442e60\n",
" description: Detects CVE-2019-11510 exploitation attempt - URI contains Guacamole\n",
" references:\n",
" - https://www.exploit-db.com/exploits/47297\n",
" author: Florian Roth\n",
" logsource:\n",
" category: webserver\n",
" product: null\n",
" service: null\n",
" detection:\n",
" selection:\n",
" c-uri-path: '*?/dana/html5acc/guacamole/*'\n",
" condition: selection\n",
" fields:\n",
" - client_ip\n",
" - vhost\n",
" - url\n",
" - response\n",
" falsepositives:\n",
" - Unknown\n",
" level: critical\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-*', 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='c-uri-path.keyword:*?\\/dana\\/html5acc\\/guacamole\\/*')\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
}