WEBVTT

00:00.000 --> 00:00.640
Quick intro.

00:00.640 --> 00:01.700
I'm Mickey.

00:01.900 --> 00:03.280
That's Jesse.

00:03.620 --> 00:05.280
We hack things.

00:05.460 --> 00:07.320
We give talks.

00:07.420 --> 00:08.180
That's who we are.

00:08.180 --> 00:11.160
There's a lot of stuff online.

00:11.160 --> 00:13.340
We work for a company called Eclipsium.

00:13.460 --> 00:17.740
We want to mention them because they help us fund all of this stuff.

00:19.420 --> 00:25.840
Quick terminology, for those unaware, UART is a serial communication protocol.

00:25.880 --> 00:32.360
Wow, it's really distracting, that noise from the other place.

00:33.940 --> 00:35.340
Don't tempt me.

00:36.360 --> 00:47.040
Okay, so UART is a serial communication protocol, usually in IoT devices, OTA over the air, UVC, basically read it yourselves.

00:48.700 --> 00:53.420
One thing I want to be clear about that I do want some participation.

00:53.420 --> 00:57.560
If anyone has a question, shout because I can't see anything.

00:57.560 --> 00:59.180
I have a light in my eyes.

00:59.340 --> 01:08.040
So either come to the microphones and ask us a question or interrupt, yell, everything's cool as long as you do it, you know, with taste.

01:09.100 --> 01:17.380
Another thing I want to be clear about, there's multiple ways to hack a thing.

01:17.460 --> 01:19.460
We did it one way.

01:19.740 --> 01:23.680
I'm sure there's at least 12 people here that can do it better.

01:25.240 --> 01:26.880
I'll start with a story.

01:29.140 --> 01:34.500
Back in the COVID days, we did a lot of e-meetings, you know, video calls, all that stuff.

01:34.500 --> 01:36.220
And I needed a good webcam.

01:36.380 --> 01:39.100
So I found one that did 60 frames per second.

01:39.100 --> 01:40.700
I'm like, yeah, I buy it.

01:40.740 --> 01:42.860
I plug it into my computer.

01:42.860 --> 01:47.720
And then a year goes by and it starts to be flaky in meetings.

01:47.720 --> 01:52.260
And I'm like, okay, it's been on the market for two years.

01:52.260 --> 01:55.400
There must be a firmware update that I haven't applied yet.

01:55.900 --> 01:59.500
I should go and apply that.

01:59.500 --> 02:03.340
So I find the firmware update tool.

02:03.340 --> 02:04.500
I go on their website.

02:04.500 --> 02:05.820
I download it.

02:05.820 --> 02:10.240
That's the URL for the web archive for the original tool.

02:11.340 --> 02:15.680
I recommend that you save it because it's no longer on the internet.

02:16.500 --> 02:21.620
So I download the tool and I install it, right?

02:21.680 --> 02:22.980
Run the installer.

02:23.960 --> 02:25.740
Get the GUI for the installer.

02:25.740 --> 02:27.400
It automatically opens it up.

02:27.600 --> 02:29.920
It shows the camera, the firmware version.

02:31.040 --> 02:32.480
But did you see it?

02:34.140 --> 02:36.380
It extracts into a folder.

02:37.640 --> 02:42.400
Me, being an inquisitive mind, I'm like, okay, something's sus here.

02:42.620 --> 02:45.000
I open and look at the files.

02:49.220 --> 02:50.640
You see it?

02:54.200 --> 03:02.860
I take a closer look and I say to myself, like, what the fuck?

03:03.660 --> 03:09.880
Why does a webcam need almost an 8 meg firmware update?

03:11.320 --> 03:13.260
So take a look at it again.

03:15.300 --> 03:17.680
There's a .sh script.

03:17.680 --> 03:20.020
Keep in mind this is a Windows updater.

03:21.400 --> 03:26.420
U-boot, a USB update binary.

03:27.120 --> 03:31.120
Some weird ass looking file, OTA.

03:31.720 --> 03:33.540
And an auto update TXT.

03:33.540 --> 03:36.000
Okay, something is off here.

03:37.100 --> 03:41.160
I like to hack IOT, so bin walk.

03:41.600 --> 03:41.680
I don't know why I'm doing this.

03:41.700 --> 03:46.760
I swear, this is one of the most beautiful bin walks I've ever gotten in my life.

03:46.920 --> 03:49.940
If you ever run bin walk, you see a lot of sometimes noise.

03:50.200 --> 03:51.760
This is the whole dump.

03:51.760 --> 03:54.340
This is how the firmware for the camera looks.

03:55.280 --> 03:57.180
Now I really have to open this.

03:58.060 --> 03:59.240
Open this device.

03:59.240 --> 04:01.680
And it's like hard.

04:01.680 --> 04:03.560
The front panel is glued in.

04:04.300 --> 04:05.560
I rip it apart.

04:05.560 --> 04:06.380
I open it up.

04:06.380 --> 04:07.180
I look at the back.

04:07.180 --> 04:08.440
I see an SOC.

04:08.500 --> 04:10.000
You see this stuff.

04:10.020 --> 04:13.540
You go like, okay, I'd expect to see a chip on a webcam.

04:13.980 --> 04:15.820
USB to the chip.

04:15.820 --> 04:18.940
The chip does its, you know, conversion of the image.

04:19.400 --> 04:20.860
Passes on the USB.

