<?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 Raja Shiva Ram on Medium]]></title>
        <description><![CDATA[Stories by Raja Shiva Ram on Medium]]></description>
        <link>https://medium.com/@rajashivaram.0?source=rss-7a36401cfd64------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Tx7zI80sS7juKFw6.jpg</url>
            <title>Stories by Raja Shiva Ram on Medium</title>
            <link>https://medium.com/@rajashivaram.0?source=rss-7a36401cfd64------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 13:32:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajashivaram.0/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[CupidBot — Love at First Breach 2026 Writeup]]></title>
            <link>https://medium.com/@rajashivaram.0/cupidbot-love-at-first-breach-2026-writeup-89278e5ff700?source=rss-7a36401cfd64------2</link>
            <guid isPermaLink="false">https://medium.com/p/89278e5ff700</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[prompt-injection-attack]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Raja Shiva Ram]]></dc:creator>
            <pubDate>Sat, 14 Feb 2026 18:37:08 GMT</pubDate>
            <atom:updated>2026-02-14T18:37:48.681Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r45dz5G1KXIadTi1OfodDw.png" /></figure><p>I initally started the conversation with CupidBot with the ls command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*V1rI2IxrCs8aQOsnR35kag.png" /></figure><p>The verification code looked like a MD5 hash, so I used john the ripper to crack the given hash</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*s7V5v5QfzknQW63lBXdOQg.png" /></figure><p>I then tried just giving emerald to the CupidBot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*puLH6OurWVXMuM_qRrjHZA.png" /></figure><p>It didn’t work.</p><p>I tried one of the prompts mentioned from this article — <a href="https://tcm-sec.com/ethically-hack-ai-prompt-injection/">https://tcm-sec.com/ethically-hack-ai-prompt-injection/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*Gcqn9grkiGUzs2MPdsn7OQ.png" /></figure><p>This is interesting as it revealed the information about how CupidBot follows instructions and the key word was SYSTEM_PROMPT_FLAG</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*y2dPOa6Kj4vI4Bf965KKDQ.png" /></figure><p>I tried continuing conversation noticing the pattern of asking with uppercase joined with underscores as flag and revealed the flag for the prompt injection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*XBv8DXID8rFtautfSR3ljQ.png" /></figure><p>The same tactic did not work for the final flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*-UCqdBV14jqUD-06DLGxJA.png" /></figure><p>I changed my approach by declaring that I am an administrator with elevated privileges asking about any other secret flag by appending gift to make sure the conversation is still about gift ideas</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*edtmHsVd8bSKCUcv3hmPJw.png" /></figure><p>Got the final flag.</p><p>References: <a href="https://tcm-sec.com/ethically-hack-ai-prompt-injection/">https://tcm-sec.com/ethically-hack-ai-prompt-injection/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89278e5ff700" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hidden Deep Into my Heart — Love at First Breach 2026 Writeup]]></title>
            <link>https://medium.com/@rajashivaram.0/hidden-deep-into-my-heart-love-at-first-breach-2026-writeup-084797c8f3f5?source=rss-7a36401cfd64------2</link>
            <guid isPermaLink="false">https://medium.com/p/084797c8f3f5</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Raja Shiva Ram]]></dc:creator>
            <pubDate>Sat, 14 Feb 2026 17:58:53 GMT</pubDate>
            <atom:updated>2026-02-14T17:58:53.844Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hidden Deep Into my Heart — Love at First Breach 2026</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-rM_L4Dq7SboQGTgUupjeg.png" /></figure><p><strong>Challenge:</strong> Cupid’s Vault was designed to protect secrets meant to stay hidden forever. Unfortunately, Cupid underestimated how determined attackers can be.</p><p>Intelligence indicates that Cupid may have unintentionally left vulnerabilities in the system. With the holiday deadline approaching, you’ve been tasked with uncovering what’s hidden inside the vault before it’s too late.</p><p>You can find the web application here: <a href="http://10.65.173.220:5000/">http://T</a>ARGET:PORT</p><p>First, I started with nmap scan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*sCKHsnhiOgMPUkkSlOHxuQ.png" /></figure><p>Nmap scan revealed an interesting endpoint</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rgRgF6QwqnIEtc403EUGg.png" /></figure><p>/robots.txt revealed a interesting note: cupid_arrow_2026!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*UpLwsBvzFl2mvjsvV_q-Lg.png" /></figure><p>then, I bruteforced directories with ffuf</p><pre>ffuf -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u http://TARGET:PORT/cupids_secret_vault/FUZZ -nc 200, 301, 302 -H &quot;User-Agent: Mozilla/5.0&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nU85qkQrxRvUVjWHemN2_g.png" /></figure><p><a href="http://TARGET:PORT/cupids_secret_vault/administrator">http://TARGET:PORT/cupids_secret_vault/administrator</a> revealed a login page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDHmGRvKvU_z51y76cMN3w.png" /></figure><p>I initially tried brute-forcing username and password with hydra but noticed that it is taking longer than expected so stepped back I tried with the obvious usernames and password with one of them being “admin” and “cupid_arrow_2026!!!” respectively.</p><p>Got the flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P_UoaiiTh0TUDNo0K9YXqQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=084797c8f3f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving MetaCTF Cooked Books]]></title>
            <link>https://medium.com/@rajashivaram.0/solving-metactf-cooked-books-e72662c60324?source=rss-7a36401cfd64------2</link>
            <guid isPermaLink="false">https://medium.com/p/e72662c60324</guid>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[metactf]]></category>
            <category><![CDATA[linux-commands]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Raja Shiva Ram]]></dc:creator>
            <pubDate>Thu, 27 Feb 2025 03:26:09 GMT</pubDate>
            <atom:updated>2025-02-27T03:26:09.405Z</atom:updated>
            <content:encoded><![CDATA[<p>Hidden Message in a Library Report</p><p>CTF (Capture the Flag) challenges are a great way to sharpen problem-solving and cybersecurity skills. In this write-up, I’ll walk you through how I solved a MetaCTF challenge using two different approaches: a Jupyter Notebook with Python and Linux command-line utilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJ5lLvr_28zhFsqlS4m43A.png" /></figure><p><strong>Solution 1: Using Pandas</strong></p><p>First, I tackled the challenge in a Jupyter Notebook using Python’s pandas library</p><p><strong>Steps:</strong></p><ol><li><strong>Import necessary libraries </strong>and load the csv file.</li><li><strong>Inspect the dataset </strong>to check column names and contents.</li><li><strong>Extract the </strong><strong>Times Borrowed </strong>column and analyze the values.</li><li><strong>Convert the numbers to ASCII characters </strong>to reveal the hidden message.</li></ol><p><strong>Code:</strong></p><pre>import pandas as pd<br><br># Load the CSV file<br>data = pd.read_csv(&quot;banned_books_report.csv&quot;)<br><br># Inspect the column names<br>print(data.columns)<br><br># Extract and inspect the &#39;Times Borrowed&#39; column<br>borrowed_values = data[&quot;Times Borrowed&quot;].values<br><br># Convert numbers to ASCII characters<br>result = &quot;&quot;<br>for i in borrowed_values:<br>  result += chr(i)<br><br>print(result) # Revealed hidden message</pre><p><strong>Explanation</strong></p><ul><li>We read the CSV file using pandas</li><li>Extracted the Times Borrowed column and noticed that the values seemed to correspond to ASCII codes.</li><li>Used chr() to convert each number into a character and reconstructed the hidden message.</li></ul><p><strong>Solution 2: Using Linux Commands</strong></p><p>For a more lightweight approach, I used Linux command-line tools to extract the values and decode the hidden message.</p><p><strong>Steps:</strong></p><ol><li><strong>Download the CSV file </strong>using wget.</li><li><strong>Extract the </strong><strong>Times Borrowed column </strong>using awk or cut.</li><li><strong>Process the extracted values </strong>with a python script to convert them to ASCII characters.</li></ol><p><strong>Commands:</strong></p><p>Download the file (if needed)</p><pre>wget https://metaproblems.com/b6672e84d7521b831764815b79d363c3/banned_books_report.csv</pre><p>Extract the ‘Times Borrowed’ column using awk</p><pre>awk -F, &#39;{print $3}&#39; banned_books_report.csv &gt; times_borrowed.txt</pre><p>Alternatively, using cut</p><pre>cut -d, -f3 banned_books_report.csv &gt; times_borrowed.txt</pre><p><strong>Python Script:</strong></p><pre>with open(&#39;times_borrowed.txt&#39;, &#39;r&#39;) as file:<br>    lines = file.readlines()<br>    s = [line.rstrip(&#39;\n&#39;) for line in lines]<br><br># Remove header<br>s = s[1:]<br><br># Convert numbers to characters<br>result = &quot;&quot;<br>for i in s:<br>    result += chr(int(i))<br><br>print(result)  # Revealed hidden message</pre><p><strong>Explanation:</strong></p><ul><li>Used awk or cut to extract the third column (Times Borrowed values) and saved it into a text file.</li><li>Wrote a simple Python script to read and convert these values into characters.</li><li>Printed the decoded message.</li></ul><p><strong>Conclusion</strong></p><p>This challenge demonstrated two different ways to extract and process data:</p><ul><li><strong>Python with Pandas:</strong> Useful for more complex data manipulation and analysis.</li><li><strong>Linux CLI tools:</strong> Quick and efficient for handling text-based data in a shell environment.</li></ul><p>By solving CTFs and writing about them, I’m building my technical portfolio and showcasing my problem-solving skills. If you’re looking for a way to stand out in job applications, blogging about challenges like these is a great start!</p><p>Do you have any feedback or suggestions? Let’s discuss in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e72662c60324" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe — Brooklyn Nine-Nine CTF — Walkthrough]]></title>
            <link>https://medium.com/@rajashivaram.0/tryhackme-brooklyn-nine-nine-ctf-walkthrough-d0d6524f86d4?source=rss-7a36401cfd64------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0d6524f86d4</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[stegseek]]></category>
            <category><![CDATA[brooklyn-nine-nine]]></category>
            <category><![CDATA[nmap]]></category>
            <category><![CDATA[gtfobins]]></category>
            <dc:creator><![CDATA[Raja Shiva Ram]]></dc:creator>
            <pubDate>Tue, 20 Aug 2024 02:19:28 GMT</pubDate>
            <atom:updated>2024-08-20T02:19:28.513Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe — Brooklyn Nine-Nine CTF — Walkthrough</h3><p>In this article, I will walk you through my approach to solving the Brooklyn Nine-Nine CTF on TryHackMe.</p><p>First, I started the AttackBox and the target machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*321uk2xGBiCrq0dO3ze4tQ.png" /></figure><p>While waiting for them to initialize, I found a one-hour loop of the Brooklyn Nine-Nine soundtrack on YouTube to keep me entertained.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6puTBwwR1wqRru45KYSxKg.png" /></figure><p>After a while, with the soundtrack still looping, the AttackBox and target machine were ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bx5PDwBZ0YDdghvptBFhbw.png" /><figcaption>Target machine information</figcaption></figure><p>To kick off the information gathering phase, I performed a port scan on the target machine using the following <strong>nmap </strong>command:</p><pre>nmap -sV -sC &lt;target machine IP&gt;</pre><p>This command will not only detect the versions of the services running on open ports (-sV), but also run the default set of NSE scripts (-sC) to gather more detailed information and identify potential vulnerabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*Wl6w6484aYu5mdflmNZStw.png" /></figure><p>The <strong>nmap</strong> scan revealed three interesting open services: FTP, SSH, and HTTP.</p><p>I decided to investigate the FTP service first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*g00dgBNT_EJM_mZcd4fEZw.png" /></figure><p>The FTP server allowed anonymous login, meaning no credentials were required. After a quick search on how to navigate this, I found a useful <a href="https://stackoverflow.com/questions/3936911/how-can-i-login-anonymously-with-ftp-usr-bin-ftp">stackoverflow article.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*-t_CPUQ0dyVCjpB_cS49hg.png" /></figure><p>After getting into the FTP server using anonymous login, I listed files on the server and found note_to_jake.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*tH3J81C9LpdNbcOVrkorJg.png" /></figure><p>I used <strong>get note_to_file.txt </strong>to transfer files from the FTP server to local machine and got our first hint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*iDFDPmnapahK1A6D9tsCqQ.png" /></figure><p>Transferring this file to my local machine provided the first hint: the password is weak.</p><p>I wanted to check out the HTTP service by visiting the target machine’s IP in my browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UbS6uuoNEoOYDe3wK4hOeQ.png" /></figure><p>The bottom of the web page appeared as follows: “This example creates a full page background image. Try to resize the browser window to see how it always will cover the full screen (when scrolled to top), and that it scales nicely on all screen sizes.” Initially, I was puzzled by the content on the webpage, but I quickly realized that the real clue might be hidden in the page source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*puIUEP8VfD8-32pAu9Mdxg.png" /></figure><p>It said in the HTML comments, “Have you ever heard of steganography?”. Of course, I have.</p><p>I downloaded the background image using <strong>wget </strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*a95vZ6DFnJS8Ck24KUmgpQ.png" /></figure><p>For steganography analysis, I initially tried <a href="https://aperisolve.com/">Aperi’Solve</a>, but it didn’t yield useful results, I then switched to <strong>stegseek </strong>by <a href="https://github.com/RickdeJager/stegseek">Rick de Jage</a>r, which is specifically designed for this purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*nxCfo9hMYS1hZMT5WJtapA.png" /></figure><p>The arguments given to the stegseek command were image file and the classic rockyou.txt wordlist. The output was extracted to the file named brooklyn99.jpg.out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*1G__lwoyf8zmevk5umXcPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*vDFIVTCKMoF56nIZL0eWrA.gif" /></figure><p>This gif is literally the password.</p><p>After I got Captain Holt’s password. I decided to login to ssh server with holt as username and the above password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*LupikUR4vgQXCoe5Z24DYA.png" /></figure><p>I listed all the files using ls -lah command and found user.txt .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*BC6moXaeQZvu8iUa7JHgrg.png" /></figure><p>We found our first flag.</p><p>The final challenge is to gain root access.</p><p>Before that, I finally realized that I have explored ftp and http but I didn’t quite use the first hint.</p><pre>From Amy,<br><br>Jake please change your password. It is too weak and holt will be mad if someone hacks into the nine nine</pre><p>Jake’s password might be weak so I brute forced “jake” as the username against the SSH server on the target machine.</p><p>The hydra command used is hydra -l &lt;username&gt; -P &lt;wordlist&gt; &lt;target machine IP&gt; ssh -t 4</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*1vxvmy3IEDfESpw3vmhWwA.png" /></figure><p>I logged into the SSH server with these credentials and checked the allowed (and forbidden) commands for <strong>jake </strong>using the command sudo -l.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*hl9LecNcY0cojXUA9AFmig.png" /></figure><p>User jake may run the less command and I used GTFObins to exploit this and gain root access. GTFOBins lists binaries that, when set with the SUID or SGID bit, can be exploited to execute arbitrary commands as another user (typically root). This is a common method for privilege escalation.</p><p><a href="https://gtfobins.github.io/gtfobins/less/">less | GTFOBins</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*bEL0kNWaKtozfElcvSfOTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*QvkMgr-YRMyYQRVBy_MzFg.png" /></figure><p>After entering the less /etc/profile , I typed !/bin/sh which will spawn a shell with a root access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*h2xYbrojtqNRuwk07RAVKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/161/1*OiZSOQOSEmfGKcRvfIiGYg.png" /></figure><p>Initially, I didn’t get root access, but then I tried the command: <strong>sudo less /etc/profile</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*hffU-Do7QXTKKLCW4P95hw.png" /></figure><p><strong>sudo</strong> is a very powerful command, I would say. I changed directory to root and got the root flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*qicQp1qRFzt_h2jm4cK_vg.png" /></figure><p>With the root flag in hand, I successfully completed the CTF, truly feeling like an ‘amazing detective/genius’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*YszRhtiez5LbqWEHOo0sVg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7JdBsXqIKLI9W6baDfnKSg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0d6524f86d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe — Bounty Hacker CTF Walkthrough]]></title>
            <link>https://medium.com/@rajashivaram.0/tryhackme-bounty-hacker-ctf-walkthrough-f88bf33d62db?source=rss-7a36401cfd64------2</link>
            <guid isPermaLink="false">https://medium.com/p/f88bf33d62db</guid>
            <category><![CDATA[bounty-hacker]]></category>
            <category><![CDATA[bounty-hacker-tryhackme]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Raja Shiva Ram]]></dc:creator>
            <pubDate>Wed, 24 Apr 2024 01:20:35 GMT</pubDate>
            <atom:updated>2024-04-24T01:20:35.661Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe — Bounty Hacker CTF Walkthrough</h3><p>Here is the walkthrough of how I solved the Bounty Hacker CTF.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cPubphFBIlMsqS7FftJfWg.png" /></figure><p>This is my first attempt at writing a blog, this will be one of those foundational moments in my cybersecurity learning journey.</p><p>I deployed the machine and started using it in AttackBox.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p13dQiGWeELxH19BPguVEg.png" /></figure><p>I used Nmap to find open ports on the machine.</p><p>The command used is nmap -sV MACHINE_IP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*IAQ7LXdAsTUP2YrODAvfOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9lw8PNiy-lluJpn632oZbA.png" /></figure><p>From the basic Nmap scan, it is discovered that FTP, SSH, and HTTP are some of the open ports.</p><p>Now, I tried to log into the FTP server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*QZVu0659oJB9Hnb53RcvJQ.png" /></figure><p>It says that the FTP server is anonymous only. So, I searched about FTP anonymous login and came across the following source: <a href="https://stackoverflow.com/questions/3936911/how-can-i-login-anonymously-with-ftp-usr-bin-ftp">how can I login anonymously with FTP</a>? I tried to log in using an ‘anonymous’ username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*hYW_jen1avsHCfWYqhtY4w.png" /></figure><p>After logging in, the files listed on the server are: locks.txt, and task.txt and we can use the command ‘get filename’ to download it locally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*8BUW2uUnPlL7BrfW8Jg_7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*JCn5du05Kikd5mWEorYEbQ.png" /></figure><p>task.txt revealed that the username is ‘lin’ and the locks.txt is the password file. From the Nmap scan report, ssh could be a good place to brute force with the gathered information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*njvAHwG97IFHVyZ0eK6h8g.png" /></figure><p>Before logging in with SSH, we need the correct password, to brute force, I used Metasploit for this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MUgODjdDooMInH5CyEbhUg.png" /></figure><p>In the Metasploit framework, the auxiliary/scanner/ssh/ssh_login module is helpful to brute force the login credentials with username ‘lin’ and password list as locks.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sijPULGKK386PHqvARyfsA.png" /></figure><p>I set RHOSTS to the MACHINE_IP, set USERNAME to lin, set PASS_FILE as locks.txt, and ran the exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mMWxwn3FmiR3MP4NZXXtQQ.png" /></figure><p>The username and password are lin:RedDr4gonSynd1cat3 [username: password]. We can use these credentials to log in to SSH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*_bHEmyelwX-OoCg1PUnF3g.png" /></figure><p>After successfully logging into the SSH server, user.txt can be accessed. But, the root.txt cannot be found. It could be accessible via root privilege so, I checked whether the user ‘lin’ can escalate privilege to root but the user cannot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*NcefOwS1RKBQ8uMQwe1gjQ.png" /></figure><p>The hint provided said that the user ‘lin’ may run /bin/tar. I search about /bin/tar and got to know about GTFOBins, which can be used to bypass local security restrictions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5TQw8TzO5BCE4Pocanlvtw.png" /></figure><p>The following command can be used to escalate privilege access.</p><pre>sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*KjF4b1gweM6B7KqmBSNEiw.png" /></figure><p>After executing the tar sudo binary, root access is gained. I got access to the root.txt file and thus got the answer to the last question.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f88bf33d62db" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>