<?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 Rachael Muga on Medium]]></title>
        <description><![CDATA[Stories by Rachael Muga on Medium]]></description>
        <link>https://medium.com/@rachael_muga?source=rss-2fac4eec3c88------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OKsi2QBX_FrlcSDAmsfkxw.jpeg</url>
            <title>Stories by Rachael Muga on Medium</title>
            <link>https://medium.com/@rachael_muga?source=rss-2fac4eec3c88------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 03:39:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rachael_muga/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[SQL Injection Attack: Listing the Database Contents on Non-Oracle Databases: Without Burp Suite…]]></title>
            <link>https://medium.com/@rachael_muga/sql-injection-attack-listing-the-database-contents-on-non-oracle-databases-without-burp-suite-4dff53807b3a?source=rss-2fac4eec3c88------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dff53807b3a</guid>
            <category><![CDATA[sql-union]]></category>
            <category><![CDATA[portswigger-academy-labs]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Rachael Muga]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 08:59:31 GMT</pubDate>
            <atom:updated>2026-10-20T09:03:05.838Z</atom:updated>
            <content:encoded><![CDATA[<h3>SQL Injection Attack: Listing the Database Contents on Non-Oracle Databases: Without Burp Suite (Browser-Only Walkthrough)</h3><p>In my previous write-up I solved this lab the “normal” way, using <strong>Burp Suite Repeater</strong>. 👉 <a href="https://medium.com/@rachael_muga/sql-injection-attack-querying-the-database-type-and-version-portswigger-lab-f84544885955?sharedUserId=rachael_muga">Read here</a></p><p>Then someone asked a fair question:</p><blockquote>“Do I have to use Burp? Is there another method to solve it without using burp suite?”</blockquote><p>Short answer: <strong>for this lab, yes.</strong> The injection point is a <strong>GET</strong> parameter, which means it lives directly in the URL. Anything Burp sends in that request, you can reproduce straight from the address bar. Burp is a convenience here, not a requirement.</p><p>This walkthrough shows the full solution using nothing but the browser.</p><p><strong>Lab</strong>:<a href="https://portswigger.net/web-security/sql-injection/examining-the-database/lab-listing-database-contents-non-oracle"> SQL Injection Attack, Listing the Database Contents on Non-Oracle Databases</a></p><h4>Lab Objective</h4><p>This lab contains a SQL injection vulnerability in the product category filter.</p><p><strong>Goal:</strong><br> Retrieve the usernames and passwords of all users from the database, then log in as the administrator user.</p><h3>Why the UI Works Here</h3><p>When you click a category, look at your address bar:</p><pre>https://YOUR-LAB-ID.web-security-academy.net/filter?category=Gifts</pre><p>That category=Gifts is the injection point. Because it’s part of the URL, we can inject our payload by editing the URL directl</p><h3>What We Already Know (From Previous Labs)</h3><p>This lab builds on the earlier ones, Please review those walkthroughs first, as this lab builds directly on them.</p><ul><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attacks-determining-the-number-of-columns-e311a738ac85?postPublishedType=repub">Determining the number of columns</a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attack-finding-a-column-containing-text-f47c3014063c">Finding which column accepts text</a></li></ul><p>So we already know:</p><ul><li>The query returns <strong>2 columns</strong></li><li><strong>Both columns accept string (text) data</strong></li></ul><p>That means a UNION SELECT col1, col2 payload will work cleanly.</p><h3>Step 1: List the Tables in the Database</h3><p>We query information_schema.tables to see every table name. These labs generate <strong>random table names per instance</strong>, so you need to discover yours, don’t copy mine.</p><pre>Gifts&#39; UNION SELECT table_name, NULL FROM information_schema.tables--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yg-2ROnjkwEXnQ9L51ze8w.png" /></figure><p>Press Enter and scan the response. Among the system tables you’ll spot one that looks like:</p><pre>users_abcdef</pre><p>You can use ctrl+find (ctrl+f)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*YpzSPC7oMx4Kjgk76hokGw.png" /></figure><h3>Step 2: List the Columns in the Users Table</h3><p>Now we ask information_schema.columns which columns that table has.</p><pre>Gifts&#39; UNION SELECT column_name, NULL FROM information_schema.columns WHERE table_name=&#39;users_abcdef&#39;--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZJTNm_ZPQ14CSGGRDUmtJg.png" /></figure><h3>Step 3: Dump the Usernames and Passwords</h3><p>Now put the two columns into our UNION, one per column.</p><pre>Gifts&#39; UNION SELECT username_ghijkl, password_mnopqr FROM users_abcdef--</pre><p>The page now lists every user and their password, including the administrator account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M_thjyhYZYMK2g6U2qkqAw.png" /></figure><h3>Step 4: Log In as Administrator</h3><p>Copy the administrator password, go to the login page, and sign in.</p><p>✅ <strong>Lab Solved</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B7WKAOiFp83MixRcHtC8_w.png" /></figure><h3>Key Takeaways</h3><ul><li><strong>GET-based injections can be solved entirely in the browser</strong> — the payload lives in the URL.</li><li>Use <strong>-- (with a trailing space)</strong> instead of # for the address-bar method; it survives encoding and works across non-Oracle databases.</li><li>Burp isn’t mandatory here, but it’s the right tool once requests get complex or move out of the URL.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dff53807b3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fix“npm: command not found” in Git Bash]]></title>
            <link>https://medium.com/@rachael_muga/fix-npm-command-not-found-in-git-bash-fb032678640f?source=rss-2fac4eec3c88------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb032678640f</guid>
            <category><![CDATA[npm-install]]></category>
            <category><![CDATA[node-installation]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[git-bash]]></category>
            <category><![CDATA[npm-package]]></category>
            <dc:creator><![CDATA[Rachael Muga]]></dc:creator>
            <pubDate>Mon, 14 Sep 2026 11:47:27 GMT</pubDate>
            <atom:updated>2026-09-14T11:47:27.594Z</atom:updated>
            <content:encoded><![CDATA[<p>While working on a project, I needed to install the project’s dependencies.</p><p>I opened Git Bash, navigated to my project directory, and ran:</p><pre>npm install</pre><p>Instead of installing the dependencies, I received the following error:</p><pre>bash: npm: command not found</pre><p>At first, I assumed there was a problem with npm or my project. However, the error was actually related to my development environment.</p><p>In this article, I will walk through how I diagnosed and fixed the npm: command not found error in Git Bash.</p><h3>Understanding the Error</h3><p>npm stands for <strong>Node Package Manager</strong>. It is used to install, manage, and update packages in Node.js projects.</p><p>When we run:</p><pre>npm install</pre><p>npm reads the project’s package.json file and installs the dependencies required by the project.</p><p>The error:</p><pre>bash: npm: command not found</pre><p>means that Git Bash cannot find the npm command.</p><p>There can be several reasons for this, including:</p><ul><li>Node.js is not installed.</li><li>npm is not installed.</li><li>Node.js was installed, but its location was not added to the system PATH.</li><li>Git Bash needs to be restarted after installing Node.js.</li></ul><p>Since I was using Git Bash, the first thing I needed to determine was whether Node.js and npm were installed on my computer.</p><h3>Step 1: Check Whether Node.js Is Installed</h3><p>I checked whether Node.js was available by running:</p><pre>node -v</pre><p>Instead of returning a version number, Git Bash showed that the node command was not found.</p><p>This confirmed that Node.js was not installed on my computer.</p><p>Since npm is installed together with Node.js, the next step was to install Node.js.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*bG3uWbKG1rXH2mycWSpovQ.png" /></figure><h3>Step 2: Download and Install Node.js</h3><p>I downloaded Node.js from the official Node.js website.: <a href="https://nodejs.org/en/download">https://nodejs.org/en/download</a></p><p>I chose the <strong>LTS (Long-Term Support)</strong> version because it is generally the most stable option for development.</p><p>After downloading the installer, I ran it and followed the installation steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*sQ5Aq76UazE8cpc5Z-zwFw.png" /></figure><p>During installation, I kept the default settings and allowed the installer to complete the setup.</p><p>An important part of the installation is ensuring that Node.js is added to the system PATH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*r1rHsA3EcI3BJHAkuHey4g.png" /></figure><p>The PATH environment variable allows terminals and command-line tools, including Git Bash, to locate commands such as:</p><pre>node</pre><p>and:</p><pre>npm</pre><p>Once the installation was complete, I closed Git Bash and opened it again.</p><p>Restarting the terminal is important because an existing terminal session may not immediately recognize changes made to the system PATH.</p><h3>Step 3: Verify the Node.js Installation</h3><p>After reopening Git Bash, I checked whether Node.js was successfully installed:</p><pre>node -v</pre><p>This time, Git Bash returned a version number.</p><p>For example:</p><pre>vXX.X.X</pre><p>The exact version may be different depending on the version of Node.js installed.</p><p>Next, I checked npm:</p><pre>npm -v</pre><p>Git Bash also returned an npm version number.</p><p>For example:</p><pre>X.X.X</pre><p>This confirmed that both Node.js and npm were successfully installed and accessible from Git Bash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*J3mLVSy4q-SeYdd5WdP2ow.png" /></figure><h3>Step 4: Make Sure You Are in the Correct Project Directory</h3><p>After installing Node.js and npm, I ran:</p><pre>npm install</pre><p>However, I encountered a different error:</p><pre>npm error code ENOENT<br>npm error enoent Could not read package.json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*exXMslaFDNYk_TNLNQakew.png" /></figure><p>This error was different from the original:</p><pre>bash: npm: command not found</pre><p>The fact that npm returned an error message meant that npm was now successfully installed and working.</p><p>The new problem was that npm could not find a package.json file in my current directory.</p><p>Before running:</p><pre>npm install</pre><p><strong>make sure you are inside the correct project directory because npm looks for a </strong><strong>package.json file in the current directory.</strong></p><p>The package.json file contains important information about a Node.js project, including its dependencies and scripts.</p><p>To check the files in the current directory, I ran:</p><pre>ls</pre><p>If the package.json file is not listed, you are likely in the wrong directory.</p><p>You can move into the correct project directory using:</p><pre>cd path/to/your/project</pre><p>Then check the directory again:</p><pre>ls</pre><p>Once you can see:</p><pre>package.json</pre><p>you can run:</p><pre>npm install</pre><h3>Step 5: Run npm install Again</h3><p>With Node.js and npm successfully installed, I ran:</p><pre>npm install</pre><p>This time, Git Bash recognized the command.</p><p>npm began reading the project’s package.json file and installing the required dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/168/1*Us0pFMNcUC0kRzwLPr_bVA.png" /></figure><p>After the installation was complete, the project dependencies were available in the project directory.</p><p>Depending on the project, npm may create or update files such as:</p><pre>node_modules/<br>package-lock.json</pre><p>The node_modules directory contains the installed project dependencies.</p><p>The package-lock.json file helps keep track of the exact versions of installed packages.</p><h3>What If npm Is Still Not Found?</h3><p>If Node.js has been installed but Git Bash still displays:</p><pre>bash: npm: command not found</pre><p>there are a few things to check.</p><h3>1. Restart Git Bash</h3><p>Close all open Git Bash windows and open Git Bash again.</p><p>Then run:</p><pre>node -v<br>npm -v</pre><h3>2. Check Whether Windows Can Find Node.js</h3><p>You can also check whether Node.js is available using the Windows Command Prompt or PowerShell.</p><p>Run:</p><pre>node -v<br>npm -v</pre><p>If the commands work in PowerShell or Command Prompt but not in Git Bash, the issue may be related to the terminal environment or the system PATH.</p><h3>3. Check the Node.js Installation Location</h3><p>On Windows, Node.js is commonly installed in a directory similar to:</p><pre>C:\Program Files\nodejs\</pre><p>Git Bash needs access to this location through the Windows PATH environment variable.</p><p>After updating the PATH, restart Git Bash and try the commands again.</p><h3>What I Learned</h3><p>The error:</p><pre>bash: npm: command not found</pre><p>was not caused by my project or by the npm install command itself.</p><p>The problem was that Node.js was not installed on my computer.</p><p>Since npm is included with Node.js, installing Node.js solved the problem.</p><p>My troubleshooting process was:</p><ol><li>Run the command that caused the error.</li><li>Identify the missing command.</li><li>Check whether Node.js is installed.</li><li>Install Node.js.</li><li>Restart Git Bash.</li><li>Verify Node.js using node -v.</li><li>Verify npm using npm -v.</li><li>Run npm install again.</li></ol><h3>Conclusion</h3><p>When I first encountered:</p><pre>bash: npm: command not found</pre><p>in Git Bash, the problem appeared to be related to npm.</p><p>However, after checking my environment, I discovered that Node.js was not installed.</p><p>Installing Node.js also installed npm. After restarting Git Bash and verifying the installation, I was able to run:</p><pre>npm install</pre><p>successfully.</p><p>The key lesson is that when a terminal says command not found, the first step should be to check whether the software that provides that command is installed and available in your system&#39;s PATH.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb032678640f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Injection Attack: Listing the Contents of the Database {Non-Oracle Databases}(Portswigger Lab)]]></title>
            <link>https://medium.com/@rachael_muga/sql-injection-uattack-listing-the-contents-of-the-database-non-oracle-databases-portswigger-lab-b96dbe7855a7?source=rss-2fac4eec3c88------2</link>
            <guid isPermaLink="false">https://medium.com/p/b96dbe7855a7</guid>
            <category><![CDATA[sqli-union-attack]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[sql-injection]]></category>
            <dc:creator><![CDATA[Rachael Muga]]></dc:creator>
            <pubDate>Mon, 19 Jan 2026 12:49:26 GMT</pubDate>
            <atom:updated>2026-01-19T13:01:57.495Z</atom:updated>
            <content:encoded><![CDATA[<h3>SQL Injection UNION Attack: Listing the Contents of the Database {Non-Oracle Databases}(Portswigger Lab)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ym6tGDgyo9_blGb9" /></figure><p>After identifying the database type and confirming a UNION-based SQL injection, the next logical step is <strong>enumerating the database structure</strong>.</p><p>In real-world attacks, you rarely know:</p><ul><li>Table names</li><li>Column names</li><li>Where credentials are stored</li></ul><p>Fortunately, most modern databases (except Oracle) expose metadata through a special set of views called the <strong>information schema</strong>.</p><p>These views allow us to:</p><ul><li>List all tables in the database</li><li>List all columns inside a specific table</li><li>Target the exact table that stores usernames and passwords</li></ul><p>This lab demonstrates that full process end-to-end.</p><h3>Lab Overview</h3><p><strong>Lab:</strong> SQL injection attack, listing the database contents on non-Oracle databases</p><p>This lab contains a SQL injection vulnerability in the <strong>product category filter</strong>. The results of the query are returned in the application’s response, allowing UNION-based injection.</p><p>🎯 <strong>Goal:</strong><br>Identify the table storing user credentials, extract usernames and passwords, and log in as the <strong>administrator</strong> user.</p><h3>Database Metadata: The Information Schema</h3><p>Most non-Oracle databases (MySQL, PostgreSQL, Microsoft SQL Server) provide an <strong>information schema</strong>, which contains metadata about the database itself.</p><p>Common views include:</p><ul><li>information_schema.tables → lists all tables</li><li>information_schema.columns → lists all columns for each table</li></ul><p>📌 Oracle does <strong>not</strong> support information_schema. Instead, it uses views like:</p><ul><li>all_tables</li><li>all_tab_columns</li></ul><p>Full reference: <a href="https://portswigger.net/web-security/sql-injection/cheat-sheet">PortSwigger SQL Injection Cheat Sheet</a></p><h3>Initial Setup</h3><ul><li>Open <strong>Burp Suite</strong></li><li>Go to <strong>Proxy → Intercept → Turn Intercept off</strong></li><li>Click <strong>Open Browser</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kOC0sKk8-M35dgMo36yGQg.png" /></figure><ul><li>Open the lab URL</li><li>Click any category (e.g. Accessories)</li></ul><h3>Sending the Request to Repeater</h3><ul><li>Go back to <strong>Burp Suite</strong></li><li>Open the <strong>HTTP history</strong> tab</li><li>Find the request:</li></ul><pre>GET /filter?category=Accessories</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H3QA9oP39fxf28jfM4SSwA.png" /></figure><ul><li>Right-click → <strong>Send to Repeater</strong></li><li>Go to the <strong>Repeater</strong> tab</li><li>Send the request and view the response</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iWpU8dPtLEY7-7Wq2mOGvQ.png" /></figure><h3>Prerequisites (From Previous Labs)</h3><p>This lab assumes you already know how to:</p><ul><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attacks-determining-the-number-of-columns-e311a738ac85?postPublishedType=repub">Determine the <strong>number of columns</strong></a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attack-finding-a-column-containing-text-f47c3014063c">Identify <strong>which columns accept string data</strong></a></li></ul><p>📌 If you missed those labs, review them first, this attack builds directly on that knowledge.</p><h3>Step 1: Listing All Tables</h3><p>Since the lab hint tells us this is a <strong>non-Oracle database</strong>, we use information_schema.tables.</p><h4>Payload Used</h4><pre>&#39; UNION SELECT table_name, NULL FROM information_schema.tables--</pre><h3>Why This Works</h3><ul><li>table_name retrieves the names of all tables in the database</li><li>NULL is a placeholder to match the second column</li><li>The UNION merges table names into the original query results</li></ul><h3>Why Double Quotes Cause an Error</h3><p>If you try:</p><pre>&quot;users&quot;</pre><p>Instead of:</p><pre>&#39;users&#39;</pre><p>You may get an error because:</p><ul><li>Many databases treat <strong>double quotes as identifiers</strong> (column or table names)</li><li><strong>Single quotes</strong> are required for <strong>string literals</strong></li></ul><p>That’s why table filters must use <strong>single quotes</strong>.</p><h3>Step 2: Identifying the Users Table</h3><p>From the output, several tables appear. One of them clearly contains user data, for example:</p><p>This is our target table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iyoB16w_xb_8n_EK98Al1g.png" /></figure><h3>Step 3: Listing Columns in the Users Table</h3><p>Now that we know the table name, we enumerate its columns using information_schema.columns.</p><h4>Payload Used</h4><pre>&#39; UNION SELECT column_name, NULL FROM information_schema.columns WHERE table_name=&#39;table-name-you-found&#39;--</pre><h3>Result</h3><p>The response reveals two important columns:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m2WqMiE8vF7j0U20Zr9bvg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VZPPNXaH_e-BhnXTeM6bSg.png" /></figure><p>These are the credential fields.</p><h3>Step 4: Extracting Usernames and Passwords</h3><p>Now that we know:</p><ul><li>The table name</li><li>The exact column names</li></ul><p>We can retrieve the actual credentials.</p><h4>Payload Used</h4><pre>&#39; UNION SELECT username-column-you-found, password-name-you-found FROM users-table-you-found--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g3o3m_46YZaBINwVk0Eo7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*veGc5fuBh8w3N1Yfbwf3-w.png" /></figure><h3>Step 5: Logging In as Administrator</h3><ul><li>Go back to the browser</li><li>Navigate to <strong>My Account</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*A2j7OdhXBIoJM5JyEFIy1A.png" /></figure><ul><li>Use the <strong>administrator</strong> username and password obtained from the injection</li><li>Log in</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LNYv3bm3j8mkgkr7gQpj4Q.png" /></figure><p>✅ <strong>Lab Solved</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*V9HJo6YgwOZ35G4b9xk_FA.png" /></figure><h3>Key Takeaways</h3><ul><li>Metadata enumeration is critical for real-world SQL injection</li><li>information_schema allows attackers to map the database without guessing</li><li>Single quotes are required for string comparisons</li><li>SQL injection is a <strong>methodology</strong>, not just payloads:</li><li>Identify DB type, Enumerate tables, Enumerate columns, Extract data, Abuse functionality (login)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b96dbe7855a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Injection UNION Attack: Querying the Database Type and Version on MySQL and MS (Portswigger…]]></title>
            <link>https://medium.com/@rachael_muga/sql-injection-attack-querying-the-database-type-and-version-portswigger-lab-f84544885955?source=rss-2fac4eec3c88------2</link>
            <guid isPermaLink="false">https://medium.com/p/f84544885955</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[Rachael Muga]]></dc:creator>
            <pubDate>Mon, 19 Jan 2026 10:40:48 GMT</pubDate>
            <atom:updated>2026-01-21T23:47:26.725Z</atom:updated>
            <content:encoded><![CDATA[<h3>SQL Injection UNION Attack: Querying the Database Type and Version on MySQL and MicroSoft(Portswigger Lab)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/0*hMDnNQLkOklQGikk" /></figure><p>Before extracting sensitive data with SQL injection, one critical step is identifying <strong>what database the application is using</strong>.</p><p>Different databases (MySQL, Microsoft SQL Server, Oracle, PostgreSQL) have:</p><ul><li>Different system tables</li><li>Different functions</li><li>Different syntax rules</li></ul><p>If you use the wrong syntax, your payload will fail, even if the injection point exists.</p><p>This lab focuses on using a <strong>UNION-based SQL injection</strong> to retrieve the <strong>database version string</strong>, which also reveals the database type.</p><p><strong>Lab:</strong> <a href="https://portswigger.net/web-security/sql-injection/examining-the-database/lab-listing-database-contents-non-oracle">SQL Injection UnionAttack: Querying the Database Type and Version</a></p><h3>Lab Objective</h3><p>This lab contains a SQL injection vulnerability in the <strong>product category filter</strong>.</p><p><strong>Goal:</strong><br> Display the <strong>database version string</strong> in the application’s response.</p><h3>Common Database Version Queries</h3><p>The exact query used depends on the database:</p><ul><li><strong>MySQL / Microsoft SQL Server</strong></li></ul><pre>SELECT @@version</pre><ul><li><strong>PostgreSQL</strong></li></ul><pre>SELECT version()</pre><ul><li><strong>Oracle</strong></li></ul><pre>SELECT * FROM v$version</pre><p>(Oracle always requires a FROM clause; it often uses the built-in dual table.)</p><p>📌 Full reference: <a href="https://portswigger.net/web-security/sql-injection/cheat-sheet">PortSwigger SQL Injection Cheat Sheet</a></p><h3>Initial Setup</h3><ul><li>Open <strong>Burp Suite</strong></li><li>Go to <strong>Proxy → Intercept → Turn Intercept off</strong></li><li>Click <strong>Open Browser</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EoRfD726YvKOyxypJQAyBA.png" /></figure><ul><li>Open the lab URL</li><li>Click on any category (e.g. <strong>Lifestyle</strong>)</li></ul><p>At the top of the page, the lab instructs us to retrieve a string similar to:</p><pre>8.0.42-0ubuntu0.20.04.1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*kqJEwTnoA9KjlhHPpTWVyw.png" /></figure><p>A quick lookup (or experience) tells us this version format belongs to <strong>MySQL</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*wGBGnPsQsotUOt39Rs7kdA.png" /></figure><p>That means:<br> 👉 We should use @@version in our payload.</p><h3>Sending the Request to Repeater</h3><ul><li>Go back to <strong>Burp Suite</strong></li><li>Open the <strong>HTTP history</strong> tab</li><li>Find the request:</li></ul><pre>GET /filter?category=Lifestyle</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JC1nPIK6HuOgHdtBLzxCTQ.png" /></figure><ul><li>Right-click → <strong>Send to Repeater</strong></li><li>Go to the <strong>Repeater</strong> tab</li><li>Send the request and view the response in the <strong>Render</strong> tab</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VMoot7beS17an1pnd4vUFg.png" /></figure><blockquote><em>📌 If you missed the previous labs on:</em></blockquote><ul><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attacks-determining-the-number-of-columns-e311a738ac85?postPublishedType=repub">Determining the number of columns</a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attack-finding-a-column-containing-text-f47c3014063c">Finding which column accepts text</a></li></ul><p>Please review those walkthroughs first, as this lab builds directly on them.</p><h3>What We Already Know (From Previous Labs)</h3><p>From earlier walkthroughs, we already identified that:</p><ul><li>The query returns <strong>2 columns</strong></li><li><strong>Both columns accept string data</strong></li></ul><p>This means:</p><ul><li>We can safely inject text into either column</li><li>A UNION-based payload will work</li></ul><h3>Performing the UNION Attack</h3><p>Initial attempt using standard SQL comments (--) resulted in an error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kL3yG09I9eFKvNEzmnm0AQ.png" /></figure><p>This is an important learning moment.</p><h4>Why (--) Didn’t Work</h4><p>In <strong>MySQL</strong>, the -- comment syntax:</p><ul><li>Requires a <strong>space or newline after it</strong></li><li>Or may be restricted depending on how the query is constructed</li></ul><p>However, MySQL also supports another comment style:</p><pre>#</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iC5llxASkfkvEh7B0s6i-Q.png" /></figure><h3>Working Payload (MySQL)</h3><pre>GET /filter?category=Lifestyle&#39; UNION SELECT @@version, NULL#</pre><h3>How This Payload Works</h3><ul><li>&#39;:Closes the original string in the SQL query.</li><li>UNION SELECT:Appends a new row to the original query’s results.</li><li>@@version:Returns the database version string (MySQL-specific).</li><li>NULL:Placeholder for the second column.</li><li>#:Comments out the rest of the original SQL query to prevent syntax errors.</li></ul><h3>Result</h3><p>The page now displays:</p><pre>8.0.42-0ubuntu0.20.04.1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*REnh_to20ecB4AIQLVD83Q.png" /></figure><p>✅ <strong>Lab Solved</strong></p><h3>Key Takeaways</h3><ul><li>Identifying the <strong>database type</strong> is essential before further exploitation</li><li>Different databases require <strong>different syntax</strong></li><li>Comment styles matter:</li></ul><p>a. -- may fail depending on spacing or backend handling</p><p>b. # is often safer in MySQL</p><ul><li>UNION-based SQL injection is extremely powerful when query results are reflected</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f84544885955" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Injection UNION Attack: Retrieving Multiple Values in a Single Column (Portswigger Lab)]]></title>
            <link>https://medium.com/@rachael_muga/sql-injection-union-attack-retrieving-multiple-values-in-a-single-column-portswigger-lab-21ae92c51e7c?source=rss-2fac4eec3c88------2</link>
            <guid isPermaLink="false">https://medium.com/p/21ae92c51e7c</guid>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <dc:creator><![CDATA[Rachael Muga]]></dc:creator>
            <pubDate>Thu, 15 Jan 2026 10:55:48 GMT</pubDate>
            <atom:updated>2026-01-15T10:55:48.919Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/525/0*blrWzwmV632b6Vgv" /></figure><p>In the previous lab, we learned how to retrieve data from another table using a UNION-based SQL injection when <strong>each column could be displayed separately</strong>.</p><p>However, real-world applications don’t always make this easy.</p><p>Sometimes:</p><ul><li>The query returns <strong>only one visible column</strong></li><li>Only <strong>one column accepts string data</strong></li></ul><p>In such cases, we still need a way to extract <strong>multiple values</strong> (like usernames and passwords) through <strong>a single output column</strong>.</p><p>That’s where <strong>string concatenation</strong> comes in.</p><blockquote><em>📌 If you missed the previous labs on:</em></blockquote><ul><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attacks-determining-the-number-of-columns-e311a738ac85?postPublishedType=repub">Determining the number of columns</a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attack-finding-a-column-containing-text-f47c3014063c">Finding which column accepts text</a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attack-retrieving-data-from-other-tables-portswigger-lab-27e73fd32ba0">Retrieving data from other tables</a></li></ul><p>Please review those walkthroughs first, as this lab builds directly on them.</p><h3>Lab Overview</h3><p><strong>Lab:</strong> <a href="https://portswigger.net/web-security/sql-injection/union-attacks/lab-retrieve-multiple-values-in-single-column">SQL injection UNION attack, retrieving multiple values in a single column</a></p><p>This lab contains a SQL injection vulnerability in the <strong>product category filter</strong>. The results of the SQL query are returned in the application’s response, allowing us to perform a UNION-based attack.</p><p>The database contains a table called:</p><ul><li><strong>users</strong></li></ul><p>With the following columns</p><ul><li>username</li><li>password</li></ul><p>🎯 <strong>Goal:</strong><br> Retrieve all usernames and passwords and use them to log in as the <strong>administrator</strong> user.</p><h3>Initial Setup</h3><ul><li>Open <strong>Burp Suite</strong></li><li>Go to <strong>Proxy → Intercept → Turn Intercept off → </strong>Click <strong>Open Browser</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umibvV6znhHpK4cTp6gmOQ.png" /></figure><ul><li>Open the lab URL <strong>→ </strong>Click on any category (e.g. <strong>Gifts</strong>)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*fTA2iGiO7PaeBxirZWe81A.png" /></figure><h3>Sending the Request to Repeater</h3><ol><li>Go back to <strong>Burp Suite</strong></li><li>Open the <strong>HTTP history</strong> tab</li><li>Find the request:</li></ol><pre>GET /filter?category=Gifts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Honnl-g59I3iETVACvIuSw.png" /></figure><ul><li>Right-click the request → <strong>Send to Repeater </strong>→ Go to the <strong>Repeater</strong> tab</li><li>Send the request and view the response in the <strong>Render</strong> tab</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqLl-GLi-hL2yMQunTCYJg.png" /></figure><h3>What We Already Know (From Previous Labs)</h3><p>From earlier walkthroughs, we already identified that:</p><ol><li>The query returns <strong>2 columns</strong></li><li><strong>Only one column accepts string data</strong></li></ol><p>This means:</p><ul><li>We <strong>cannot</strong> retrieve username and password in separate columns</li><li>We <strong>must combine them into a single column</strong></li></ul><h3>Retrieving Multiple Values Using Concatenation</h3><p>To extract both values in one column, we use <strong>string concatenation</strong>.</p><p>In many databases (including this lab), concatenation is done using the || operator.</p><p>We also add a separator (~) so the output is readable.</p><h4>Payload Used</h4><pre>GET /filter?category=Gifts&#39; UNION SELECT NULL, username||&#39;~&#39;||password FROM users--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O_3YvN_CtCkmZATzKRfSiQ.png" /></figure><h3>How This Payload Works</h3><ul><li>&#39;: Closes the original string in the SQL query.</li><li>UNION SELECT: Appends a new result set to the original query.</li><li>NULL: Placeholder for the first column (since it does not accept text).</li><li>username||&#39;~&#39;||password: Concatenates the username and password into <strong>one string</strong>, separated by ~.</li><li>FROM users: Specifies the table we want to extract data from.</li><li>--: Comments out the rest of the original SQL query to avoid syntax errors.</li></ul><h3>Extracting Credentials</h3><p>After sending the payload:</p><ul><li>The page displays multiple entries in the format: username~password</li><li>Among them, we find the <strong>administrator</strong> credentials.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*npFKAVeOZwx5us13NkaxCA.png" /></figure><h3>Logging In as Administrator</h3><ul><li>Go back to the browser</li><li>Navigate to <strong>My Account</strong></li><li>Enter the administrator username and password obtained from the injection</li><li>Log in</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m3CRssX8SAnEcydt_LAvIA.png" /></figure><p>✅ <strong>Lab Solved</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJ_31ObP4ybRtSqxEgvvlA.png" /></figure><h3>Key Takeaways</h3><ul><li>Even when only <strong>one column</strong> is reflected, you can still extract <strong>multiple values</strong></li><li>String concatenation is essential for advanced UNION attacks</li><li>Understanding database output behavior is critical for real-world exploitation</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21ae92c51e7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL injection UNION attack, retrieving data from other tables( Portswigger Lab)]]></title>
            <link>https://medium.com/@rachael_muga/sql-injection-union-attack-retrieving-data-from-other-tables-portswigger-lab-27e73fd32ba0?source=rss-2fac4eec3c88------2</link>
            <guid isPermaLink="false">https://medium.com/p/27e73fd32ba0</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[sqli-union-attack]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Rachael Muga]]></dc:creator>
            <pubDate>Mon, 12 Jan 2026 13:12:31 GMT</pubDate>
            <atom:updated>2026-01-15T11:06:16.443Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*bBdWPIaOWbsLuzwt" /></figure><p>In the previous UNION-based SQL injection labs, we focused on two critical preparatory steps:</p><ol><li>Determining the <strong>number of columns</strong> returned by the vulnerable query : <a href="https://medium.com/@rachael_muga/sql-injection-union-attacks-determining-the-number-of-columns-e311a738ac85?postPublishedType=repub">SQL Injection UNION Attacks: Determining the Number of Columns</a></li><li>Identifying <strong>which columns accept string data: </strong><a href="https://medium.com/@rachael_muga/sql-injection-union-attack-finding-a-column-containing-text-f47c3014063c">SQL injection UNION attack, finding a column containing text</a></li></ol><p>These steps are not the goal on their own, they are <strong>setup work</strong>. The real objective of a UNION attack is to retrieve <em>interesting data</em> from the database, such as usernames and passwords.</p><p>In this lab, we’ll bring everything together and use a UNION-based SQL injection to extract credentials from another table in the database.</p><blockquote><em>⚠️ If you haven’t yet learned how to identify the number of columns or string-compatible columns, review the earlier walkthroughs before continuing.</em></blockquote><h4>What Problem Are We Solving?</h4><p>When exploiting SQL injection, you often want to retrieve data from <strong>tables you don’t control, </strong>for example, a users table.</p><p>To do that, you must know: The <strong>table name </strong>and<strong> </strong>The <strong>column names. So </strong>that the injected query matches the <strong>same number of columns and data types</strong></p><p>Guessing table and column names blindly would be slow and unreliable. Luckily, modern databases expose metadata that allows attackers to systematically discover database structure, something you’ll explore more deeply in later labs.</p><p>In this lab, however, PortSwigger already tells us the table and column names, so we can focus on constructing the attack.</p><h3>Lab Overview</h3><p><strong>Lab:</strong> <a href="https://portswigger.net/web-security/sql-injection/union-attacks/lab-retrieve-data-from-other-tables">SQL injection UNION attack, retrieving data from other tables</a></p><p><strong>Vulnerability location:</strong> Product category filter</p><p><strong>What we’re given:</strong></p><ul><li>A table named users</li><li>Columns named username and password</li></ul><p><strong>Goal:</strong></p><ul><li>Retrieve all usernames and passwords</li><li>Use the credentials to log in as the administrator user</li></ul><h4>What We Already Know (From Previous Labs)</h4><p>We will skip the initial discovery steps because they were covered earlier:</p><h3>✔ Number of columns</h3><ul><li>The original query returns <strong>2 columns</strong></li></ul><p>How to identify the columns please reference this writeup: <a href="https://medium.com/@rachael_muga/sql-injection-union-attacks-determining-the-number-of-columns-e311a738ac85?postPublishedType=repub">SQL Injection UNION Attacks: Determining the Number of Columns</a></p><h3>✔ Columns that accept string data</h3><ul><li><strong>Both columns</strong> accept string values</li></ul><p>How to check that, please refernce this walkthrough: <a href="https://medium.com/@rachael_muga/sql-injection-union-attack-finding-a-column-containing-text-f47c3014063c">SQL injection UNION attack, finding a column containing text</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h28YFQs4CFOnbPtS3GroKQ.png" /></figure><p>This is important because:</p><ul><li>The users table has <strong>exactly two columns</strong> (username, password)</li><li>Both are string-based</li><li>This perfectly matches the structure of the original query</li></ul><p>At this point, all UNION requirements are satisfied.</p><h4>Constructing the UNION Payload</h4><p>Since we know:</p><ul><li>The table name: users</li><li>The column names: username, password</li><li>The query expects <strong>2 columns</strong></li></ul><p>We can now directly inject a UNION query that pulls data from the users table.</p><h4>Payload</h4><pre>&#39; UNION SELECT username, password FROM users--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*--bPgalRdCS08-GygE5DLQ.png" /></figure><h4>Why This Works (Step by Step)</h4><p>Let’s break it down carefully:</p><p>&#39; :Closes the original string in the SQL query:</p><pre>UNION SELECT username, password FROM users</pre><p>Appends a second query to the original one, telling the database:</p><blockquote><em>“Along with the normal product results, also return usernames and passwords from the users table.”</em></blockquote><p>Because:</p><ul><li>The column count matches (2 columns)</li><li>The data types match (strings)</li><li>The results are rendered in the response</li></ul><p>…the application displays the credentials on the page.</p><h3>Observing the Result</h3><p>After sending the request, going back to “Raw” SEction on your repeater:</p><ul><li>The response contains a list of usernames and passwords</li><li>One of the returned users is <strong>administrator</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wlLKwn0P2H5gqiYZIJW1mg.png" /></figure><p>At this point, the SQL injection phase is complete.</p><h3>Logging in as Administrator</h3><ul><li>Copy the administrator’s username and password from the response</li><li>Go back to the browser</li><li>Navigate to <strong>My Account</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*8u8Tb8DuKc917yNhF1vFSQ.png" /></figure><ul><li>Enter the extracted credentials</li><li>Log in</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXpN_HoQ5h2OC4vDZktlHw.png" /></figure><h4>✅ Lab Solved</h4><p>You’ve successfully:</p><ul><li>Used a UNION-based SQL injection</li><li>Retrieved sensitive data from another table</li><li>Leveraged that data to authenticate as an administrator</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CoSdCIaxn4rk-6peTG8IRQ.png" /></figure><p>This lab demonstrates the <strong>real power</strong> of SQL injection: not just bypassing filters, but extracting high-value data that leads to full account compromise.</p><h3>Key Takeaway</h3><p>UNION-based SQL injection is a <strong>progressive attack</strong>:</p><ol><li>Identify column count</li><li>Identify string-compatible columns</li><li>Identify tables and columns</li><li>Extract meaningful data</li><li>Escalate access</li></ol><p>In this lab, we saw a scenario where it was possible to retrieve data from other tables because <strong>both columns in the original query accepted string values</strong>. However, real-world systems are not always that straightforward. In many cases, <strong>only one column may accept string data</strong>, while the others reject it. When this happens, you can still retrieve multiple values by <strong>combining (concatenating) columns into a single output</strong>. This technique is demonstrated in the next lab:</p><p><a href="https://medium.com/@rachael_muga/sql-injection-union-attack-retrieving-multiple-values-in-a-single-column-portswigger-lab-21ae92c51e7c?postPublishedType=initial">SQL Injection UNION Attack: Retrieving Multiple Values in a Single Column</a></p><p>Each lab builds directly on the previous one and you’re now firmly past the basics. Good Job!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27e73fd32ba0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Injection UNION Attacks: Determining the Number of Columns (Portswigger Lab)]]></title>
            <link>https://medium.com/@rachael_muga/sql-injection-union-attacks-determining-the-number-of-columns-e311a738ac85?source=rss-2fac4eec3c88------2</link>
            <guid isPermaLink="false">https://medium.com/p/e311a738ac85</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[sqli-union-attack]]></category>
            <category><![CDATA[sql-injection-portswigger]]></category>
            <category><![CDATA[sql-injection]]></category>
            <dc:creator><![CDATA[Rachael Muga]]></dc:creator>
            <pubDate>Mon, 12 Jan 2026 10:30:13 GMT</pubDate>
            <atom:updated>2026-01-12T12:12:03.434Z</atom:updated>
            <content:encoded><![CDATA[<h3>SQL Injection UNION Attacks: Determining the Number of Columns(Portswigger Lab)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*5Wt87WAsa9DHRGff" /></figure><h4>Why UNION-Based SQL Injection Exists</h4><p>Instead of just changing conditions, <strong>we force the database to return results from an additional SELECT query</strong>.</p><p>This is powerful because it allows us to:</p><ul><li>Pull data from <strong>other tables</strong></li><li>Retrieve usernames, passwords, emails, etc.</li><li>Combine attacker-controlled data with legitimate application results</li></ul><h4>What Is a UNION Attack</h4><p>The SQL UNION keyword allows you to <strong>combine results from two SELECT queries</strong> into a single result set.</p><p>Example (normal SQL):</p><pre>SELECT name, price FROM products<br>UNION<br>SELECT username, password FROM users</pre><p>For a UNION attack to work, <strong>two rules must be met</strong>:</p><ol><li>Both SELECT queries must return the <strong>same number of columns</strong></li><li>The columns must be of <strong>compatible data types</strong></li></ol><p>If either rule is broken, the database throws an error.</p><p>That’s why the <strong>first step</strong> in any UNION-based SQL injection is:</p><blockquote><em>figuring out how many columns the original query returns.</em></blockquote><p><strong>Access the Lab:</strong> <a href="https://portswigger.net/web-security/sql-injection/union-attacks/lab-determine-number-of-columns">https://portswigger.net/web-security/sql-injection/union-attacks/lab-determine-number-of-columns</a></p><h4>Lab Goal</h4><p>This lab contains a SQL injection vulnerability in the <strong>product category filter</strong>. The query results are reflected in the application’s response, meaning:</p><ul><li>We can see database errors</li><li>We can see extra rows if our UNION works</li></ul><h4>Objective</h4><p>Determine the <strong>number of columns returned by the original query</strong> by performing a UNION attack that returns a row of NULL values.</p><h4>Tool Used</h4><ul><li>Burp Suite (Repeater)</li><li>Browser</li></ul><h3>Step 1: Capture the Request</h3><ul><li>Open <strong>Burp Suite</strong></li><li>Turn <strong>Intercept OFF</strong></li><li>Open the lab in your browser</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SM6Cn3V9mZMGzyYxfcVRAA.png" /></figure><ul><li>Click any category (e.g. <em>Lifestyle</em>)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y4UocI40dybA8WCd8mGGcQ.png" /></figure><ul><li>In Burp → <strong>HTTP history</strong>, find:</li></ul><pre>GET /filter?category=Lifestyle</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vz3PmJGd1TCoamjhFiOXtA.png" /></figure><ul><li>Right-click → <strong>Send to Repeater</strong></li><li>Send the request and view the response in <strong>Render</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ext-lndPwqMuRqnpRh9kw.png" /></figure><p>At this point, the page shows normal product results.</p><h3>Step 2: Determining the Number of Columns (ORDER BY Method)</h3><h4>Why ORDER BY Works</h4><p>ORDER BY sorts query results by column index. If the query tries to order by a column number that <strong>doesn’t exist</strong>, the database throws an error.</p><p>This makes it a useful way to <strong>count columns</strong>.</p><h4>Testing Column Numbers</h4><p>We start incrementing the column index one by one:</p><pre>/filter?category=Lifestyle&#39; ORDER BY 1--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3x2g_Fvdsdx4xZfiyCpgjQ.png" /></figure><p>✅ Works</p><pre>/filter?category=Lifestyle&#39; ORDER BY 2--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UXmP5dnPCluTZVECpojCSA.png" /></figure><p>✅ Works</p><pre>/filter?category=Lifestyle&#39; ORDER BY 3--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qf3Qbq2P7pxonIFfpEqQ2Q.png" /></figure><p>✅ Works</p><pre>/filter?category=Lifestyle&#39; ORDER BY 4--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TaqfZbJhKu874I5yyJDw0g.png" /></figure><p>❌ Error appears</p><h4>What This Tells Us:</h4><ul><li>Columns 1, 2, and 3 exist</li><li>Column 4 does not</li></ul><p>✅ <strong>The query returns exactly 3 columns</strong></p><p>This information is critical, without it, UNION attacks will fail.</p><h3>Step 3: Confirming with UNION + NULL (Lab Solution)</h3><h4>Why We Use NULL</h4><p>At this stage, we <strong>don’t know the data types</strong> of the columns.</p><p>NULL is special because:</p><ul><li>It is compatible with <strong>any data type</strong></li><li>It prevents type mismatch errors</li></ul><p>That makes it perfect for testing.</p><h4>UNION Payload Used</h4><p>Since we determined there are 3 columns:</p><pre>/filter?category=Lifestyle&#39; UNION SELECT NULL, NULL, NULL--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rkk1fYHl1gYTYMWKoXqFEw.png" /></figure><h4>Result</h4><ul><li>The page loads successfully</li><li>Lab solved</li></ul><p>This confirms:</p><ul><li>UNION is working</li><li>The column count is correct</li><li>We are ready to retrieve real data in later labs</li></ul><h4>Lessons</h4><p>1. UNION Attacks Require Precision: Guessing column counts will fail. Enumeration is required.</p><p>2. ORDER BY Is a Recon Technique: You’re not exploiting yet, you’re preparing.</p><p>3. NULL Is a Safe Placeholder: It lets you test structure before extracting real data.</p><p>4. UNION Is a Gateway Technique: Once column count and data types are known, real data extraction becomes trivial.</p><h4>Importance:</h4><p>Every UNION-based SQL injection follows this exact pattern:</p><ol><li>Find injection point</li><li>Determine column count</li><li>Identify data types</li><li>Extract sensitive data</li></ol><p><strong>See Next lab, on how to find column containing text:</strong> <a href="https://medium.com/@rachael_muga/sql-injection-union-attack-finding-a-column-containing-text-f47c3014063c">SQL injection UNION attack, finding a column containing text</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e311a738ac85" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL injection vulnerability in WHERE clause allowing retrieval of hidden data (Portswigger Lab)]]></title>
            <link>https://medium.com/@rachael_muga/sql-injection-vulnerability-in-where-clause-allowing-retrieval-of-hidden-data-portswigger-lab-9a0482d3a35a?source=rss-2fac4eec3c88------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a0482d3a35a</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[information-retrieval]]></category>
            <category><![CDATA[sql-where-clause]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[sql-injection-attack]]></category>
            <dc:creator><![CDATA[Rachael Muga]]></dc:creator>
            <pubDate>Wed, 07 Jan 2026 08:58:57 GMT</pubDate>
            <atom:updated>2026-01-07T08:58:57.485Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*wm9R447A0CHpuxNn.png" /></figure><h3>Understanding The Vulnerability</h3><p>This lab is designed to teach one of the most common real-world SQL injection scenarios: <strong>filtering data using a WHERE clause</strong>.</p><p>Many applications hide data using conditions like:</p><ul><li>is_active = 1</li><li>published = true</li><li>released = 1</li></ul><p>If an attacker can manipulate these conditions, they can often see <strong>data that was never meant to be shown</strong>.</p><h3>Lab Description</h3><p>When a user clicks on a product category (for example, <em>Gifts</em>), the application runs a SQL query similar to:</p><pre>SELECT * FROM products WHERE category = &#39;Gifts&#39; AND released = 1</pre><p>Let’s break this down:</p><ul><li>category = &#39;Gifts&#39; → Only show products in the Gifts category</li><li>released = 1 → Only show products that are released (public)</li></ul><p>This means:</p><blockquote><em>Even if unreleased products exist, they are intentionally hidden by the </em><em>released = 1 condition.</em></blockquote><p>Our goal is to <strong>manipulate this logic</strong> so that the database returns unreleased products as well.</p><h3>Where the Vulnerability Is</h3><p>The category value comes from the URL:</p><pre>/filter?category=Gifts</pre><p>This is important.</p><p>Anything that: Comes from the user, Goes directly into a SQL query, Is not properly sanitized…can potentially be injected into.</p><p>That makes category the <strong>injection point</strong>.</p><h3>Setting Up the Test (Using Burp Suite)</h3><ul><li>Open <strong>Burp Suite</strong></li><li>Turn <strong>Intercept OFF</strong></li><li>Open the lab in your browser</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1f-wttR8GRTdTh86nqa1Ag.png" /></figure><ul><li>Click any category (e.g. <em>Gifts</em>)</li><li>Go to <strong>HTTP history</strong> in Burp</li><li>Find the request:</li></ul><pre>GET /filter?category=Gifts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*6mY0h3PF7DyftpDkjXq97w.png" /></figure><ul><li>Right-click → <strong>Send to Repeater</strong></li><li>In Repeater, send the request and view the response in <strong>Render</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*NcCw79moFx2YEvs2ReTn5A.png" /></figure><p>At this point:</p><ul><li>Only released products are visible</li><li>The application is working as intended</li></ul><h3>First Injection Attempt: Commenting Out Logic</h3><h4>Payload:</h4><pre>category=Gifts&#39; --</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*-mJXeJwp4MJEwlKIddjzQA.png" /></figure><h4>What I Was Trying to Do</h4><p>The idea was simple:</p><ul><li>Close the string (&#39;)</li><li>Comment out everything after it (--)</li><li>Remove the AND released = 1 condition</li></ul><p>This would turn the query into:</p><pre>SELECT * FROM products WHERE category = &#39;Gifts&#39;</pre><h4>Result</h4><p>❌ No visible change. Unreleased products did <strong>not</strong> appear.</p><h4>Why This Didn’t Work (Important Concept)</h4><p>Even though released = 1 was removed, <strong>the category filter still exists</strong>.</p><p>The query still means:</p><blockquote><em>“Show me products that belong to the Gifts category.”</em></blockquote><p>If: There are no unreleased products in that category or The difference isn’t visually obvious…it will look like nothing happened.</p><h4>Key lesson:</h4><p><em>Removing a condition does </em><strong><em>not automatically widen results</em></strong><em>. </em>You removed one filter, but left another one intact.</p><h3>Second Injection Attempt: Changing Query Logic</h3><h4>Payload:</h4><pre>category=Gifts&#39; OR 1=1 --</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*Em2T1B2cqSwYuU-KOq43nA.png" /></figure><h4>What This Does</h4><p>This payload doesn’t just remove conditions, it <strong>changes how the WHERE clause behaves</strong>. The query now becomes:</p><pre>SELECT * FROM products WHERE category = &#39;Gifts&#39; OR 1=1</pre><p>Let’s analyze this logically:</p><ul><li>category = &#39;Gifts&#39;</li><li>OR 1=1 → always true</li><li>-- → comments out AND released = 1</li></ul><p>Because 1=1 is <strong>always true</strong>, the database returns <strong>all rows</strong>.</p><h4>Result</h4><p>✅ Unreleased products are now visible<br> Lab solved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Og2lx_YkwIrSHO2cldiLSA.png" /></figure><h3>Lesson:</h3><ul><li><em>SQL injection only works where user input is actually used in a SQL query.</em></li><li>Headers don’t matter unless the backend explicitly uses them.</li></ul><h3>Core Concepts This Lab Teaches</h3><p>1. SQL Injection Is About Logic: It’s not about “breaking” SQL. It’s about <strong>rewriting the logic</strong> of the query.</p><p>2. &quot;--” Removes Code (comments things out) , &quot;OR” Controls Behavior (decides whether rows are included)</p><p>3. Boolean Conditions Are Powerful: Payloads like: “OR 1=1” are extremely effective when filtering logic exists.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a0482d3a35a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Security SQL Injection (Portswigger Labs)]]></title>
            <link>https://medium.com/@rachael_muga/web-security-sql-injection-portswigger-labs-371e636ca2f7?source=rss-2fac4eec3c88------2</link>
            <guid isPermaLink="false">https://medium.com/p/371e636ca2f7</guid>
            <category><![CDATA[sql-injection-portswigger]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[sql-injection]]></category>
            <dc:creator><![CDATA[Rachael Muga]]></dc:creator>
            <pubDate>Wed, 07 Jan 2026 08:55:08 GMT</pubDate>
            <atom:updated>2026-01-21T23:45:44.261Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*CHvATvM_GWCKuqVH.png" /></figure><p>This is not a polished tutorial series. These are walkthrough-style notes I’m writing as I learn, mainly for future reference, and to help anyone who might get stuck on the same labs. Each lab has its own walkthrough-style write-up. I focus on what I tried, what worked, what didn’t, and why.</p><blockquote><strong><em>If you’re stuck, read the reasoning , not just the payload.</em></strong></blockquote><h3>Brief Introduction to SQL Injection</h3><p>SQL injection is essentially <strong>manipulating SQL queries</strong>.</p><p>SQL (Structured Query Language) is the language used to interact with databases. Just like we have different languages for different purposes; for example, CSS is used for styling the UI. SQL is used for <strong>storing, retrieving, and manipulating data</strong>.</p><p>Most applications store data in databases (on servers, data warehouses, or the cloud). To interact with this data, applications use SQL queries. These queries perform actions such as:</p><ul><li>SELECT – retrieve data</li><li>INSERT / UPDATE – add or modify data</li><li>DELETE / DROP – remove records or tables</li></ul><p>SQL injection happens when an application <strong>does not properly control user input</strong> and that input becomes part of an SQL query. As an attacker, I can take advantage of this to <strong>change how the query behaves</strong>.</p><p>Depending on how the developer is handling things like usernames and passwords on the backend, SQL injection can allow me to:</p><ul><li>Bypass a login page</li><li>Read data from database tables</li><li>Modify or delete data as an unauthorized user</li><li>In some cases, escalate the attack and compromise the backend system</li></ul><h3>Detecting SQL Injection Vulnerabilities</h3><p>There are many ways to detect SQL injection vulnerabilities. These range from simple input manipulation to more advanced techniques, depending on how the application handles errors and responses.</p><p>In this series, I’ll walk through <strong>different SQL injection techniques using PortSwigger labs</strong>, documenting what I try, what works, and why it works.</p><p><em>(Labs will be listed and linked here as I complete them~ 18labs)</em></p><ol><li><a href="https://medium.com/@rachael_muga/sql-injection-vulnerability-in-where-clause-allowing-retrieval-of-hidden-data-300e863864d8">SQL injection vulnerability in WHERE clause allowing retrieval of hidden data</a> <strong>OR</strong> <a href="https://medium.com/@rachael_muga/sql-injection-vulnerability-in-where-clause-allowing-retrieval-of-hidden-data-portswigger-lab-9a0482d3a35a">SQL injection vulnerability in WHERE clause allowing retrieval of hidden data</a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-vulnerability-allowing-login-bypass-8a33b9c3d4cd">SQL injection vulnerability allowing login bypass</a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attacks-determining-the-number-of-columns-e311a738ac85?postPublishedType=repub">SQL Injection UNION Attacks: Determining the Number of Columns</a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attack-finding-a-column-containing-text-f47c3014063c">SQL injection UNION attack, finding a column containing text</a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attack-retrieving-data-from-other-tables-portswigger-lab-27e73fd32ba0">SQL injection UNION attack, retrieving data from other tables</a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-union-attack-retrieving-multiple-values-in-a-single-column-portswigger-lab-21ae92c51e7c?postPublishedType=initial">SQL Injection UNION Attack: Retrieving Multiple Values in a Single Column</a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-attack-querying-the-database-type-and-version-portswigger-lab-f84544885955">SQL Injection UNION Attack: Querying the Database Type and Version on MySQL and Microsoft</a></li><li><a href="https://medium.com/@rachael_muga/sql-injection-uattack-listing-the-contents-of-the-database-non-oracle-databases-portswigger-lab-b96dbe7855a7">SQL Injection UNION Attack: Listing the Contents of the Database {Non-Oracle Databases}</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=371e636ca2f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Cyber 2025: Day 1 + SideQuest 1 Key Finding Write Up]]></title>
            <link>https://medium.com/@rachael_muga/advent-of-cyber-2025-day-1-sidequest-1-write-up-57f45fe7f645?source=rss-2fac4eec3c88------2</link>
            <guid isPermaLink="false">https://medium.com/p/57f45fe7f645</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[advent-of-cyber-2025]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[side-quest]]></category>
            <dc:creator><![CDATA[Rachael Muga]]></dc:creator>
            <pubDate>Tue, 02 Dec 2025 16:32:50 GMT</pubDate>
            <atom:updated>2025-12-08T09:27:15.781Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TryHackMe Room:</strong> <a href="https://tryhackme.com/room/linuxcli-aoc2025-o1fpqkvxti">Linux CLI AOC 2025</a></p><p>Day 1 of Advent of Cyber 2025 kicked off with a gentle Linux warm-up. A nice little reminder that shells keep track of almost everything you type, yes, even your mistakes. 🫣</p><h3>Part 1: Day 1 (Main Task)</h3><p>The first task was straightforward: check the command history on an Ubuntu box.</p><p>You get a user account, and the goal is to find a hidden flag inside <strong>root’s command history</strong>.</p><p>There are two ways to peek into history:</p><ol><li>Use the built-in command:</li></ol><pre>history</pre><p><strong>2. Reading the stored file directly:</strong></p><pre>cat ~/.bash_history</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*FUMxbrjT_PCHb9OW9Rpy9g.png" /></figure><p>But since the challenge asks for <strong>root’s history</strong>, you need to become root:</p><pre>sudo su -<br>history</pre><p>Or check the root’s file:</p><pre>cat /root/.bash_history</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*9Q06XL_wnVKcZe11koGNjQ.png" /></figure><p>The flag is hiding somewhere in that output. Pretty straightforward, just a reminder that Linux remembers more than you think.</p><h3>Part 2: SideQuest 1</h3><p>And now… the real fun begins! 🎉</p><p>I navigated to:</p><pre>cd /home/mcskidy/Documents/<br>ls<br>cat read-me-please.txt</pre><p>Inside, I found a username, a password, and three mysterious clues pointing to tiny “easter eggs.” Each one held a fragment of a password I’d eventually need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*DjQuw6JXdXcvN2giVq9rNg.png" /></figure><p>Here’s how I tracked them down.</p><h3>🥚 Clue 1: Something loaded by the shell</h3><blockquote>“I ride with your session, not with your chest of files. Open the little bag your shell carries when you arrive.”</blockquote><p>Ah, this one made me think. “Something loaded by the shell”? That means shell startup files, like .bashrc or .profile. These are read automatically when a user logs in.</p><p>Following the hint:</p><pre>su eddi_knapp<br>cd ~<br>ls -la</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*Iu1rAmMVLgAcYKb7m2HOGg.png" /></figure><pre>cat .bashrc</pre><p>Scrolling to the bottom… and there it was. The first fragment! <em>(Note it down)</em>🎯</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*gvdhyh6WoJgmOOnL6gwRNw.png" /></figure><h3>🥚 Clue 2: “tree”, “rings”, “ledger” → past versions</h3><blockquote>The tree shows today; the rings remember yesterday.<br>Read the ledger’s older pages.</blockquote><p>This one threw me off at first. Logs? Backups? Timestamps? Listing everything, including hidden files:</p><pre>ls -a ~<br>ls -aR ~</pre><p>You’ll notice a .git directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5oE2pZCIKKNgHZZAPIy1Q.png" /></figure><p>So the actual hint is that the directory has <strong>git history</strong>. Navigate to that directory.</p><pre>cd ./.secret_git/.git/</pre><p>Running:</p><pre>git log</pre><p>This shows the commit history. To see actual file contents from a commit:</p><pre>git show &lt;commitID&gt;</pre><p>Bingo. Inside either of the commits was the <strong>second fragment</strong><em>(Note it down)</em>. Sometimes the treasure is literally in the past… you just have to dig for it. ⏳</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*GyhH04FgSkCnuyZQJXR0Ig.png" /></figure><h3>🥚 Clue 3: Pixels + tail → image file with readable data at the end</h3><blockquote>When pixels sleep, their tails sometimes whisper plain words.<br>Listen to the tail.</blockquote><p>The hint implies:</p><ul><li>It’s an <strong>image</strong></li><li>The message is at the <strong>end of the file</strong></li><li>So you literally “tail” it</li></ul><p>Searching for hidden files:</p><pre>ls -a ~/Pictures</pre><p>You’ll see a hidden .easter_egg picture</p><p>Then:</p><pre>tail ~/Pictures/.easter_egg</pre><p>This prints the <strong>third fragment</strong><em>(Note it down)</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*LddOs1FFptGUS7Fv90mcrg.png" /></figure><h3>🔑 Assembling the Password</h3><p>Join the three fragments in order: <em>Flag1+Flag2+Flag3</em>. That gives the passphrase needed to decrypt one of the encrypted files on the machine:</p><pre>find ~ -name &quot;*.gpg&quot;</pre><p>Two encrypted files appear:</p><pre>/home/eddi_knapp/.secret/dir.tar.gz.gpg<br><br>/home/eddi_knapp/Documents/mcskidy_note.txt.gpg</pre><p>The second file (the text file) is the one the fragments decrypt.</p><h3>🔐 Decrypting the GPG File</h3><p>Use:</p><pre>gpg --batch --yes --passphrase &quot;&lt;the passphrase&gt;&quot;/home/eddi_knapp/Documents/mcskidy_note.txt.gpg &gt; mcskidy_note.txt<br><br>cat mcskidy_note.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10EhuUGxisNCXyXrhNQD5A.png" /></figure><p>The decrypted note tells you to edit:</p><pre>/home/socmas/2025/wishlist.txt</pre><p>Replace the contents with the new text and save it.(I used Vim)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*kMZsoQIWkepmdsGtag1HBw.png" /></figure><h3>🌐 Firefox Step (OpenSSL Decryption)</h3><p>Go to the provided URL http://&lt;Ip Address&gt;:8080.</p><h3>2️⃣ The website will show ciphertext</h3><p>(Don’t panic, this is expected.)</p><p>Copy the Gibberish message text message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*AYrsGnAqoz9FCAMuA9U6cg.png" /></figure><h3>3️⃣ Save that ciphertext into a file</h3><pre>vim website_output.txt</pre><p>Paste the message you copied and Save</p><h3>4️⃣ Decode it using the UNLOCK_KEY</h3><pre>openssl enc -d -aes-256-cbc -pbkdf2 -iter 200000 -salt -base64 \<br>-in website_output.txt \<br>-out decoded_message.txt \<br>-pass pass:&#39;&lt;THE KEY&#39;</pre><h3>5️⃣ Read the final message:</h3><pre>cat decoded_message.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*CfqiThs-DaosH0bxA4foGg.png" /></figure><h3>⭐ How to Decrypt the Sidequest Archive</h3><p>You’re inside eddi_knapp, so run:</p><pre>cd ~/.secret<br><br>gpg --batch --yes --passphrase &#39;&lt;The Flag you got above&gt;&#39; \<br>-o dir.tar.gz -d dir.tar.gz.gpg</pre><p>If the passphrase is correct, it will silently extract the decrypted archive file dir.tar.gz.</p><p>Now extract it:</p><pre>tar -xzf dir.tar.gz</pre><p>After extraction, run:</p><pre>ls dir</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*NT9w-Aix9ydS8rPaI6kGPw.png" /></figure><p>Inside should be the <strong>sidequest key </strong>but instead we have an image. Tried different commands to try read the file but couldn’t extract the hidden sidequest key on the VM unless I get admin rights to install tools. so what I did, I downloaded the image to my local machine</p><p>From your Local Machine, run:</p><pre>scp eddi_knapp@&lt;IP Machine&gt;:~/.secret/dir/sq1.png ~/Downloads/</pre><ul><li>Replace ~/Downloads/ with your preferred local path.</li><li>This copies sq1.png from the remote VM to your computer.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MiY8-rXmT141WJo7MVFWDA.png" /></figure><p>Then you can open it in an image viewer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*HR4qV1HkMnQEL12e4sZg4g.png" /></figure><p>And finally, write down the message you see. This is the key to start working on the next SideQuest: <a href="https://tryhackme.com/room/sq1-aoc2025-FzPnrt2SAu">https://tryhackme.com/room/sq1-aoc2025-FzPnrt2SAu</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57f45fe7f645" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>