04:21.200 --> 04:22.420
Normal stuff.

04:22.420 --> 04:28.260
What you'd normally expect from a Linux running target or a system or a device is to have the trifecta.

04:28.440 --> 04:33.500
The CPU, the memory and the storage.

04:33.940 --> 04:37.260
I didn't see memory, so I'm like, okay, weird.

04:37.520 --> 04:38.600
Look at the back.

04:38.600 --> 04:42.660
I see a spy and then I see these pads.

04:42.660 --> 04:44.020
I call them sus pads.

04:44.860 --> 04:47.620
It's three pads on the middle of a PCB.

04:47.620 --> 04:48.500
I'm like, okay.

04:48.780 --> 04:50.420
Turns out, there you are.

04:51.000 --> 04:54.360
So maybe I can hotwire this thing.

04:54.480 --> 04:55.760
So I hotwire it.

04:56.900 --> 04:58.540
And this is what I see.

05:02.170 --> 05:02.890
Okay?

05:02.890 --> 05:09.550
So at this point, um, I'm a bit processing.

05:09.550 --> 05:11.190
I'm like, okay, what did I see?

05:11.390 --> 05:14.470
I see Linux on a CPU.

05:14.470 --> 05:15.910
What Linux version?

05:16.290 --> 05:17.310
Firmware version.

05:17.310 --> 05:23.710
And this is the exact process of emotions that I've had at the time.

05:26.090 --> 05:28.150
Then it turned into this.

05:30.190 --> 05:32.570
And then it came into that.

05:34.710 --> 05:35.670
Okay.

05:36.030 --> 05:37.630
I'm going to hand it off to Jesse now.

05:40.030 --> 05:44.570
So we've already seen some kind of suspicious things already.

05:44.570 --> 05:50.450
So we started to dive into what the firmware update process actually does and how that works.

05:50.450 --> 05:58.690
So the way their package arrives, you have this firmware tool executable and then a couple DLLs.

05:58.690 --> 06:06.290
There's this HD 510 SDK DLL that has most of the update code itself.

06:06.490 --> 06:11.290
And then it has a helper function that's AIT UBC extension API.

06:11.290 --> 06:18.290
It's basically just used for, there's something in UBC or USB video class, it's called extension units.

06:18.290 --> 06:21.790
And those are used for configuring different things about the camera.

06:22.050 --> 06:26.850
This really, most of the update code runs in that HD SDK.

06:27.010 --> 06:29.210
It only calls three of the functions through this helper.

06:29.210 --> 06:36.850
There's a lot of other stuff in this extension unit helper library that is used for other types of devices.

06:36.850 --> 06:40.270
So they just pulled this in for a few small commands.

06:40.270 --> 06:55.610
And then together, those will take instructions from the auto update.txt which will then basically parse commands from the OTA and send commands and the firmware file to the device itself.

06:55.830 --> 07:04.850
And if you look at that auto update, it just has this E star command and then the name of the other file to parse and then reset.

07:06.170 --> 07:13.390
If we look in the OTA, these are even more suspicious because it's just SF probe.

07:13.390 --> 07:17.970
It's like spy flash probe and we're probing chip select zero.

07:18.210 --> 07:20.230
And then spy flash erase.

07:20.230 --> 07:26.230
This particular region offset, this particular size and then it's TFTP transfer.

07:26.230 --> 07:31.290
That doesn't really make sense over this USB interface for how they're doing it.

07:31.290 --> 07:37.450
But we'll go with that and then write that region to that offset that they just erased.

07:37.690 --> 07:40.990
This is literally the full update script that it runs.

07:41.710 --> 07:46.290
We take a closer look at how this actually works in the internals.

07:46.290 --> 07:49.070
I mentioned the UVC extension units .

07:49.210 --> 08:00.850
They're only doing one call to get a property for this specific vendor extension extension unit to get the firmware version and then also switch the camera into firmware update mode.

08:01.130 --> 08:12.030
Extension units are used for a bunch of other things for different cameras like if you have like a pan, tilt, zoom, all of that, those are configured using extension units.

08:12.410 --> 08:23.530
But when you send this specific vendor, specific set property, it reboots the device and comes up as a mass storage device which is kind of interesting.

08:23.770 --> 08:41.630
And then from then on, it's sent, it's using SCSI commands, basically SCSI direct, SCSI pass through commands in order to use vendor specific SCSI op codes to continue sending command and data to the device.

08:41.730 --> 08:53.970
And then it also sends this interesting USB updater op bin and uboot.bin for the camera to run during that update process, which is also something that we're concerned and suspicious about.

08:54.370 --> 08:56.410
But here's some of the code.

08:56.410 --> 09:11.910
It's just doing the open device by path using that helper library and then sending this extension set with a specific GUID and then a specific control selector to say what specific request I'm doing within this extension unit.

09:12.050 --> 09:17.530
Once it does this, it just starts waiting and looks to see, has a new mass storage device popped up?

09:17.530 --> 09:21.050
Can I find the specific device I'm looking for?

09:21.390 --> 09:25.770
So at that point it starts sending SCSI commands.

09:25.770 --> 09:28.410
If you look at the bottom, there's this device IO control.

09:28.630 --> 09:34.130
The specific IOCTL number is OX4D004.

09:34.130 --> 09:37.250
That's the specific IOCTL for SCSI pass through.

