WEBVTT
Kind: captions
Language: en

00:00:00.480 --> 00:00:07.359 align:start position:19%
What's up everybody? This is Matt Brown
with another IoT hacking video. Today we

00:00:04.720 --> 00:00:13.200 align:start position:19%
are taking another look at this Chinese
IP camera made by the company Anran and

00:00:10.800 --> 00:00:20.400 align:start position:19%
we are going to be performing chip off
firmware extraction. We will use a hot

00:00:15.759 --> 00:00:23.840 align:start position:19%
air rework station to remove the flash
storage chip from the device and then

00:00:22.480 --> 00:00:29.519 align:start position:19%
we're going to put it in our firmware
reader and read out its contents. And

00:00:26.400 --> 00:00:35.680 align:start position:19%
this is going to be a one take first
look. I have not performed this chip off

00:00:32.480 --> 00:00:39.680 align:start position:19%
yet. So, we are going to explore this
together. I'm going to show you all the

00:00:37.840 --> 00:00:44.399 align:start position:19%
mistakes that I make along the way as
well as how I account for those and

00:00:41.440 --> 00:00:49.360 align:start position:19%
we're going to see how it goes. Uh, so
if you are new to this channel, like I

00:00:46.160 --> 00:00:54.000 align:start position:19%
said, my name is Matt Brown. I am an IoT
pen tester by day. I perform security

00:00:52.000 --> 00:00:59.039 align:start position:19%
assessments just like the device that
we're going to look at over here on my

00:00:56.399 --> 00:01:04.159 align:start position:19%
workbench and I love to provide
educational content like this to you.

00:01:02.000 --> 00:01:08.880 align:start position:19%
And if that all sounds great, hit that
subscribe button. Really helps helps out

00:01:06.000 --> 00:01:16.240 align:start position:19%
the channel. Let's get over to our
workbench here where uh let me zoom out

00:01:11.840 --> 00:01:21.759 align:start position:19%
just a little bit. So this is a a solar
powered camera and so there is a a

00:01:19.119 --> 00:01:27.200 align:start position:19%
battery on board here and uh it does
ship with this solar panel which plugs

00:01:24.799 --> 00:01:32.079 align:start position:19%
in via USBC
but we are not going to be powering on

00:01:29.680 --> 00:01:38.799 align:start position:19%
the device today. We are going to be
extracting our flash chip. So if we zoom

00:01:35.280 --> 00:01:48.399 align:start position:19%
in here and we look at this main PCB, we
see side by side here, we have got the

00:01:43.360 --> 00:01:54.799 align:start position:19%
main uh SOC, the CPU on this device. And
then right next door, we have our

00:01:50.960 --> 00:02:00.719 align:start position:19%
eightpin flash chip. So this is a pretty
simple Linux-based device. And then we

00:01:58.000 --> 00:02:05.840 align:start position:19%
got our Wi-Fi stuff over here, which we
might look at in another video. And I've

00:02:03.680 --> 00:02:10.800 align:start position:19%
been also probing around at the UR
interface here. Uh, and then we might

00:02:08.959 --> 00:02:14.959 align:start position:19%
talk about that later, but right now all
I can get out of the interface actually

00:02:12.640 --> 00:02:19.760 align:start position:19%
is I can only get it to print out a very
quick message on boot and then it goes

00:02:17.200 --> 00:02:25.040 align:start position:19%
dark. So, we are going to look at the
firmware that is contained on this chip

00:02:22.160 --> 00:02:31.040 align:start position:19%
to hopefully shed more light on how this
device works. So, the first thing I'm

00:02:27.040 --> 00:02:39.200 align:start position:19%
going to do here is I'm going to try to
get all of these connectors

00:02:35.519 --> 00:02:46.080 align:start position:19%
and to basically set free this main PCB
here. So, we're just gonna,

00:02:43.280 --> 00:02:51.680 align:start position:19%
like I said, I have not done this yet on
this device, and

00:02:49.599 --> 00:02:59.760 align:start position:19%
it's always way easier to do it when
you're not trying to film yourself. So,

00:02:53.920 --> 00:03:06.239 align:start position:19%
let's go ahead and get these off.
Some of these I I just just kind of pull

00:03:02.080 --> 00:03:12.000 align:start position:19%
off. Okay, we have two more connectors
on this side. And this is uh a little

00:03:09.440 --> 00:03:16.879 align:start position:19%
more complex of a device because this is
a pan tilt zoom camera. So, it can

00:03:14.319 --> 00:03:22.560 align:start position:19%
actually move with these motors inside,
which is what a bunch of these

00:03:18.319 --> 00:03:29.599 align:start position:19%
connectors are for. So now I've got that
removed, but we are still connected up

00:03:26.159 --> 00:03:34.080 align:start position:19%
to the PCB that sits on the front of the
camera. That's usually for infrared

00:03:31.519 --> 00:03:40.799 align:start position:19%
lights up here. And those might actually
be visible lights and infrared. So we

00:03:37.440 --> 00:03:46.599 align:start position:19%
are going to very carefully figure out
how to get this ribbon cable out of

00:03:43.599 --> 00:03:46.599 align:start position:19%
here.

00:03:46.959 --> 00:03:54.920 align:start position:19%
Let's
without breaking it would be great.

00:03:55.120 --> 00:04:02.000 align:start position:19%
Gotcha. Got it.
All right. So, that ribbon cable is out.

00:04:00.239 --> 00:04:08.560 align:start position:19%
And then we got one more here. This is
labeled mic. So, must be a microphone

00:04:04.879 --> 00:04:14.720 align:start position:19%
there. And just like that, we have the
main PCB. So, when we are putting hot

00:04:11.280 --> 00:04:19.280 align:start position:19%
air on this, we're going to try to avoid
as little melting of plastic as

