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

130 lines
3.0 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# LSASS Access Detected via Attack Surface Reduction\n",
"Detects Access to LSASS Process"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rule Content\n",
"```\n",
"- title: LSASS Access Detected via Attack Surface Reduction\n",
" id: a0a278fe-2c0e-4de2-ac3c-c68b08a9ba98\n",
" description: Detects Access to LSASS Process\n",
" status: experimental\n",
" references:\n",
" - https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-exploit-guard/attack-surface-reduction-exploit-guard?WT.mc_id=twitter\n",
" author: Markus Neis\n",
" date: 2018/08/26\n",
" tags:\n",
" - attack.credential_access\n",
" - attack.t1003\n",
" logsource:\n",
" product: windows_defender\n",
" definition: 'Requirements:Enabled Block credential stealing from the Windows local\n",
" security authority subsystem (lsass.exe) from Attack Surface Reduction (GUID:\n",
" 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2)'\n",
" service: null\n",
" category: null\n",
" detection:\n",
" selection:\n",
" EventID: 1121\n",
" Path: '*\\lsass.exe'\n",
" condition: selection\n",
" falsepositives:\n",
" - Google Chrome GoogleUpdate.exe\n",
" - Some Taskmgr.exe related activity\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-*', 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:\"1121\" AND process_path.keyword:*\\\\lsass.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
}