09:37.450 --> 09:39.870
And it's used for other mass storage devices.

09:40.090 --> 09:50.410
But in this case we're just sending an inquiry request where we get information back from the device about the specific device from this inquiry request.

09:51.010 --> 09:56.390
In this case they're using this in order to determine what mode the camera is operating in.

09:56.390 --> 10:00.910
So after it reboots, it comes up in what's called ROM mode.

10:01.210 --> 10:10.650
And by doing this inquiry command they can determine if it's in ROM mode based on inside of the buffer it will have a G or a C at a specific offset.

10:11.250 --> 10:16.170
If it has a UPD at a different offset, it's in update mode.

10:16.270 --> 10:19.530
And if it's in UBO, it's in UBOOT mode.

10:19.690 --> 10:29.730
And the way that this works is that it will transition the camera into update by sending that UVC extension unit request.

10:29.830 --> 10:31.550
And then it will send an inquiry.

10:31.650 --> 10:35.630
Once it's in ROM mode, it will send the updater.

10:35.650 --> 10:38.890
And then once it's in updater mode, it will send UBOOT.

10:38.890 --> 10:49.050
And then once it's in UBOOT mode, it will just literally send UBOOT commands over that mass storage channel that it's still using, which is kind of an interesting way to do this.

10:49.570 --> 10:53.510
So they are using vendor specific SCSI op codes to transfer data.

10:53.590 --> 11:07.550
The TFT command instead of doing network operations, they have special handling to convert that into there's a load info command that they send which says here's the address to load this at in memory.

11:07.550 --> 11:08.870
Here's the size.

11:08.950 --> 11:29.570
And then the update tool itself will then calculate an MD5 hash, pass that over and then start sending chunks of that buffer in multiple different SCSI write requests using that specific vendor op code with a sub op code to say these are the chunks and then the last chunk has a different sub op code.

11:29.710 --> 11:37.250
But all the other commands are just sent as literal strings to run and by the camera to interpret in this UBOOT that's running for you now.

11:38.310 --> 11:43.950
So when you're looking at the camera UART itself, it basically looks like this.

11:43.950 --> 11:52.550
And you can see the camera is running and then it switches into UBOOT mode and waits a little bit while it's doing things.

11:52.550 --> 11:55.410
And you start seeing things like this run command at the end.

11:55.410 --> 12:01.890
Those are literal commands that are being run by this, that are being sent from the updater tool to be run by UBOOT in the camera.

12:02.070 --> 12:11.330
So it will do the run commands and then it will do this operation of erase, transfer the data and then write.

12:11.710 --> 12:19.930
And we can look at this and these basically map to our commands that were in that auto update TXT or the OTA TXT.

12:20.490 --> 12:32.550
One interesting thing that we noticed is if you look at the order for here, they're erasing the spy region and in this case they are erasing only the root file system and the kernel.

12:32.610 --> 12:37.950
So they erase the file system and then they transfer the new image to update.

12:37.950 --> 12:42.550
So if you look at the bottom there, there's an MD5 pass.

12:42.770 --> 12:44.310
What happens if that fails?

12:44.310 --> 12:52.090
If there's like an integrity ‑‑ if there's an integrity problem while they're transferring that file, maybe it was a file that isn't going to work.

12:52.150 --> 13:00.510
They've already erased the image and there isn't really any retry and send the copy, send the firmware file again if that fails.

13:00.510 --> 13:03.590
So that's another thing to take a look at.

13:04.150 --> 13:10.130
But at this point, it's a pretty straightforward method of how we can do the updates.

13:10.170 --> 13:11.990
I'll pass that back to Becky.

13:13.270 --> 13:16.090
Spoiler alert, it breaks the camera.

13:20.040 --> 13:21.340
That was easy.

13:22.740 --> 13:27.600
So we've seen their GUI and their tool and everything.

13:27.600 --> 13:29.800
Can we just simplify and make our own tool?

13:29.800 --> 13:35.500
Because we know they're using the third party API from some SOC vendor.

13:36.420 --> 13:38.380
Short answer is yes.

13:38.420 --> 13:40.460
And it's in C sharp.

13:40.460 --> 13:52.860
And the simplest thing is because we got lucky and the firmware update tool is in C sharp, we threw it in our IL disassembler and got the assembly and hacked it together.

13:52.860 --> 13:55.080
And you can convert it to PowerShell if you'd like.

13:55.080 --> 13:56.020
It's fun.

13:56.900 --> 14:01.940
And it works the same, calls the DLLs and fun.

14:02.580 --> 14:06.200
So a quick topic change.

14:08.160 --> 14:11.380
Why the fuck would you put Linux in a webcam?

14:13.960 --> 14:17.740
The quick answer is basically money.

14:19.300 --> 14:37.920
If there's a company that sells you an SOC that has all this integrated already in it and it works and you just got to rebrand it and maintain a, a small workforce of people to maintain the updates over a couple of years that already do other things, it's cheaper to do it that way but it's not always secure.

14:42.080 --> 14:43.720
The way it looks is like this.

14:43.720 --> 14:46.040
The SOC vendor is called Sigma Star.

14:46.280 --> 14:48.660
They make this chip.

14:49.020 --> 14:57.800
You go on the website, they sell all these kinds of SKUs of it, they do for webcams, IOT, all kinds of stuff.