00:04:16.880 --> 00:04:26.000 align:start position:19%
possible, but I still have a little bit
of an issue in that department. Let's

00:04:21.919 --> 00:04:31.520 align:start position:19%
look at it. So, you'll see here that we
have these plastic connectors that I

00:04:28.560 --> 00:04:35.440 align:start position:19%
would not I don't want to melt these.
So, I'm gonna be blowing air right

00:04:32.880 --> 00:04:39.120 align:start position:19%
there. And then on the other side, we
got some of those as well. So, what

00:04:37.040 --> 00:04:46.800 align:start position:19%
we're going to do is I've got some of
this tape, which is heat resistant. And

00:04:42.960 --> 00:04:55.040 align:start position:19%
so, we're going to tape off pretty much
everything except for the spot I'm going

00:04:49.759 --> 00:04:59.680 align:start position:19%
to be pumping air at. So,
there we go.

00:04:57.600 --> 00:05:08.400 align:start position:19%
You know, this this might be a little
overkill, but it's it's just a good idea

00:05:02.479 --> 00:05:15.240 align:start position:19%
usually to tape that off on that side.
And then I'm just going to tape off this

00:05:10.720 --> 00:05:15.240 align:start position:19%
connector as well. Why not?

00:05:16.080 --> 00:05:24.560 align:start position:19%
All right. And we can just tape off all
of that stuff on that side. And that is

00:05:21.840 --> 00:05:31.600 align:start position:19%
pretty cool. So then we have right here
where we're going to target our heat.

00:05:28.560 --> 00:05:35.840 align:start position:19%
And I'm just going to use this.
And the cool thing is we don't really

00:05:34.000 --> 00:05:40.479 align:start position:19%
need to do this under the microscope.
You guys can see that pretty well. And

00:05:38.400 --> 00:05:47.600 align:start position:19%
uh doing hot air stuff like this under
the microscope is not that easy. So here

00:05:44.160 --> 00:05:54.320 align:start position:19%
is my rework station. I'll zoom out. Uh,
so over on the desk I have this set to a

00:05:51.759 --> 00:05:59.280 align:start position:19%
very high temperature. I set mine to
about 450C.

00:05:56.880 --> 00:06:06.400 align:start position:19%
That's that's pretty hot, but it usually
gets the job done. So, let's zoom in for

00:06:03.199 --> 00:06:12.759 align:start position:19%
you guys. And on this chip, it should go
pretty quick. This isn't like one of

00:06:08.400 --> 00:06:12.759 align:start position:19%
those big BGA chips.

00:06:14.479 --> 00:06:21.759 align:start position:19%
So,
Not going to pull. I'm just going to

00:06:18.880 --> 00:06:26.960 align:start position:19%
very Oh, and there we go. Just comes
right off.

00:06:24.000 --> 00:06:31.120 align:start position:19%
All right. And I'm just going to set
that aside because we are not going to

00:06:29.360 --> 00:06:39.680 align:start position:19%
be worrying about that for the rest of
this video. Everything is going to be

00:06:34.240 --> 00:06:49.160 align:start position:19%
focused on this guy right here. And
let's bring in our microscope.

00:06:45.120 --> 00:06:49.160 align:start position:19%
Get that centered up.

00:06:53.199 --> 00:07:01.599 align:start position:19%
There we go.
So, we can read the identifying

00:06:59.520 --> 00:07:05.440 align:start position:19%
information. So, sometimes what I will
do, uh, just to give you guys some

00:07:03.680 --> 00:07:09.360 align:start position:19%
context of what I'm not going to do
here, because it looks great, but

00:07:07.680 --> 00:07:14.639 align:start position:19%
sometimes if there's a bunch of excess
solder left on the legs here of the

00:07:12.240 --> 00:07:19.199 align:start position:19%
chip, I will clean that up with some
solder braid and my soldering iron. But

00:07:18.080 --> 00:07:22.400 align:start position:19%
this looks pretty good. I don't think
we're going to have a problem getting a

00:07:20.560 --> 00:07:28.240 align:start position:19%
connection. And then, obviously with a
microscope, we can see that there's no

00:07:24.639 --> 00:07:33.759 align:start position:19%
bridges left on the chip, which is good.
And let's zoom in.

00:07:32.000 --> 00:07:39.960 align:start position:19%
Are you kidding? I have to go I have to
lower my microscope down a little bit.

00:07:36.560 --> 00:07:39.960 align:start position:19%
There we go.

00:07:40.560 --> 00:07:51.199 align:start position:19%
So there you can see that this is a
X

00:07:46.560 --> 00:07:54.199 align:start position:19%
MC that C is kind of obscured there. 25
QH64D.

00:07:56.240 --> 00:08:05.599 align:start position:19%
So let's talk about that.
So over here in my XG Pro software, so

00:08:02.319 --> 00:08:15.199 align:start position:19%
this is the software that works with the
XGEU T76 device. This is the latest XGKU

00:08:11.759 --> 00:08:22.000 align:start position:19%
uh universal programmer. So here I have
I've done a search for that first part

00:08:18.960 --> 00:08:26.240 align:start position:19%
of the model number of our flash chip.
And you will notice that what's

00:08:24.639 --> 00:08:33.599 align:start position:19%
interesting
is that here we have you know profiles

00:08:30.400 --> 00:08:40.640 align:start position:19%
in the software for
25 QH64

00:08:36.159 --> 00:08:47.760 align:start position:19%
A B and C but not D. So this is a
situation that I do get into sometimes

00:08:45.040 --> 00:08:52.480 align:start position:19%
where I will have a chip that is really
close but not exactly correct. It

00:08:50.720 --> 00:08:57.680 align:start position:19%
doesn't quite have the latest model of
the chip profile in the software, but we

