<?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 Adem_Zayani on Medium]]></title>
        <description><![CDATA[Stories by Adem_Zayani on Medium]]></description>
        <link>https://medium.com/@edemzayaniyt?source=rss-e09ff558ed9c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MB9DeDrQumc8LM6HIim4Hg.jpeg</url>
            <title>Stories by Adem_Zayani on Medium</title>
            <link>https://medium.com/@edemzayaniyt?source=rss-e09ff558ed9c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 23:54:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@edemzayaniyt/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[How a Sort Parmeter Became Blind SQL Injection]]></title>
            <link>https://medium.com/@edemzayaniyt/how-a-sort-parmeter-became-blind-sql-injection-6c2ffe0ec457?source=rss-e09ff558ed9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c2ffe0ec457</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Adem_Zayani]]></dc:creator>
            <pubDate>Sun, 13 Sep 2026 20:50:54 GMT</pubDate>
            <atom:updated>2026-09-13T20:52:38.255Z</atom:updated>
            <content:encoded><![CDATA[<h3>How a Sort Parameter Became Blind SQL Injection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZiyBF9TcyGuA-YS8QeocQ.png" /></figure><p>Hello everyone 👋</p><p>While testing a web application in scope for a private program, I came across a REST API endpoint used to return a list of records (counties, in this case). Nothing fancy — just a simple “get all” endpoint with two query parameters:</p><pre>GET https://[REDACTED].com/wp-json/counties/v1/all?sort_by=CountyName&amp;sort_dir=asc</pre><p>At first glance it looked completely harmless , a sort parameter .But I wanted to see what the backend actually did with it.</p><h3>Finding the Injection</h3><p>I started by confirming that sort_by genuinely controlled the ordering of the response, using two legitimate values.</p><pre>sort_by=CountyName  → first record: Appling County<br>sort_by=CountyID    → first record: Bartow County</pre><p>Two different, predictable orderings. That told me the value was being used directly to build the query — which made me want to test whether it was being validated at all.</p><p>So instead of a real column name, I sent a SQL expression:</p><pre>sort_by=(CASE WHEN 1=1 THEN CountyName ELSE CountyID END)</pre><p>The response came back ordered by CountyName.</p><p>Then I flipped the condition:</p><pre>sort_by=(CASE WHEN 1=2 THEN CountyName ELSE CountyID END)</pre><p>This time it came back ordered by CountyID.</p><p>That was the confirmation. The database was evaluating my CASE WHEN expression directly , no authentication, no sanitization — just raw SQL injection in the ORDER BY clause.</p><h3>From Oracle to Data Extraction</h3><p>At this point I had a working boolean oracle: depending on whether my condition was true or false, the response ordering flipped between two known states. That’s enough to ask the database anything, one true/false question at a time.</p><p>Using LENGTH() and ASCII(SUBSTRING(...)) inside the same CASE WHEN, I extracted real values character by character:</p><pre>sort_by=(CASE WHEN (LENGTH(DATABASE())=14) THEN CountyName ELSE CountyID END)<br>sort_by=(CASE WHEN (ASCII(SUBSTRING(DATABASE(),1,1))=119) THEN CountyName ELSE CountyID END)</pre><p>Repeating this for each position, I was able to recover:</p><p>Item value database name[REDACTED]Current DB user[REDACTED]@127.0.0.1DB server hostname[REDACTED]Total tables in schema 155 Users tablewp_users (confirmed to exist) User account count 71</p><p>All of it, unauthenticated.</p><h3>Why Was This Possible?</h3><p>The root cause was simple : the sort_by value was being concatenated straight into the SQL ORDER BY clause with no allowlist and no validation.</p><p>The application effectively trusted:</p><pre>sort_by=&lt;anything the client sends&gt;</pre><p>instead of checking:</p><pre>Is this one of the columns we actually allow sorting by?</pre><p>Prepared statements don’t help here — you can parameterize a <em>value</em>, but not a column name or expression. Without an explicit allowlist, anything goes.</p><p>The Attack Flow</p><pre>Send a normal request with a known sort_by value<br>        ↓<br>Confirm the ordering changes as expected<br>        ↓<br>Replace sort_by with a CASE WHEN boolean expression<br>        ↓<br>Observe which ordering comes back<br>        ↓<br>Use that as a true/false oracle<br>        ↓<br>Extract data character-by-character with LENGTH() / ASCII(SUBSTRING())<br>        ↓<br>Automate it</pre><p>I ended up scripting the whole extraction (Python and PowerShell versions) so the triage team could reproduce it themselves without trusting a wall of manual curl commands.</p><h3>Impact</h3><p>This gave an unauthenticated attacker a reliable SQL injection primitive against the production database, with no rate limiting slowing it down. In practice that meant:</p><ul><li>Extraction of database and server metadata</li><li>Confirmation of internal table structure</li><li>Ability to query user account counts from the wp_users table</li><li>A clear path toward extracting further data, limited only by the DB user’s permissions</li></ul><p>No login, no session, no prior access required — just the endpoint and a query string.</p><h3>Disclosure</h3><p>I reported the vulnerability through HackerOne to the responsible program. It was validated, escalated to Critical severity, and the fix was later confirmed via retest — the report is now closed as Resolved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*ZoDUvRFBTRjGFYIMwdEzMw.png" /></figure><p>I’m sharing this write-up for educational purposes, to show how something as small and overlooked as a sort parameter can turn into a full unauthenticated database extraction primitive when input isn’t validated against an allowlist.</p><h3>visit my X profile for more :</h3><p><a href="https://x.com/Adem_Zayan1">https://x.com/Adem_Zayan1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c2ffe0ec457" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How a Simple IDOR Led to Full Account Takeover]]></title>
            <link>https://medium.com/@edemzayaniyt/how-a-simple-idor-led-to-full-account-takeover-c54ba9525301?source=rss-e09ff558ed9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c54ba9525301</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Adem_Zayani]]></dc:creator>
            <pubDate>Sat, 22 Aug 2026 14:23:10 GMT</pubDate>
            <atom:updated>2026-08-25T23:48:02.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ic9abXyumMSzdku_lDGz1Q.jpeg" /></figure><p>Hello everyone 👋</p><p>While testing a Vodafone application, I found an interesting request during the registration process.</p><p>At first, it looked completely normal but one parameter immediately caught my attention:</p><p>uid</p><p>I wanted to see what would happen if I changed it.</p><h3>Finding the IDOR</h3><p>I created two test accounts:</p><ul><li><strong>Account A:</strong> my attacker account</li><li><strong>Account B:</strong> my second victim test account</li></ul><p>I register into Account A and intercepted the registration request using Burp Suite.</p><p>The request looked roughly like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*UITBCMrKF2Ega6rB9itHqg.png" /></figure><pre>action=complete_registration_form &amp;form=uid=41320 &amp;display_name=FromAttacker &amp;password=... &amp;password-confirm=...</pre><p>The uid was being sent directly from the client.</p><p>So I changed it from my own user ID to the ID of my second victim test account and I didn’t change anything else.</p><p>Then I sent the request.</p><h3>The Server Accepted It</h3><p>The response came back with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*lrc6r3xEnpVxIwnJOYX61A.png" /></figure><pre>{<br>  &quot;success&quot;: true,<br>  &quot;type&quot;: &quot;success_updated_user&quot;,<br>  &quot;message&quot;: &quot;User updated with success&quot;,<br>  &quot;data&quot;: {<br>    &quot;user_id&quot;: &quot;TARGET_ID&quot;<br>  }<br>}</pre><p>That was interesting.</p><p>The application had accepted my request and updated an account belonging to a different user.</p><p>At this point, I knew I was dealing with an IDOR / Broken Access Control issue.</p><p>But I wanted to understand how far it could actually go.</p><h3>From IDOR to Account Takeover</h3><p>The request wasn’t just changing harmless profile information.</p><p>It also allowed me to provide a new password.</p><p>So I set a new password for my second victim test account and then tried logging into that account using the new password.</p><p>It worked.</p><p>That changed the severity of the finding completely.</p><p><strong>IDOR → Password Change → Account Takeover</strong></p><h3>Why Was This Possible?</h3><p>The problem was the way the server handled the uid parameter.</p><p>The application knew that I was authenticated, but it didn’t properly check whether I was actually authorized to modify the user represented by the supplied uid.</p><p>The server was effectively trusting something like:</p><pre>uid=12345</pre><p>instead of checking:</p><pre>Is the authenticated user allowed to modify user 12345?</pre><p>That missing authorization check was the core of the vulnerability.</p><h3>The Attack Flow</h3><p>The whole attack was surprisingly simple:</p><pre>register as a normal user<br>        ↓<br>Intercept the registration request<br>        ↓<br>Change the uid<br>        ↓<br>Send the request<br>        ↓<br>Server updates the target account<br>        ↓<br>Set a new password<br>        ↓<br>Login using the target account<br>        ↓<br>Full Account Takeover</pre><h3>Impact</h3><p>The vulnerability allowed an authenticated attacker to modify accounts they didn’t own.</p><p>Because the password could also be changed, the impact included:</p><ul><li>Full Account Takeover</li><li>Unauthorized access to the victim’s account</li><li>Modification of account information</li><li>Access to information available inside the account</li><li>Potential compromise of multiple accounts if automated</li></ul><p>The most important part was that the attack didn’t require knowing the victim’s password.</p><p>The attacker only needed a valid authenticated session and the target user’s ID.</p><h3>Disclosure</h3><p>I reported the vulnerability to Vodafone through HackerOne.</p><p>After the report was reviewed and validated, the issue was addressed by the security team and the report was marked as resolved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*7nzhSkbte8u3nlcTJXLzzg.png" /></figure><p>I’m sharing this write-up for educational purposes to show how a simple IDOR can sometimes lead to a much more serious impact, such as full account takeover.</p><h3><strong>visit my X profile for more :</strong></h3><p><a href="https://x.com/Adem_Zayan1">Mkache5_TN (@Adem_Zayan1) on X</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c54ba9525301" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mojo jojo CTF reverse engineering underneath challenge a hidden flag in a 3d model]]></title>
            <link>https://medium.com/@edemzayaniyt/mojo-jojo-ctf-reverse-engineering-underneath-challenge-a-hidden-flag-in-a-3d-model-23b4d11a0ab7?source=rss-e09ff558ed9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/23b4d11a0ab7</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[securinets]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <dc:creator><![CDATA[Adem_Zayani]]></dc:creator>
            <pubDate>Mon, 09 Feb 2026 13:36:37 GMT</pubDate>
            <atom:updated>2026-02-09T13:36:37.925Z</atom:updated>
            <content:encoded><![CDATA[<p>yesterday i was participating in mojo jojo ctf and i solved the underneath challenge in the reverse engineering category and honestly it was a very strange challenge</p><h3>Underneath</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/0*QdZ13Ml90GM7w4uP.png" /></figure><p>The challenge gave us a file named (challenge.stl), and the two interesting things were the file description and its extension if you’ve worked with 3D software like Blender or CAD, you’ll recognize (.stl) as a 3D model format but since the category was the Reverse the natural instinct was to find out what was hidden within the binary file and understand how it work.</p><h3>Step 1</h3><p>First thing I did:</p><pre>file challenge.stl</pre><p>It’s a <strong>Binary STL file</strong>.</p><p>For those who dont know, STL is a 3D model format used in Blender,CAD and 3D printing a binary STL looks like this:</p><p>80-byte header</p><p>4-byte triangle count</p><p>50 bytes per triangle (normals + vertices + attribute bytes)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SN4M_FgVabHYVfJi" /></figure><p>I dumped it with:</p><pre>xxd challenge.stl | head</pre><p>Header All zeros<br>Triangle count 13408</p><p>Interesting but not useful yet</p><h3>Step2</h3><p>lets look at Description: “Not really much reversing to do” Also… its an STL file An STL file is literally a 3D model i tried to open it in blender so I did the obvious thing ishould’ve done first:</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*aCqIL6vHd97JFbEE.png" /></figure><p>after opening the stl file in blender i immediately saw what looked like the flag and i thought that was the end of the challenge i submitted it and it was wrong that is when i realized the author was playing with us and the visible text was a fake flag so i decided to inspect the model more carefully</p><p>i switched to wireframe mode to check if there was anything hidden inside the mesh and there it was</p><p>another text built inside the geometry which was not visible in solid view that was the real flag</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*4WltPaQItT3wWBe4.png" /></figure><blockquote><em>Flag: MOJO-JOJO{GG_th4t_w4s ann0y1ng_wasnt_1t}</em></blockquote><p>the trick of the challenge was not reversing the binary but looking deeper into the 3d model and not trusting the first thing you see</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23b4d11a0ab7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>