<?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 Gokulvinesh on Medium]]></title>
        <description><![CDATA[Stories by Gokulvinesh on Medium]]></description>
        <link>https://medium.com/@gokulvinesh?source=rss-6338e46733d4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gIbAuAxe-By8Ulv1mReYaQ.jpeg</url>
            <title>Stories by Gokulvinesh on Medium</title>
            <link>https://medium.com/@gokulvinesh?source=rss-6338e46733d4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 18:19:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gokulvinesh/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[Reverse Shell via File Upload]]></title>
            <link>https://gokulvinesh.medium.com/reverse-shell-via-file-upload-de11ad755285?source=rss-6338e46733d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/de11ad755285</guid>
            <category><![CDATA[reverse-shell]]></category>
            <category><![CDATA[rce]]></category>
            <category><![CDATA[rce-vulnerability]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Gokulvinesh]]></dc:creator>
            <pubDate>Mon, 17 Feb 2025 10:07:37 GMT</pubDate>
            <atom:updated>2025-02-17T10:07:37.613Z</atom:updated>
            <content:encoded><![CDATA[<p>In this, my fourth blog, I delve into the <strong>Reverse Shell via File Upload</strong> vulnerability, a critical issue I encountered during my journey in web security.</p><h3>What is RCE and Reverse Shell?</h3><p><strong>Remote Code Execution (RCE)</strong> is a critical security vulnerability that allows an attacker to execute arbitrary commands on a target system remotely. When exploited, this can lead to complete system compromise.</p><p>A <strong>reverse shell</strong> is a type of shell where the target machine initiates an outbound connection to an attacker’s system. This allows the attacker to gain interactive access to the compromised system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SAuT8K0jYZ7zGSn--T4sPQ.gif" /></figure><h3>Impact of This Vulnerability</h3><ul><li>Unauthorized access to the system</li><li>Data exfiltration</li><li>System takeover and persistence</li><li>Potential for lateral movement within the network</li></ul><h3>Exploitation Steps</h3><h3>Step 1: Create a JSP File with an RCE Payload</h3><p>Prepare a JSP file containing a malicious payload that will execute commands on the server when accessed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*5XZRt0dU0iMHIJGhdj_2vw.png" /><figcaption>Create a JSP file</figcaption></figure><h3>Step 2: Upload the Malicious JSP File</h3><p>Since the target application is vulnerable to unrestricted file uploads, upload the JSP file to the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*tn7hzv6TNkihfvyyDx8vfw.png" /><figcaption>upload the jsp file</figcaption></figure><h3>Step 3: Locate and Access the Uploaded File</h3><p>Once the file is uploaded, identify its path. In this case, <strong>file upload traversal</strong> was used to determine the file location. You can refer to <a href="https://medium.com/@gokulvinesh/exploiting-and-securing-file-upload-traverser-vulnerabilities-a-practical-guide-160bd47a553e">this guide</a> for more details.</p><p>When accessed, the uploaded JSP file executes commands successfully, as shown in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*ao28rTEhy12-fMg5QHkZjA.png" /><figcaption>RCE screenshot</figcaption></figure><h3>Step 4: Configure Inbound and Outbound Connections on an AWS Machine</h3><ul><li>Set up an AWS instance (or use any system with a public IP or Ngrok or port forwarding).</li><li>Configure inbound and outbound firewall rules to allow reverse shell communication.</li><li>Run <strong>Netcat</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*QBaztDZ_Paos1I2lMYYzOA.png" /><figcaption>Netcat in AWS instance</figcaption></figure><h3>Step 5: Execute PowerShell Command for Reverse Shell</h3><p>Use the uploaded JSP file to execute a PowerShell command that establishes a reverse shell to your AWS machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*1F-Yr-eo_p-Bnw6fivW8ww.png" /><figcaption>command execution for reverse shell</figcaption></figure><h3>Step 6: Gain a Reverse Shell</h3><p>Once the payload executes successfully, you gain a reverse shell connection to the compromised system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*ruMKustSvhLvdmHY-CrQIw.png" /><figcaption>output of reverse shell</figcaption></figure><h3>Mitigation Strategies</h3><p>To protect against file upload vulnerabilities and reverse shell attacks, implement the following security measures:</p><ol><li><strong>Restrict File Uploads</strong> — Allow only specific file types (e.g., images) and validate them using server-side checks.</li><li><strong>Use Whitelisting</strong> — Restrict executable file extensions like .jsp, .php, .exe, etc.</li><li><strong>Disable Direct Execution</strong> — Store uploaded files in non-web-accessible directories.</li><li><strong>Implement Strong Authentication</strong> — Enforce strong access controls and authentication mechanisms.</li><li><strong>Monitor File Uploads</strong> — Regularly audit and monitor file uploads for suspicious activity.</li><li><strong>Network Security</strong> — Use firewalls and intrusion detection systems (IDS) to monitor inbound/outbound traffic.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de11ad755285" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploiting and Securing File Upload Traverser Vulnerabilities: A Practical Guide]]></title>
            <link>https://gokulvinesh.medium.com/exploiting-and-securing-file-upload-traverser-vulnerabilities-a-practical-guide-160bd47a553e?source=rss-6338e46733d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/160bd47a553e</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[path-traversal]]></category>
            <category><![CDATA[vulnerability-assessment]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[file-upload-vulnerability]]></category>
            <dc:creator><![CDATA[Gokulvinesh]]></dc:creator>
            <pubDate>Sat, 28 Sep 2024 16:27:43 GMT</pubDate>
            <atom:updated>2024-09-28T16:31:16.272Z</atom:updated>
            <content:encoded><![CDATA[<p>In this, my third blog, I delve into the <strong>File Upload Traverser</strong> vulnerability, a critical issue I encountered during my journey in web security. My first experience exploiting this vulnerability using Burp Suite was eye-opening, highlighting the importance of proper file path validation. This exploration has deepened my passion for ethical hacking and reinforced the need for robust security measures in web applications.</p><p><strong>What is File Upload Traverser?</strong></p><p>The File Upload Traverser vulnerability is a type of file upload vulnerability where an attacker exploits improper handling of file paths during the file upload process to perform directory traversal. This allows the attacker to upload files to arbitrary directories on the server by manipulating the file path using traversal sequences like ../ (dot-dot-slash). The vulnerability typically arises due to insufficient validation or sanitization of user-provided file paths.</p><p>This vulnerability can occur on any server or web application that allows users to upload files and fails to properly handle file path inputs. The type of server doesn’t matter as much as how the server-side application processes and stores uploaded files.</p><p><strong>Impact</strong></p><p>The File Upload Traverser vulnerability allows attackers to manipulate file paths during the upload process, often by using directory traversal sequences like ../, to place files in unauthorized directories on the server. This can lead to significant security risks, including remote code execution (RCE) if attackers upload malicious scripts, enabling them to execute arbitrary commands. It may also lead to file overwriting, where critical system or configuration files are replaced, causing service disruptions or privilege escalation. Additionally, attackers can upload webshells for persistent access or steal sensitive information by placing files into directories containing confidential data. This makes it a highly dangerous vulnerability that can compromise both server integrity and data security.</p><p><strong>Practical Steps to Exploit</strong></p><p><strong><em>Step 1:</em></strong> Upload a file to the server and capture the request in Burp Suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zbk5K4J3BLjd8wzw2sD18A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wQEQZcFj_c3jDXTkHuJ4sw.png" /></figure><p><strong><em>Step 2:</em></strong> Verify the file upload location, for example, now file uploaded into “assets/upload_folder/uploads/hello.txt”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3aoMyxYIrAYEW1EzQnERaw.png" /></figure><p><strong><em>Step 3:</em></strong> Upload the file again, but this time change the filename to “../../../hello.txt” to perform a directory traversal. The file will be uploaded to a different directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NdcEWerj90uqJgQmf7n2Sg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4P5HyiNiHwRs1sEIqYPtgA.png" /></figure><p><strong>Automated Tools to Find This Vulnerability :</strong><br><strong><em>Burp Suite Extension:</em></strong> Use the File Upload Traverser extension to automatically test for this vulnerability during file uploads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kjpCsWTI0RKvCZXXB_jjqw.png" /><figcaption>burp BApp Store</figcaption></figure><p><strong>Solution</strong><br> To prevent File Upload Traverser vulnerabilities, ensure proper validation and sanitization of file paths, blocking directory traversal sequences like ../. Store uploaded files in non-executable directories to prevent code execution. Restrict allowed file types using a whitelist and rename uploaded files to avoid path manipulation. Implement permission-based controls to prevent unauthorized file access. Finally, validate the content of uploaded files to ensure they don’t contain malicious code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=160bd47a553e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BetaFast]]></title>
            <link>https://gokulvinesh.medium.com/betafast-9072cb27a97f?source=rss-6338e46733d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/9072cb27a97f</guid>
            <dc:creator><![CDATA[Gokulvinesh]]></dc:creator>
            <pubDate>Mon, 09 Oct 2023 07:08:29 GMT</pubDate>
            <atom:updated>2023-10-09T07:08:29.314Z</atom:updated>
            <content:encoded><![CDATA[<h4>Lab configuration for thick client</h4><blockquote>Requirements</blockquote><blockquote>&gt; .Net 4.6.0</blockquote><blockquote>&gt; visual studio</blockquote><blockquote>&gt; Docker</blockquote><blockquote>&gt; Hyper-V</blockquote><p><a href="https://github.com/NetSPI/BetaFast/tree/master/"><strong>Copy the GIT repository</strong></a><strong> and </strong>Clone into visual studio</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OKhviw_eYr-kZJ75G5QbAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sq6QgksH5Jmf2RP31mpBnQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QQh73sS-ErnpGFFH5qVtSQ.png" /></figure><p>In visual studio click rebuild</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NiEkIYwuTalakt8vSp__rQ.png" /></figure><p>Now open the config file from the following path</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XCc0-b9ZNIbxGBjiDWWF0w.png" /></figure><p>Enter <a href="http://www.betafast.net/">www.betafast.net</a> in base URI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L-Pdz-lNHTTVFmJsKhFeJA.png" /></figure><p>In debug folder exe file has been created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nMtSdAv7yOAihT6m5fO3AA.png" /></figure><p>add this URL in host file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*1c3_EhDXgGsnY0yQjZqa8Q.png" /></figure><p>Now we need to configure docker, run docker and Open shell from following path</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_G55kDbX-XRgmfhdMos-Cg.png" /></figure><p>Run the following command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R6xPJ0Dr8sspIFX3hPQBKw.png" /></figure><p>Run docker up command and Ignore the error’s</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_dTL5YlBC-QPJpm-MU96CA.png" /></figure><p>Now the application is connected with the docker server open the application and create a account</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b6rN0cDDKSFSOxIijn539Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZs9JHZM_ZQ0mcZBv_ld7Q.png" /></figure><p>Configure proxy for burp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qAnrHgY4gZdVHmSgiU_X3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J9ZmIpl2O6XJgpHBaUC3Kg.png" /></figure><p>If any error occurs run the build and up command on this path</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IB5SdUvxhArb0VGtr8assg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9072cb27a97f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RCE | XSS via Image Exif metadata]]></title>
            <link>https://gokulvinesh.medium.com/rce-xss-via-image-exif-metadata-dddf33dadb41?source=rss-6338e46733d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/dddf33dadb41</guid>
            <dc:creator><![CDATA[Gokulvinesh]]></dc:creator>
            <pubDate>Wed, 13 Sep 2023 05:23:52 GMT</pubDate>
            <atom:updated>2023-09-13T05:23:52.059Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys,</p><p>Welcome to my First Blog</p><p>Hi, I’m GOKULVINESH , and if life were a command line, my ‘whoami’ would reveal a curious explorer always seeking new knowledge.</p><p><strong>Table of Contents</strong></p><p>➢What is Exif metadata</p><p>➢ Usage of Exif Metadata</p><p>➢ information gathering via image file</p><p>➢ XSS</p><p>➢ RCE</p><p>➢ mitigations</p><p><strong>What is Exif metadata</strong></p><p> Exif (Exchangeable image file format) metadata is a standard for embedding metadata into image files, typically digital photos captured by digital cameras, smartphones, and other imaging devices. This metadata contains information about the image itself and the circumstances under which it was taken. Exif data can include various types of information, </p><p>➢Camera Settings </p><p>➢Date and Time </p><p>➢ Geographic Information </p><p>➢ Copyright and Authorship and etc.</p><p><strong>Usage of Exif Metadata</strong></p><p>➢ Document Management: Document metadata, such as authorship, creation date, version history, and document type, helps track and manage documents within organizations.</p><p>➢ Geospatial Information: Geographic Information Systems (GIS) rely heavily on metadata to describe the attributes and location of geospatial data, enabling users to analyze and visualize spatial information effectively.</p><p>➢ Scientific Research: Researchers use metadata to document experiments, datasets, and research findings, making it easier to reproduce experiments and validate results.</p><p>➢ Digital Signatures: Metadata can include information about digital signatures applied to documents or digital assets. Digital signatures provide a way to authenticate the source and integrity of a file. Metadata can store details about the signing entity, the signing algorithm used, and the timestamp of the signature. And etc.</p><p><strong>Information Gathering via Image File</strong></p><p>➢ Lots of tools is there to extract a Exif meta data for example</p><ul><li>Metadata2go</li><li>Exif tool</li></ul><p>➢ Download and install the Exif tool</p><p>➢ Give the following command to extract the details from image file <strong>Exiftool imagename.extention</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4zG4wlC-RaeVH9h7t4b_A.png" /></figure><p><strong>XSS via Metadata</strong></p><p>A security issue arose with an image processing library that mishandled image metadata, specifically Exif tags, during uploads. This oversight led to a potential cross-site scripting (XSS) vulnerability. The library should have either removed Exif data entirely or sanitized it by converting XSS payloads into HTML entities to mitigate this risk.</p><p>➢ By following comment we can able to write a XSS payload in image <strong>exiftool -UserComment=yourcomment imagename.extention</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vcKMk7GDuHjUTLzU1iWEuw.png" /></figure><p>➢ Upload that image to vulnerable website</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Ab695p-W9TXRDWRQW31cg.png" /></figure><p><strong>RCE</strong></p><p>➢ Inject following PHP into image file and convert into .php file in this portswigger lab application will check content of the file so it’s not checking the extension</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7fx5WwoM_SIFf_7r5WpBVg.png" /></figure><p>➢ Upload that vulnerable file in profile picture option</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dr-2vsaD9fcQweAOIF-Y7A.png" /></figure><p>➢ Capture the profile picture packet in burp and see the response the code has been executed successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1sUxrxYfI3DLfkmiQo72A.png" /></figure><p><strong>Mitigations</strong></p><p>➢ Always strip the exif data (meta-data) from the uploaded images. If you don’t want to strip the exif data then there should be a validation check for metadata where it should check whether the metadata (exifdata) is containing any malicious payload and if yes then it should be removed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dddf33dadb41" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>