00:08:55.839 --> 00:09:04.080 align:start position:19%
shouldn't have a problem here. So, what
I've gone ahead and done is I pulled up

00:09:00.560 --> 00:09:11.040 align:start position:19%
the data sheet here. And here we can see
that this is a 64 megabit

00:09:08.720 --> 00:09:16.160 align:start position:19%
chip. That's important. And if we go
down here, it'll even kind of translate

00:09:13.440 --> 00:09:22.240 align:start position:19%
that for us. Uh just so if you're not
aware uh you know sometimes you get like

00:09:20.000 --> 00:09:26.480 align:start position:19%
advertised you know internet speeds that
are in megabits and uh that's that's

00:09:24.560 --> 00:09:31.839 align:start position:19%
different than megabytes and sometimes
it can play tricks on you in your head.

00:09:28.240 --> 00:09:38.399 align:start position:19%
Uh so this is an 8 megabyte
chip as how much data is stored on it

00:09:35.200 --> 00:09:45.839 align:start position:19%
and so this is the data sheet again for
the the D model. It ends in D. And we

00:09:43.279 --> 00:09:51.279 align:start position:19%
can go over here and why I'm hopeful
that we are going to be able to read

00:09:47.519 --> 00:09:56.800 align:start position:19%
this. Okay, let me select a let me
select the A chip and get my very

00:09:55.120 --> 00:10:01.839 align:start position:19%
sketchy
Windows remote desktop session to not

00:10:00.160 --> 00:10:07.600 align:start position:19%
look like that. All right. So, if we
look at this chip, we can see that it is

00:10:04.880 --> 00:10:12.640 align:start position:19%
also a eight.
Yeah, you know, this is an 8.3

00:10:11.040 --> 00:10:17.519 align:start position:19%
megabyte
flash chip. And so this looks like

00:10:15.680 --> 00:10:20.800 align:start position:19%
they're all the same. So hopefully
there's not a big difference between

00:10:19.279 --> 00:10:26.399 align:start position:19%
those chip models that we don't know
about. And what we are probably going to

00:10:24.079 --> 00:10:30.640 align:start position:19%
need to do though, but I'm going to
leave it checked just to get the error.

00:10:28.640 --> 00:10:37.760 align:start position:19%
And so we'll we'll we'll watch it in
real time. But this uh check ID value

00:10:35.680 --> 00:10:42.240 align:start position:19%
down here in the kind of device info
options there's this checkbox where we

00:10:40.079 --> 00:10:49.279 align:start position:19%
can say check ID and what [snorts] that
will do is it will check to make sure

00:10:45.839 --> 00:10:56.480 align:start position:19%
that the kind of like it can read out
the an identifier that is should be

00:10:53.200 --> 00:11:01.760 align:start position:19%
unique to this a model of the chip and
then it will make sure that it's correct

00:10:59.360 --> 00:11:08.640 align:start position:19%
before it goes to the next steps of
performing a read and I suspect that we

00:11:05.680 --> 00:11:12.399 align:start position:19%
will we will fail this check ID and so
we have to we'll have to uncheck it but

00:11:10.640 --> 00:11:19.680 align:start position:19%
we're gonna we'll test that hypothesis
in a little bit. So uh let's go ahead

00:11:15.839 --> 00:11:28.240 align:start position:19%
and come back under the microscope here
and I'm going to prepare this for our

00:11:24.079 --> 00:11:34.399 align:start position:19%
socket here. So what we're going to do
is oh I should show you in the software

00:11:31.279 --> 00:11:39.680 align:start position:19%
first. Okay. So in the software
in this case the diagram is correct.

00:11:37.279 --> 00:11:46.880 align:start position:19%
Sometimes these pictures are not exactly
accurate but in this case it's right. So

00:11:41.760 --> 00:11:51.760 align:start position:19%
you'll notice here that this XGU adapter
right here wants pin one. We see this

00:11:49.279 --> 00:11:57.839 align:start position:19%
little dot here that indicates pin one
on the chip. It wants it facing upwards,

00:11:54.880 --> 00:12:03.200 align:start position:19%
upwards towards pin one of the socket
for our firmware reader device. And we

00:12:00.720 --> 00:12:09.040 align:start position:19%
want it to face up but be all the way at
the bottom of this kind of stack here.

00:12:07.200 --> 00:12:14.639 align:start position:19%
So what we're going to do is we're going
to come over to our microscope. And so

00:12:11.920 --> 00:12:18.800 align:start position:19%
uh the ignore so what's maybe a common
thing to confuse this paint piece of

00:12:17.120 --> 00:12:23.920 align:start position:19%
paint right here is not the pin one
indicator. This divot in the chip is the

00:12:21.440 --> 00:12:28.560 align:start position:19%
pin one indicator. So there we go. We
got it right the right way. And then we

00:12:26.000 --> 00:12:34.760 align:start position:19%
have our adapter here, which let's now
put the adapter in focus.

00:12:31.760 --> 00:12:34.760 align:start position:19%
Ah,

00:12:35.200 --> 00:12:42.560 align:start position:19%
okay.
Just going to fumble that around a

00:12:39.680 --> 00:12:49.639 align:start position:19%
little bit.
There we go. Let me get that focus

00:12:46.639 --> 00:12:49.639 align:start position:19%
again.

00:12:52.000 --> 00:13:00.560 align:start position:19%
All right. So, there we go. We can see
all of the legs now are in contact with

00:12:58.399 --> 00:13:06.880 align:start position:19%
our little socket.
And you kind of see what that looks like

00:13:03.920 --> 00:13:13.440 align:start position:19%
there.
We are going to place that

00:13:09.680 --> 00:13:18.480 align:start position:19%
into our device
all the way at the bottom. So, pin one

