k3nn3dy commited on
Commit
150d23b
·
verified ·
1 Parent(s): 293aed6

Add HackTheBox_-_Instant.jsonl

Browse files
Files changed (1) hide show
  1. HackTheBox_-_Instant.jsonl +28 -0
HackTheBox_-_Instant.jsonl ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"text": "what's going on YouTube this is IPC and today we'll be doing instant from hack the box which is a relatively straightforward machine that starts with downloading an Android application off a web server and we can decompile that with Jad X and the first thing I normally look for when decompiling an app are what endpoints it talks to this reveals an API along with a Swagger interface which is live documentation on how to interact with the API unfortunately many of the endpoints require administrative access so we look at the app and discover a hardcoded JWT which provides us that access the API has a file disclosure vulnerability which we can use to read an SSH key that gets us onto the box and once there we discover a solar putty configuration which doing some light Googling we discover a way to crack this um", "start": 0.16, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
2
+ {"text": "encryption on the configuration and obtain the root password so with that being said let's just jump in as always we're can start off with an end map so- for default scripts SV enumerate versions dvv for double verost this gives us things like the TTL OA output all formats put in the end map directory and call it instant and then the IP address of 1010 11.37 this can take some time to run so I've all already ran it looking at the results we have SSH on Port 22 and the banner tells us it's an obuntu server we also have HTTP on Port 80 its Banner tells us it's Apache it's directing us over to instant. HTP so let's go ahead and add that to the host M we'll do pseud VY host and then we can add 10 10 11 37 instant. htb save that and the other odd thing I'm not seeing is when I'm seeing Apache on Ubuntu servers I'm used to it", "start": 45.84, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
3
+ {"text": "having like parentheses Ubuntu and it doesn't here actually wait a second the server header is having it so n map's just not showing it I don't know exactly what's going on there but disregard that so we don't really have much information to go on so I'm just going to go to the website and see what we have and we get a page instantly send funds to anywhere and it has a link that goes to downloads instant. APK so let's go ahead and save that so we'll move downloads instant APK to our working directory and then I also want to go to that downloads directory so we'll do SL downloads and we get a 4 or4 not found I was hoping we'd have like an open directory index and we may have like other versions of the APK maybe like instant. dev. APK things like that um I may have also misremembered and maybe we SL download", "start": 100.24, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
4
+ {"text": "and we get a different error message which is interesting so downloads and download so I think download this is probably coming from Apache just because we see Apache 2458 here and then downloads this is just 4 or4 not found I'm guessing this is going to be like python flask or something like that but it's interesting of the like URL rewriting that's going on because this is going to Apache this obviously um is going somewhere else because that looks like a error message from uh something let's actually go o xdf error message and search Google for that maybe I should add 404 there we go default 4 or4 pages I just want to see if that is anywhere 4 or4 not found is that what it looks like 404 Dash not found there's a dash there so it's not AOH HTTP not that so I don't know exactly what this", "start": 152.28, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
5
+ {"text": "is um maybe once we get a shell in the Box we can take a look but since we have the APK let's just go ahead and look at it so the first thing I want to do is run jet X against it uh because I want to see if I can decompile it so let's make directory called I guess out and I'm going to do jet x and- d the odd thing with this is um jet X by default I think will work out of the current directory the application sits in so if I just did like out and then specifi instant APK it can't find it because it's looking in user share Jad X bin right so always use absolute paths when dealing with j x it's a weird Quirk I don't know exactly why we have to but you just have to right and and that's why we always add the- D because by default it's just going to put it in user share Jad X bin and then we probably don't have WR", "start": 220.08, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
6
+ {"text": "permission here if you installed it with apt if you just did a get clone off jadex or downloaded the release and copied it to somewhere where you have right access to you may not have to do all of this but if you use apt um always use absolute pads so there we go we have it now decompiled if we open this up in VSS code we can take a look at it and the other thing I always like doing is looking for URLs in applications so before we go here I'm just going to do a quick grap I'm going to grip for let's do instant. htb so we'll do A- capital r for recursive and then look here and we have quite a few and right off the bat we see Swagger UI instant htb and my wallet V1 so we have some host names what I'm going to do is add a o i so this is going to show be um only things that match my search and this going to be", "start": 277.32, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
7
+ {"text": "case insensitive I'm going to do star like this and let's see we could also say um a to be 07 and then special characters there we go um kind of just cleans up the output a little bit so we have my wallet V1 and Swagger so let's take a look at these real quick so pseudo V Etsy host and then we can add my wallet and then let's also add the Swagger one so we'll copy this and paste it and whenever I see Swagger that's generally going to be exactly where I go to so we can do HTTP Swagger because this is going to be documentation of the API and we can see various endpoints we require authentication to hit like add user list user things like that if I do try it out we execute uh let's see we get unauthorized so we got to figure out exactly how this authenticates we could potentially log in and register a user because this is", "start": 334.36, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
8
+ {"text": "not um require authentication however there is an admin to create a admin user so I'm guessing this won't work but I guess we can try it out uh email we do root ic. Ro password of password pin we'll do 1 2 3 4 username we'll do IC we can execute this and let's see pin must be five digits so we'll do 1 2 3 4 five there we go we have registered a user now we can attempt to log in so try it out password weird that that one's first not username but okay hipc password and execute we get logged in we get a JWT we can put the JWT on authorize so now all my requests are going to use this and let's see if we can list users now see we still get unauthorized and that's probably going to be because our JWT isn't an admin I'm just going to test this out so we'll do Echo - n Bas 64- D and then the role instan I guess", "start": 401.8, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
9
+ {"text": "there's probably an administrator Ro as well he has my wallet ID but let's go ahead and take a look at the source code of the application so I'm going to go in sources and it's probably to be C there we go instant Labs these are all just like dependencies of what it uses right I want to get into the custom source code and see exactly how this works so if we go to admin activities uh we can see if we close all these we have test admin authentication it's going to build a my wallet V1 instant htb request and then adds the header authorization and puts a JWT in so let's go ahead and take a look at what this JWT is real quick so same thing Echo DN base 64- D and we see the RO is is admin now the other thing I see is there's no IAT like expiration oh no there is expiration right here um that is very far in the future holy cow", "start": 486.4, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
10
+ {"text": "um hold on one second I just want to see what year that is the easiest way let's just go to JWT doio paste the token in and let's see expiration if we hover over this we can see it expires in the year 3023 so almost 1 th years into the future wow that is I don't even know you could go that far with these so let's go ahead and authenticate with this so what I'm going to do click authorize log out paste in the new JWT authorize and now let's try this list user endpoint and we can see we can list users so we have three the first one is admin then we have sherro and then me so let's look at what other things we have we could add new admins but we have this read log applic um function so let's look at exactly how this goes so we can do try it out and the file name is going to probably be one. log let's get something valid just", "start": 551.519, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
11
+ {"text": "so we can make sure this works and we have it and let's move this over to burp Suite because the repeater window is just more natural to me so we can execute this send it over to repeater run and there we go we can see what it looks like and because we logged in on Swagger we have the uh token already um inputed for us so let's now look for lfi or this isn't going to be lfi because it's probably python um it's just going to be a file disclosure so I'm just going to do a bunch of dot dot slashes and see if we grab Etsy P WD and we can now the odd thing is we're working out of home this user logs so I want to see if there is a SSH directory uh internal server error uh let's do authorized keys and we do have an authorized key so let's try idore RSA and we can so I'm going to save this to a text file", "start": 618.64, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
12
+ {"text": "so let's do um CD do dot V it's probably going to be this user right Shiro Shiro hi G that is it pem paste this and hold on did I copy everything I'm going to copy this whole Json real quick because cuz if I don't then I probably have to like manually format this key and I don't want to do that so let's pipe it over to JQ and then it's going to be really weird how we read this because it actually has slashes in it um to do this I think we do Dot and then escape a quote like this I really hope this is right like that there we go I can do I thought I could do- R there we go so that got me into this key and then this is just going to be a list so that's why I did the open and close bracket and now I can do a GP on period to grab every line that has data I'm just going to copy to Temp and then move temp over top of this", "start": 690.8, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
13
+ {"text": "because whoops like that there we go because if I just wrote it to this file because this cat opened it and I tried to write it it would just be an empty file it's really weird but you only make that mistake once right so if we did CP this to Temp we cat Temp and then direct it over to Temp now temp is blank so that's why I did it that weird way but let's chod 600 because this is an sh key and it really cares about missions and we can do sh - I Shiro at 1010 1137 and we also have to specify the key yes and we get logged in now the first thing I always do whenever I pop a web server is try to go and dump all the um database credentials so in this we do have the projects directory and this is going to be where the actual source code is and we kind of knew that just based upon how the swag it worked right", "start": 778.48, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
14
+ {"text": "because this was going in home the username and that but let's just pretend we don't know exactly where the web server is so my first bet is always look at ver dubdub duub and if we do that we just have HTML this going to be the default page and we have downloads there where instant. APK is so there is actually no like flask web server or anything like that um we could also like look in opt and if we go there we have backups so we go opt backups this is or putty and we'll get into this in just a little bit you could pop the Box just from discovering this directory but let's just keep going because um and once I have a path I don't like um deviating it from it that much because if I went down that solar putty route I'll probably completely forget I never looked at the database so I always like", "start": 839.44, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
15
+ {"text": "looking at databases first um so the next thing is go to Etsy Apache 2 and then let's go to sites enabled and we can take a look and exactly how this is configured so let's do a g-v for uh the comment and we can see exactly how this works so this is just directness to ver dubdub duub HTML that's not that important let's look at instant app and let's see this is on my wallet V1 instant hdb and it's directing us to Port quad 8s uh let's take a look at the Swagger interface and kind of the same thing we're going to 8808 so let's do SS lntp and we're going to GP for everything with 88 in it and we can see two pids both python 1388 and 1331 so let's do PF GP for 1338 and we can see uh that is going into home sherro hedge projects my wallet and if we look for p ID what's the other one 1331 we see it's going into the same", "start": 888.6, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
16
+ {"text": "place so let's go into this directory now and then let's go into in well I guess we can look at my environment see exactly what this is this is a python environment uh C the VM nothing special there let's go into instant API is that where both of them were those are just environments okay and we have instance and my wallet so let's look at my wallet and there is a serve. pi is this going to just be flask let's take a look real quick there is no v no le oh wow no less either C I'm just curious what the web server coded in um is there a head there is and it is going to be um flask so I'm just going to grip for everything that ends in DB there is a instant. DB so this is going to be um SQL light you could have also done a SS and notice 3306 doesn't exist so most likely it's going to be a SQL light", "start": 960.759, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
17
+ {"text": "database um so let's go ahead and download this so I'm going to C this we'll pipe it over to Dev TCP 101048 port 90001 and then I'm going to listen on 90001 and direct it to instant. DB send that and then let's just do SQL light 3 instant. dump and see if we have any hashes anywhere there we go we have uh PB KF df2 sha 256 and we have a hash so it's in wallet users so let's do a um schema and we just want to get what username and password so we'll do select username password from wallet users and we can save all of these V we'll say um hashes do text I guess paste that okay and let's see um we could look at exactly how these are made so let's see if we go into was it my wallet serve. py man not having I should just copy all these files back to me um register so how is it making the password filter", "start": 1032.6, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
18
+ {"text": "jsonify method pbkdf2 so generate password hash this is a work Zug function if memory serves um if we looked at head let's just GP this on serve yep work Zug security generate password hash so if we tried to crack this with hashcat we'll find there is no work Zug mode um if we Google hashcat crack work Zug we'll get to a posting I got to turn BP Suite intercept off there we go and we get a feature request here so they're trying to crack a hash that is generated with work Zug and they put a feature request in for it the maintainer of hashcat says the mode already exists but it's just like formatted slightly differently and if we keep scrolling we find someone uh gives a program so let's copy this and we're going to tweak it slightly to work better for us so let's do V I'm going to call this work Zug to hashcat I guess I think", "start": 1128.12, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
19
+ {"text": "that's the standard format and I probably should like use this arv and stuff but I'm not I'm going to be lazy we're just going to cat has. text we're going to copy these and then I'm going to say hashes is equal to paste all of them and we'll put this like that okay I'm going to leave the user names and we will just split so we can say for I in hashes and then we want to index all these and let's see we'll do hash or we'll do PW is equal to username PW then I.S split on the pipe that should be fine this gets renamed to PW because it's searching for that string and then it's just going to put it in this format and that looks fine last thing we want is username colon Python 3 Works Zug can't use bite pattern on a string light object what if I do incode maybe that works there we go so now we have a format here so I'm", "start": 1210.36, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
20
+ {"text": "going to go over into the Kraken which is just another box on my network work you can run hashcat anywhere you want I recommend not running in VM I'm going to do VES SL we'll call it instant dot I guess we'll do work Zug paste all this and thenat Bin the file name opt word list rocku and let's see if it detects anything uh we also forgot to specify the user flag because we have username colon the password hash so hopefully with that it starts cracking and it is awesome so I'm going to just rename this to the Kraken and hopefully it cracks relatively quickly but let's just keep going on because you don't actually need to crack that password hash it's actually longer to crack that hash than just to um crack the backup file so if we looked at solar party we got this sessions backup. so if we C the file it looks like base 64 so", "start": 1315.2, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
21
+ {"text": "we try to decode it and we see a bunch of gibberish so normally I do like xxd we still get nothing um we could maybe like do we have the entropy command we don't maybe it's just ENT uh don't have that so let's just get this sessions back up over to me so we'll do Dev TCP 10 1048 and then let's say nvmp sessions. 91 like that send this file with specified report so we C this base 64- D do we have the entropy command I don't um that may just be helpful to identify encrypted files but if we uh Google solar putty cracker let's see if we get anything we could also Google like decryptor and things like that um solar party Windows I'm going to add GitHub to this python tool to crack is this and this is probably the first um program that comes out I just don't like using it because as this one says um it's written in", "start": 1383.799, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
22
+ {"text": "CNET and it becomes a bit harder to run on Linux right so this is why I like this solar party cracker so let's just go ahead and clone this so we can do a get clone solo party cracker we try to run it we need a library so let's do python 3-m virtual environment create one and then we will source. VM bin activate and then we can say Python 3 um pip 3 install D requirements.", "start": 1465.6, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
23
+ {"text": "text install all the libraries and then try to run it again and there we go so we got to specify the word list so I'm just going to do users share word list and then Rock you.", "start": 1502.919, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
24
+ {"text": "text and then the sessions file so I'm just going to give it the sessions. and it's going to attempt to crack and there we go it says decrypted file is saved in solop party sessions.", "start": 1520.72, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
25
+ {"text": "text and the password was arella and if we look at hashcat we have it cracking this password which was arella so just in case like you're I think the um if we go back here the solar party decrypt the one written inet I don't think it accepted a word list so you had to crack the work Zug in order to do it or Loop it or something like that if we look at exactly how this decryptor works um let's see it's just going to be triple Dez and it's going to attempt to decrypt it and then it tries to load it as Json Because the actual config is Json so if it does the triple or what encryption it was and can't um convert from Json to object then it knows it didn't decrypt it successfully so then it moves on right but if we C this file we can see credentials and we have instant rout username root password", "start": 1534.919, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
26
+ {"text": "of this so let's do SSH root at instant.", "start": 1606.039, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
27
+ {"text": "htb and I'm going to put that password in I always like uh pasting My Clipboard after I put it just to uh make sure like I pasted what I thought I did and we get invalid password if we do su put in this password we get root and why is that because it's probably SSH is prohibiting root login right so if we cat SSH sshd config um g-i on root let's see what we have um permit root login prohibit password so I wonder if that's just the default um it probably needs permit root login yes to allow passwords so we can test that real quick um I want to say it's yes so let's do V we don't have V this is annoying Echo permit root login yes to Etsy sshd config service SSH restart does that do it I think it does I don't have that in my clipboard anymore let's put it back on there we go rout attempt to log in and that was", "start": 1611.96, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}
28
+ {"text": "definitely it so s was configured not to allow root with the password and that's why we had to use Su but that is going to be the Box hope you guys enjoyed it take care and I will see you all next time", "start": 1688.64, "duration": 0.0, "meta": {"video_id": "Oyh84PHjzsQ", "title": "HackTheBox - Instant", "url": "https://www.youtube.com/watch?v=Oyh84PHjzsQ"}}