{"id":471,"date":"2025-05-19T16:50:46","date_gmt":"2025-05-19T15:50:46","guid":{"rendered":"https:\/\/www.aledthomas.com\/?post_type=jetpack-portfolio&#038;p=471"},"modified":"2025-05-19T16:51:54","modified_gmt":"2025-05-19T15:51:54","slug":"hack-the-box-devvortex-write-up","status":"publish","type":"jetpack-portfolio","link":"https:\/\/www.aledthomas.com\/index.php\/portfolio\/hack-the-box-devvortex-write-up\/","title":{"rendered":"Hack the box &#8211; devvortex write up"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"338\" height=\"172\" src=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-11_09-17-31.png\" alt=\"\" class=\"wp-image-137\" srcset=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-11_09-17-31.png 338w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-11_09-17-31-300x153.png 300w\" sizes=\"auto, (max-width: 338px) 100vw, 338px\" \/><\/figure>\n\n\n\n<p>This machine was added to htb a couple of weeks ago, it&#8217;s been rated as easy<\/p>\n\n\n\n<p>Starting with nmap and the address given for the machine we find ports 22 and 80 open, nothing unusual looking on the scan.<\/p>\n\n\n\n<p>The website on port 80 seems to be a company site for a web design firm, there&#8217;s some photos, a few names to note down for later, and a contact form &#8211; but nothing that seems to lead anywhere.<\/p>\n\n\n\n<p>Start dirb scanning- doesn&#8217;t seem to find much interesting, there&#8217;s not much on this site.<\/p>\n\n\n\n<p>Scan for subdomains with wfuzz- ah, theres a &#8220;dev.&#8221; subdomain, looks like a slightly different version of the main site, and has a robots.txt &#8211; some interesting files to check out in there<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"434\" height=\"273\" src=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-10_09-30-16.png\" alt=\"\" class=\"wp-image-125\" srcset=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-10_09-30-16.png 434w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-10_09-30-16-300x189.png 300w\" sizes=\"auto, (max-width: 434px) 100vw, 434px\" \/><\/figure>\n\n\n\n<p>plus the comment at the top tells us something about &#8220;joomla&#8221; which appears to be a content management system.\u00a0 A quick google and I find out that the version string can be found in an xml file. Looking up the version on exploitdb and it is listed as vulnerable &#8211; there is a proof of concept python script on there, it seems that the joomla config is exposed through a link. We don&#8217;t need to use the pre-written POC script we can just load the link ourself.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"265\" src=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_22-17-42-1024x265.png\" alt=\"\" class=\"wp-image-121\" srcset=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_22-17-42-1024x265.png 1024w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_22-17-42-300x78.png 300w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_22-17-42-768x199.png 768w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_22-17-42.png 1358w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Here the username and password for the database is exposed, what are the chances that the same details can get us into the website admin page? It&#8217;s an &#8216;easy&#8217; box so pretty high I&#8217;d guess, and:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"358\" src=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-10_09-41-47-1024x358.png\" alt=\"\" class=\"wp-image-126\" srcset=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-10_09-41-47-1024x358.png 1024w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-10_09-41-47-300x105.png 300w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-10_09-41-47-768x268.png 768w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-10_09-41-47.png 1359w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I don&#8217;t know my way around this &#8220;joomla&#8221; but there&#8217;s access to the page templates here so I add a reverse shell to the php section and we&#8217;re in as the www user account.<\/p>\n\n\n\n<p><br>Now to get an actual user account, \/etc\/passwd shows a user account for a &#8220;logan&#8221;, we have the user\/pass for the mysql database from eariler so lets have a look in it:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"293\" src=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_23-36-31-1024x293.png\" alt=\"\" class=\"wp-image-124\" srcset=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_23-36-31-1024x293.png 1024w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_23-36-31-300x86.png 300w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_23-36-31-768x220.png 768w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_23-36-31.png 1347w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Here&#8217;s a hashed password for a user &#8220;logan&#8221;, might be worth trying to crack it. My computer is a potato but this htb machine is rated as easy so I figure I&#8217;ll run JtR on it and if it&#8217;s meant to be cracked it&#8217;ll be a simple one, else I&#8217;m looking in the wrong place, so I start the cracking tool and go off to do something else<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"173\" src=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_23-37-16.png\" alt=\"\" class=\"wp-image-122\" srcset=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_23-37-16.png 727w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-09_23-37-16-300x71.png 300w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><\/figure>\n\n\n\n<p>The password was cracked pretty quick so that must be the intended route, try and ssh in as &#8220;logan&#8221; and yes we have the user flag!<\/p>\n\n\n\n<p>Now to get root:<\/p>\n\n\n\n<p><code>sudo -l<\/code>; tells us that we have permission to run the command <em>apport-cli<\/em> as root. <\/p>\n\n\n\n<p><code>apport-cli -v<\/code> gives us the version available, and cross checking online shows that this version is vulnerable to <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-1326\" target=\"_blank\" rel=\"noreferrer noopener\">CVE-2023-1326<\/a><\/p>\n\n\n\n<p>Simply put: if we can generate a crash report within <em>apport-cli <\/em>we can view it as a text file before sending, the program uses the <em>less<\/em> command to display the text file but doesn&#8217;t drop it&#8217;s privileges so as we can run <em>apport-cli<\/em> as root, we can run any command from within <em>less<\/em> with root privileges; read files, modify configuration, even open a shell as root user. For this machine we only need to get the flag from \/root\/root.txt.<\/p>\n\n\n\n<p>We can cause a report to be generated by running <code>apport-cli -f<\/code> and a process id (doesn&#8217;t matter which, we don&#8217;t care about the report only that we can view it). Choose the option to view it and once it&#8217;s displayed we can hit &#8220;!&#8221; and enter our command.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"571\" height=\"162\" src=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-11_09-01-53.png\" alt=\"\" class=\"wp-image-130\" srcset=\"https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-11_09-01-53.png 571w, https:\/\/www.aledthomas.com\/wp-content\/uploads\/2023\/12\/Screenshot_2023-12-11_09-01-53-300x85.png 300w\" sizes=\"auto, (max-width: 571px) 100vw, 571px\" \/><\/figure>\n\n\n\n<p>This was a fun machine, pretty straightforward with some unpatched software and a bit of password reuse. It&#8217;s classed as an &#8220;easy&#8221; machine, and it was exactly that.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This machine was added to htb a couple of weeks ago, it&#8217;s been rated as easy Starting with nmap and the address given for the<span class=\"more-button\"><a href=\"https:\/\/www.aledthomas.com\/index.php\/portfolio\/hack-the-box-devvortex-write-up\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\">Hack the box &#8211; devvortex write up<\/span><\/a><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","jetpack-portfolio-type":[22],"jetpack-portfolio-tag":[],"class_list":["post-471","jetpack-portfolio","type-jetpack-portfolio","status-publish","hentry","jetpack-portfolio-type-security"],"_links":{"self":[{"href":"https:\/\/www.aledthomas.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aledthomas.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio"}],"about":[{"href":"https:\/\/www.aledthomas.com\/index.php\/wp-json\/wp\/v2\/types\/jetpack-portfolio"}],"author":[{"embeddable":true,"href":"https:\/\/www.aledthomas.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aledthomas.com\/index.php\/wp-json\/wp\/v2\/comments?post=471"}],"wp:attachment":[{"href":"https:\/\/www.aledthomas.com\/index.php\/wp-json\/wp\/v2\/media?parent=471"}],"wp:term":[{"taxonomy":"jetpack-portfolio-type","embeddable":true,"href":"https:\/\/www.aledthomas.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio-type?post=471"},{"taxonomy":"jetpack-portfolio-tag","embeddable":true,"href":"https:\/\/www.aledthomas.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio-tag?post=471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}