00:13:16.000 --> 00:13:25.519 align:start position:19%
is up here.
And we're going to place it down at the

00:13:19.920 --> 00:13:32.320 align:start position:19%
bottom pin one towards the upper side.
And now we're going to plug that in. And

00:13:29.600 --> 00:13:36.360 align:start position:19%
we should see it be identified in the
software when we do that.

00:13:38.560 --> 00:13:48.160 align:start position:19%
Good. It has identified
um Yeah. Yeah. New product launch stuff.

00:13:46.000 --> 00:13:52.480 align:start position:19%
Yeah. This is their like newest product.
So, it's identified the reader and now

00:13:50.399 --> 00:14:01.360 align:start position:19%
we're going to go ahead and let's go
ahead and let's perform a read.

00:13:57.040 --> 00:14:08.399 align:start position:19%
Uh, okay. This is not the check ID
error. This is telling me that it can't

00:14:05.199 --> 00:14:12.639 align:start position:19%
make contact perfectly
with these pins. So, what I'm going to

00:14:10.560 --> 00:14:18.560 align:start position:19%
do
is I'm just gonna like wiggle it around

00:14:16.320 --> 00:14:23.440 align:start position:19%
there.
Do another read. Okay. Okay. So, that so

00:14:21.199 --> 00:14:27.920 align:start position:19%
that was that first error that we
encountered which is which is cool to

00:14:25.120 --> 00:14:33.199 align:start position:19%
show this off. That was it was detecting
that it was not quite making contact

00:14:30.000 --> 00:14:41.360 align:start position:19%
right with all eight pins. Now it made
contact, but it read

00:14:36.560 --> 00:14:45.320 align:start position:19%
the incorrect ID out of the chip. It
says ID is blank.

00:14:45.920 --> 00:14:53.440 align:start position:19%
That could prove bad for us. But you
know what? Now, okay, so now we're going

00:14:50.399 --> 00:15:00.480 align:start position:19%
to uncheck that option
and we're going to read anyway.

00:14:58.079 --> 00:15:03.440 align:start position:19%
Oh, it's getting a pin detect again.
Okay.

00:15:06.399 --> 00:15:12.639 align:start position:19%
Huh?
Yeah, it's not liking this. All right,

00:15:11.120 --> 00:15:19.079 align:start position:19%
read.
All right, here we go.

00:15:15.600 --> 00:15:19.079 align:start position:19%
It's reading.

00:15:19.279 --> 00:15:27.440 align:start position:19%
It did something. And we do have some
data. Okay. So, that is good.

00:15:25.920 --> 00:15:31.120 align:start position:19%
That is a good thing. All right. And we
have data out. So I think it's reading

00:15:29.600 --> 00:15:35.519 align:start position:19%
successfully
in all cases when I'm doing this work

00:15:33.440 --> 00:15:40.560 align:start position:19%
professionally and in this case right
now I'm going to do a double check. I

00:15:37.839 --> 00:15:44.800 align:start position:19%
know it does an internal verification
but I like to do my own sanity check. So

00:15:43.600 --> 00:15:51.680 align:start position:19%
what I'm going to do is I'm going to
save this file. We're going to call this

00:15:48.240 --> 00:15:56.320 align:start position:19%
ran one.bin.
So that was like our first read of the

00:15:53.360 --> 00:16:00.560 align:start position:19%
firmware. We're going to save it and
then we're going to do a whole another

00:15:58.240 --> 00:16:03.839 align:start position:19%
read
where we read the firmware in again.

00:16:02.480 --> 00:16:10.440 align:start position:19%
It's doing its own internal
verification. Shouldn't be a problem,

00:16:07.440 --> 00:16:10.440 align:start position:19%
but

00:16:11.680 --> 00:16:19.759 align:start position:19%
uh oh gosh, I like named it the weird
thing. Okay, whatever. They're both

00:16:16.320 --> 00:16:27.759 align:start position:19%
there. That's MD5 sum
the bin

00:16:23.199 --> 00:16:32.720 align:start position:19%
and the that one. Okay. Okay. Cool. So,
our double check it. It It matched.

00:16:30.399 --> 00:16:38.000 align:start position:19%
We're all good to go. So, now what I
need to do is I just need to transfer

00:16:34.399 --> 00:16:43.480 align:start position:19%
this to my Linux side here.
And so, we're just going to pop that

00:16:40.000 --> 00:16:43.480 align:start position:19%
file over.

00:16:48.720 --> 00:16:57.759 align:start position:19%
like shift insert or something. Yeah.
Hey, there we go.

00:16:55.199 --> 00:17:03.839 align:start position:19%
All right. So, now we have that firmware
file over here. If we want to really uh,

00:17:00.880 --> 00:17:09.600 align:start position:19%
you know, sanity check this thing, make
sure that my SCP was was solid. It was.

00:17:07.919 --> 00:17:17.839 align:start position:19%
All right.
Now we can go ahead and run Binwok on

00:17:13.520 --> 00:17:21.919 align:start position:19%
this thing. And oh man, the the Okay, it
doesn't like Binwok really just doesn't

00:17:19.520 --> 00:17:28.000 align:start position:19%
like me making the SC the the font
bigger. So here we have Okay, we've got

00:17:25.839 --> 00:17:32.400 align:start position:19%
some kind of
some boot headers. Okay, that's all

00:17:30.559 --> 00:17:41.039 align:start position:19%
cool.
Uh kernel image. Okay,

00:17:37.200 --> 00:17:47.520 align:start position:19%
some Uboot string stuff. That's great.
More U image things.

00:17:44.720 --> 00:17:53.840 align:start position:19%
A Squash FS file system. That's that's
good. And a J FFS2 file system. That's

