{"id":601,"date":"2025-09-01T02:15:43","date_gmt":"2025-09-01T02:15:43","guid":{"rendered":"https:\/\/infosecjake.net\/?p=601"},"modified":"2025-09-01T02:15:46","modified_gmt":"2025-09-01T02:15:46","slug":"hackthebox-titanic-walkthrough","status":"publish","type":"post","link":"https:\/\/infosecjake.net\/?p=601","title":{"rendered":"HackTheBox &#8211; Titanic Walkthrough"},"content":{"rendered":"\n<p>Back again with another HackTheBox machine. This time, an easy box called Titanic.<\/p>\n\n\n\n<p>As usual, let\u2019s start off with our trusty nmap scan.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"475\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-23.png\" alt=\"nmap scan\" class=\"wp-image-602\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-23.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-23-300x146.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-23-768x374.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Pretty standard open ports from what we\u2019ve seen with other HTB boxes. We have an SSH port open, likely for connecting when we get an actual account and then a web service running.<\/p>\n\n\n\n<p>Let\u2019s add this to our \/etc\/hosts file and take a look at the website.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"788\" height=\"252\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-24.png\" alt=\"etc\/hosts\" class=\"wp-image-603\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-24.png 788w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-24-300x96.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-24-768x246.png 768w\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" \/><\/figure>\n\n\n\n<p>Now, let\u2019s browse to http:\/\/titanic.htb and take a look around the site.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"284\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-25.png\" alt=\"website view\" class=\"wp-image-604\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-25.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-25-300x87.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-25-768x224.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Pretty simple webpage, only the \u2018Home\u2019 button and \u2018Book Now\u2019 button appear to be working. The \u2018Book Now\u2019 button does pop up a form that we can fill out. Maybe there\u2019s something there with what the form sends off. However, let\u2019s do some directory browsing with dirb and see if we can find anything else on this site.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"613\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-26.png\" alt=\"dirb\" class=\"wp-image-605\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-26.png 741w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-26-300x248.png 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/figure>\n\n\n\n<p>Looks like we have three directories it found. Book, download, and server-status. The \/book appears to be part of the \u2018Book Now\u2019 button and \/server-status gets us nowhere as it shows forbidden. Lastly, we have the \/download directory. Browsing to that brings us to the below page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"292\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-27.png\" alt=\"download dir\" class=\"wp-image-606\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-27.png 961w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-27-300x91.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-27-768x233.png 768w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/figure>\n\n\n\n<p>\u201cTicket parameter is required\u201d. This appears to be requiring some input to download. This also appears like it\u2019s a JSON response on an API endpoint. So, we need to pass this some sort of ticket parameter in order to get something back.<\/p>\n\n\n\n<p>However, as I\u2019ve said before\u2026let\u2019s try a different directory browsing tool just in case we\u2019re missing something here. <\/p>\n\n\n\n<p>Tried out a new tool, ferric oxide\u2026pretty neat. However, still nothing new other than \/static\/assets\/.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"688\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-28.png\" alt=\"ferric oxide\" class=\"wp-image-607\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-28.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-28-300x212.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-28-768x542.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Also tried ffuf, but nothing new there.<\/p>\n\n\n\n<p>So, with that coming to a bit of a dead end\u2026.There may be something in the \/download portion we found previously. Let\u2019s go through the booking process and capture that in Burp to see what happens.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"373\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-29.png\" alt=\"Burp\" class=\"wp-image-608\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-29.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-29-300x115.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-29-768x294.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>We will fill out the form with some generic details and ensure we\u2019ve got intercept on.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"379\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-30.png\" alt=\"burp request\" class=\"wp-image-609\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-30.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-30-300x117.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-30-768x299.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Our intercepted request shows the details we are sending off to the server. Let\u2019s send this to repeater and go from there.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"328\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-31.png\" alt=\"Sending to repeater\" class=\"wp-image-610\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-31.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-31-300x101.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-31-768x258.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>In Repeater we can send the request and immediately see the response back from the server.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"246\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-32.png\" alt=\"Repeater request\" class=\"wp-image-611\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-32.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-32-300x76.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-32-768x194.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Notice the \/download link that includes a ticket. If we go to that URL now we then get a download for a JSON ticket.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"79\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-33.png\" alt=\"Ticket download\" class=\"wp-image-612\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-33.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-33-300x24.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-33-768x62.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>However, this makes me wonder\u2026.could we change this download to something different?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"88\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-34.png\" alt=\"LFI - downloading file\" class=\"wp-image-613\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-34.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-34-300x27.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-34-768x69.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Sure enough, we can use this as a local file inclusion vulnerability. However, the \/etc\/passwd file doesn\u2019t give us a lot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"905\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-35.png\" alt=\"passwd file\" class=\"wp-image-614\" style=\"width:674px;height:auto\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-35.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-35-300x278.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-35-768x713.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>It does show us there is a developer user. With that in mind\u2026let\u2019s see if we can find a user.txt file in the developer\u2019s home folder. (I wasn\u2019t sure what _laurel was so I had to google it, laurel is an event audit plugin, basically it creates audit logs for security\u2026.so I learned something new)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"59\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-36.png\" alt=\"download user flag\" class=\"wp-image-615\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-36.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-36-300x18.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-36-768x46.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Sure enough, here\u2019s the user flag.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"87\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-37.png\" alt=\"user flag\" class=\"wp-image-616\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-37.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-37-300x27.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-37-768x69.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Entering that shows we have user flag. Now, lets continue to see what else we can do.<\/p>\n\n\n\n<p>Here I kind of hit a roadblock. We can download files from the host system but that will only get us so far, especially when we have to know what files are there to download.<\/p>\n\n\n\n<p>I spent some time looking into a good way to do subdomain directory brute forcing and this resulted in me just using gobuster. I did this initially with a different wordlist and made the mistake of not outputting it to a text file. Next, I outputted it to a text file on my desktop to better be able to browse. Additionally, for a CTF box like this, you will need to use the gobuster flag \u2018vhost\u2019 so that it doesn\u2019t try looking up DNS response. Since this is a CTF box and there won\u2019t be any DNS responses, running it without the vhost flag will fail.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"72\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-38.png\" alt=\"gobuster\" class=\"wp-image-617\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-38.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-38-300x22.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-38-768x57.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>After a bit, I opened up the file and looked for responses with a code of 30X. Anything with a 40X indicates it was a bad request.<\/p>\n\n\n\n<p>After a bit of digging I noticed \u2018dev\u2019 got a positive response from the server. So, I added dev.titanic.htb to our \/etc\/hosts file and lets browse that site.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"345\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-39.png\" alt=\"dev site\" class=\"wp-image-618\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-39.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-39-300x106.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-39-768x272.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Simply hitting the \u2018Explore\u2019 lets us anonymously view repositories here.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"168\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-40.png\" alt=\"Viewing repos\" class=\"wp-image-619\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-40.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-40-300x52.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-40-768x132.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>We have docker-config and flask-app. In the flask-app we can see the app.py code that allows us to do the local file inclusion above. This Gitea instance also appears to be installed into \u2018developer\u2019 home directory based on the README in the git.<\/p>\n\n\n\n<p>After reading the Gitea documentation, it shows the config file location &#8211; <a href=\"https:\/\/docs.gitea.com\/installation\/install-with-docker#customization\">https:\/\/docs.gitea.com\/installation\/install-with-docker#customization<\/a><\/p>\n\n\n\n<p>It notes that \/data\/gitea\/conf\/app.ini will be the config file location. If this is in \u2018developer\u2019 directory then we can use the local file inclusion vulnerability to download it.<\/p>\n\n\n\n<p>Let\u2019s try!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"70\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-41.png\" alt=\"config file download\" class=\"wp-image-620\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-41.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-41-300x22.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-41-768x55.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"614\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-42.png\" alt=\"config file view\" class=\"wp-image-621\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-42.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-42-300x189.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-42-768x484.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Looks like we have the config file!<\/p>\n\n\n\n<p>It does look like we have a database file we could download.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"713\" height=\"297\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-43.png\" alt=\"database\" class=\"wp-image-622\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-43.png 713w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-43-300x125.png 300w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><\/figure>\n\n\n\n<p>Let\u2019s see if we can download that as well\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"63\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-44.png\" alt=\"db file\" class=\"wp-image-623\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-44.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-44-300x19.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-44-768x50.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Now that we downloaded, lets try opening this up in SQLite db viewer.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"400\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-45.png\" alt=\"sql db viewer\" class=\"wp-image-624\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-45.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-45-300x123.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-45-768x315.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>In the \u2018Database Structure\u2019 column we can find the \u2018user\u2019 table. Let\u2019s right click that and click \u2018Browse Table\u2019<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"176\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-46.png\" alt=\"users\" class=\"wp-image-625\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-46.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-46-300x54.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-46-768x139.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Now we see that we have three users with their passwords. We can also query this from command line with sqlite3. However, we\u2019re simply going to copy and paste into a text file, as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"57\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-47.png\" alt=\"hashed password\" class=\"wp-image-626\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-47.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-47-300x18.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-47-768x45.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Now, let\u2019s try hashcat\u2026<\/p>\n\n\n\n<p>Well\u2026initial tries with hashcat weren\u2019t working\u2026so I spent some time googling on this.<\/p>\n\n\n\n<p>I found this nice write up on cracking gitea passwords. <a href=\"https:\/\/www.unix-ninja.com\/p\/cracking_giteas_pbkdf2_password_hashes\">https:\/\/www.unix-ninja.com\/p\/cracking_giteas_pbkdf2_password_hashes<\/a><\/p>\n\n\n\n<p>So, I copied the gitea2hashcat.py script to my desktop and walked through the same process as the documentation above.<\/p>\n\n\n\n<p>Query the db from where I downloaded it. Just an FYI, I renamed it to \u2018gitea1.db\u2019 instead of the super long name it downloaded as. Makes things simpler \ud83d\ude09<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"159\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-48.png\" alt=\"sql db query\" class=\"wp-image-627\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-48.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-48-300x49.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-48-768x125.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Ok, so this part is a bit tricky\u2026.we first have to run our python script\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"176\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-49.png\" alt=\"script hash cracker\" class=\"wp-image-628\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-49.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-49-300x54.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-49-768x139.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Then we copy\/past the hash from the SQLite query\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"48\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-50.png\" alt=\"copy the hash\" class=\"wp-image-629\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-50.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-50-300x15.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-50-768x38.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Ensure you don\u2019t copy the :pbkdf2 section for the algorithm.<\/p>\n\n\n\n<p>Now paste it\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"212\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-51.png\" alt=\"pasting it\" class=\"wp-image-630\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-51.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-51-300x65.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-51-768x167.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>After pasting it\u2019ll give us the output right below\u2026it can be hard to miss.<\/p>\n\n\n\n<p>Now we use hashcat to crack\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"125\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-52.png\" alt=\"starting it\" class=\"wp-image-631\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-52.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-52-300x38.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-52-768x98.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"270\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-53.png\" alt=\"hash cracked\" class=\"wp-image-632\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-53.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-53-300x83.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-53-768x213.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Now, we have a password. Let\u2019s see if we can connect via SSH with the developer username and the password we just got.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"674\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-54.png\" alt=\"login as dev\" class=\"wp-image-633\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-54.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-54-300x207.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-54-768x531.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>We are finally in!<\/p>\n\n\n\n<p>Next, let\u2019s run linpeas and see what we can find. As a note, I curl linpeas from the victim machine to my attacker machine where I have it hosted on a simple python webserver. If you want to see how I do that then check out my other HTB write up for Underpass as I walk through how to do that. It\u2019s really simple though.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"889\" height=\"41\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-55.png\" alt=\"linpeas curl\" class=\"wp-image-634\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-55.png 889w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-55-300x14.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-55-768x35.png 768w\" sizes=\"auto, (max-width: 889px) 100vw, 889px\" \/><\/figure>\n\n\n\n<p>Now, we let it run and figure out what could be an avenue for privilege escalation\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"237\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-56.png\" alt=\"Interesting files\" class=\"wp-image-635\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-56.png 975w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-56-300x73.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-56-768x187.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Some interesting files that it\u2019s calling out. Let\u2019s take a look at this \/opt\/app\/static\/ directories\u2026<\/p>\n\n\n\n<p>Digging around and found the \/images directory. Right inside is the root.txt file and it\u2019s not restricted to root access only\u2026so with simple user access we are able to read the root.txt file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"886\" height=\"342\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-57.png\" alt=\"Root flag\" class=\"wp-image-636\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-57.png 886w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-57-300x116.png 300w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-57-768x296.png 768w\" sizes=\"auto, (max-width: 886px) 100vw, 886px\" \/><\/figure>\n\n\n\n<p>I\u2019m a little bummed out on this, to be honest with you. I was expecting a privilege escalation technique to be able to read the root.txt file. However, a win is a win and we\u2019ll take it.<\/p>\n\n\n\n<p>Additionally, I wanted to show that you can also just search for root.txt and find the file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"744\" height=\"184\" src=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-58.png\" alt=\"Finding root flag\" class=\"wp-image-637\" srcset=\"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-58.png 744w, https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/image-58-300x74.png 300w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><\/figure>\n\n\n\n<p>Well, this was a bit different than what was expected\u2026but we were able to get both flags and finish this box. However, I wouldn\u2019t call this a true root pwn as we never actually got root access. I\u2019m unsure if this was intentional or someone left this file in the directory. However, we could have continue to try privilege escalation techniques to see if we could get actual root.<\/p>\n\n\n\n<p>Hope you enjoyed the walkthrough! Until next time!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back again with another HackTheBox machine. This time, an easy box called Titanic. As usual, let\u2019s start off with our<\/p>\n<p><a href=\"https:\/\/infosecjake.net\/?p=601\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\">HackTheBox &#8211; Titanic Walkthrough<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":639,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[31],"tags":[33,42,34],"class_list":["post-601","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ctf-challenge-walkthroughs","tag-ctf","tag-hackthebox","tag-walkthrough"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/infosecjake.net\/wp-content\/uploads\/2025\/09\/titanic.png","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/infosecjake.net\/index.php?rest_route=\/wp\/v2\/posts\/601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infosecjake.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infosecjake.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infosecjake.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infosecjake.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=601"}],"version-history":[{"count":1,"href":"https:\/\/infosecjake.net\/index.php?rest_route=\/wp\/v2\/posts\/601\/revisions"}],"predecessor-version":[{"id":638,"href":"https:\/\/infosecjake.net\/index.php?rest_route=\/wp\/v2\/posts\/601\/revisions\/638"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infosecjake.net\/index.php?rest_route=\/wp\/v2\/media\/639"}],"wp:attachment":[{"href":"https:\/\/infosecjake.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infosecjake.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infosecjake.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}