14:58.040 --> 15:08.800
They are a subsidiary of a company called M-Star Semiconductor that doesn't appear to be alive, it's only on paper and that is a subsidiary of Mediatek.

15:10.300 --> 15:23.220
Out of Sigma Star's SOCs we've identified so far, we've seen, um, in TP-Link, which credit to TP-Link, they do publish their GPL code, which is great.

15:23.380 --> 15:25.980
Nexigo and OBSBot.

15:25.980 --> 15:29.080
Never heard of these before this, uh, this research.

15:29.760 --> 15:31.940
But we'll get to that in a second.

15:32.220 --> 15:41.540
Uh, when you go to their website, the fun, the, the good thing about these companies when they, when they want to sell their product, they build a full vertical stack of everything you need.

15:41.920 --> 15:49.880
So, the SDK, the code, the documentation, the data sheets, the examples, everything.

15:50.060 --> 15:53.100
You go to the website and you get all the data you need.

15:53.860 --> 15:56.380
That's, that's the link to go there.

15:56.380 --> 16:00.560
You do need, uh, to create a credential.

16:01.440 --> 16:05.660
Supposedly it will get you access to the source and the SDK.

16:05.720 --> 16:11.260
I have tried, I think it's been two months with two different accounts.

16:11.440 --> 16:17.240
Uh, one is Gmail, one is a cor, Gmail didn't work so I went with my corporate email to see maybe they filter.

16:17.240 --> 16:18.920
No, they just don't give a shit.

16:19.300 --> 16:22.980
Um, there's no data, there's no, nothing.

16:23.100 --> 16:25.440
It is like pulling teeth.

16:25.980 --> 16:26.880
It's terrible.

16:26.880 --> 16:28.900
So, what can you do?

16:28.900 --> 16:30.420
So, do it yourself.

16:31.140 --> 16:36.200
You go Google things, GitHub things, look in the forums.

16:36.760 --> 16:40.160
Surprise, you can go through LinkedIn and you can go through Twitter.

16:41.140 --> 16:41.940
Why?

16:42.400 --> 16:43.400
In a second.

16:43.560 --> 16:56.060
Um, so the process is like this, you Google for the files, you find them on GitHub, you find them on Google and you repeat this over and over and over and over again.

16:56.100 --> 16:58.960
And if you can go into the Russian forums, you get bonus points.

17:01.280 --> 17:05.500
There's a GitHub repo with four, sorry, GitHub user with four repos.

17:05.920 --> 17:10.380
One of them is the actual USB tool from Sigma Star.

17:10.380 --> 17:17.780
It's a bit of an older version but it, they keep things the same way over generations because people are lazy.

17:18.240 --> 17:22.580
Um, and if it works they just keep it moving over the years, the technology.

17:22.820 --> 17:25.980
You get the U-Boot, you get the Linux, you get the, their SDK.

17:26.480 --> 17:29.980
Um, the next two are open directories.

17:30.480 --> 17:35.840
So, you just find random stuff in open directories.

17:36.220 --> 17:41.280
And the last one is an open IPC kinda sorta, um, implementation.

17:41.280 --> 17:42.880
Open IPC if you don't know.

17:42.880 --> 17:50.180
It's, um, it's for internet cameras that you can open, you can use open source code to do it.

17:50.180 --> 17:52.220
And it supports Sigma Star's chipsets.

17:52.220 --> 17:55.520
So, they do have a kernel for that.

17:56.400 --> 18:00.020
But like I said, no help from them.

18:00.060 --> 18:02.300
I thought maybe there's a chance.

18:02.580 --> 18:03.500
Nothing.

18:03.760 --> 18:04.800
Forget about it.

18:04.820 --> 18:13.500
Um, the only other thing we could do is reach out to Lenovo and say, can you give us the GPL code?

18:15.780 --> 18:17.680
And this is how it went.

18:19.080 --> 18:24.520
We asked for the GPL code, Lenovo asks Sigma Star for GPL code.

18:24.520 --> 18:29.380
Sigma Star's, Sigma Star gives Lenovo the code, Lenovo gives us the code.

18:29.380 --> 18:30.960
We build it, it fails.

18:31.060 --> 18:37.220
We go to Lenovo and we go back to Lenovo and say, we need more, uh, it's not complete.

18:37.700 --> 18:39.240
Again, cycle.

18:40.260 --> 18:42.280
We get the code, it works.

18:42.700 --> 18:50.760
We build all our demos for the talk and then we're like, you know what, we want to take the extra step, do something, we did something crazy, let's do something even more crazy.

18:51.640 --> 18:56.400
Uh, we requested the GPL again and nothing yet.

18:57.520 --> 19:00.080
Um, hopefully we'll get it.

19:00.080 --> 19:05.580
So, we do have the U-Boot, we have the kernel, we don't have the latest SDK.

19:06.260 --> 19:09.500
We have a bunch of stuff from GitHub, what can we do?

19:09.920 --> 19:12.840
We do know the structure of how it looks.

19:12.840 --> 19:17.340
They do have, for the same SOC you can build either for, uh, Spynor or Spynand.

19:17.760 --> 19:19.320
In our case it's a NOR.

19:19.400 --> 19:21.480
This is how the, the partition looks like.

19:21.480 --> 19:27.340
We're going to focus on these two because it's easier, it's the easiest way for anyone to get into this world.

19:28.280 --> 19:35.360
Uh, just build a kernel or modify a file system and that's what we know.