00:17:51.679 --> 00:17:58.240 align:start position:19%
awesome. So, if you don't if you haven't
watched the first video, I suggest uh

00:17:55.840 --> 00:18:02.480 align:start position:19%
you know going through my my videos on
the channel and looking at the first

00:18:00.640 --> 00:18:06.960 align:start position:19%
video we did where we saw some network
traffic in that first video and there

00:18:04.559 --> 00:18:10.240 align:start position:19%
were some header values when it was
calling out to the cloud server. We were

00:18:09.039 --> 00:18:15.840 align:start position:19%
really interested in how it was
performing that authentication. And so

00:18:13.600 --> 00:18:19.600 align:start position:19%
with that goal in mind, we're doing some
kind of targeted firmware reverse

00:18:18.480 --> 00:18:25.760 align:start position:19%
engineering is what we're going to do
with this. I suspect it's going to be in

00:18:23.200 --> 00:18:30.880 align:start position:19%
one of these two directories.
Probably the squash fs file system. So

00:18:28.000 --> 00:18:36.880 align:start position:19%
most Linux systems like this, the way
that they work is most of the binary

00:18:34.000 --> 00:18:41.280 align:start position:19%
executables things like that the main
core of the system that is not going to

00:18:39.360 --> 00:18:47.679 align:start position:19%
change will be in a squash FS file
system because squash fs by its very

00:18:44.000 --> 00:18:51.120 align:start position:19%
nature is read only. Right? the the if
you wanted to make updates to it, you

00:18:49.280 --> 00:18:56.640 align:start position:19%
would have to rebuild a whole new
SquashFS file system and and write it

00:18:53.520 --> 00:19:01.520 align:start position:19%
over top of this partition right here.
And so

00:18:58.880 --> 00:19:05.360 align:start position:19%
if you want to have data that changes
dynamically, say a device has some

00:19:03.600 --> 00:19:11.440 align:start position:19%
authentication credentials that are
unique to each device, those need to be

00:19:08.720 --> 00:19:18.400 align:start position:19%
in a writable partition. And that's what
JFFS2 is. If you're not familiar with

00:19:14.559 --> 00:19:23.280 align:start position:19%
JFFS2, it is a file system that is built
specifically for embedded devices. So if

00:19:21.520 --> 00:19:27.679 align:start position:19%
you're not from the embedded Linux
world, then you probably haven't seen

00:19:25.280 --> 00:19:32.080 align:start position:19%
this before. So
uh and as well as Squash FS, but

00:19:29.280 --> 00:19:37.440 align:start position:19%
Squashfest sometimes gets used uh more a
little more mainstream than this other

00:19:33.919 --> 00:19:42.000 align:start position:19%
stuff. So we just used binwock with no
arguments. And when you do that, it just

00:19:40.000 --> 00:19:46.640 align:start position:19%
looks for stuff. It doesn't do any
extraction. So what we're going to do

00:19:44.000 --> 00:19:51.600 align:start position:19%
now is if I can type, we're going to do
the dash e flag.

00:19:49.039 --> 00:19:57.679 align:start position:19%
And it has extracted three things.
That's awesome. So a u image, that's the

00:19:54.480 --> 00:20:01.200 align:start position:19%
kernel, squash fs, the root file system,
and jfs2.

00:19:59.840 --> 00:20:05.600 align:start position:19%
That's probably going to be like our
data directory. Again, we'll get to see

00:20:03.760 --> 00:20:10.000 align:start position:19%
a little bit in a little bit probably
where that mount that mount that uh is

00:20:07.360 --> 00:20:14.080 align:start position:19%
mounted. But this is awesome because it
didn't nothing failed. None of the

00:20:11.520 --> 00:20:17.679 align:start position:19%
extraction failed. So, uh, sometimes
that happens and you got to do some

00:20:15.840 --> 00:20:23.200 align:start position:19%
other stuff to figure it out. But this
is great. So now, uh, the new binwok by

00:20:21.039 --> 00:20:28.880 align:start position:19%
default it puts everything in a new
directory called extractions. We can

00:20:25.440 --> 00:20:35.520 align:start position:19%
look into here and there are the three
separate areas. I'm just going to go

00:20:31.039 --> 00:20:39.919 align:start position:19%
find dot and let's just see what what it
found inside of here. We can we can make

00:20:37.840 --> 00:20:45.039 align:start position:19%
the font bigger again now that we're not
dealing with that binwatch stuff. All

00:20:41.520 --> 00:20:52.320 align:start position:19%
right. So, aha, just as I suspected, we
have that JFFS root file system here.

00:20:49.520 --> 00:20:59.520 align:start position:19%
And we have a what looks like a database
file in that writable

00:20:56.000 --> 00:21:05.679 align:start position:19%
data partition. Right? We see config,
you know, DB, some more configuration

00:21:02.480 --> 00:21:10.000 align:start position:19%
stuff, right? That's that's to be
expected because that's stuff that's

00:21:07.520 --> 00:21:15.039 align:start position:19%
going to be unique per device and needs
to be put in a writable partition. And

00:21:12.640 --> 00:21:20.640 align:start position:19%
then we have squash fs root. Uh okay.
And then here we have again a a Linux

00:21:17.919 --> 00:21:25.360 align:start position:19%
kernel image. Uh it's running, you know,
the kernel 3.10.

00:21:23.280 --> 00:21:31.280 align:start position:19%
And in the root file system, we're going
to see things like binary executables.

00:21:27.840 --> 00:21:36.960 align:start position:19%
All right. So pps config
um pp. Okay. So this PPS, this is

00:21:34.720 --> 00:21:43.760 align:start position:19%
interesting because I saw a bunch of
strings in that first video in the

00:21:40.720 --> 00:21:48.880 align:start position:19%
headers that was like PPS something PPS
something. So uh that is interesting and

