HELK/docker/helk-jupyter/notebooks/sigma/apt_judgement_panda_gtr19.i...

139 lines
3.5 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Judgement Panda Exfil Activity\n",
"Detects Judgement Panda activity as described in Global Threat Report 2019 by Crowdstrike"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rule Content\n",
"```\n",
"- title: Judgement Panda Exfil Activity\n",
" id: 03e2746e-2b31-42f1-ab7a-eb39365b2422\n",
" description: Detects Judgement Panda activity as described in Global Threat Report\n",
" 2019 by Crowdstrike\n",
" references:\n",
" - https://www.crowdstrike.com/resources/reports/2019-crowdstrike-global-threat-report/\n",
" author: Florian Roth\n",
" date: 2019/02/21\n",
" tags:\n",
" - attack.lateral_movement\n",
" - attack.g0010\n",
" - attack.credential_access\n",
" - attack.t1098\n",
" - attack.exfiltration\n",
" - attack.t1002\n",
" logsource:\n",
" category: process_creation\n",
" product: windows\n",
" service: null\n",
" detection:\n",
" selection1:\n",
" CommandLine:\n",
" - '*\\ldifde.exe -f -n *'\n",
" - '*\\7za.exe a 1.7z *'\n",
" - '* eprod.ldf'\n",
" - '*\\aaaa\\procdump64.exe*'\n",
" - '*\\aaaa\\netsess.exe*'\n",
" - '*\\aaaa\\7za.exe*'\n",
" - '*copy .\\1.7z \\\\*'\n",
" - '*copy \\\\client\\c$\\aaaa\\\\*'\n",
" selection2:\n",
" Image: C:\\Users\\Public\\7za.exe\n",
" condition: selection1 or selection2\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_command_line.keyword:(*\\\\ldifde.exe\\ \\-f\\ \\-n\\ * OR *\\\\7za.exe\\ a\\ 1.7z\\ * OR *\\ eprod.ldf OR *\\\\aaaa\\\\procdump64.exe* OR *\\\\aaaa\\\\netsess.exe* OR *\\\\aaaa\\\\7za.exe* OR *copy\\ .\\\\1.7z\\ \\\\* OR *copy\\ \\\\client\\\\c$\\\\aaaa\\\\*) OR process_path:\"C\\:\\\\Users\\\\Public\\\\7za.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
}