19:35.360 --> 19:36.580
We know, this is what we know.

19:36.580 --> 19:42.560
We know the camera runs Linux, we know how to build a Linux, we know we can flash it, we know how to flash it.

19:44.080 --> 19:46.820
So, here comes the fun part.

19:48.560 --> 20:00.070
Can we turn the camera into a camera?

20:00.070 --> 20:02.430
We have a laptop, we have a camera, this one.

20:03.670 --> 20:05.470
We plug the USB in.

20:10.590 --> 20:16.430
Uh, I opened the camera app on the, on the background just to show, I disabled the, the built-in camera.

20:16.990 --> 20:23.830
The camera shoots out a text and then it reboots into normal, regular code.

20:24.670 --> 20:26.370
Take a picture of him too.

20:26.370 --> 20:27.790
Okay, cool.

20:31.030 --> 20:32.350
And that's it.

20:32.350 --> 20:39.470
So, we, we took the kernel, we built it, we added the hit stack, USB gadgets, cool.

20:39.850 --> 20:47.270
The camera boots up, it's a hit, it's a keyboard, it types in stuff, it's cool, it's funny.

20:49.350 --> 20:51.450
Um, what?

20:52.930 --> 20:54.250
There's more.

20:54.290 --> 20:57.170
So, um, so this is the, this is the, this is the, this is the how do we do that?

20:57.170 --> 20:58.910
The, the file system is read only, right?

20:58.910 --> 21:05.430
It's, it's a spy chip, it loads it to memory and then runs it and every change you do doesn't persist across reboots.

21:06.250 --> 21:12.530
Um, so it turns out there's a, there's a section in memory called environment variables, every system usually has it.

21:12.950 --> 21:24.890
Um, in this case we just added our own variable called implant and the camera just, the, our code in the camera checks if implant is one, run the hit payload, change it to zero.

21:24.890 --> 21:34.150
Next time the camera reboots, implant is zero, if, if, if the code is, if the implant is zero, boot into the normal Lenovo flow.

21:34.450 --> 21:35.410
That's it.

21:36.530 --> 21:39.930
This is how it looks from the camera side.

21:41.190 --> 21:56.470
The camera boots, you see implant equals one, means run the payload, start sending key strokes, this opens an admin command prompt and starts saying, psst, I'm your camera, this is an admin command prompt, I'm going to become a camera now.

21:57.130 --> 22:09.830
It reboots, implant is now zero and it just follows the normal Lenovo boot flow and it's a regular camera.

22:10.910 --> 22:14.190
Okay, let's, uh, change gears.

22:14.730 --> 22:23.050
Uh, for some god awful reason, uh, the RCS script in the camera has Telnet D starting in it.

22:24.030 --> 22:29.450
So can we have a network gadget on the camera?

22:29.570 --> 22:30.790
Let's try it.

22:34.110 --> 22:38.730
So we plug in a camera , I don't know if it's playing.

22:39.430 --> 22:40.610
Yeah, it's playing now.

22:41.090 --> 22:48.850
So we plug in a camera, integrated camera is off, just to be sure.

22:49.290 --> 23:02.630
I'm going to show that there's an, there's an RNDIS gadget, once it's plugged in, it flashed, means the USB event happened, USB Ethernet means the camera's connected.

23:04.090 --> 23:09.210
As you can see, it's connected alongside a keyboard from the same composite device.

23:12.640 --> 23:36.760
Here we, uh, open Teraterm, Telnet to it, AI Scion, no password, we drop, drop into a shell, I go to my folder, I run the script, it issues the usual I am evil keyboard script, and then I go and I reboot the camera, I don't, I type reboot, it's wrong,

23:36.760 --> 23:45.020
I need to type, no, I do, I type reboot, it works, it's fine, I open the, uh, the camera app in Windows and then I wait.

23:52.440 --> 23:54.320
And that's it, it's a normal camera.

23:58.080 --> 24:00.840
Uh, so, what else can we do?

24:00.840 --> 24:02.220
We got to this point.

24:03.380 --> 24:06.700
Um, better buckle up for this one.

24:08.060 --> 24:16.400
This is a PowerShell script that all it does is share the Internet connection from the host Wi-Fi to the gadget.

24:19.200 --> 24:21.740
I see you're getting the, where we're going with this.

24:24.560 --> 24:34.220
So, on the left top is the webcam UI, on the bottom left is a Kali machine that we have in Microsoft's cloud, and on the right is the laptop.

24:39.090 --> 24:52.110
We start hosting a payload, we start Metasploit listening on the 443, and then you have Metasploit running and listening.

24:53.630 --> 24:56.370
Um, yeah, listening.

24:57.730 --> 25:01.710
The moment, the moment the text starts running on the top left, the camera's plugged in.

25:02.310 --> 25:07.710
Uh, Wi-Fi is connected to a, uh, network called local host, sorry for the confusion.

25:08.490 --> 25:14.690
That's it, it's connected to a Wi-Fi, nothing says shared, nothing there, just normal Wi-Fi.

25:15.090 --> 25:19.130
Camera plugged in, you are scrolling,

25:23.380 --> 25:28.560
the camera now goes to and fetches that PowerShell script.

25:34.500 --> 25:41.960
The, the camera has now enabled Internet connection sharing between the Wi-Fi and the RNDIS gadget.