00:21:47.039 --> 00:21:56.080 align:start position:19%
is kind of related to things that I've
seen about this system and wow. Wait,

00:21:52.400 --> 00:22:02.159 align:start position:19%
really? That is an extremely small
system. All right. Yeah. And and and

00:22:00.000 --> 00:22:06.480 align:start position:19%
also this device. So, I didn't show this
last time. When you end mapap this

00:22:04.000 --> 00:22:11.280 align:start position:19%
device, zero ports open. It reaches out
to the cloud server like we that's what

00:22:08.799 --> 00:22:16.880 align:start position:19%
we analyzed in the first video, but it
nothing connects into this device. There

00:22:13.200 --> 00:22:21.760 align:start position:19%
are zero ports open on this thing. And
so, there is an init script, which that

00:22:20.320 --> 00:22:29.280 align:start position:19%
is pretty interesting. Some
initialization here. So, okay, we got

00:22:24.960 --> 00:22:33.559 align:start position:19%
some stuff setting up a kernel.
Some like kernel mod stuff.

00:22:34.240 --> 00:22:40.640 align:start position:19%
All right.
Okay. Where do we Yeah. Yeah. Yeah.

00:22:38.880 --> 00:22:46.159 align:start position:19%
Yeah. Yeah. Right here. Okay. So, this
script right is going to mount that

00:22:44.000 --> 00:22:50.200 align:start position:19%
JFFS2
partition ontoconfig.

00:22:50.240 --> 00:22:58.720 align:start position:19%
So if we ever were to get a shell on the
live device, we would know that's where

00:22:55.600 --> 00:23:04.559 align:start position:19%
the that data partition that config.
It's the config partition we can call it

00:23:00.799 --> 00:23:09.760 align:start position:19%
now is is mounted there. Oh, it even it
says it in the comment. Here I should

00:23:06.080 --> 00:23:13.520 align:start position:19%
read format the config partition if it's
invalid. Okay, so like if there's not a

00:23:12.080 --> 00:23:18.480 align:start position:19%
real partition there, it's going to it's
going to create it out of whole cloth.

00:23:16.159 --> 00:23:23.600 align:start position:19%
So that's awesome. Um, it's going to set
up some links.

00:23:21.280 --> 00:23:31.360 align:start position:19%
Okay. Oh, right here. Okay, cool. So,
this app PPS app, I'm guessing this

00:23:27.840 --> 00:23:36.400 align:start position:19%
binary is most likely going to be the
thing that we're going to target for

00:23:33.679 --> 00:23:41.600 align:start position:19%
reverse engineering that makes the the
traffic that that makes that traffic

00:23:38.880 --> 00:23:45.600 align:start position:19%
call uh that you makes the web traffic
go out to the cloud server. I'm just

00:23:43.679 --> 00:23:48.720 align:start position:19%
guessing that it's going to be that one.
Um, and it gets started in the

00:23:47.440 --> 00:23:52.559 align:start position:19%
background. As you can see there, it
gets run in the background. The

00:23:50.240 --> 00:23:55.600 align:start position:19%
amperand, uh, instead of running a
program in the foreground, runs it in

00:23:54.080 --> 00:24:00.559 align:start position:19%
the background so the rest of the script
can keep running.

00:23:57.679 --> 00:24:05.440 align:start position:19%
Um,
yeah. And then

00:24:03.120 --> 00:24:11.360 align:start position:19%
if
that's this is really interesting. It

00:24:07.280 --> 00:24:16.159 align:start position:19%
says if this thing exists, then it runs
it. But that has to be in it's not like

00:24:14.400 --> 00:24:21.760 align:start position:19%
we could change that. We'd have to
change the whole squash fs to to do that

00:24:19.120 --> 00:24:28.240 align:start position:19%
because this is not in the writable
partition. Okay, this is a very simple

00:24:25.039 --> 00:24:33.240 align:start position:19%
device. So what I want to do is I want
to find the binary.

00:24:33.919 --> 00:24:43.840 align:start position:19%
I Yeah, I'm like blind.
Here it is. I want to find this PPS app.

00:24:48.480 --> 00:25:02.880 align:start position:19%
Okay, there it is.
Let's run file on it. It is a 32bit

00:24:57.840 --> 00:25:08.400 align:start position:19%
MIPS. Oh, man. We're running MIPS.
Well, well, isn't this fun? Isn't this

00:25:05.360 --> 00:25:11.640 align:start position:19%
fun? All right, let's just run strings
on it.

00:25:11.679 --> 00:25:14.679 align:start position:19%
And

00:25:16.240 --> 00:25:24.640 align:start position:19%
I just want to get down to the actual
like string section of the binary.

00:25:22.640 --> 00:25:27.640 align:start position:19%
Come on. This is like code code. Come
on.

00:25:31.200 --> 00:25:37.039 align:start position:19%
Really? There's a lot of code in there.
Okay, let's do this.

00:25:42.799 --> 00:25:45.799 align:start position:19%
talking.

00:25:54.000 --> 00:25:59.360 align:start position:19%
Very interesting stuff. Okay. Yeah.
These are all the strings related to the

00:25:57.440 --> 00:26:02.360 align:start position:19%
binary.
Huh.

00:26:08.559 --> 00:26:11.559 align:start position:19%
Yes.

00:26:17.679 --> 00:26:25.919 align:start position:19%
Okay. Okay. This is cool. This This is
one of these paths that we saw last time

00:26:23.760 --> 00:26:31.919 align:start position:19%
right there.
And if I remember correctly,

00:26:30.000 --> 00:26:40.600 align:start position:19%
yeah, there was like an authentication
credential that was put into here.

00:26:35.919 --> 00:26:40.600 align:start position:19%
Um, oh, where was it?

