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

132 lines
3.5 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Suspicious GUP Usage\n",
"Detects execution of the Notepad++ updater in a suspicious directory, which is often used in DLL side-loading attacks"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rule Content\n",
"```\n",
"- title: Suspicious GUP Usage\n",
" id: 0a4f6091-223b-41f6-8743-f322ec84930b\n",
" description: Detects execution of the Notepad++ updater in a suspicious directory,\n",
" which is often used in DLL side-loading attacks\n",
" status: experimental\n",
" references:\n",
" - https://www.fireeye.com/blog/threat-research/2018/09/apt10-targeting-japanese-corporations-using-updated-ttps.html\n",
" tags:\n",
" - attack.defense_evasion\n",
" - attack.t1073\n",
" author: Florian Roth\n",
" date: 2019/02/06\n",
" logsource:\n",
" category: process_creation\n",
" product: windows\n",
" service: null\n",
" detection:\n",
" selection:\n",
" Image: '*\\GUP.exe'\n",
" filter:\n",
" Image:\n",
" - C:\\Users\\\\*\\AppData\\Local\\Notepad++\\updater\\gup.exe\n",
" - C:\\Users\\\\*\\AppData\\Roaming\\Notepad++\\updater\\gup.exe\n",
" - C:\\Program Files\\Notepad++\\updater\\gup.exe\n",
" - C:\\Program Files (x86)\\Notepad++\\updater\\gup.exe\n",
" condition: selection and not filter\n",
" falsepositives:\n",
" - Execution of tools named GUP.exe and located in folders different than Notepad++\\updater\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='(process_path.keyword:*\\\\GUP.exe AND (NOT (process_path.keyword:(C\\:\\\\Users\\\\*\\\\AppData\\\\Local\\\\Notepad\\+\\+\\\\updater\\\\gup.exe OR C\\:\\\\Users\\\\*\\\\AppData\\\\Roaming\\\\Notepad\\+\\+\\\\updater\\\\gup.exe OR C\\:\\\\Program\\ Files\\\\Notepad\\+\\+\\\\updater\\\\gup.exe OR C\\:\\\\Program\\ Files\\ \\(x86\\)\\\\Notepad\\+\\+\\\\updater\\\\gup.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
}