25:42.020 --> 25:59.560
The camera now has Internet, but the camera wants to show you, so here we go, there's the gadget, the camera opens the properties for the Wi-Fi controller, tabs over, Internet connection sharing, hits enter, and we have the Wi-Fi controller .

25:59.560 --> 26:02.320
And we have a, an interpreter session open on the camera.

26:11.340 --> 26:20.720
I open a shell to the camera from the cloud, I just reboot it, because the flag tells it to run as normal camera now.

26:23.400 --> 26:28.740
Usual Windows camera app to show you there's no camera found, but it's connected, it will pop it up.

26:32.740 --> 26:33.700
Yay!

26:45.240 --> 26:49.320
To be honest, this whole demo is structured around this GIF, so I'm not going to show it .

26:49.320 --> 26:50.420
That's it.

26:53.920 --> 26:57.200
So, um, go have fun.

26:57.200 --> 27:02.060
You can buy this camera on Amazon right now, 45 bucks, uh, even cheaper on eBay.

27:02.920 --> 27:11.020
Uh, if you're, uh, if you, uh, if you're afraid, if you want to go deeper and you want to play with it, get two.

27:11.020 --> 27:12.340
Always get two.

27:13.060 --> 27:14.540
Uh, pro tip.

27:15.340 --> 27:16.840
And get a flash tool.

27:17.060 --> 27:21.600
I recommend, if you have money, buy, uh, Dirty Prog.

27:21.600 --> 27:28.460
If you don't, if you have 50 bucks, buy the, uh, the Tigard by Joe Fitz, also known the Tigard King.

27:29.600 --> 27:33.880
Um, or any other spy flashing tool.

27:35.200 --> 27:37.580
Let's go rent a little bit of the other vendors.

27:37.580 --> 27:42.100
So, um, quick question, anyone here from Lenovo?

27:42.220 --> 27:43.600
Raise your hand.

27:44.760 --> 27:47.140
Don't be shy, I'm not going to do anything bad.

27:48.180 --> 27:50.500
No one here from Lenovo?

27:51.760 --> 27:52.880
Okay.

27:53.180 --> 27:54.760
I'm not offended.

27:55.820 --> 28:03.580
Um, so we looked at other cameras, and it turns out there's a bunch of other cameras running Linux.

28:04.840 --> 28:09.620
Uh, the Opal Tadpole is running Linux on an Ambarella SOC.

28:10.260 --> 28:20.640
Uh, there's a story behind that, I think I'm going to tell that in a second, I don't remember if it's in the slides, but they published the, the, the GPL code yesterday.

28:21.420 --> 28:26.920
Next to go is Sigma Star SOC, crickets, nothing.

28:26.920 --> 28:28.980
Uh, TP-Link, love it.

28:28.980 --> 28:33.520
They already burn, they already got burned by GPL, so they publish it, they don't argue with that.

28:33.880 --> 28:38.140
Uh, and OBS Bot is another unknown, uh, brand.

28:38.140 --> 28:46.740
OBS is Open Broadcasting Studio, if you're not familiar with it, that's a very popular tool, open source tool to do a lot of video capturing.

28:47.140 --> 28:52.200
So, some companies rebranded it, and is selling cameras.

28:52.760 --> 28:59.800
Sigma Star SOCs, but newer kernel, ask for GPL, no answer.

29:00.000 --> 29:01.580
So, we're going to drop an O there.

29:02.920 --> 29:08.740
Um, this is how the Opal Tadpole motherboard looks like.

29:08.800 --> 29:18.080
Remember I said, in the beginning, the trifecta, you get the SOC, the RAM, and the storage, it's right there, you can see it, it's three chips.

29:18.360 --> 29:23.380
Easiest to recognize, you know, you see this, you get a wide attack surface.

29:24.820 --> 29:35.520
OBS Bot, um, Sigma Star SOC, they were kind enough, to mark on the board, T and R, which is TX and RX.

29:36.360 --> 29:43.200
So, you connect it, and this is what you get.

29:43.200 --> 29:46.120
So, this is going to be an O day, real quick, I'm going to run you through it.

29:46.540 --> 30:04.060
Um, you boot, you hold enter, you get into the boot loader, you print the environment variables, remember print env, you see in the environment variables, it mounts the UBI file system as, um, sorry, I'm going faster than my explanation in the video.

30:04.060 --> 30:11.900
RO, so it's mounting the NAND as read only, and it in it's, into the Linux RC executable.

30:11.900 --> 30:13.660
So, we're going to change those.

30:18.680 --> 30:23.800
We're going to set env, RW, and in it to bin SH,

30:30.160 --> 30:32.720
and save env.

30:32.720 --> 30:33.460
Don't ever forget to save env.

30:33.460 --> 30:33.460
So, we're going to

30:37.480 --> 30:41.000
reboot , because that doesn't work, so type reset.

30:43.180 --> 30:54.100
The camera resets and falls into bin SH, you fall into a root shell, you just change the password, root, root, it's too short, but it will change it anyway.

30:56.180 --> 31:00.500
You reboot, you go back into your boot, and then you have to revert your changes.

31:01.560 --> 31:16.280
So, you change it back to RW, because you don't want anyone messing with your changes, and Linux RC, the usual stack, and it boots into the normal vertical, the normal code, normal camera code.

31:16.520 --> 31:25.260
At the end, it's OBS Linux, OBS boot Linux, you just type root, root, and you have a root shell.

