diff --git a/detections/endpoint/first_time_seen_cmd_line___ssa.yml b/detections/endpoint/first_time_seen_cmd_line___ssa.yml index 3cbdcd6724..cea30c3771 100644 --- a/detections/endpoint/first_time_seen_cmd_line___ssa.yml +++ b/detections/endpoint/first_time_seen_cmd_line___ssa.yml @@ -5,8 +5,7 @@ date: '2020-6-25' description: "This search looks for command-line arguments that use a `/c` parameter to execute a command that has not previously been seen. This is an implementation on SPL2 of the rule `First time seen command line argument` by @bpatel." -how_to_implement: "You must be ingesting sysmon logs. -This search has been modified to process raw sysmon data from attack_range's nxlogs on DSP." +how_to_implement: "You must be populating the endpoint data model for SSA and specifically the process_name and the process fields" author: Ignacio Bermudez Corrales, Splunk type: SSA search: '| from read_ssa_enriched_events() diff --git a/notebooks/unit_test_prohibited_apps_spawning_cmdprompt.ipynb b/notebooks/unit_test_prohibited_apps_spawning_cmdprompt.ipynb new file mode 100644 index 0000000000..94160fe672 --- /dev/null +++ b/notebooks/unit_test_prohibited_apps_spawning_cmdprompt.ipynb @@ -0,0 +1,204 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Detect Prohibited Applications Spawning cmd exe Unit Test\n", + "\n", + "#### This search looks for executions of cmd.exe spawned by a process that is often abused by attackers and that does not typically launch cmd.exe. This is a SPL2 implementation of the rule `Detect Prohibited Applications Spawning cmd.exe`\n", + "\n", + "Source: https://github.com/splunk/security-content/blob/develop/detections/endpoint/prohibited_apps_spawning_cmdprompt___ssa.yml" + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "metadata": { + "execution": { + "iopub.execute_input": "2020-10-15T00:21:43.611728Z", + "iopub.status.busy": "2020-10-15T00:21:43.611411Z", + "iopub.status.idle": "2020-10-15T00:21:43.615239Z", + "shell.execute_reply": "2020-10-15T00:21:43.614712Z", + "shell.execute_reply.started": "2020-10-15T00:21:43.611700Z" + } + }, + "outputs": [], + "source": [ + "import json\n", + "data='{\"process_path\":\"c:\\\\\\windows\\\\\\system32\",\"process_name\":\"cmd.exe\",\"process\":\"C:\\\\\\Windows\\\\\\system32\\\\\\cmd.exe\",\"parent_process_name\":\"C:\\\\\\Program Files\\\\\\Microsoft Office\\\\\\winword.exe\",\"dest_user_id\":\"eyJlbnRpdHlUeXBlIjoiVVNFUiIsInByaW1hcnlBcnRpZmFjdCI6ImFkbWluaXN0cmF0b3IiLCJwcmltYXJ5QXJ0aWZhY3RUeXBlIjoiV0lORE9XU19BQ0NPVU5UX05BTUUifQ\",\"dest_device_id\":\"eyJlbnRpdHlUeXBlIjoiREVWSUNFIiwicHJpbWFyeUFydGlmYWN0Ijoid2luLWRjLTY1NjUwNzEiLCJwcmltYXJ5QXJ0aWZhY3RUeXBlIjoiRE5TIn0\",\"_time\":\"1602004409000\"}'\n", + "json.loads(data)\n", + "with open(\"detect_prohibited_applications_spawning_cmd_exe.json\", \"w\") as outfile:\n", + " outfile.write(data)" + ] + }, + { + "cell_type": "code", + "execution_count": 94, + "metadata": { + "execution": { + "iopub.execute_input": "2020-10-15T00:22:58.225618Z", + "iopub.status.busy": "2020-10-15T00:22:58.225357Z", + "iopub.status.idle": "2020-10-15T00:22:59.362013Z", + "shell.execute_reply": "2020-10-15T00:22:59.361508Z", + "shell.execute_reply.started": "2020-10-15T00:22:58.225596Z" + } + }, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c2d2b32468a04f8a8bb7eafd174e5c5d", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(HTML(value=''), FloatProgress(value=0.0, max=5.0), HTML(value='')))" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Finished. " + ] + }, + { + "data": { + "text/html": [ + "
| \n", + " | start_time | \n", + "dest_device_id | \n", + "field0 | \n", + "entities | \n", + "process_name | \n", + "end_time | \n", + "dest_user_id | \n", + "parent_process | \n", + "body | \n", + "value | \n", + "input_event | \n", + "timestamp | \n", + "
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", + "2020-10-06 17:13:29 | \n", + "eyJlbnRpdHlUeXBlIjoiREVWSUNFIiwicHJpbWFyeUFydG... | \n", + "winword.exe | \n", + "[eyJlbnRpdHlUeXBlIjoiREVWSUNFIiwicHJpbWFyeUFyd... | \n", + "cmd.exe | \n", + "2020-10-06 17:13:29 | \n", + "eyJlbnRpdHlUeXBlIjoiVVNFUiIsInByaW1hcnlBcnRpZm... | \n", + "c:\\program files\\microsoft office\\winword.exe | \n", + "TBD | \n", + "{\"process_path\":\"c:\\\\windows\\\\system32\",\"proce... | \n", + "{'process_path': 'c:\\windows\\system32', 'proce... | \n", + "2020-10-06 17:13:29 | \n", + "