00:26:42.240 --> 00:26:51.360 align:start position:19%
Was it? It wasn't token, was it?
Oh, man. I need to like have

00:26:48.960 --> 00:26:56.720 align:start position:19%
Oh, hey. Hey, hey. Oh, wow. This is
interesting. [snorts] Okay. So, the

00:26:53.120 --> 00:27:02.320 align:start position:19%
device that I have was not communicating
with this server in China. It was

00:27:00.720 --> 00:27:07.440 align:start position:19%
communicating with one that was hosted
in the United States, right? But this is

00:27:05.039 --> 00:27:12.320 align:start position:19%
really interesting that that we see this
like hardcoded into here. This like

00:27:09.440 --> 00:27:17.840 align:start position:19%
Chinese this like CN domain. That's
really interesting.

00:27:14.720 --> 00:27:25.919 align:start position:19%
All right. Um Oh, right here. Okay. Here
it is. Here it is. Here it is. this uh

00:27:20.960 --> 00:27:31.919 align:start position:19%
XCA sign string in the first video the
there's clearly some kind of signing of

00:27:28.559 --> 00:27:38.080 align:start position:19%
the HTTP request that is performing the
authentication right so

00:27:35.360 --> 00:27:47.520 align:start position:19%
yeah right here is where that's being
performed let's see if we can

00:27:44.960 --> 00:27:51.279 align:start position:19%
um I'm going to I'm going to open that
binary in binary Ninja. I'm going to do

00:27:49.840 --> 00:27:56.200 align:start position:19%
it off screen, then I'm going to pull it
on screen real fast here.

00:28:00.320 --> 00:28:07.919 align:start position:19%
All right. Awesome.
Oh, there's a bunch of other PPS stuff,

00:28:04.480 --> 00:28:13.760 align:start position:19%
too. Let's go six.
All right. So, we got Binary Ninja here.

00:28:11.120 --> 00:28:18.399 align:start position:19%
And we are just again, this is this is
first impressions. This is all live. I

00:28:16.399 --> 00:28:24.240 align:start position:19%
have not dumped this firmware yet. So,
we're just going to see what happens.

00:28:20.960 --> 00:28:30.240 align:start position:19%
All right. So, it is
it is still actively analyzing stuff.

00:28:28.320 --> 00:28:35.840 align:start position:19%
All right. Let's go look at the strings.
Oh, you guys can't see that. So, so just

00:28:33.360 --> 00:28:41.360 align:start position:19%
so you know, I'm clicking this, but it's
hidden behind my face to to bring out

00:28:38.080 --> 00:28:47.480 align:start position:19%
this strings menu here. And we're going
to search for this string here.

00:28:48.880 --> 00:28:58.399 align:start position:19%
All right, there we go.
And

00:28:54.960 --> 00:29:04.080 align:start position:19%
is this still analyzing?
I can't tell.

00:29:01.679 --> 00:29:09.000 align:start position:19%
But I don't have an XREF to this. Oh.
Oh, I do. H I got one here.

00:29:10.559 --> 00:29:16.360 align:start position:19%
Okay, I do have one cross reference.
Aha.

00:29:17.279 --> 00:29:24.399 align:start position:19%
Okay, this is okay. This is really cool
here because we're seeing a very nice

00:29:22.559 --> 00:29:31.760 align:start position:19%
string that is clearly for some kind of
a logging function here. Um, man, I wish

00:29:28.799 --> 00:29:38.080 align:start position:19%
uh I could
make this bigger for you guys. I'm a

00:29:34.480 --> 00:29:45.399 align:start position:19%
little new to Binary Ninja, but what I
need to do is

00:29:40.480 --> 00:29:45.399 align:start position:19%
make the screen bigger. Come on.

00:29:45.760 --> 00:29:54.840 align:start position:19%
It's got to be here somewhere.
Window.

00:29:51.679 --> 00:29:54.840 align:start position:19%
Come on.

00:29:56.640 --> 00:30:03.520 align:start position:19%
This is so funny. All right. Settings.
Uhhuh.

00:30:00.720 --> 00:30:07.880 align:start position:19%
Like
font size.

00:30:10.399 --> 00:30:13.799 align:start position:19%
There we go.

00:30:15.360 --> 00:30:22.960 align:start position:19%
actually make it bigger. I don't think
it did. Anyway, uh we can see here uh a

00:30:19.679 --> 00:30:29.200 align:start position:19%
string that is clearly uh yeah, like
this is clearly some person's like home

00:30:25.919 --> 00:30:33.840 align:start position:19%
directory that this was built in. Uh the
Marari SDK

00:30:32.080 --> 00:30:38.000 align:start position:19%
that's that's related to this company
that makes the camera.

00:30:36.080 --> 00:30:44.880 align:start position:19%
And yeah, we're we're seeing a bunch of
stuff here about

00:30:41.120 --> 00:30:51.320 align:start position:19%
this CAN knots.
Yeah, I mean this whole function seems

00:30:46.799 --> 00:30:51.320 align:start position:19%
to be wrapped up in the authentication

00:30:52.799 --> 00:30:56.840 align:start position:19%
signature content

00:30:59.440 --> 00:31:05.000 align:start position:19%
XCA key XCA sign.

00:31:06.000 --> 00:31:11.360 align:start position:19%
Okay, so wait. Oh, this is Oh, this is
really interesting. So, it's sprint

00:31:09.200 --> 00:31:16.240 align:start position:19%
fing.
How many things are there here? That's

00:31:13.279 --> 00:31:20.279 align:start position:19%
be the last one that
What's What's R?

00:31:21.919 --> 00:31:27.080 align:start position:19%
Yeah, I mean it's passing in some big
thing here