31:33.270 --> 31:36.550
Okay, so, I can't believe I'm saying this.

31:37.350 --> 31:43.030
There's Linux and webcams now, so, go look at that stuff.

31:45.350 --> 31:59.550
There's a whole, like, we've done this 10 years ago, we're going to do this thing again, where you have to do a root of trust, verify firmware signatures, do all that stuff, but now we have to do it in webcams and everything else that runs Linux.

32:04.560 --> 32:13.520
Basically, all the stuff that we have to deal with IoT, move that, move that mindset into USB.

32:13.520 --> 32:17.920
So, think of every USB device also as an IoT device.

32:19.120 --> 32:20.940
Now, GPL compliance.

32:24.900 --> 32:33.840
I've done a lot of, of, of complaining to people for GPL code for this project for a while.

32:34.580 --> 32:39.140
Basically, any device that runs GPL code, you can ask for the source.

32:41.520 --> 32:46.060
They don't usually do that, especially if they're in China.

32:46.840 --> 32:52.540
But, you can, you can harass them into compliance.

32:53.500 --> 32:59.180
Okay, so, there's, there's a way to do this.

32:59.180 --> 33:03.580
You can track people down on LinkedIn and Twitter and social media, which I did in a second.

33:04.400 --> 33:12.280
And you can also contact the Software Freedom Conservancy, and they can help as well.

33:13.180 --> 33:20.920
What I did, I have no shame, so I just contact Opal co-founders on LinkedIn.

33:20.920 --> 33:24.700
I counted the OBS bot CEO on LinkedIn.

33:25.200 --> 33:28.320
The next to go co-founder, I just contacted the co-founders.

33:28.320 --> 33:30.820
I just went, give me code.

33:30.980 --> 33:37.400
And I, pro tip, use GPT to word legal sounding messages.

33:39.180 --> 33:43.420
I got a response on Twitter from one of the co-founders of Opal.

33:43.420 --> 33:46.180
Any, give me a chance , anyone from Opal here?

33:49.380 --> 33:51.480
Ah, thank you for coming.

33:52.040 --> 33:53.460
So, good job.

33:53.460 --> 33:54.940
Get GPL code.

33:57.260 --> 34:03.100
Cool story about Opal, they do firmware updates over web USB.

34:04.000 --> 34:06.800
And because they were good, I'm not going to say more about that.

34:07.620 --> 34:15.920
Um, so, a, a little bit of experience of how to work with PSIRTs as a security, a security researcher.

34:16.380 --> 34:28.960
When you talk to product security response teams, there's a lot of communication that goes on in the background between what the PSIRT team does that face you when you, when you contact Lenovo or any other big OEM.

34:29.940 --> 34:32.020
They have to go talk to their product team.

34:32.020 --> 34:35.520
So there's a lot of sometimes miscommunications.

34:35.520 --> 34:44.000
At first we were told that these devices are end of development and turns out it was not the case.

34:44.000 --> 34:47.520
So we have to, we have to change things.

34:47.520 --> 34:54.140
Anyway, if you've seen the movie, you know how I feel.

34:54.640 --> 34:57.040
This is the Lenovo statement, we're going to skip that.

34:57.600 --> 35:00.480
Updates, links, firmware updates over that link.

35:01.600 --> 35:04.420
Um, this is the disclosure for them.

35:04.420 --> 35:07.080
They, they published it yesterday.

35:07.540 --> 35:10.220
Uh, arbitrary code execution as a medium.

35:11.040 --> 35:13.300
Someone needs to help me math this.

35:13.860 --> 35:24.700
Um, physical access, I don't know, I can have software execution on the host if it's connected to the camera, then I can flash the camera.

35:24.700 --> 35:27.760
I guess you can word it as physical access, I don't know.

35:28.580 --> 35:31.320
Bottom line, this is not a camera .

35:31.860 --> 35:39.660
Uh, I want to thank Rainforest Puppy for, uh, GPL advice and, uh, Case for helping us battling the, the kernel.

35:40.480 --> 35:57.420
There is a bunch of shit on this mega link, um, including an OVA VMware image for you to take, download and install and build your own Sigma Star Kernel and other stuff in the GitHub.

35:58.040 --> 35:58.840
Questions?

36:00.080 --> 36:01.800
Okay, you can clap now, sorry.

36:06.920 --> 36:08.660
We were, we were rushing it a little bit.

36:08.660 --> 36:09.780
We have five minutes, I know.

36:09.780 --> 36:12.780
We, we were stressed out that we won't have enough time.

36:14.260 --> 36:16.760
Okay, now we're open for questions.

36:18.240 --> 36:20.280
Just yell them out if you have them.

36:21.160 --> 36:23.460
Or run to the next talk, it's fine too.

36:30.860 --> 36:37.880
Either yell it louder or... How long did it take us to reverse the camera?

36:39.420 --> 36:40.420
Minutes.

36:41.280 --> 36:44.960
It's, it's basically building blocks that you know exist.

36:44.960 --> 36:49.660
Linux, you look at it, it's like hacking classic IOT but over USB.

36:51.540 --> 36:52.640
Thank you.

36:54.560 --> 36:56.740
More questions, give me more questions.

36:57.100 --> 36:59.160
Yes, yell it out.

37:03.530 --> 37:07.070
Anybody, anybody can buy one of these, flash it and resell it.

