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

125 lines
2.8 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Emissary Panda Malware SLLauncher\n",
"Detects the execution of DLL side-loading malware used by threat group Emissary Panda aka APT27"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rule Content\n",
"```\n",
"- title: Emissary Panda Malware SLLauncher\n",
" id: 9aa01d62-7667-4d3b-acb8-8cb5103e2014\n",
" status: experimental\n",
" description: Detects the execution of DLL side-loading malware used by threat group\n",
" Emissary Panda aka APT27\n",
" references:\n",
" - https://app.any.run/tasks/579e7587-f09d-4aae-8b07-472833262965\n",
" - https://twitter.com/cyb3rops/status/1168863899531132929\n",
" author: Florian Roth\n",
" date: 2018/09/03\n",
" logsource:\n",
" category: process_creation\n",
" product: windows\n",
" service: null\n",
" detection:\n",
" selection:\n",
" ParentImage: '*\\sllauncher.exe'\n",
" Image: '*\\svchost.exe'\n",
" condition: selection\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='(process_parent_path.keyword:*\\\\sllauncher.exe AND process_path.keyword:*\\\\svchost.exe)')\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
}