mirror of https://github.com/infosecn1nja/HELK.git
140 lines
3.4 KiB
Plaintext
140 lines
3.4 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Mimikatz Use\n",
|
|
"This method detects mimikatz keywords in different Eventlogs (some of them only appear in older Mimikatz version that are however still used by different threat groups)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Rule Content\n",
|
|
"```\n",
|
|
"- title: Mimikatz Use\n",
|
|
" id: 06d71506-7beb-4f22-8888-e2e5e2ca7fd8\n",
|
|
" description: This method detects mimikatz keywords in different Eventlogs (some\n",
|
|
" of them only appear in older Mimikatz version that are however still used by different\n",
|
|
" threat groups)\n",
|
|
" author: Florian Roth\n",
|
|
" date: 2017/01/10\n",
|
|
" modified: 2019/10/11\n",
|
|
" tags:\n",
|
|
" - attack.s0002\n",
|
|
" - attack.t1003\n",
|
|
" - attack.lateral_movement\n",
|
|
" - attack.credential_access\n",
|
|
" - car.2013-07-001\n",
|
|
" - car.2019-04-004\n",
|
|
" logsource:\n",
|
|
" product: windows\n",
|
|
" service: null\n",
|
|
" category: null\n",
|
|
" detection:\n",
|
|
" keywords:\n",
|
|
" Message:\n",
|
|
" - '* mimikatz *'\n",
|
|
" - '* mimilib *'\n",
|
|
" - '* <3 eo.oe *'\n",
|
|
" - '* eo.oe.kiwi *'\n",
|
|
" - '* privilege::debug *'\n",
|
|
" - '* sekurlsa::logonpasswords *'\n",
|
|
" - '* lsadump::sam *'\n",
|
|
" - '* mimidrv.sys *'\n",
|
|
" - '* p::d *'\n",
|
|
" - '* s::l *'\n",
|
|
" condition: keywords\n",
|
|
" falsepositives:\n",
|
|
" - Naughty administrators\n",
|
|
" - Penetration test\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='Message.keyword:(*\\ mimikatz\\ * OR *\\ mimilib\\ * OR *\\ 3\\ eo.oe\\ * OR *\\ eo.oe.kiwi\\ * OR *\\ privilege\\:\\:debug\\ * OR *\\ sekurlsa\\:\\:logonpasswords\\ * OR *\\ lsadump\\:\\:sam\\ * OR *\\ mimidrv.sys\\ * OR *\\ p\\:\\:d\\ * OR *\\ s\\:\\:l\\ *)')\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
|
|
}
|