37:07.070 --> 37:07.890
Yes.

37:08.630 --> 37:10.210
I have a, I have a question.

37:10.270 --> 37:10.930
Yeah.

37:10.930 --> 37:26.750
I, uh, I bought a, a very similar generic Chinese webcam, uh, about two years ago and a couple of weeks ago I was doing some ADB debugging on my Android phone and when I ran ADB list devices, the camera showed up.

37:27.110 --> 37:28.310
Yeah, that, that'll be it.

37:28.310 --> 37:29.390
Yeah, have fun.

37:29.570 --> 37:30.110
Yeah.

37:30.110 --> 37:30.410
Yeah.

37:30.410 --> 37:31.870
We do that too.

37:33.670 --> 37:35.150
Android's a Linux too.

37:35.150 --> 37:35.690
Yeah, go ahead.

37:36.270 --> 37:39.410
How many times did Linux fail to build?

37:39.650 --> 37:40.690
Oh God.

37:41.250 --> 37:47.290
Um, so Linux failed to build a couple of times but maybe mainly because we got incomplete source.

37:48.110 --> 37:48.230
Oh.

37:48.930 --> 38:05.550
There, there was a bug in... Oh, there, there was a bug in, uh, the HID gadget that we had to patch for getting the, to get the HID stack to work but in the second iteration of GPL code they already gave us the fixed version.

38:06.210 --> 38:07.070
Oh, okay.

38:07.070 --> 38:08.230
So it works .

38:08.930 --> 38:11.150
Yeah, building the kernel is fun.

38:11.290 --> 38:12.710
Just take a deep breath before you do it.

38:12.710 --> 38:13.370
Go ahead.

38:14.690 --> 38:18.650
I think it, you sounded surprised to see Linux in these.

38:18.650 --> 38:21.310
I've, I've been an embedded developer for a long time myself.

38:21.310 --> 38:25.270
What was it you expected to see, like Wind River, FreeRTOS, something like that?

38:25.270 --> 38:31.510
Uh , simple, like it's, it's a freaking convert a CMOS image to USB.

38:31.510 --> 38:31.970
That's it.

38:31.970 --> 38:34.030
It just takes an image and put it on.

38:34.130 --> 38:34.930
Why?

38:35.090 --> 38:37.510
Well, it looked like a... Wait, wait, hold on.

38:37.530 --> 38:38.910
The AIs, I get it.

38:38.910 --> 38:43.710
There's a lot of, you expand things, facial recognition, Windows hello, all that stuff, I get it.

38:44.490 --> 38:55.630
But I was surprised to see it because I wasn't expecting it, I was expecting the host to handle most of the processing versus the camera to do all that.

38:55.710 --> 39:01.330
Do you feel like that's a trend you see accelerating, just shoveling more horsepower into those things?

39:01.830 --> 39:08.010
I'd say over the past ten years there would be a trend of just shoving Linux into things.

39:08.630 --> 39:13.010
How's that affecting like the prototyping cycle for these guys?

39:13.010 --> 39:17.610
Are they kicking stuff out even faster, figuring they can just patch it?

39:18.990 --> 39:23.370
It's, it's a low, it's a, it's a more convenient learning curve.

39:23.790 --> 39:26.830
And it, it helps handle your attrition of staff.

39:26.930 --> 39:34.590
Because all you need to do is bring in people that know Linux and they can pick up where the other left off and just maintain the stack.

39:35.430 --> 39:37.710
I guess it's cheaper.

39:37.710 --> 39:47.310
So by attrition of staff you mean you're seeing kind of the same education fall off in everything that isn't Windows or Linux in China as here?

39:47.310 --> 39:50.410
When I, when I say education of staff I mean learning curve.

39:50.410 --> 39:58.050
If you have a custom SOC with your own custom stack with not, with complicated proprietary code, learning curve is wild.

39:58.490 --> 40:00.210
But if you have Linux it's simple.

40:00.210 --> 40:03.330
Just bring someone who knows the basics, ramp them up fast.

40:07.710 --> 40:11.870
So you mentioned that you were able to get internet access over USB.

40:11.930 --> 40:22.390
Is it possible that you could use this method to implement something like say an IP webcam or like functionally upgrade the camera to do something it didn't do before?

40:22.670 --> 40:24.770
So funny you mention that.

40:25.170 --> 40:32.850
We, we, we were missing files at the end of the, of the cycle of the GPL.

40:32.850 --> 40:34.030
Let's call it that way.

40:34.530 --> 40:41.210
And some, a couple of those files, not you guys, I'm pointing at Opal, not, not you guys, the, the Sigma Star people.

40:42.490 --> 40:51.650
They had kernel modules specifically for the IR SOC, the IR chip and the, the CMOS chip.

40:52.310 --> 41:00.270
So we were hoping we can get those kernel modules and just use an interpreter and just webcam, snapshot, go wild.

41:00.450 --> 41:02.370
But we didn't get that in time.

41:03.190 --> 41:04.210
So, yeah.

41:04.450 --> 41:07.950
You can do, you can do crazy stuff with this.

41:07.950 --> 41:09.650
It's a computer on a USB.

41:09.970 --> 41:12.430
It's a bash bunny basically with a camera.

41:15.050 --> 41:16.350
More questions?

41:16.430 --> 41:22.550
We got no time, so catch me in the hallway.

