{"id":183,"date":"2025-09-14T10:59:34","date_gmt":"2025-09-14T09:59:34","guid":{"rendered":"https:\/\/berky.uk\/?p=183"},"modified":"2025-09-14T11:41:04","modified_gmt":"2025-09-14T10:41:04","slug":"hackthebox-busqueda","status":"publish","type":"post","link":"https:\/\/berky.uk\/?p=183","title":{"rendered":"HackTheBox &#8211; Busqueda"},"content":{"rendered":"\n<p>This is a quick writeup to illustrate how I gained root access to the &#8216;Busqueda&#8217; machine in HackTheBox. This is a retired Linux machine of Easy difficulty.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enumeration<\/h3>\n\n\n\n<p>Our first step, as always, is to scan the IP address for open ports using nmap. This scan revealed 2 services, SSH and HTTP. The HTTP redirection shows that the web service is running under the vhost &#8220;searcher.htb&#8221;. We add this to our hosts file and proceed to the website.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"785\" height=\"504\" src=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image.png\" alt=\"\" class=\"wp-image-185\" srcset=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image.png 785w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-300x193.png 300w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-768x493.png 768w\" sizes=\"auto, (max-width: 785px) 100vw, 785px\" \/><\/figure>\n\n\n\n<p>The website itself is quite simple. It gives the user a selection of search engines and an input field for their search query. The website then returns the complete URL for the requested search, with the correct parameter\/query string on the end. I tinkered with this function in Burp Suite for a few minutes, but there&#8217;s really nothing to it, so I moved on.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"710\" src=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-1-1024x710.png\" alt=\"\" class=\"wp-image-187\" srcset=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-1-1024x710.png 1024w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-1-300x208.png 300w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-1-768x533.png 768w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-1.png 1166w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Exploitation<\/h3>\n\n\n\n<p>As an attacker, the most interesting part of the page is right at the bottom. It reveals that the website uses a library called &#8216;Searchor&#8217;, and even specifies the exact version number, allowing us to search for publicly available exploits. I have linked the one that I used below.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/nexis-nexis\/Searchor-2.4.0-POC-Exploit-\">https:\/\/github.com\/nexis-nexis\/Searchor-2.4.0-POC-Exploit-<\/a><\/p>\n\n\n\n<p>Using the exploit is very simple. We start a netcat listener, and adjust the POC payload to include our attack host&#8217;s IP and listener port. The payload can then simply be copy-pasted into the search query field on the website. Once we send the &#8216;search&#8217; request, we catch a reverse shell as the &#8216;svc&#8217; user.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"487\" height=\"265\" src=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_10_00-1.png\" alt=\"\" class=\"wp-image-189\" srcset=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_10_00-1.png 487w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_10_00-1-300x163.png 300w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Privilege Escalation<\/h3>\n\n\n\n<p>The first manual checks I tend to do when looking for a PE vector are to look through the user&#8217;s home directory (e.g. bash \/ SQL history, other files), their sudo privilege and their crontab. On this box, none of these were applicable, so I started looking for potential local exploits and other automated PE methods.<\/p>\n\n\n\n<p>First, I wanted to upgrade my shell to a meterpreter session by crafting a payload with msfvenom. I used a HTTP server on my attack box, and used wget on the target host to download my payload (and linPEAS while I was at it).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"793\" height=\"374\" src=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-2.png\" alt=\"\" class=\"wp-image-191\" srcset=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-2.png 793w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-2-300x141.png 300w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-2-768x362.png 768w\" sizes=\"auto, (max-width: 793px) 100vw, 793px\" \/><\/figure>\n\n\n\n<p>I set up msfconsole on my attack host, ready to catch the meterpreter session when I execute the payload on the target. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"451\" src=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-3.png\" alt=\"\" class=\"wp-image-192\" srcset=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-3.png 737w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-3-300x184.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/figure>\n\n\n\n<p>Once we have a meterpreter session, we&#8217;re able to use a lot of handy post-exploit modules to move further. In this case, I opted to run the local exploit suggester. This returned 8 exploits that the target machine was likely to be vulnerable to.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"482\" src=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-4-1024x482.png\" alt=\"\" class=\"wp-image-193\" srcset=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-4-1024x482.png 1024w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-4-300x141.png 300w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-4-768x362.png 768w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-4-1536x723.png 1536w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/image-4.png 1671w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I tested all 8 exploits with various options. Most exploits failed to establish a session, but the final one (ubuntu_needrestart_lpe) was a hit.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"874\" height=\"724\" src=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_32_26.png\" alt=\"\" class=\"wp-image-195\" srcset=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_32_26.png 874w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_32_26-300x249.png 300w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_32_26-768x636.png 768w\" sizes=\"auto, (max-width: 874px) 100vw, 874px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Summary<\/h3>\n\n\n\n<p>This was definitely one of the easier machines that I&#8217;ve taken down on HackTheBox. Nothing too complicated was required to exploit the web app and escalate to root, but it was a good exercise in research &amp; attack methodology in general. After having taken a break from the platform for a while, this lab served as valuable practice and helped get some confidence back.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"527\" src=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_33_50-1024x527.png\" alt=\"\" class=\"wp-image-196\" srcset=\"https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_33_50-1024x527.png 1024w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_33_50-300x154.png 300w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_33_50-768x395.png 768w, https:\/\/berky.uk\/wp-content\/uploads\/2025\/09\/Screenshot_2025-09-14_11_33_50.png 1219w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a quick writeup to illustrate how I gained root access to the &#8216;Busqueda&#8217; machine in HackTheBox. This is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":198,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[5],"tags":[],"class_list":["post-183","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cyber-sec"],"_links":{"self":[{"href":"https:\/\/berky.uk\/index.php?rest_route=\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/berky.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/berky.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/berky.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/berky.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=183"}],"version-history":[{"count":4,"href":"https:\/\/berky.uk\/index.php?rest_route=\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":197,"href":"https:\/\/berky.uk\/index.php?rest_route=\/wp\/v2\/posts\/183\/revisions\/197"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/berky.uk\/index.php?rest_route=\/wp\/v2\/media\/198"}],"wp:attachment":[{"href":"https:\/\/berky.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/berky.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/berky.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}