{"id":207,"date":"2025-07-02T18:48:00","date_gmt":"2025-07-02T18:48:00","guid":{"rendered":"https:\/\/thecyberstaff.com\/?p=207"},"modified":"2025-12-28T19:47:33","modified_gmt":"2025-12-28T19:47:33","slug":"updown-hackthebox-lab","status":"publish","type":"post","link":"https:\/\/thecyberstaff.com\/?p=207","title":{"rendered":"UpDown- Hackthebox lab"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This assessment was tough, the foothold was really demanding and helped me learn a lot. I started off with port scans using the tool Nmap for both TCP and UDP ports.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"744\" height=\"314\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630091820.png\" alt=\"\" class=\"wp-image-477\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630091820.png 744w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630091820-300x127.png 300w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"713\" height=\"153\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630093903.png\" alt=\"\" class=\"wp-image-478\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630093903.png 713w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630093903-300x64.png 300w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The site on port 80 was a website created to determine if another website is up or not.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630102430-1024x576.png\" alt=\"\" class=\"wp-image-479\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630102430-1024x576.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630102430-300x169.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630102430-768x432.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630102430.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I an Nikto and Nuclei to look for any vulnerabilities but did not find anything interesting.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"266\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630103511-1024x266.png\" alt=\"\" class=\"wp-image-480\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630103511-1024x266.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630103511-300x78.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630103511-768x200.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630103511.png 1341w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"838\" height=\"321\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630104505.png\" alt=\"\" class=\"wp-image-481\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630104505.png 838w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630104505-300x115.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630104505-768x294.png 768w\" sizes=\"auto, (max-width: 838px) 100vw, 838px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next I used Gobuster to fuzz the web directories Wfuzz to check for subdomains.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"835\" height=\"352\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630110129.png\" alt=\"\" class=\"wp-image-482\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630110129.png 835w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630110129-300x126.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630110129-768x324.png 768w\" sizes=\"auto, (max-width: 835px) 100vw, 835px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"263\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630120220-1024x263.png\" alt=\"\" class=\"wp-image-484\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630120220-1024x263.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630120220-300x77.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630120220-768x197.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630120220.png 1338w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I added the discovered subdomain to my \/etc\/hosts file to access the page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"438\" height=\"223\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630120354.png\" alt=\"\" class=\"wp-image-485\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630120354.png 438w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630120354-300x153.png 300w\" sizes=\"auto, (max-width: 438px) 100vw, 438px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">With the name resolution in pace on my local attack box. I was still unable to access the page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"495\" height=\"210\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630120423.png\" alt=\"\" class=\"wp-image-486\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630120423.png 495w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630120423-300x127.png 300w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">While fuzzing the \/dev directory I found earlier, I found a Git repository on the website.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"590\" height=\"533\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630133710.png\" alt=\"\" class=\"wp-image-487\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630133710.png 590w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630133710-300x271.png 300w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Using a tool called git-dumper, I pulled down the files to my local attack box.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"480\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630135241.png\" alt=\"\" class=\"wp-image-488\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630135241.png 640w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630135241-300x225.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"451\" height=\"207\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630135334.png\" alt=\"\" class=\"wp-image-489\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630135334.png 451w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630135334-300x138.png 300w\" sizes=\"auto, (max-width: 451px) 100vw, 451px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">While looking through the files, I found in the .htaccess file that a special header was required to access some of the resources.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"441\" height=\"110\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630135421.png\" alt=\"\" class=\"wp-image-490\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630135421.png 441w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630135421-300x75.png 300w\" sizes=\"auto, (max-width: 441px) 100vw, 441px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I added the header in the web browser plugin \u201cModify Header Values\u201d and was able to access the dev subdomain.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"544\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630144254-1024x544.png\" alt=\"\" class=\"wp-image-491\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630144254-1024x544.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630144254-300x159.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630144254-768x408.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630144254.png 1474w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"480\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630144431.png\" alt=\"\" class=\"wp-image-493\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630144431.png 640w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630144431-300x225.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, I wanted to upload a reverse shell but nothing was working as expected, under further investigation. This site had many php functions blocked. Also, in order to successfully upload a file, it needed to be zipped and have a file extensions such as png. I used the phar function to read the zip file and uploaded a php shell in a zip file named shell.jpg.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"235\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630152526.png\" alt=\"\" class=\"wp-image-494\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630152526.png 583w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630152526-300x121.png 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I was able to run the request above and get a reverse shell, I had to use some other writeups to get this working as it was a bit outside of my comfort zone.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630152825-1024x576.png\" alt=\"\" class=\"wp-image-495\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630152825-1024x576.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630152825-300x169.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630152825-768x432.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250630152825.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"645\" height=\"155\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702093200.png\" alt=\"\" class=\"wp-image-496\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702093200.png 645w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702093200-300x72.png 300w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I upgraded the shell using \u201cpython3 -c \u2018import pty;pty.spawn(\u201c\/bin\/bash\u201d)&#8217;\u201d then found some scripts on the box. One of the scripts was an ELF binary that is used to execute other python scripts. I used this script to inject some code and got access to the developer account.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"614\" height=\"230\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702093810.png\" alt=\"\" class=\"wp-image-497\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702093810.png 614w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702093810-300x112.png 300w\" sizes=\"auto, (max-width: 614px) 100vw, 614px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I then exfiltrated the ssh key for developer.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"495\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702093912-1024x495.png\" alt=\"\" class=\"wp-image-498\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702093912-1024x495.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702093912-300x145.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702093912-768x371.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702093912.png 1096w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I used the key to access the box as the developer account over ssh.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"551\" height=\"74\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702094154.png\" alt=\"\" class=\"wp-image-499\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702094154.png 551w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702094154-300x40.png 300w\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I checked if the user had access to run sudo on anything with sudo -l. easy_install has instructions on gtfobins&nbsp;<a href=\"https:\/\/gtfobins.github.io\/\">https:\/\/gtfobins.github.io\/<\/a>&nbsp;for privilege escalation. I used the commands below to get root.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"952\" height=\"261\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702094433.png\" alt=\"\" class=\"wp-image-500\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702094433.png 952w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702094433-300x82.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702094433-768x211.png 768w\" sizes=\"auto, (max-width: 952px) 100vw, 952px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This box took me a couple of days and taught me a lot. This shows the importance of hardening web servers and the persistence some attackers will use to get in. Thank you to&nbsp;<a href=\"https:\/\/medium.com\/@Poiint\/htb-updown-write-up-bf01d926ddc4\">https:\/\/medium.com\/@Poiint\/htb-updown-write-up-bf01d926ddc4<\/a>&nbsp;for the writeup and help getting through this lab.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This assessment was tough, the foothold was really demanding and helped me learn a lot. I started off with port scans using the tool Nmap for both TCP and UDP ports. The site on port 80 was a website created to determine if another website is up or not. I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":208,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-207","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cybersecurity","category-pentesting"],"brizy_media":[],"_links":{"self":[{"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/posts\/207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=207"}],"version-history":[{"count":2,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":501,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions\/501"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/media\/208"}],"wp:attachment":[{"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}