Add HackTheBox_-_Heal.jsonl
Browse files- HackTheBox_-_Heal.jsonl +51 -0
HackTheBox_-_Heal.jsonl
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"text": "What's going on YouTube? This is Ipsac doing Heel from Hack the Box, which is a nice medium box. And when you start this box, you quickly discover two subdomains that run vastly different technology stacks, an API and survey domain. The API subdomain is a Ruby on Rails app, and the survey is PHP running some software called Lime Survey. It's easy to focus in on the Lime Survey because many people are more familiar with PHP. But without credentials to log in, there isn't much we can do here. Looking at the API domain reveals a file disclosure vulnerability which you can use to excfiltrate the SQLite database and get credentials that let you log into Lime Survey. But the trick here is just navigating the Rails file structure as it's new to many people. But once you learn how the Rails app is set up, you", "start": 0.24, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 2 |
+
{"text": "can quickly traverse it, find the database config, which then points to where the SQLite database is. You can download that and crack the password. Once you have credentials, you can log into lime survey, submit a malicious plugin to get code execution on the box and then from here you can exploit a service called console that is listing on local host. So with that being said, let's jump in. As always, we'll start off with an end map. So - sc for default scripts, SV numerate versions vv for double verose. This gives us things like the TTL OA output all formats. We're putting it in the end map directory and call it heel. And then the IP address, which is 101011.46. This can take some time to run. So, I've already ran it. Looking at the results, we have two ports open. The first one being SSH on port 22 and the banner tells us it's an Ubuntu server.", "start": 44.079, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 3 |
+
{"text": "We also have HTTP on port 80. Its banner tells us it's engine X also running on Ubuntu and it's directing us over to heel.htb. So, let's go ahead and add this to our host file. So, we'll do pseudov etsy host and then we can add 1010 1146 gel.htb htb and let's go take a look at the website in our browser. We get the fast ré builder and if I try logging in with like admin admin, we just get something went wrong. So I'm going to click on the new account and we're going to try just creating an account. So I'll do ipsack roots.ro and then the username is going to be ipsack and the password will be password. If I click sign up, nothing is happening. Now we can open up our dev tools and then click sign up again. And we see it's making a request over to api.heel.htb which isn't in our host file. So let's go ahead and add that into etsy host. So we can add this", "start": 90.72, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 4 |
+
{"text": "domain. So api.heel.htb. Save that. And then when we click sign up again, we have it successful. Now if you're going through burpuite um its cache may be a little bit longer than you expect. So it may take like two minutes before that host can resolve, but I haven't sent through burpuite yet, so we don't have that issue. So logging in, we get this resume builder. If I click on profile, I get this. And I don't have a way to get back to the previous page. So I'm just going to click back. The thing I note is I am not an admin. So let's go over to survey. And then we have this link that's taking me to take-servey.heel.htb. And I'm going to show you what happens if we do this in burpswuite real quick. So I'm going to set it to go through. Um I'm going to turn intercept off. Click it. We get this unknown host. So I'm going to copy this. We're going to add this to our host", "start": 147.68, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 5 |
+
{"text": "file. Save that. And if I refresh, I still get this unknown host. If I take uh burp suite off, so we'll disable. Uh I said disable. Refresh. It should be going through. Looks like it is. So we just have to wait probably 2 minutes for Burpuite to um flush the DNS on its own. But we don't need to send it through Burpuite. So I'll leave it disabled so we can take a look at the site. And we see um this icon right here. I was expecting to see something in this title bar, but I guess it did not load. Uh let's see.", "start": 204.84, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 6 |
+
{"text": "Doesn't look like it is. If I just go to the root of the page, we see Lime Survey. So, this is free and open source. So, the first thing I always do is go GitHub uh Google Lime Survey. And then we can take a look at the um GitHub page. So the thing I'm looking for is a way to enumerate the version. And I want to say um let's see. The first thing I want to see is readme.md exist on this server. It looks like it does. And if we look at this readme though, it's not going to say anything about the exact version. So we could probably like MD5summit and then search through the um get log to find exactly what version this readme is because it is updated somewhat frequently right we see five months ago but there is also a docs page or a docs folder and if I go inside of docs we have release notes and this is updated days ago and also contains the", "start": 246.239, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 7 |
+
{"text": "version. So, I'm going to see if Doc's release notes exist on the server because that's how we can detect the exact version of Lime Survey. Looks like it is. So, we see it is um from September 23rd, 2024. And it's this version. We could Google like Lime Survey this version exploit. And let's see, we have an RCE exploit right here, but I think this is going to require authentication, right? Um, this is going to admin authentication SA login. So, this is uploading a plugin, I believe. Uh, if we go to, let's see, there's a CVE here. Let's see. So, long story short, um, I can't find it right now, but there's a CVE against Lime Survey for installing a plugin that can give you code execution. And the lime survey team essentially said that's not a vulnerability because you're a admin and that's how plugins work. We can't really restrict uh PHP from sending you a shell when you giving", "start": 311.919, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 8 |
+
{"text": "the ability for a plugin to run PHP code which is perfectly legitimate. So there's not much here we can go off of. But if we took a step back and looked back at what we could do once we could log in. So I'm going to go um let's just check API heel.htb HTTP uh HTTP API heel HTTP we can see this is a Ruby on Rails application and also once we logged in let's see I think it's under resume we saw this page and at the very bottom if we scroll down there's an export as PDF button and if we click this we get a PDF so I'm going to look at this so we got um 43 32. So let's move downloads 432 over to our home directory. I'm just going to run exe tool against it. And we can see this is WK HTML to PDF. So that's what it's using to generate these PDFs. So we can Google this and then version 0126 exploit. And let's go over to Google. And we have server side request", "start": 375.68, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 9 |
+
{"text": "forgeries. So, um I'm not going to dig into this that much because I don't know what we can actually gain from it right now. If I ever saw like the web browser showing um you can't access um the location from this IP address, then I try this because the SSRF would allow us to make a web request from the server itself. If I saw other ports that were filtered, then I try the SSRF against that port, right? But right now, I don't think the server side request forgery gets us that much. So, let's go take a look at exactly what happened when I clicked this export as PDF. So, I'm going to go pipe it through Burp Suite.", "start": 446.96, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 10 |
+
{"text": "It should be um enough time for my cache to be updated. I'm going to click export as PDF and we're just going to examine this, right? We're going to send a post request and we're going to send the contents of this PDF file. And then we're going to do an options request on download. And this options is just going to tell us like what um verbs are supported. It's not actually going to perform the request. So I'm just going to intercept the response. We click forward. And I thought it would tell Oh, there we go. It allows get, post, put, patch, delete, I guess, but I think only gets are really allowed. So it's going to then do a get request. So, I'm going to look at this.", "start": 485.919, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 11 |
+
{"text": "And then we have a git and then a file name. And this is how we download the PDF. So, I'm going to try just a um file I know exists. Let's try etsy passwd. And there we go. We have a file disclosure vulnerability here. So, since I got this passd file, I'm just going to copy it. And then I'm going to um v pastd paste it. And then I'm going to GP for everything that ends in sh because those are accounts that have a shell. Then we can do alt-f separate on the colon print the first one. And then we can do users.ext. So we have a list of usernames that can potentially log into the box. Um but with this file disclosure, we know the server is also a Ruby on Rails because just going to the home of it, we just see Rails. So, I'm going to Google GitHub Rails um hello world. And this is going to give me a example Rails package. We could also stand one up locally. But what I'm", "start": 530.08, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 12 |
+
{"text": "trying to do right here is uh see exactly how um Rails apps are structured, right? Because we have a file disclosure vulnerability. I want to know how to like pillage the database, things like that. So, if we look here in the home directory of Rails, we have a gem file. So that's what I'm going to look for first. So let's just do file name is equal to gem file and we get file not found. We can do dot dot slash file not found dot dot slash and we get the gem file here. So this is going to be like requirements.ext in Python. It's just going to specify everything that's required. We know this is using a SQL lite 3 database. So we can potentially download that database. But we know we're in the home. So, what we want to do is find where the um configuration is. So, I'm going to look at config and then uh this isn't showing", "start": 596.0, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 13 |
+
{"text": "it, but I think there's a config database.l or there should be uh let's see. I'm going to try it real quick. Config. Let's try database.yamel. I'm not sure why it didn't exist in this hello world app. Maybe because there was no database stood up. Um, so this is just something I guess you should know from looking at Rails apps exactly where configuration files and stuff are. I'm sure if we went through a few Hello World apps, we would eventually find one on GitHub, but probably should just stand up our own Rails app if we wanted to examine that. However, um, I know you want to go for config database.yamel because that's where it's going to be stored. And let's see, we have the development database storage development SQLite 3. Um, we also have a test SQLite 3. And in production, it's using", "start": 650.48, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 14 |
+
{"text": "development as well. So, I'm going to go ahead and see if I can access the SQLite 3 database. And I can. So, let's copy this to a file. So, uh, rightclick, copy to file. And then I'm going to call this, uh, database.sqlite3. SQL light 3.", "start": 705.2, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 15 |
+
{"text": "Save it. And then I'm going to delete the HTTP header. There we go. Save it. SQLite 3 database.dump to see if we can see the contents. And we can. Awesome. So, let's see where are the usernames. Uh, we have insert into users Ralph right here. And we have a hash. So, let's go ahead and um go into the Kraken. We can go cd hashcat and we're going to try to crack this hash. So, v hashes. I'm going to call this um heel.brypt, I guess. Paste this hash in dot slashcat opt word list rocku.ext. And let's see if it cracks pretty quickly. Um let's see the mode. It's going to be probably 3200. And let's see. It is starting the crack. And there we go. It's already cracked. It just took a couple of seconds. And looking at it, we have the password of just straight digits. So, I'm going to save this. And then let's see what this goes to. So, the account was", "start": 726.959, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 16 |
+
{"text": "ralphel.htb. So, the first thing I want to do is um log into the application.", "start": 805.399, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 17 |
+
{"text": "Let's see. We can do log out and then username Ralph and then put in that password. And looking at this, we don't really have anything um interesting in the resume. Clicking on profile, we are an admin um survey. There's nothing else here.", "start": 810.959, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 18 |
+
{"text": "So, we may want to use this account to enumerate the API potentially. So, we'd have to like fuzz the API, look for hidden endpoints. But, we do have Lime Survey as well. And we know there's a code execution path if we have um authentication. So I'm going to do /admin because normally that's how you get to login prompts of applications. We could also try like login.php, but we get to lime survey. So I'm going to try the username of Ralph and we're going to try that password again. And I could also try um let's see if we cat users.ext. We could try ssh ralph um heel.htb http and try the password there as well. And it does not work here. But we do get logged into lime survey. Now I know uh we can get code execution through plugins just because of the research I did. But when I first log in here, just looking at the settings, um I would probably go for editing the theme", "start": 831.2, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 19 |
+
{"text": "as well for code execution because a lot of times when you log into these applications, these themes are just PHP um files or whatever. And we can normally put code in there to get code execution. So I'm going to go into theme editor and let's see how we can edit this. I think we have to click extend in order to edit the code. And we see this is um some templating language.", "start": 888.48, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 20 |
+
{"text": "And I look it is twig. So I'm going to Google uh payload all the things. twig ssti for uh server side template injection and we can go through um these payloads right so let's see do we have twig here um let's see server side intruder php twig and we can try like running ID so if I go here I'm going to paste the twig payload in and then let's see copy local theme and save changes and looking at it we have an error filter is not allowed we can go try other things as well maybe like map so I'm going to copy this and then we'll paste this in where we pasted that but I've tried this before and they've covered all the dangerous things we see join is not allowed so we can't get code execution through just a malicious twig template because it looks like they have that hardened. Um, there may be ways to bypass this blacklist, but I didn't look", "start": 915.6, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 21 |
+
{"text": "that much into it because you can also install plugins. So, let's go ahead and um search this again. Let's do lime survey uh malicious plugin on Google. And I'm going to add GitHub as well. P exploit. Let's see. I don't want to just run a Python file because I think this is just going to have like the zip all built in for us and give us the shell. Um, I want to show exactly what's going on. Let's see. Lime survey rce plugin GitHub. Is this going to give it here's another one. Let's see. Just checking a few of these. That's just going to upload a PHP reverse shell Python script. Man, I cannot find the plugin I had used. So maybe we'll just try one of these. Yep. I guess let's run this. um get clone and go in here. So if we look at config, this is going to be the configuration and look at reverse", "start": 988.079, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 22 |
+
{"text": "shell. Let's see 1010432. I'm going to change this to be 10148.", "start": 1080.679, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 23 |
+
{"text": "And then we'll do port 90001. And this looks like it just sends a reverse shell. So I'm going to make a directory called I'll just call it plugin. I'm going to see if this works.", "start": 1087.76, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 24 |
+
{"text": "Um I'm not exactly sure, but we'll copy the revshell.php and the config into the plugin. And I'm going to do zip plugin.zip. Specify that. So now I have a plugin that zipped up and we have the config and PHP file and let's go over to lime survey upload and install and let's go http heel go here plugin.zip install sure uh could not parse config.xml XML file. Let's see. Let's go in plugin. I wonder if we just do this in in there. We go. So, it looks like it expects the um plugin to be just a flat file. Like what I had before was I had the plugin in a folder then had config.xml. It wants config.xml at the very top of the zip. So, let's see. We have the plugin here. And let's see where are plugins stored. It's probably just plugins, I would guess, and maybe evil. Let's see. plugins evil not found. Let's look at exactly what the Python script", "start": 1099.679, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 25 |
+
{"text": "does. Uh lime survey rce.py. So admin essay authentication. So it goes upload plugins evil revshell.php. Uh let's see plugin. Did I change the port?", "start": 1209.0, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 26 |
+
{"text": "I did. So, nclvmpp 90001. And let's try upload plugins evil rev shell. Looks like it's hanging because we have a shell. Awesome. So, if we do a who am I? We are dubdubdubdub- data. So, I'm going to do python 3- c import pty pty spawn then bin bash. Then we can do control zty raw minus echo foreground. Enter. Enter. So now we have a good shell where we can have tab autocomplete and things like that. So the first thing I always do when I um hold on export term is equal to x term so I can clear the screen.", "start": 1230.559, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 27 |
+
{"text": "Okay. So the first thing I do when I land on a web server is try to export the config. We already got the password off the API, but maybe we can get a different password here, right? So I'm just going to do find and grep for config and oh man there is a lot. So let's do config.php. Maybe that's standard for PHP applications. And we have application config config.php. So let's try this. And let's see. We do have a um credential here. DB user and this password. Okay. So let's do psql- uh what was that username? I think it's capital u db user like p uh maybe lowerase p uh password space paste this in uh pure authentication failure. Do we specify a host? Let's see.", "start": 1271.44, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 28 |
+
{"text": "Uh, let's do localhost. Put this in. I am not sure what I'm doing wrong. DB user. Let's see. Dash D for database, I'm guessing. And the database name is survey.", "start": 1344.159, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 29 |
+
{"text": "Uh, let's see. Dash H. See, how do I do database? Use that. H is hurse name. Dash D.", "start": 1371.6, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 30 |
+
{"text": "So, dashw force a password prompt dash h localhost. I'm honestly not sure why I can't connect. Oh, there we go. So, now we can look at the tables.", "start": 1402.08, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 31 |
+
{"text": "I'm really not sure why I was having issue earlier, but we can probably do select star from lime users and then we can get a hash here for Ralph. Uh, so we could try cracking that hash, but we've already logged in as Ralph. So, we've got that password out of it. Um, but we do have this new password. So, what I'm going to try to do is uh spray this password against all the users. So, we're going to do nxc ssh uh we'll do heel.htb u users.ext text p and we're going to put this password in and we're going to see if this password logs into any user right and the reason why I'm not trying to crack Ralph is because we logged into Ralph with the password we had which was that straight digit password right so there's no need to crack the lime survey passwords because we've already known everything but we see this password goes", "start": 1417.44, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 32 |
+
{"text": "to run so I'm going to do ssh runonheelhb and we can log in and I also think that um this entire step isn't needed because the next step is pivoting into this port right this 8500. So if we look at this we can see localhost is listing on a bunch of ports. If we do a ps-fest um let's do last- capital S so we can see what process are running. I'm going to search for root. So root is always highlighted and let's take a look at what we have right. So let's see. All this looks like it's standard stuff. We have PHP um running and based upon this which is me getting the shell. I'm going to assume this is going to be lime survey right now, right? Because we see dubdubdub data and then this call chain. So that's probably going to be um the lime survey because we got a shell there. Then we have this one. This is the resume API running puma. I'm", "start": 1473.36, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 33 |
+
{"text": "guessing this is some type of Rails thing. It's running as the Ralph user and um we also have a NodeJS thing.", "start": 1538.24, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 34 |
+
{"text": "So, this is probably going to be the front end for the resume. So, we could try going into Ralph's home and looking at the um ré API potentially. And then let's see what else we have. Um that's SSH engine X. And then we have console running on local host. So this is probably what's running on all those like uh ports in the 8,000 range, right?", "start": 1547.6, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 35 |
+
{"text": "Because that's another server running. And it's there, right? The other thing we could try doing that I do a lot is like grepping for uh let's do a random port there. Dev null and seeing if in any of the like system def files we have access to if 8500 is shown. And this is all like SSH moduli, but I don't see anything here. So, I'm gonna go in a hunch and say it's console running on these higher ports. We can try curling um local host 8600. Let's see. Don't get anything there. Let's try 8503. Empty reply. Uh let's just try 8500.", "start": 1574.4, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 36 |
+
{"text": "And there you go. We have a web server here. So I'm just going to on the first line do control u squiggly c. And that's going to put me in this SSH prompt. And I can forward port 8500 localhost back to myself. And then we can do 127001 8500. And this is going to load console. And we can do research around this. It looks like it's some type of monitoring application. If I click on like this um heel react app, it's going to load a page and probably going to give me the status all service checks passed. So it looks like it's some type of monitoring application. I know I've done this on one previous box before. I forget exactly what that box name was. I bet if I went to ipsc.rocks and type console um it was probably ambassador, right? But we see console version 1.19. So let's do uh this exploit search on", "start": 1625.039, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 37 |
+
{"text": "Google and we have a rce exploit from exploit DB and let's just um copy and run this I guess. So v exploit.sh paste this in. Let's see what do we need. uh URG v1 is going to be the host. So 127001. Then we need the port 8500. And then what's next? Rhost R port LHOST Lport. So let's do 1048 90001. Make sure we're listening. And then we need the ACL token. So, we could probably get that. So, let's go Etsy. Uh, let's do find.g console. Uh, we have a console.d catconfig.json. And I'm going to guess it's this encrypt token. It's actually not needed for this box because console is configured without authentication. But I'm going to put that in to run it cuz I don't think it actually matters what we put here. I don't know why it's taking so long. Let's see. It shouldn't take this long. Let's see. Exploit.sh. Sh. What is this", "start": 1685.799, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 38 |
+
{"text": "doing? Headers. So, request put dash I. I wonder if this exploits just not working. Let's see if I go to console itself.", "start": 1791.32, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 39 |
+
{"text": "See, do we see anything? This isn't the exploit script I had ran when I was solving the box.", "start": 1817.679, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 40 |
+
{"text": "Um, but let's just troubleshoot this, I guess. Oh, wait. I did bash. This is Python. That would probably be the issue.", "start": 1826.6, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 41 |
+
{"text": "and request sent checklist listener. There we go. We got root. Awesome. So, that's pretty much the box, right? Uh but after solving this, um there was something I thought about um about this whole exploit. And it's actually not going to be possible because if we look at this console exploit, it's a put request, not a post request. And I'm mentioning this because we had a serverside request forgery at the very start of this box, right? And I want to go a bit into that. Uh, actually, let's keep my root shell real quick. Let's do a chod 4755 on bin bash. And that's just going to let me um get a proper shell as root, right?", "start": 1848.159, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 42 |
+
{"text": "Uh, which bin bash? That should have the set UID, right? It does.", "start": 1898.36, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 43 |
+
{"text": "Um, bin bash-p maybe. There we go. Now I'm root. So, let's see. Awesome.", "start": 1911.0, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 44 |
+
{"text": "So I was thinking maybe from the WK HTML to PDF we could exploit this, right? Or discover this is running. Um, so let's go take a step way back in this machine and let's go. Let's see. It's probably in my Burp history, right? HTTP history. Uh, post exports. Here we go. So this is where it makes a PDF. And the whole exploit is um you should be able to do I frame to create this. So I'm going to show this actually doesn't work.", "start": 1927.159, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 45 |
+
{"text": "Um see I think this is correct, right?", "start": 1970.279, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 46 |
+
{"text": "Uh, let's go. WK HTML 2 PDF SSRF let's see I think yeah so what this is showing is in the PDF generation the WK HTML to PDF is vulnerable to I frames right so this should make a connection back to me on port um 8000 We're waiting. It says the PDF was created and I don't have any connection back. So, let's go into the source. I think that was the Ralph user, right? Yep. Resume API. I'm going to grab WK HTML because that's what it's using to create this. And we see the command here. So we're doing wk html to pdf proxy none. Giving the stylesheet and giving the path. So let's just do this real quick. Let's do dev shm v test.html. I'm going to copy this. And we don't need to URL that. There we go. Awesome.", "start": 1977.12, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 47 |
+
{"text": "Uh let's see. So if I just run this on my test.html, I give it out.", "start": 2066.32, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 48 |
+
{"text": "PDF, uh application appears to be running. That didn't work. The test.html HTML I frame source let's see dev hm do we have to give Huh This is a bit odd. Uh, this is wk HTML. Maybe it doesn't like me running this as a set UID binary ID. There we go.", "start": 2080.44, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 49 |
+
{"text": "devshing to try running this again now that I don't have set UID. There we go. It works. That's kind of weird, but we see the connection is coming back. But if I do the proxy none because that's what the application's doing. So we have d-proxy none. I'm going to do run the same command but put that here. and we no longer um get a call back and we have host none not found. So this is kind of a unintentional way to harden WK HTML to PDF, right? We set the proxy to none and it's not actually using no proxy. It's doing a lookup on none getting host not found and then panicking, right? Like we could change this to be please subscribe and it still fails because it's trying to use the proxy please subscribe DNS request fails and then since that DNS request fails it just aborts the program. So that is a clever", "start": 2143.16, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 50 |
+
{"text": "way to fix this right and if we didn't have an iframe in this. So we can do devshm test.html. Uh let's just do please subscribe here. It generates the PDF because the um program is never making a web request. So it never even processes the proxy. So that's why um putting that proxy in um fixes the server side request forgery in this PDF parser which I found interesting. But that's going to be the box. Hope you guys enjoyed it.", "start": 2210.16, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|
| 51 |
+
{"text": "Take care and I will see you all next", "start": 2241.839, "duration": 0.0, "meta": {"video_id": "7KsIks7bdp8", "title": "HackTheBox - Heal", "url": "https://www.youtube.com/watch?v=7KsIks7bdp8"}}
|