00:31:28.080 --> 00:31:35.120 align:start position:19%
arg one.
Yeah, this this is obviously going to

00:31:32.960 --> 00:31:44.000 align:start position:19%
take a lot a little bit longer to get to
the bottom of, but uh and I also want to

00:31:39.360 --> 00:31:49.600 align:start position:19%
try messing around with uh doing some M
MCP stuff with uh Binary Ninja. So, but

00:31:47.679 --> 00:31:53.919 align:start position:19%
for now, I want to see Whoa. Okay, a
million things call this function. Of

00:31:51.200 --> 00:31:57.760 align:start position:19%
course, I'm guessing this function is
just for sending it's like for sending

00:31:55.519 --> 00:32:02.480 align:start position:19%
web web requests.
Wait, no, it just gets sent a string.

00:32:01.120 --> 00:32:08.080 align:start position:19%
Let me just like look at one of these
functions that that talks to it. All

00:32:05.760 --> 00:32:13.120 align:start position:19%
right. So, here
sends a string.

00:32:10.399 --> 00:32:16.120 align:start position:19%
Oh, okay. It's like it's just like a
request.

00:32:18.480 --> 00:32:21.480 align:start position:19%
Fascinating.

00:32:24.480 --> 00:32:29.840 align:start position:19%
All right. Yeah, we're gonna we're going
to have to get to the bottom of this,

00:32:27.360 --> 00:32:35.200 align:start position:19%
but uh obviously some cool stuff there.
Let's go back to the firmware dump and

00:32:31.679 --> 00:32:39.039 align:start position:19%
let's let's let's look the stuff that is
inside

00:32:37.039 --> 00:32:43.600 align:start position:19%
of
our

00:32:40.880 --> 00:32:50.320 align:start position:19%
data directory.
And we'll just look at this to see which

00:32:45.919 --> 00:32:55.760 align:start position:19%
one it is. Okay, it's it's like the 78
one.

00:32:52.480 --> 00:33:00.600 align:start position:19%
All right, so here are are a bunch of
stuff.

00:32:57.600 --> 00:33:00.600 align:start position:19%
Wait,

00:33:00.720 --> 00:33:09.600 align:start position:19%
that's so interesting.
Prod info.

00:33:06.799 --> 00:33:19.039 align:start position:19%
Prodinfo.com. Okay, there's not much
there. Interesting. Test info. Save

00:33:14.880 --> 00:33:22.960 align:start position:19%
madeup state. All right. Fun stuff. OSS
config.

00:33:20.559 --> 00:33:28.919 align:start position:19%
Okay, that just looks like an actual
like text file there.

00:33:25.279 --> 00:33:28.919 align:start position:19%
All right, cool.

00:33:29.200 --> 00:33:35.919 align:start position:19%
All right. Yeah, there you go. Those are
all my authentication creds. So,

00:33:34.240 --> 00:33:40.080 align:start position:19%
yeah. So, you can impersonate with my
device with that. Have fun, everybody.

00:33:38.559 --> 00:33:45.600 align:start position:19%
Um,
if you can like push like an image to my

00:33:42.880 --> 00:33:53.000 align:start position:19%
account, I'll uh I'll give you a shout
out in the next video. You can figure

00:33:47.919 --> 00:33:53.000 align:start position:19%
out how to use that. All right. Um,

00:33:53.679 --> 00:33:59.360 align:start position:19%
that's fun.
Okay. Okay. The DB I want to I want to

00:33:57.519 --> 00:34:04.960 align:start position:19%
look at what's in this database. Let's
open it with S. I assume I assume this

00:34:01.679 --> 00:34:09.760 align:start position:19%
is a SQLite database. Uh, it is not
interesting. Okay.

00:34:07.760 --> 00:34:15.919 align:start position:19%
File. Let's just run file and all this
stuff. Okay.

00:34:13.599 --> 00:34:22.879 align:start position:19%
Database. The database. No, it just said
data. All right. What do we got?

00:34:19.359 --> 00:34:28.000 align:start position:19%
Oh, okay. It's just a text file.
Ah, more stuff. Okay. More. Yeah,

00:34:25.599 --> 00:34:31.240 align:start position:19%
there's my key and a whole bunch of
other stuff.

00:34:31.280 --> 00:34:39.359 align:start position:19%
IoT signature.
That's interesting.

00:34:37.760 --> 00:34:43.359 align:start position:19%
All right. So, this is all the device
specific authentication credentials

00:34:41.679 --> 00:34:48.079 align:start position:19%
obviously.
Now, what I am interested in is how

00:34:46.480 --> 00:34:51.679 align:start position:19%
these are communicated to the camera.
I'm guessing. So, I did go through the

00:34:49.839 --> 00:34:56.639 align:start position:19%
setup process on the mobile app. So, I'm
guessing the mobile app sends this stuff

00:34:54.560 --> 00:35:00.720 align:start position:19%
over to the camera or there's some kind
of bootstrapping process that gets this

00:34:58.400 --> 00:35:08.240 align:start position:19%
stuff on here. So,
fun stuff, fun firmware analysis. This

00:35:04.720 --> 00:35:12.320 align:start position:19%
leaves us with a lot of room to explore
on this system. Like I said, that main

00:35:10.400 --> 00:35:17.040 align:start position:19%
application binary, we are definitely
going to take a look at that and do some

00:35:14.160 --> 00:35:22.720 align:start position:19%
deep diving into how the authentication
is being performed. So stay tuned for

00:35:20.400 --> 00:35:25.760 align:start position:19%
that in next video. Thank you for
watching this. Let me know in the

00:35:24.079 --> 00:35:32.160 align:start position:19%
comments what you thought and what kind
of videos you'd like me to do in the

00:35:28.000 --> 00:35:32.160 align:start position:19%
future. And as always, have a good day.

