{
    "id": "15ef69a1-b236-455a-9c37-2fee12213441",
    "name": "Effectively Using Splunk (Scenario 1)",
    "slug": "effectively-using-splunk-scenario-1",
    "status": "published",
    "lab_type": "pta",
    "is_sample": false,
    "duration_in_seconds": 1800,
    "metadata": {
        "courses": [
            "5c7838a9-c6c4-4062-a3b2-ec2e908c19f2"
        ],
        "pta_sdn": "206",
        "pta_namespace": "my.ine",
        "learning_paths": [],
        "has_published_parent": true
    },
    "session": null,
    "company": "a491bc32-c056-4946-9169-cc053387bada",
    "created": "2022-06-16T17:55:41.523195Z",
    "modified": "2023-10-03T18:58:30.361451Z",
    "is_beta": false,
    "lab_objectives": [],
    "main_learning_area": "3e1aa06f-2e9f-4789-b50d-aa027ad8dcfa",
    "learning_areas": [
        {
            "id": "3e1aa06f-2e9f-4789-b50d-aa027ad8dcfa",
            "name": "Cyber Security",
            "slug": "cyber-security"
        }
    ],
    "categories": [],
    "tags": [],
    "difficulty": null,
    "is_web_access": false,
    "is_lab_experience": false,
    "is_featured": false,
    "cve": null,
    "severity": null,
    "year": null,
    "classification": null,
    "external_url": "",
    "solution_video": null,
    "explanation_video": null,
    "description": "# Effectively Using Splunk (Scenario 1)\n\n## LAB 8\n\n# Scenario\n\nThe organization you work for (**Wayne Enterprises**) is using [Splunk](https://www.splunk.com/) as a SIEM solution to enhance its intrusion detection capabilities. The SOC manager informed you that the organization has been hit by an APT group. He tasked you with responding to this incident by heavily utilizing Splunk and all the data that it ingested.\n\nThe data that Splunk has ingested consist of Windows event logs, Sysmon logs, Fortinet next-generation firewall logs, Suricata logs, etc.\n\n**Note**: This lab is based on the [Boss Of The SOC (BOTS) v1 dataset](https://github.com/splunk/botsv1) released by Splunk. Credits to [Ryan Kovar](https://twitter.com/meansec), [Dave Herrald](https://twitter.com/daveherrald?lang=el) and [John Stoner](https://twitter.com/stonerpsu) for sharing the Splunk detection tips this lab covers with the public, through this dataset.\n\n# Learning Objectives\n\nThe learning objective of this lab is to not only get familiar with Splunk's architecture and detection capabilities but also to learn effective Splunk search writing.\n\nSpecifically, you will learn how to use Splunk's capabilities in order to:\n\n-   Have better visibility over a network\n\n-   Respond to incidents timely and effectively\n\n-   Proactively hunt for threats\n\n# Introduction To Splunk\n\nSplunk's creators describe it as a solution to aggregate, analyze and get answers from machine data. Splunk can be used for Application Management, Operations Management, Security & Compliance, etc.\n\nWhen it comes to security, Splunk can be used as a log management solution but most importantly as an analytics-driven SIEM. Splunk can fortify investigations of dynamic, multi-step attacks with detailed visualizations and even enhance an organization's detection capabilities through User Behavior Analytics.\n\nSplunk can literally ingest almost any data from almost any source, through both an agent-less and a forwarder approach.\n\n![0](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/0.png)\n\n**Splunk Architecture Overview**:\n\n![1](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/1.png)\n\nSplunk's architecture (at a high level) consists of the:\n\n- **Forwarder** component\n\n   -   **Universal Forwarders** collect data from remote sources and send them to one or more Splunk Indexers. Universal Forwarders are separate downloads that can be installed on any remote source, with little impact on network or host performance.\n\n  -   **Heavy Forwarders** also collect data from remote sources, but they are typically used for heavy data aggregation tasks, from sources like firewalls or data routing/filtering passing points. According to [Splexicon](https://docs.splunk.com/Splexicon:Heavyforwarder), unlike other forwarder types, heavy forwarders parse data before forwarding them and can route data based on criteria such as source or type of event. They can also index data locally while forwarding the data to another indexer. Heavy Forwarders are usually run as \"data collection nodes\" for API/scripted data access, and they are only compatible with Splunk Enterprise.\n\n  **Note: HTTP Event Collectors (HECs)** also exist to collect data directly from applications, at-scale, through a token-based JSON or raw API way. Data are sent directly to the Indexer level.\n\n- **Indexer** component\n\n  The Indexer processes machine data, storing the results in indexes as events, enabling fast search and analysis. As the indexer indexes data, it creates a number of files organized in sets of directories by age. Each directory contains raw data (compressed) and indexes (points to the raw data).\n\n- **Search Head** component\n\n  The Search Head component allows users to use the Search language to search for indexed data. It distributes user search requests to the Indexers and consolidates the results as well as extracts field value pairs from the events to the user. Knowledge Objects on the Search Heads can be created to extract additional fields and transform the data without changing the underlying index data. It should be noted that Search Heads also provide tools to enhance the search experience such as reports, dashboards, and visualizations.\n\n**Splunk Apps and Technology Add-ons (TAs):**\n\n**Splunk Apps** are designed to address a wide variety of use cases and to extend the power of Splunk. Essentially, they are collections of files containing data inputs, UI elements, and/or knowledge objects. Splunk Apps also allow multiple workspaces for different use cases/user roles to co-exist on a single Splunk instance. Ready-made apps are available on Splunkbase (splunkbase.com).\n\n**Splunk Technology Add-ons** abstract the collection methodology and they typically include relevant field extractions (schema-on-the-fly). They also include relevant config files (props/transforms) and ancillary scripts binaries.\n\nYou can think of a Splunk App as a complete solution, that typically uses one or more Technology Add-ons.\n\n**Splunk Users and Roles:**\n\nSplunk users are assigned roles which determine their capabilities and data access. Out of the box, there are three main roles:\n\n-   **admin**: This role has the most capabilities assigned to it.\n\n-   **power**: This role can edit all shared objects (saved searches, etc.) and alerts, tag events, and other similar tasks.\n\n-   **user**: This role can create and edit its own saved searches, run searches, edit its own preferences, create and edit event types, and other similar tasks.\n\n**Splunk's Search & Reporting App:**\n\nYou will spend most of your time inside **Splunk's Search & Reporting**.\n\n![2](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/2.jpg)\n\n![3](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/3.jpg)\n\n**Data Summary** can provide you with hosts, sources or sourcetypes on separate tabs.\n\n![4](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/4.jpg)\n\n![4_1](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/4_1.jpg)\n\n![4_2](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/4_2.jpg)\n\n![4_3](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/4_3.jpg)\n\nFinally, this is how **Events** will look like.\n\n![5](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/5.jpg)\n\n**Splunk's Search Processing Language (SPL):**\n\nAccording to Splunk, SPL combines the best capabilities of SQL with the Unix pipeline syntax allowing you to:\n\n-   Access all data in its original format\n\n-   Optimize for time-series events\n\n-   Use the same language for visualizations\n\nSPL provides over 140 commands that allow you to search, correlate, analyze and visualize any data.\n\nThe below diagram represents a search, broken down to its syntax components.\n\n![6](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/6.png)\n\nSearches are made up of five basic components.\n\n1.  **Search terms**, where you specify what you are looking for. Search terms contain keywords, phrases, Booleans, etc.\n\n2.  **Commands**, where you specify how you want to manipulate the results. For example, create a chart, compute statistics, etc.\n\n3.  **Functions**, where you specify how exactly do you want to chart, compute or evaluate the results.\n\n4.  **Arguments**, in case there are variables you want to apply to a function.\n\n5.  **Clauses**, where you specify how exactly do you want to group or rename the fields in the results.\n\nAs you write searches, you will notice that some parts of the search string are automatically colored. The color is based on the search syntax. Example:\n\n![7](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/7.png)\n\nSomething else to consider while submitting searches is Splunk's search modes.\n\nThere are three search modes:\n\n-   **Fast Mode**: Field discovery off for event searches. No event or field data for stats searches.\n\n-   **Smart Mode**: Field discovery on for event searches. No event or field data for stats searches.\n\n-   **Verbose Mode**: All event & field data.\n\nIt is recommended to start searching with Smart and then go from there.\n\n<u>**We strongly suggest you spend time studying the] [Exploring Splunk](https://www.splunk.com/goto/book) [e-book before proceeding to the lab's tasks. Especially Chapter 4, as that covers the most commonly used search commands.**</u>\n\n**Various Search aspects are also nicely documented, in the following resource.**\n\n<https://docs.splunk.com/Documentation/Splunk/7.2.4/Search/GetstartedwithSearch>\n\n# Recommended tools\n\n-   Splunk\n\n# Network Configuration & Credentials\n\n# Recommended tools\n\n- Splunk\n\n- Use Firefox browser to connect to Splunk's web interface (**http://demo.ine.local:8000**)\n\n**Throughout this lab, we will split attacker actions based on the [Cyber Kill Chain](https://www.lockheedmartin.com/en-us/capabilities/cyber/cyber-kill-chain.html).**",
    "description_html": "<h1>Effectively Using Splunk (Scenario 1)</h1>\n<h2>LAB 8</h2>\n<h1>Scenario</h1>\n<p>The organization you work for (<strong>Wayne Enterprises</strong>) is using <a href=\"https://www.splunk.com/\">Splunk</a> as a SIEM solution to enhance its intrusion detection capabilities. The SOC manager informed you that the organization has been hit by an APT group. He tasked you with responding to this incident by heavily utilizing Splunk and all the data that it ingested.</p>\n<p>The data that Splunk has ingested consist of Windows event logs, Sysmon logs, Fortinet next-generation firewall logs, Suricata logs, etc.</p>\n<p><strong>Note</strong>: This lab is based on the <a href=\"https://github.com/splunk/botsv1\">Boss Of The SOC (BOTS) v1 dataset</a> released by Splunk. Credits to <a href=\"https://twitter.com/meansec\">Ryan Kovar</a>, <a href=\"https://twitter.com/daveherrald?lang=el\">Dave Herrald</a> and <a href=\"https://twitter.com/stonerpsu\">John Stoner</a> for sharing the Splunk detection tips this lab covers with the public, through this dataset.</p>\n<h1>Learning Objectives</h1>\n<p>The learning objective of this lab is to not only get familiar with Splunk's architecture and detection capabilities but also to learn effective Splunk search writing.</p>\n<p>Specifically, you will learn how to use Splunk's capabilities in order to:</p>\n<ul>\n<li>\n<p>Have better visibility over a network</p>\n</li>\n<li>\n<p>Respond to incidents timely and effectively</p>\n</li>\n<li>\n<p>Proactively hunt for threats</p>\n</li>\n</ul>\n<h1>Introduction To Splunk</h1>\n<p>Splunk's creators describe it as a solution to aggregate, analyze and get answers from machine data. Splunk can be used for Application Management, Operations Management, Security &amp; Compliance, etc.</p>\n<p>When it comes to security, Splunk can be used as a log management solution but most importantly as an analytics-driven SIEM. Splunk can fortify investigations of dynamic, multi-step attacks with detailed visualizations and even enhance an organization's detection capabilities through User Behavior Analytics.</p>\n<p>Splunk can literally ingest almost any data from almost any source, through both an agent-less and a forwarder approach.</p>\n<p><img alt=\"0\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/0.png\" /></p>\n<p><strong>Splunk Architecture Overview</strong>:</p>\n<p><img alt=\"1\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/1.png\" /></p>\n<p>Splunk's architecture (at a high level) consists of the:</p>\n<ul>\n<li>\n<p><strong>Forwarder</strong> component</p>\n</li>\n<li>\n<p><strong>Universal Forwarders</strong> collect data from remote sources and send them to one or more Splunk Indexers. Universal Forwarders are separate downloads that can be installed on any remote source, with little impact on network or host performance.</p>\n</li>\n<li>\n<p><strong>Heavy Forwarders</strong> also collect data from remote sources, but they are typically used for heavy data aggregation tasks, from sources like firewalls or data routing/filtering passing points. According to <a href=\"https://docs.splunk.com/Splexicon:Heavyforwarder\">Splexicon</a>, unlike other forwarder types, heavy forwarders parse data before forwarding them and can route data based on criteria such as source or type of event. They can also index data locally while forwarding the data to another indexer. Heavy Forwarders are usually run as \"data collection nodes\" for API/scripted data access, and they are only compatible with Splunk Enterprise.</p>\n</li>\n</ul>\n<p><strong>Note: HTTP Event Collectors (HECs)</strong> also exist to collect data directly from applications, at-scale, through a token-based JSON or raw API way. Data are sent directly to the Indexer level.</p>\n<ul>\n<li><strong>Indexer</strong> component</li>\n</ul>\n<p>The Indexer processes machine data, storing the results in indexes as events, enabling fast search and analysis. As the indexer indexes data, it creates a number of files organized in sets of directories by age. Each directory contains raw data (compressed) and indexes (points to the raw data).</p>\n<ul>\n<li><strong>Search Head</strong> component</li>\n</ul>\n<p>The Search Head component allows users to use the Search language to search for indexed data. It distributes user search requests to the Indexers and consolidates the results as well as extracts field value pairs from the events to the user. Knowledge Objects on the Search Heads can be created to extract additional fields and transform the data without changing the underlying index data. It should be noted that Search Heads also provide tools to enhance the search experience such as reports, dashboards, and visualizations.</p>\n<p><strong>Splunk Apps and Technology Add-ons (TAs):</strong></p>\n<p><strong>Splunk Apps</strong> are designed to address a wide variety of use cases and to extend the power of Splunk. Essentially, they are collections of files containing data inputs, UI elements, and/or knowledge objects. Splunk Apps also allow multiple workspaces for different use cases/user roles to co-exist on a single Splunk instance. Ready-made apps are available on Splunkbase (splunkbase.com).</p>\n<p><strong>Splunk Technology Add-ons</strong> abstract the collection methodology and they typically include relevant field extractions (schema-on-the-fly). They also include relevant config files (props/transforms) and ancillary scripts binaries.</p>\n<p>You can think of a Splunk App as a complete solution, that typically uses one or more Technology Add-ons.</p>\n<p><strong>Splunk Users and Roles:</strong></p>\n<p>Splunk users are assigned roles which determine their capabilities and data access. Out of the box, there are three main roles:</p>\n<ul>\n<li>\n<p><strong>admin</strong>: This role has the most capabilities assigned to it.</p>\n</li>\n<li>\n<p><strong>power</strong>: This role can edit all shared objects (saved searches, etc.) and alerts, tag events, and other similar tasks.</p>\n</li>\n<li>\n<p><strong>user</strong>: This role can create and edit its own saved searches, run searches, edit its own preferences, create and edit event types, and other similar tasks.</p>\n</li>\n</ul>\n<p><strong>Splunk's Search &amp; Reporting App:</strong></p>\n<p>You will spend most of your time inside <strong>Splunk's Search &amp; Reporting</strong>.</p>\n<p><img alt=\"2\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/2.jpg\" /></p>\n<p><img alt=\"3\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/3.jpg\" /></p>\n<p><strong>Data Summary</strong> can provide you with hosts, sources or sourcetypes on separate tabs.</p>\n<p><img alt=\"4\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/4.jpg\" /></p>\n<p><img alt=\"4_1\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/4_1.jpg\" /></p>\n<p><img alt=\"4_2\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/4_2.jpg\" /></p>\n<p><img alt=\"4_3\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/4_3.jpg\" /></p>\n<p>Finally, this is how <strong>Events</strong> will look like.</p>\n<p><img alt=\"5\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/5.jpg\" /></p>\n<p><strong>Splunk's Search Processing Language (SPL):</strong></p>\n<p>According to Splunk, SPL combines the best capabilities of SQL with the Unix pipeline syntax allowing you to:</p>\n<ul>\n<li>\n<p>Access all data in its original format</p>\n</li>\n<li>\n<p>Optimize for time-series events</p>\n</li>\n<li>\n<p>Use the same language for visualizations</p>\n</li>\n</ul>\n<p>SPL provides over 140 commands that allow you to search, correlate, analyze and visualize any data.</p>\n<p>The below diagram represents a search, broken down to its syntax components.</p>\n<p><img alt=\"6\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/6.png\" /></p>\n<p>Searches are made up of five basic components.</p>\n<ol>\n<li>\n<p><strong>Search terms</strong>, where you specify what you are looking for. Search terms contain keywords, phrases, Booleans, etc.</p>\n</li>\n<li>\n<p><strong>Commands</strong>, where you specify how you want to manipulate the results. For example, create a chart, compute statistics, etc.</p>\n</li>\n<li>\n<p><strong>Functions</strong>, where you specify how exactly do you want to chart, compute or evaluate the results.</p>\n</li>\n<li>\n<p><strong>Arguments</strong>, in case there are variables you want to apply to a function.</p>\n</li>\n<li>\n<p><strong>Clauses</strong>, where you specify how exactly do you want to group or rename the fields in the results.</p>\n</li>\n</ol>\n<p>As you write searches, you will notice that some parts of the search string are automatically colored. The color is based on the search syntax. Example:</p>\n<p><img alt=\"7\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/7.png\" /></p>\n<p>Something else to consider while submitting searches is Splunk's search modes.</p>\n<p>There are three search modes:</p>\n<ul>\n<li>\n<p><strong>Fast Mode</strong>: Field discovery off for event searches. No event or field data for stats searches.</p>\n</li>\n<li>\n<p><strong>Smart Mode</strong>: Field discovery on for event searches. No event or field data for stats searches.</p>\n</li>\n<li>\n<p><strong>Verbose Mode</strong>: All event &amp; field data.</p>\n</li>\n</ul>\n<p>It is recommended to start searching with Smart and then go from there.</p>\n<p><u><strong>We strongly suggest you spend time studying the] <a href=\"https://www.splunk.com/goto/book\">Exploring Splunk</a> [e-book before proceeding to the lab's tasks. Especially Chapter 4, as that covers the most commonly used search commands.</strong></u></p>\n<p><strong>Various Search aspects are also nicely documented, in the following resource.</strong></p>\n<p><a href=\"https://docs.splunk.com/Documentation/Splunk/7.2.4/Search/GetstartedwithSearch\">https://docs.splunk.com/Documentation/Splunk/7.2.4/Search/GetstartedwithSearch</a></p>\n<h1>Recommended tools</h1>\n<ul>\n<li>Splunk</li>\n</ul>\n<h1>Network Configuration &amp; Credentials</h1>\n<h1>Recommended tools</h1>\n<ul>\n<li>\n<p>Splunk</p>\n</li>\n<li>\n<p>Use Firefox browser to connect to Splunk's web interface (<strong>http://demo.ine.local:8000</strong>)</p>\n</li>\n</ul>\n<p><strong>Throughout this lab, we will split attacker actions based on the <a href=\"https://www.lockheedmartin.com/en-us/capabilities/cyber/cyber-kill-chain.html\">Cyber Kill Chain</a>.</strong></p>",
    "tasks": "# Tasks\n\n## Task 1: Identify any reconnaissance activities against your network through Splunk searches\n\nUsing Splunk's capabilities, try to identify any reconnaissance activities performed by the APT group. Your organization's website is **imreallynotbatman.com.**\n\n**Hints**:\n\n-   Focus on the **stream:http** sourcetype and identify the source IPs that are responsible for the majority of the traffic. Then, validate your findings using the **suricata** sourcetype.\n\n-   Move the investigation deeper by analyzing all important fields and sourcetypes\n\n## Task 2: Identify any weaponization activities on your network\n\nUsing Open Source Intelligence (OSINT), try to identify any weaponization activities performed by the APT group.\n\n**Hints**:\n\n-   Identify any IP addresses tied to domains that are pre-staged to attack Wayne Enterprises\n\n-   Try to understand the associations between IP addresses and domains among other things\n\n-   Do the same as above to associate attacker emails with infrastructure on the internet\n\n## Task 3: Identify any delivery activities on your network\n\nUsing OSINT, try to identify any delivery activities performed by the APT group. Specifically, try to identify malware associated with the attacker infrastructure you have previously uncovered.\n\n**Hints**:\n\n-   Submit any attacker-related IP address to open sources such as ThreatMiner, VirusTotal and Hybrid Analysis\n\n## Task 4: Identify any exploitation activities on your network through Splunk searches\n\nUsing Splunk's capabilities, try to identify any exploitation activities performed by the APT group.\n\n**Hints**:\n\n-   Focus on the **stream:http** and **iis** sourcetypes and identify which of your servers is the target as well as the Content Management System it uses\n\n-   Focus on the **stream:http** sourcetype and identify the source of a brute force attack\n\n-   Move the investigation deeper by analyzing all important fields and sourcetypes\n\n## Task 5: Identify any installation activities on your network through Splunk searches\n\nUsing Splunk's capabilities, try to identify any installation activities performed by the APT group.\n\n**Hints**:\n\n-   Focus on the **stream:http** and **suricata** sourcetypes to identify any uploaded executables\n\n-   Leverage Sysmon logs to identify additional information about any uploaded executables\n\n## Task 6: Identify any command and control-related activities on your network through Splunk searches\n\nUsing Splunk's capabilities, try to identify any Command and Control (C2)-related activities performed by the APT group.\n\n**Hints**:\n\n-   Focus on the **stream:http,** **fgt_utm,** and **stream:dns** sourcetypes to identify any domains acting as Command and Control.",
    "tasks_html": "<h1>Tasks</h1>\n<h2>Task 1: Identify any reconnaissance activities against your network through Splunk searches</h2>\n<p>Using Splunk's capabilities, try to identify any reconnaissance activities performed by the APT group. Your organization's website is <strong>imreallynotbatman.com.</strong></p>\n<p><strong>Hints</strong>:</p>\n<ul>\n<li>\n<p>Focus on the <strong>stream:http</strong> sourcetype and identify the source IPs that are responsible for the majority of the traffic. Then, validate your findings using the <strong>suricata</strong> sourcetype.</p>\n</li>\n<li>\n<p>Move the investigation deeper by analyzing all important fields and sourcetypes</p>\n</li>\n</ul>\n<h2>Task 2: Identify any weaponization activities on your network</h2>\n<p>Using Open Source Intelligence (OSINT), try to identify any weaponization activities performed by the APT group.</p>\n<p><strong>Hints</strong>:</p>\n<ul>\n<li>\n<p>Identify any IP addresses tied to domains that are pre-staged to attack Wayne Enterprises</p>\n</li>\n<li>\n<p>Try to understand the associations between IP addresses and domains among other things</p>\n</li>\n<li>\n<p>Do the same as above to associate attacker emails with infrastructure on the internet</p>\n</li>\n</ul>\n<h2>Task 3: Identify any delivery activities on your network</h2>\n<p>Using OSINT, try to identify any delivery activities performed by the APT group. Specifically, try to identify malware associated with the attacker infrastructure you have previously uncovered.</p>\n<p><strong>Hints</strong>:</p>\n<ul>\n<li>Submit any attacker-related IP address to open sources such as ThreatMiner, VirusTotal and Hybrid Analysis</li>\n</ul>\n<h2>Task 4: Identify any exploitation activities on your network through Splunk searches</h2>\n<p>Using Splunk's capabilities, try to identify any exploitation activities performed by the APT group.</p>\n<p><strong>Hints</strong>:</p>\n<ul>\n<li>\n<p>Focus on the <strong>stream:http</strong> and <strong>iis</strong> sourcetypes and identify which of your servers is the target as well as the Content Management System it uses</p>\n</li>\n<li>\n<p>Focus on the <strong>stream:http</strong> sourcetype and identify the source of a brute force attack</p>\n</li>\n<li>\n<p>Move the investigation deeper by analyzing all important fields and sourcetypes</p>\n</li>\n</ul>\n<h2>Task 5: Identify any installation activities on your network through Splunk searches</h2>\n<p>Using Splunk's capabilities, try to identify any installation activities performed by the APT group.</p>\n<p><strong>Hints</strong>:</p>\n<ul>\n<li>\n<p>Focus on the <strong>stream:http</strong> and <strong>suricata</strong> sourcetypes to identify any uploaded executables</p>\n</li>\n<li>\n<p>Leverage Sysmon logs to identify additional information about any uploaded executables</p>\n</li>\n</ul>\n<h2>Task 6: Identify any command and control-related activities on your network through Splunk searches</h2>\n<p>Using Splunk's capabilities, try to identify any Command and Control (C2)-related activities performed by the APT group.</p>\n<p><strong>Hints</strong>:</p>\n<ul>\n<li>Focus on the <strong>stream:http,</strong> <strong>fgt_utm,</strong> and <strong>stream:dns</strong> sourcetypes to identify any domains acting as Command and Control.</li>\n</ul>",
    "published_date": "2020-10-20T15:32:25Z",
    "solutions": "# SOLUTIONS\n\nBelow, you can find solutions for every task of this lab. Remember though, that you can follow your own strategy, which may be different from the one explained in the following lab.\n\n**Kali Machine**\n\n![8](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/8.jpg)\n\n## Task 1: Identify any reconnaissance activities against your network through Splunk searches\n\nOnce you are logged into Splunk's web management interface, click the **Search & Reporting** application that resides on the **Apps** column on your left. You should see something similar to the below.\n\n![9](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/9.jpg)\n\nIn order to test if Splunk can successfully access the ingested/loaded data, first change the time range picker to **All time** and then, submit the following search.\n\n```\nindex=\"botsv1\" earliest=0\n```\n\nYou should see the number of events growing as time progresses.\n\n![10](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/10.jpg)\n\nNow that we know everything worked as expected, let's identify any reconnaissance activities against Wayne Enterprises. As a reminder, the organization's website is **imreallynotbatman.com**.\n\nThe first thing we should do is determine the sourcetypes to search. Specifically, we should first determine the sourcetypes that are associated with **imreallynotbatman.com**. We can do so by changing the time range picker to **All time** and submitting the following Splunk search.\n\n```\nindex=botsv1 imreallynotbatman.com\n```\n\nYou should see something similar to the below.\n\n![11](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/11.jpg)\n\nTo determine the sourcetypes, simply click on **sourcetype** (red rectangle above). You should see the following.\n\n![12](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/12.jpg)\n\nLet's also identify all source addresses. We can do so through the previous search, but this time we will scroll down and click on the **src** field, as follows.\n\n![13](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/13.jpg)\n\nSince we are interested in identifying reconnaissance activities, it would be better to focus on the **stream:http** sourcetype. (Stream is a free app for Splunk that collects wire data and can focus on a number of different protocols including smtp, tcp, ip, http and so on.)\n\n```\nindex=botsv1 imreallynotbatman.com sourcetype=stream:http\n```\n\n![14](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/14.jpg)\n\nIf we do so, the sources will be narrowed down to two, **40.80.148.42** and **23.22.63.114**. **40.80.148.42** is associated with ~95% of the http traffic, so let's focus on this one for the time being.\n\nAn alternative way to identify all sources is the following.\n\n```\nindex=botsv1 imreallynotbatman.com sourcetype=stream* | stats count(src_ip) as Requests by src_ip | sort - Requests\n```\n\n![15](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/15.jpg)\n\nSo far, we can only assume that **40.80.148.42** was the IP from where the APT group performed its reconnaissance/scanning activities. We can validate this finding, by checking with Suricata, as follows.\n\n```\nindex=botsv1 imreallynotbatman.com src_ip=40.80.148.42 sourcetype=suricata\n```\n\nWe see Suricata logs related to **40.80.148.42**, but no signature field. We can see the signatures by scrolling down, clicking on **more fields** and choosing **signature**. If we do so, the signature field will be visible under the **SELECTED FIELDS** column.\n\n![16](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/16.jpg)\n\nFrom the Suricata signatures that were triggered, we can conclude that **40.80.148.42** was actually scanning **imreallynotbatman.com**.\n\nWe are also interested in knowing our adversary's level of sophistication. So the question that arises is, did the APT group use known or sophisticated scanning techniques? Let's take a look at the submitted requests to answer that.\n\n```\nindex=botsv1 src_ip=40.80.148.42 sourcetype=stream:http\n```\n\nThe detailed request information can be found inside the **src_headers** field.\n\n![17](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/17.jpg)\n\nThe APT group utilized an instance of the reputable [Acunetix](https://www.acunetix.com/) vulnerability scanner.\n\nWe could have also identified the usage of this tool by looking for uncommon user agents.\n\n![18](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/18.jpg)\n\nWe can easily identify which server was the target through the same search and the **dest** field.\n\n![19](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/19.jpg)\n\nThe target was obviously **192.168.250.70**.\n\nIf we want to have a closer look at what has been requested by the APT group, we can do that as follows.\n\n```\nindex=botsv1 dest_ip=192.168.250.70 sourcetype=stream:http\n```\n\nThe URLs being requested can be found inside the **uri** field.\n\n![20](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/20.jpg)\n\nWe are also interested in successful page loads. We can identify them, as follows.\n\n```\nindex=botsv1 dest_ip=192.168.250.70 sourcetype=stream:http| timechart count by uri limit=10\n```\n\n![21](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/21.jpg)\n\nWe could have achieved similar results through the **iis** sourcetype, as follows. (This time we are using a transformational search command called **stats** that will allow us to count the number of events grouped by URI.)\n\n```\nindex=botsv1 sourcetype=iis sc_status=200 | stats values(cs_uri_stem)\n```\n\n![22](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/22.jpg)\n\nYou may be wondering why we aren't specifying **192.168.250.70**. This is because if we submit the below and check the host field, we will find only one host, **we1149srv**. This host's IP address is **192.168.250.70**\n\n```\nindex=botsv1 sourcetype=iis\n```\n\n![23](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/23.jpg)\n\nBelow are our findings so far.\n\n![24](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/24.png)\n\n![25](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/25.png)\n\n## Task 2: Identify any weaponization activities on your network \n\nAt this point, we need to understand that Splunk is not panacea. During our investigations, not every answer can be found within the SIEM. There will be times when we will need to pivot from the SIEM to other internal or open sources to find answers.\n\nWe are interested in identifying domains that are pre-staged to attack Wayne Enterprises.\n\nWe gave the **40.80.148.42** IP address a good look through Splunk. Let's do the same for **23.22.63.114** but through open sources since Splunk doesn't contain too much information about it.\n\nIf we go to an open source like [http://www.robtex.com](http://www.robtex.com/) and submit the **23.22.63.114** IP, we will come across the following.\n\n![26](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/26.png)\n\nAs we can see, this IP has a number of other domain names associated with it. These domain names are most probably phishing domains since their name is similar to the organization we work for, **Wayne Enterprises**.\n\nOpen sources like [https://threatcrowd.org](https://threatcrowd.org/) and [https://www.virustotal.com](https://www.virustotal.com/) can provide us with additional information.\n\n![27](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/27.png)\n\nFor example, through threatcrowd.org, we identified additional domains associated with the APT group we are dealing with by simply submitting the **23.22.63.114** IP.\n\nRemember when we talked about whois information and how attackers leverage them for targeted attacks? Well, let's give attackers a taste of their own poison, by checking the whois information of every associated domain.\n\nWhile checking the whois information of **wayncorpinc.com** we come across the following.\n\n![28](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/28.png)\n\nWe can then proceed to reverse email searches and possibly identify additional infrastructure associated with the APT group. Find an example of a reverse email search below.\n\n<https://www.threatcrowd.org/email.php?email=LILLIAN.ROSE@PO1S0N1VY.COM>\n\nHere are our findings so far:\n\n![29](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/29.png)\n\n## Task 3: Identify any delivery activities on your network \n\nWe need to know as much as possible about this APT group's TTPs and used malware, so let's dig deeper through open sources.\n\n[https://www.threatminer.org](https://www.threatminer.org/) has a great capability of including related malware samples when searching for information about an IP address. This is what we will come across while searching for information about **23.22.63.114** on **threatminer.org**.\n\n![30](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/30.png)\n\nWe can then submit these MD5 hashes to open sources like threatminer, VirusTotal or hybrid-analysis.com to identify additional metadata about the sample(s).\n\n![31](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/31.png)\n\nThe APT group may create mutants, so hashes may not prove useful. We should note down that filename though in case they keep that.\n\nBelow are our findings so far.\n\n![32](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/32.png)\n\n## Task 4: Identify any exploitation activities on your network through Splunk searches\n\nIt is about time we go back to Splunk to identify any exploitation activities. Let's start by identifying source IP addresses that are associated with the largest number of http events. We can do that, as follows.\n\n```\nindex=botsv1 sourcetype=stream:http dest_ip=\"192.168.250.70\" http_method=POST\n```\n\nThe **src** field contains what we are looking for. We specified that we are interested in POST requests since logins are usually performed through POST requests (more on that in a bit).\n\n![33](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/33.jpg)\n\nLet's take a look at those POST requests made by **40.80.148.42**\n\n```\nindex=botsv1 sourcetype=stream:http dest_ip=\"192.168.250.70\" http_method=POST src_ip=\"40.80.148.42\"\n```\n\nThe **form_data** field contains information that we want to check when dealing with POST requests.\n\n![33_1](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/33_1.jpg)\n\nNothing to justify successful exploitation activities. Let's check **23.22.63.114**.\n\n```\nindex=botsv1 sourcetype=stream:http dest_ip=\"192.168.250.70\" http_method=POST src_ip=\"23.22.63.114\"\n```\n\n![34](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/34.jpg)\n\nIt looks like **23.22.63.114** is brute forcing the web server's authentication.\n\nLet's make sure, as follows.\n\n```\nindex=botsv1 sourcetype=stream:http dest_ip=\"192.168.250.70\" http_method=POST form_data=*username*passwd* | stats count by src_ip\n```\n\n![35](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/35.jpg)\n\nIndeed **23.22.63.114** performed a brute force attack against the web server's authentication.\n\nWe are quite interested in knowing if the brute force attack was successful. We can determine that, as follows.\n\n```\nindex=botsv1 sourcetype=stream:http form_data=*username*passwd* dest_ip=192.168.250.70 | rex field=form_data \"passwd=(?<userpassword>\\w+)\" | stats count by userpassword | sort - count\n```\n![36](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/36.jpg)\n\nThe search above extracts every user password and counts the times it has been seen/used. If a password is seen more than one time, this probably means that attackers got a hit and used the password again to log in. This is why we are sorting on count.\n\nIf we want to get an idea of the time of the compromise and the URI that was targeted, we can do that as follows.\n\n```\nindex=botsv1 sourcetype=stream:http form_data=*username*passwd* dest_ip=192.168.250.70 src_ip=40.80.148.42 | rex field=form_data \"passwd=(?<userpassword>\\w+)\"| search userpassword=* | table _time uri userpassword\n```\n\n![37](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/37.jpg)\n\nFinally, if we want to view the two successful logins we can do so, as follows.\n\n```\nindex=botsv1 sourcetype=stream:http | rex field=form_data \"passwd=(?<userpassword>\\w+)\" | search userpassword=batman | table _time userpassword src_ip\n```\n\n![38](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/38.jpg)\n\nBelow are our findings so far.\n\n![39](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/39.png)\n\n![40](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/40.png)\n\n## Task 5: Identify any installation activities on your network through Splunk searches\n\nAs far as the installation phase of the cyber kill chain is concerned, we are mostly interested in identifying any malware being uploaded.\n\nWe can identify that through various sourcetypes, specifically, **stream:http** and **Suricata**.\n\n```\nindex=botsv1 sourcetype=stream:http dest_ip=\"192.168.250.70\" *.exe\n```\nThe **part_filename{}** field contains the information we want to check. It won't be visible by default, so add it.\n\n![41](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/41.png)\n\n![42](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/42.jpg)\n\n\n```\nindex=botsv1 sourcetype=suricata (dest=imreallynotbatman.com OR dest=\"192.168.250.70\") http.http_method=POST .exe\n```\n\nThe **fileinfo.filename** field contains the information we want to check.\n\n![43](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/43.jpg)\n\n**3791.exe** must be the uploaded malware.\n\nThe source from where the file was uploaded can easily be identified, as follows.\n\n```\nindex=botsv1 sourcetype=suricata dest_ip=\"192.168.250.70\" http.http_method=POST .exe\n```\n\n![44](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/44.jpg)\n\nIt would be great if we could also identify the hash of the uploaded file. But what sourcetype should we use? Let's find out, as follows.\n\n```\nindex=botsv1 3791.exe\n```\n\n![45](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/45.jpg)\n\nSysmon is a good candidate since it logs information such as MD5, SHA1 and SHA256 hashes of files.\n\n```\nindex=botsv1 3791.exe sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational\n```\n\n![46](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/46.jpg)\n\nThe important fields, in this case, are **Hashes**, **CommandLine** and **ParentCommandLine**. You will have to add the last two ones since they are not visible by default.\n\nBefore analyzing the results, let's narrow things down a little bit.\n\n```\nindex=botsv1 3791.exe sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational EventCode=1\n```\n\n![47](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/47.jpg)\n\nThe search above includes EventCode 1 since this EventCode is related to process creation events. Unfortunately, to get the MD5 hash of the uploaded file, we need to narrow things down even further. Specifically, we will need to search for 3791.exe inside the command line field, since this field captures the process starting.\n\nSo, the final search is the following.\n\n```\nindex=botsv1 3791.exe CommandLine=3791.exe | stats values(md5)\n```\n\n![48](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/48.jpg)\n\nBelow are our findings so far.\n\n![49](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/49.png)\n\n![50](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/50.png)\n\n## Task 6: Identify any command and control-related activities on your network through Splunk searches\n\nAs far as the Command and Control phase of the cyber kill chain is concerned, we are mostly interested in identifying any domain used for command and control purposes.\n\nWe have a powerful ally inside Splunk to assist us in answering such questions. This ally is the **stream.dns** sourcetype. Since we already know that **23.22.63.114** is of concern, we can utilize Splunk and the **stream.dns** sourcetype to identify DNS events where **22.23.63.114** was the answer.\n\n```\nindex=botsv1 sourcetype=stream:dns 23.22.63.114 | stats values(\"name{}\")\n```\n\n![51](https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/51.jpg)\n\nIf you look carefully enough, you will identify that the **prankglassinebracket.jumpingcrab.com** domain has been used by attackers to deface the web server. Give it a try...\n\n**References:**\n\n1.  <https://www.slideshare.net/Splunk/splunk-data-onboarding-overview-splunk-data-collection-architecture>\n\n2.  <https://www.splunk.com/en_us/training.html>",
    "solutions_html": "<h1>SOLUTIONS</h1>\n<p>Below, you can find solutions for every task of this lab. Remember though, that you can follow your own strategy, which may be different from the one explained in the following lab.</p>\n<p><strong>Kali Machine</strong></p>\n<p><img alt=\"8\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/8.jpg\" /></p>\n<h2>Task 1: Identify any reconnaissance activities against your network through Splunk searches</h2>\n<p>Once you are logged into Splunk's web management interface, click the <strong>Search &amp; Reporting</strong> application that resides on the <strong>Apps</strong> column on your left. You should see something similar to the below.</p>\n<p><img alt=\"9\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/9.jpg\" /></p>\n<p>In order to test if Splunk can successfully access the ingested/loaded data, first change the time range picker to <strong>All time</strong> and then, submit the following search.</p>\n<pre class=\"codehilite\"><code>index=\"botsv1\" earliest=0</code></pre>\n\n<p>You should see the number of events growing as time progresses.</p>\n<p><img alt=\"10\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/10.jpg\" /></p>\n<p>Now that we know everything worked as expected, let's identify any reconnaissance activities against Wayne Enterprises. As a reminder, the organization's website is <strong>imreallynotbatman.com</strong>.</p>\n<p>The first thing we should do is determine the sourcetypes to search. Specifically, we should first determine the sourcetypes that are associated with <strong>imreallynotbatman.com</strong>. We can do so by changing the time range picker to <strong>All time</strong> and submitting the following Splunk search.</p>\n<pre class=\"codehilite\"><code>index=botsv1 imreallynotbatman.com</code></pre>\n\n<p>You should see something similar to the below.</p>\n<p><img alt=\"11\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/11.jpg\" /></p>\n<p>To determine the sourcetypes, simply click on <strong>sourcetype</strong> (red rectangle above). You should see the following.</p>\n<p><img alt=\"12\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/12.jpg\" /></p>\n<p>Let's also identify all source addresses. We can do so through the previous search, but this time we will scroll down and click on the <strong>src</strong> field, as follows.</p>\n<p><img alt=\"13\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/13.jpg\" /></p>\n<p>Since we are interested in identifying reconnaissance activities, it would be better to focus on the <strong>stream:http</strong> sourcetype. (Stream is a free app for Splunk that collects wire data and can focus on a number of different protocols including smtp, tcp, ip, http and so on.)</p>\n<pre class=\"codehilite\"><code>index=botsv1 imreallynotbatman.com sourcetype=stream:http</code></pre>\n\n<p><img alt=\"14\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/14.jpg\" /></p>\n<p>If we do so, the sources will be narrowed down to two, <strong>40.80.148.42</strong> and <strong>23.22.63.114</strong>. <strong>40.80.148.42</strong> is associated with ~95% of the http traffic, so let's focus on this one for the time being.</p>\n<p>An alternative way to identify all sources is the following.</p>\n<pre class=\"codehilite\"><code>index=botsv1 imreallynotbatman.com sourcetype=stream* | stats count(src_ip) as Requests by src_ip | sort - Requests</code></pre>\n\n<p><img alt=\"15\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/15.jpg\" /></p>\n<p>So far, we can only assume that <strong>40.80.148.42</strong> was the IP from where the APT group performed its reconnaissance/scanning activities. We can validate this finding, by checking with Suricata, as follows.</p>\n<pre class=\"codehilite\"><code>index=botsv1 imreallynotbatman.com src_ip=40.80.148.42 sourcetype=suricata</code></pre>\n\n<p>We see Suricata logs related to <strong>40.80.148.42</strong>, but no signature field. We can see the signatures by scrolling down, clicking on <strong>more fields</strong> and choosing <strong>signature</strong>. If we do so, the signature field will be visible under the <strong>SELECTED FIELDS</strong> column.</p>\n<p><img alt=\"16\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/16.jpg\" /></p>\n<p>From the Suricata signatures that were triggered, we can conclude that <strong>40.80.148.42</strong> was actually scanning <strong>imreallynotbatman.com</strong>.</p>\n<p>We are also interested in knowing our adversary's level of sophistication. So the question that arises is, did the APT group use known or sophisticated scanning techniques? Let's take a look at the submitted requests to answer that.</p>\n<pre class=\"codehilite\"><code>index=botsv1 src_ip=40.80.148.42 sourcetype=stream:http</code></pre>\n\n<p>The detailed request information can be found inside the <strong>src_headers</strong> field.</p>\n<p><img alt=\"17\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/17.jpg\" /></p>\n<p>The APT group utilized an instance of the reputable <a href=\"https://www.acunetix.com/\">Acunetix</a> vulnerability scanner.</p>\n<p>We could have also identified the usage of this tool by looking for uncommon user agents.</p>\n<p><img alt=\"18\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/18.jpg\" /></p>\n<p>We can easily identify which server was the target through the same search and the <strong>dest</strong> field.</p>\n<p><img alt=\"19\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/19.jpg\" /></p>\n<p>The target was obviously <strong>192.168.250.70</strong>.</p>\n<p>If we want to have a closer look at what has been requested by the APT group, we can do that as follows.</p>\n<pre class=\"codehilite\"><code>index=botsv1 dest_ip=192.168.250.70 sourcetype=stream:http</code></pre>\n\n<p>The URLs being requested can be found inside the <strong>uri</strong> field.</p>\n<p><img alt=\"20\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/20.jpg\" /></p>\n<p>We are also interested in successful page loads. We can identify them, as follows.</p>\n<pre class=\"codehilite\"><code>index=botsv1 dest_ip=192.168.250.70 sourcetype=stream:http| timechart count by uri limit=10</code></pre>\n\n<p><img alt=\"21\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/21.jpg\" /></p>\n<p>We could have achieved similar results through the <strong>iis</strong> sourcetype, as follows. (This time we are using a transformational search command called <strong>stats</strong> that will allow us to count the number of events grouped by URI.)</p>\n<pre class=\"codehilite\"><code>index=botsv1 sourcetype=iis sc_status=200 | stats values(cs_uri_stem)</code></pre>\n\n<p><img alt=\"22\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/22.jpg\" /></p>\n<p>You may be wondering why we aren't specifying <strong>192.168.250.70</strong>. This is because if we submit the below and check the host field, we will find only one host, <strong>we1149srv</strong>. This host's IP address is <strong>192.168.250.70</strong></p>\n<pre class=\"codehilite\"><code>index=botsv1 sourcetype=iis</code></pre>\n\n<p><img alt=\"23\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/23.jpg\" /></p>\n<p>Below are our findings so far.</p>\n<p><img alt=\"24\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/24.png\" /></p>\n<p><img alt=\"25\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/25.png\" /></p>\n<h2>Task 2: Identify any weaponization activities on your network</h2>\n<p>At this point, we need to understand that Splunk is not panacea. During our investigations, not every answer can be found within the SIEM. There will be times when we will need to pivot from the SIEM to other internal or open sources to find answers.</p>\n<p>We are interested in identifying domains that are pre-staged to attack Wayne Enterprises.</p>\n<p>We gave the <strong>40.80.148.42</strong> IP address a good look through Splunk. Let's do the same for <strong>23.22.63.114</strong> but through open sources since Splunk doesn't contain too much information about it.</p>\n<p>If we go to an open source like <a href=\"http://www.robtex.com/\">http://www.robtex.com</a> and submit the <strong>23.22.63.114</strong> IP, we will come across the following.</p>\n<p><img alt=\"26\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/26.png\" /></p>\n<p>As we can see, this IP has a number of other domain names associated with it. These domain names are most probably phishing domains since their name is similar to the organization we work for, <strong>Wayne Enterprises</strong>.</p>\n<p>Open sources like <a href=\"https://threatcrowd.org/\">https://threatcrowd.org</a> and <a href=\"https://www.virustotal.com/\">https://www.virustotal.com</a> can provide us with additional information.</p>\n<p><img alt=\"27\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/27.png\" /></p>\n<p>For example, through threatcrowd.org, we identified additional domains associated with the APT group we are dealing with by simply submitting the <strong>23.22.63.114</strong> IP.</p>\n<p>Remember when we talked about whois information and how attackers leverage them for targeted attacks? Well, let's give attackers a taste of their own poison, by checking the whois information of every associated domain.</p>\n<p>While checking the whois information of <strong>wayncorpinc.com</strong> we come across the following.</p>\n<p><img alt=\"28\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/28.png\" /></p>\n<p>We can then proceed to reverse email searches and possibly identify additional infrastructure associated with the APT group. Find an example of a reverse email search below.</p>\n<p><a href=\"https://www.threatcrowd.org/email.php?email=LILLIAN.ROSE@PO1S0N1VY.COM\">https://www.threatcrowd.org/email.php?email=LILLIAN.ROSE@PO1S0N1VY.COM</a></p>\n<p>Here are our findings so far:</p>\n<p><img alt=\"29\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/29.png\" /></p>\n<h2>Task 3: Identify any delivery activities on your network</h2>\n<p>We need to know as much as possible about this APT group's TTPs and used malware, so let's dig deeper through open sources.</p>\n<p><a href=\"https://www.threatminer.org/\">https://www.threatminer.org</a> has a great capability of including related malware samples when searching for information about an IP address. This is what we will come across while searching for information about <strong>23.22.63.114</strong> on <strong>threatminer.org</strong>.</p>\n<p><img alt=\"30\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/30.png\" /></p>\n<p>We can then submit these MD5 hashes to open sources like threatminer, VirusTotal or hybrid-analysis.com to identify additional metadata about the sample(s).</p>\n<p><img alt=\"31\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/31.png\" /></p>\n<p>The APT group may create mutants, so hashes may not prove useful. We should note down that filename though in case they keep that.</p>\n<p>Below are our findings so far.</p>\n<p><img alt=\"32\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/32.png\" /></p>\n<h2>Task 4: Identify any exploitation activities on your network through Splunk searches</h2>\n<p>It is about time we go back to Splunk to identify any exploitation activities. Let's start by identifying source IP addresses that are associated with the largest number of http events. We can do that, as follows.</p>\n<pre class=\"codehilite\"><code>index=botsv1 sourcetype=stream:http dest_ip=\"192.168.250.70\" http_method=POST</code></pre>\n\n<p>The <strong>src</strong> field contains what we are looking for. We specified that we are interested in POST requests since logins are usually performed through POST requests (more on that in a bit).</p>\n<p><img alt=\"33\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/33.jpg\" /></p>\n<p>Let's take a look at those POST requests made by <strong>40.80.148.42</strong></p>\n<pre class=\"codehilite\"><code>index=botsv1 sourcetype=stream:http dest_ip=\"192.168.250.70\" http_method=POST src_ip=\"40.80.148.42\"</code></pre>\n\n<p>The <strong>form_data</strong> field contains information that we want to check when dealing with POST requests.</p>\n<p><img alt=\"33_1\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/33_1.jpg\" /></p>\n<p>Nothing to justify successful exploitation activities. Let's check <strong>23.22.63.114</strong>.</p>\n<pre class=\"codehilite\"><code>index=botsv1 sourcetype=stream:http dest_ip=\"192.168.250.70\" http_method=POST src_ip=\"23.22.63.114\"</code></pre>\n\n<p><img alt=\"34\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/34.jpg\" /></p>\n<p>It looks like <strong>23.22.63.114</strong> is brute forcing the web server's authentication.</p>\n<p>Let's make sure, as follows.</p>\n<pre class=\"codehilite\"><code>index=botsv1 sourcetype=stream:http dest_ip=\"192.168.250.70\" http_method=POST form_data=*username*passwd* | stats count by src_ip</code></pre>\n\n<p><img alt=\"35\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/35.jpg\" /></p>\n<p>Indeed <strong>23.22.63.114</strong> performed a brute force attack against the web server's authentication.</p>\n<p>We are quite interested in knowing if the brute force attack was successful. We can determine that, as follows.</p>\n<p><pre class=\"codehilite\"><code>index=botsv1 sourcetype=stream:http form_data=*username*passwd* dest_ip=192.168.250.70 | rex field=form_data \"passwd=(?&lt;userpassword&gt;\\w+)\" | stats count by userpassword | sort - count</code></pre>\n<img alt=\"36\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/36.jpg\" /></p>\n<p>The search above extracts every user password and counts the times it has been seen/used. If a password is seen more than one time, this probably means that attackers got a hit and used the password again to log in. This is why we are sorting on count.</p>\n<p>If we want to get an idea of the time of the compromise and the URI that was targeted, we can do that as follows.</p>\n<pre class=\"codehilite\"><code>index=botsv1 sourcetype=stream:http form_data=*username*passwd* dest_ip=192.168.250.70 src_ip=40.80.148.42 | rex field=form_data \"passwd=(?&lt;userpassword&gt;\\w+)\"| search userpassword=* | table _time uri userpassword</code></pre>\n\n<p><img alt=\"37\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/37.jpg\" /></p>\n<p>Finally, if we want to view the two successful logins we can do so, as follows.</p>\n<pre class=\"codehilite\"><code>index=botsv1 sourcetype=stream:http | rex field=form_data \"passwd=(?&lt;userpassword&gt;\\w+)\" | search userpassword=batman | table _time userpassword src_ip</code></pre>\n\n<p><img alt=\"38\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/38.jpg\" /></p>\n<p>Below are our findings so far.</p>\n<p><img alt=\"39\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/39.png\" /></p>\n<p><img alt=\"40\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/40.png\" /></p>\n<h2>Task 5: Identify any installation activities on your network through Splunk searches</h2>\n<p>As far as the installation phase of the cyber kill chain is concerned, we are mostly interested in identifying any malware being uploaded.</p>\n<p>We can identify that through various sourcetypes, specifically, <strong>stream:http</strong> and <strong>Suricata</strong>.</p>\n<p><pre class=\"codehilite\"><code>index=botsv1 sourcetype=stream:http dest_ip=\"192.168.250.70\" *.exe</code></pre>\nThe <strong>part_filename{}</strong> field contains the information we want to check. It won't be visible by default, so add it.</p>\n<p><img alt=\"41\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/41.png\" /></p>\n<p><img alt=\"42\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/42.jpg\" /></p>\n<pre class=\"codehilite\"><code>index=botsv1 sourcetype=suricata (dest=imreallynotbatman.com OR dest=\"192.168.250.70\") http.http_method=POST .exe</code></pre>\n\n<p>The <strong>fileinfo.filename</strong> field contains the information we want to check.</p>\n<p><img alt=\"43\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/43.jpg\" /></p>\n<p><strong>3791.exe</strong> must be the uploaded malware.</p>\n<p>The source from where the file was uploaded can easily be identified, as follows.</p>\n<pre class=\"codehilite\"><code>index=botsv1 sourcetype=suricata dest_ip=\"192.168.250.70\" http.http_method=POST .exe</code></pre>\n\n<p><img alt=\"44\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/44.jpg\" /></p>\n<p>It would be great if we could also identify the hash of the uploaded file. But what sourcetype should we use? Let's find out, as follows.</p>\n<pre class=\"codehilite\"><code>index=botsv1 3791.exe</code></pre>\n\n<p><img alt=\"45\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/45.jpg\" /></p>\n<p>Sysmon is a good candidate since it logs information such as MD5, SHA1 and SHA256 hashes of files.</p>\n<pre class=\"codehilite\"><code>index=botsv1 3791.exe sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational</code></pre>\n\n<p><img alt=\"46\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/46.jpg\" /></p>\n<p>The important fields, in this case, are <strong>Hashes</strong>, <strong>CommandLine</strong> and <strong>ParentCommandLine</strong>. You will have to add the last two ones since they are not visible by default.</p>\n<p>Before analyzing the results, let's narrow things down a little bit.</p>\n<pre class=\"codehilite\"><code>index=botsv1 3791.exe sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational EventCode=1</code></pre>\n\n<p><img alt=\"47\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/47.jpg\" /></p>\n<p>The search above includes EventCode 1 since this EventCode is related to process creation events. Unfortunately, to get the MD5 hash of the uploaded file, we need to narrow things down even further. Specifically, we will need to search for 3791.exe inside the command line field, since this field captures the process starting.</p>\n<p>So, the final search is the following.</p>\n<pre class=\"codehilite\"><code>index=botsv1 3791.exe CommandLine=3791.exe | stats values(md5)</code></pre>\n\n<p><img alt=\"48\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/48.jpg\" /></p>\n<p>Below are our findings so far.</p>\n<p><img alt=\"49\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/49.png\" /></p>\n<p><img alt=\"50\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/50.png\" /></p>\n<h2>Task 6: Identify any command and control-related activities on your network through Splunk searches</h2>\n<p>As far as the Command and Control phase of the cyber kill chain is concerned, we are mostly interested in identifying any domain used for command and control purposes.</p>\n<p>We have a powerful ally inside Splunk to assist us in answering such questions. This ally is the <strong>stream.dns</strong> sourcetype. Since we already know that <strong>23.22.63.114</strong> is of concern, we can utilize Splunk and the <strong>stream.dns</strong> sourcetype to identify DNS events where <strong>22.23.63.114</strong> was the answer.</p>\n<pre class=\"codehilite\"><code>index=botsv1 sourcetype=stream:dns 23.22.63.114 | stats values(\"name{}\")</code></pre>\n\n<p><img alt=\"51\" src=\"https://assets.ine.com/content/ptp/Effectively_Using_Splunk_Scenario_1/51.jpg\" /></p>\n<p>If you look carefully enough, you will identify that the <strong>prankglassinebracket.jumpingcrab.com</strong> domain has been used by attackers to deface the web server. Give it a try...</p>\n<p><strong>References:</strong></p>\n<ol>\n<li>\n<p><a href=\"https://www.slideshare.net/Splunk/splunk-data-onboarding-overview-splunk-data-collection-architecture\">https://www.slideshare.net/Splunk/splunk-data-onboarding-overview-splunk-data-collection-architecture</a></p>\n</li>\n<li>\n<p><a href=\"https://www.splunk.com/en_us/training.html\">https://www.splunk.com/en_us/training.html</a></p>\n</li>\n</ol>",
    "flags": [],
    "min_points_to_pass": null,
    "access_type": "default",
    "user_status": "unstarted",
    "user_lab_status": null,
    "user_status_modified": null,
    "user_flags": [],
    "global_running_session": {
        "id": "c3de86a5-32f0-4dbb-9511-a5a591515e52",
        "user_id": "5dde02c1-353c-4e44-af4d-e217c38efd6a",
        "lab": {
            "id": "ad7c1ba5-4f43-39d6-87fb-be25e6623608",
            "name": "XSS Attack with XSSer",
            "lab_type": "pta"
        },
        "pta_url": "https://jznfpnoy8i385wsg90w9sfzb8.us-east-4.attackdefensecloudlabs.com",
        "last_started_at": "2024-06-21T18:53:01.159725Z",
        "terminated_at": null,
        "running_time": 10179,
        "metadata": {
            "layout": "en-us-qwerty",
            "region": "US-East",
            "context": {
                "parent_id": "ec4e1013-09f0-486a-acea-ee4936e2cf7f",
                "parent_name": "Web Application Penetration Testing: Introduction to the Web and HTTP Protocol",
                "parent_type": "course"
            }
        },
        "status": "started",
        "created": "2024-06-21T18:53:01.159766Z",
        "modified": "2024-06-21T21:42:41.002485Z",
        "duration_in_seconds": 10173,
        "shutdown_time": 10800
    }
}