WEBVTT

00:00.000 --> 00:00.840
Good deal.

00:00.840 --> 00:02.020
Thank you all for coming.

00:02.100 --> 00:04.580
This is the secret life of a rogue device.

00:05.260 --> 00:16.200
My wife told me not to tell anybody who helped me with these slides and make them look beautiful, so I'm just going to say a beautiful, anonymous woman helped me make these look nice, and the earlier format was much uglier, I assure you.

00:18.460 --> 00:20.880
So, quick background, I'm Matthew.

00:20.920 --> 00:22.400
My friends call me Mandatory.

00:22.400 --> 00:29.980
I've worked on a variety of security projects, things like XSS Hunter, Cursed Chrome, and I write security research at TheHackerBlog.com.

00:30.240 --> 00:32.940
In my professional life, I also lead the red team at Snap.

00:34.500 --> 00:41.520
So, this talk is sort of about, quote-unquote, rogue hardware, ending up on the second-hand online electronics markets.

00:41.520 --> 00:43.520
So, what do I mean by rogue?

00:43.640 --> 00:47.940
I mean things that shouldn't end up there, so this is kind of a few key categories, right?

00:47.940 --> 00:54.700
Things like employee laptops, which you're probably familiar with, right, that shouldn't be resold, maybe has sensitive data on it, stuff like that.

00:55.120 --> 01:08.520
It means things like prototypes, so early development version of your favorite products, maybe like the iPhones that you enjoy, right, earlier stages when they were first being built, right, and then sort of like more specialized things like factory line equipment and,

01:08.520 --> 01:10.380
you know, backup hard drives, stuff like that.

01:10.380 --> 01:12.120
So, that's sort of what we'll be covering.

01:13.960 --> 01:19.740
The main questions we're going to be answering here is, some of them are pretty obvious, right, it's like how often does this actually happen, right?

01:19.740 --> 01:20.980
Is this a problem, right?

01:20.980 --> 01:25.480
And then for the stuff that does end up here, you know, on these secondary markets, what's the impact?

01:25.480 --> 01:28.080
Is there anything security related that we have to worry about?

01:28.180 --> 01:32.000
And then, you know, ultimately, what is it that actually ends up getting resold like this?

01:33.340 --> 01:38.180
Along the way, we'll sort of figure out like, you know, what are the challenges of doing research in this space?

01:38.180 --> 01:49.580
Once we figure those out, we'll have to scale it up to sort of do all of the listings across western and eastern markets, and then we'll finish up with everybody's favorite part, which is like war stories and loot and all that cool stuff.

01:51.720 --> 01:55.120
Great, so what are the challenges to finding rogue hardware?

01:56.820 --> 02:00.460
First one is probably pretty obvious, you probably already guessed it, we've got to get it from somewhere.

02:00.460 --> 02:02.980
So what are the places that stuff gets resold on, right?

02:02.980 --> 02:08.000
So, if you're, you know, from the US, you're probably familiar with eBay, right, for the western side of things.

02:08.080 --> 02:12.700
There's also other things like Craigslist and Facebook Marketplace, but those are generally a little bit more local, right?

02:12.900 --> 02:18.140
They might expect you to show up, and, you know, that's kind of hard to scale out, so we want stuff where you can sort of ship it.

02:18.140 --> 02:20.100
So we'll kind of focus on eBay on this side.

02:21.320 --> 02:26.440
On the eastern side, you have sort of where all the electronics are assembled and actually put together, right, where things are manufactured.

02:26.740 --> 02:29.680
There's another market which you may not be as familiar with.

02:29.800 --> 02:42.180
I apologize to the native Chinese speakers here, I'm going to butcher this word, but ShenYu is the app that they have there, which is much larger than I thought it was going to be, but this is basically the second-hand market in China, so if you want to resell something there.

02:43.740 --> 02:48.860
So we know the where, but the second challenge is like, sellers don't usually make listings like this.

02:48.860 --> 02:53.500
They're not like, hey, this is a secret, you know, prototype for this crazy product thing, right?

02:53.560 --> 03:00.660
Usually the sellers don't even know what it is that they're selling, right, in many of these cases, and they're not just going to put that in a listing where we can easily find it.

03:00.900 --> 03:02.700
So how do we deal with that?

03:03.420 --> 03:04.700
I'll give you a little spoiler.

03:04.700 --> 03:07.700
A lot of the information that we actually want is more in the images, right?

03:07.700 --> 03:11.160
So it's not in any text, but it's actually in the text embedded in the images themselves.

03:11.240 --> 03:17.380
If you have, again, a company laptop, sticker on the bottom that says property of whatever, or asset tag, you know, whatever.

03:17.900 --> 03:22.700
So we have to dig a little bit deeper to find the answer to this stuff, right, to figure out the real truth of where these are.

03:24.400 --> 03:32.980
So assuming that we get all this stuff from where we've talked about, and then we sort of analyze those images and do all this stuff, right, we still have to know kind of like what we're looking for, right?

03:32.980 --> 03:38.560
So in the case of prototypes, like I mentioned, there's like secret code words, secret labeling conventions they use.

03:38.760 --> 03:43.260
For, I mentioned before, for employee laptops, there's special barcode formats and whatever else, right?

03:43.260 --> 03:47.040
So we have to sort of figure out what these are in order to identify when these things show up.

03:49.140 --> 03:53.260
And let's talk about sort of building a pipeline for detecting this rogue hardware at scale.

03:54.460 --> 03:58.520
Probably unsurprisingly, the first challenge is we got to scrape the hell out of a bunch of sites, right?

03:58.520 --> 04:02.720
So I mentioned before, we'll focus on two main sites here, eBay and Sinyou.

04:03.060 --> 04:05.780
We'll start off with eBay because it's dramatically easier to scrape.

04:05.780 --> 04:06.680
You'll see why.

04:07.240 --> 04:09.040
So on the eBay side, this is pretty simple.

04:09.040 --> 04:11.660
You just do searches for the kind of products you're looking for, right?

04:11.660 --> 04:14.240
Something like laptop or phone or whatever it is.

04:14.420 --> 04:18.900
You scrape the resulting listings and you extract the images out of them so you can do analysis on them.

04:20.360 --> 04:21.420
But we have a hurdle.

04:21.420 --> 04:23.700
And this is pretty much the case for any major site, right?

04:23.700 --> 04:25.320
They'll have some form of rate limiting, right?

04:25.320 --> 04:27.680
To prevent either bots or whatever it is.

04:27.880 --> 04:36.800
In the case of eBay, if you do too many requests, they give you this fake 404 page saying, hey, you know, you're doing that too much and they're trying to fool you into thinking this page doesn't exist.

04:37.840 --> 04:41.260
Luckily, the modern internet is not quite as simple as it used to be, right?

04:41.260 --> 04:47.980
We have like CDN services in the middle of a lot of things to sort of speed up page loads and optimize content being served at the edge, right?

04:47.980 --> 04:50.820
And we can use this to our advantage to circumvent this rate limiting.

04:51.100 --> 04:56.440
So in the case of eBay, you know, they essentially have an allow list from all of CloudFlare, which is a popular CDN.

04:56.440 --> 05:02.260
It's like IP ranges that said, hey, if it's coming from here, don't bother with the rate limiting, just allow unlimited requests, right?

05:02.260 --> 05:05.820
So CloudFlare allows you to make workers, which come from like their space, right?

05:05.820 --> 05:09.100
So I just simply upload a CloudFlare worker, which proxy to eBay.

05:09.100 --> 05:13.900
And so by using this as a proxy, I can get around all the rate limiting and do unlimited requests.

05:14.040 --> 05:15.440
So super easy.

05:15.440 --> 05:16.940
We've got that problem solved.

05:17.860 --> 05:19.240
Moving right along.

05:21.200 --> 05:21.800
All right.

05:21.800 --> 05:25.440
So in the China side, right, Shen Yu, it's not quite as easy.

05:25.440 --> 05:28.000
In fact, you go to their website and you don't see like anything at all.

05:28.000 --> 05:30.220
It just says like, hey, download our app to continue.

05:30.280 --> 05:31.460
You're like, all right.

05:31.800 --> 05:38.540
So you go to their, you know, your local app store, you download their web, their little app, and you start browsing for listings on this, right?

05:38.820 --> 05:42.140
Of course, if we want to do this at scale and do any scraping, this is not going to cut it.

05:42.140 --> 05:43.700
So we got to crack open the app.

05:43.700 --> 05:45.060
We remove cert pinning.

05:45.240 --> 05:51.080
And under the hood, we find that it has a total custom signing API for all of their requests.

05:51.180 --> 05:53.220
So they basically generate some cryptographic material.

05:53.220 --> 05:54.120
They sign all their requests.

05:54.120 --> 05:56.700
They have to be byte perfect and be signed properly.

05:56.700 --> 05:58.920
Otherwise, the servers will just reject your requests.

05:59.220 --> 06:05.100
On top of this, even if you do those requests, you get responses where the fields are actually encrypted in their proprietary format.

06:05.400 --> 06:07.840
So you have to be able to figure out how to get rid of that as well.

06:08.260 --> 06:10.520
And of course, they implement their own capture system.

06:10.520 --> 06:15.520
So if you're doing a lot of these requests, right, you're not logged in, they're going to spawn this and you have to solve this.

06:16.000 --> 06:18.220
And you're like, it's too easy.

06:18.220 --> 06:19.220
There's still more.

06:19.320 --> 06:24.140
All of that stuff is not done like in the Java where it might be easier to reverse, right?

06:24.140 --> 06:26.840
It's done deep inside the obfuscated JNA binary.

06:27.020 --> 06:29.700
So you're going to have to pull out some assembly and start cooking, right?

06:30.140 --> 06:32.340
Really great job, actually, like by the team.

06:32.340 --> 06:34.480
They did a good job of doing the anti-bot stuff here.

06:35.260 --> 06:37.780
But for us, this is just like a skill issue.

06:37.780 --> 06:40.460
So we're going to have to get around all of this shit, right?

06:41.320 --> 06:45.640
If any of you have ever done Android reverse engineering before, you have personally been on this scale.

06:45.740 --> 06:47.860
You start off and you're like reading a blog post.

06:47.860 --> 06:49.200
You're like, dude, Frida is sick.

06:49.200 --> 06:52.580
I can just hook all of these functions and I don't have to do any reverse engineering.

06:52.580 --> 06:54.060
It looked like easy.

06:54.180 --> 06:56.980
But then eventually you start becoming like, I'm the real deal.

06:56.980 --> 06:57.920
I learned assembly.

06:57.920 --> 06:59.020
I can reverse engineer stuff.

06:59.020 --> 07:04.460
I can actually just figure out their custom thing and re-implement it in my own language and it's super leet.

07:04.500 --> 07:07.660
And then they do an update and it breaks all your shit and you're like, wait a minute.

07:08.060 --> 07:10.460
Every update I'm going to have to do three hours of reversing?

07:10.460 --> 07:11.500
No fucking thank you.

07:11.500 --> 07:13.020
And so you go back to Frida, right?

07:13.020 --> 07:15.200
So in this case we just skip to the end.

07:15.820 --> 07:25.500
So I wrote a custom thing to basically open the app, click through all the prompts, do an initial request and do the fun like thumb capsule sliding thing automatically.

07:25.920 --> 07:31.640
And then once it's into the state where it can start actually doing these requests, it does a Frida server and does an injection.

07:31.640 --> 07:39.020
So we can basically hand it an HTTP request that we want it to sign for us and it will return us the signed request that we can then send to their API server.

07:41.540 --> 07:43.080
So this is essentially what it looks like.

07:43.080 --> 07:47.140
You've got like a rooted phone with a server and essentially it does the signing proxying for us, right?

07:47.140 --> 07:50.180
And then we send that off over our residential proxy to make the request.

07:50.780 --> 07:52.460
And the result looks something like this.

07:52.560 --> 07:54.280
Again, cable management was not me.

07:54.280 --> 07:55.900
It was much uglier when I did it.

07:57.700 --> 07:59.980
So this gives us a good way to sort of find new sellers, right?

07:59.980 --> 08:04.920
We do searches, we get their seller IDs and now we've got a good base to actually scrape the items that we want here.

08:05.980 --> 08:09.380
So when I said that there's like no websites, that was kind of a lie.

08:09.460 --> 08:13.440
They do have a special like preview thing for ostensibly growth reasons, right?

08:13.440 --> 08:17.540
So you can like share a link in the app with somebody else and they don't have to have the app to see it.

08:17.620 --> 08:19.820
And it's like a little, it'll show you the listing information.

08:19.820 --> 08:22.100
But then when you try to buy it, right, it's like download our app.

08:22.320 --> 08:27.120
So that sounds like a great way to get around this, but there's kind of a caveat, right?

08:27.140 --> 08:28.820
The rate limiting here is severe.

08:28.820 --> 08:34.780
And I don't mean like, you're like, wow, this is like three previews, you view it and it's like, no, no, no, no more, no more previews.

08:34.780 --> 08:35.760
You've got to log in.

08:35.820 --> 08:39.520
And so this means that we're going to need like a lot of IP addresses.

08:40.160 --> 08:43.600
So even for like the crappy budget networks, this is going to be a lot of IP addresses.

08:44.060 --> 08:47.220
So I had to do a little bit of digging, pun intended.

08:47.560 --> 08:51.000
And I was like, oh, it's available over IPv6.

08:51.220 --> 08:55.160
Last time I checked, I think there's a lot more IPv6 IPs out there than IPv4 .

08:55.280 --> 08:57.400
So I think there might be a solution here.

08:58.880 --> 09:05.260
So I went straight to the source for, you know, for me this is like the North American number registry, which is ARIN, right?

09:05.480 --> 09:08.860
You can apparently get a fat 36 range IPv6, right?

09:08.940 --> 09:09.660
Allocation.

09:09.680 --> 09:12.000
And it only costs like 250 bucks a year .

09:12.220 --> 09:16.120
And so with this, you actually, the number of IPs is a bigger number that I can even pronounce .

09:16.120 --> 09:18.800
But you essentially have unlimited IP space that you can now utilize.

09:19.880 --> 09:32.100
I combine this with a piece of software that my friend wrote, which essentially takes like if you have a box where you write all the IP addresses to, this turns it into like a SOCKS proxy server where every request you make to it, it will randomize it through the outbound range that you have set up,

09:32.100 --> 09:32.620
right?

09:32.680 --> 09:35.500
So now we can just start blasting from unlimited, this huge range, right?

09:35.500 --> 09:40.120
With unlimited IPs and rate limiting is, we'll call it more or less solved, right?

09:40.340 --> 09:42.340
We may never come from the same IP twice.

09:44.140 --> 09:44.860
Great.

09:45.240 --> 09:46.420
Scraping is solved.

09:46.420 --> 09:48.260
Let's talk about that second challenge, right?

09:48.260 --> 09:53.000
Again, that challenge is that the secrets that we want are probably not outright in the listing description, right?

09:53.000 --> 09:53.980
They're hidden, right?

09:54.040 --> 09:56.520
Maybe the seller doesn't even know what it is that they're selling.

09:56.920 --> 09:58.740
So how do we address this, right?

09:58.820 --> 10:01.880
The key way that we do this is via OCR, right?

10:01.880 --> 10:04.720
So there's some problems with this in practice.

10:04.720 --> 10:11.660
You've probably heard of open source solutions, but they have things like this where Apple does their very chic gray on silver design.

10:11.900 --> 10:14.280
And even some humans have issues reading this text, right?

10:14.280 --> 10:15.600
And computers are no different.

10:15.600 --> 10:18.760
When I plugged this into the open source Tesseract's model, right?

10:18.760 --> 10:21.240
It basically said, there's no text on this.

10:21.240 --> 10:22.720
I have no idea what you're talking about.

10:23.020 --> 10:25.180
So that was like not going to fly.

10:25.400 --> 10:28.300
Um, I looked at some like proprietary APIs, right?

10:28.300 --> 10:29.480
There's Google Vision.

10:29.580 --> 10:30.840
Google Vision actually did a great job.

10:30.840 --> 10:34.960
I was like, wow, it got all the text that I could, you know, want people to get out of this, right?

10:35.220 --> 10:41.040
But then I sort of looked at the pricing and I was like, oh, one penny for seven images.

10:41.040 --> 10:41.900
That's pretty good.

10:41.900 --> 10:46.980
But then I was like, wait, so for a million images, that's 1500 bucks and we're doing hundreds of millions of images.

10:47.220 --> 10:49.880
So yeah, that's not really tenable.

10:50.220 --> 10:54.080
Um, but I had sort of a eureka moment when I was actually using my iPhone.

10:54.080 --> 11:05.800
I had one of those old school captures, you know, before the current more annoying like grid ones, uh, where essentially I held my thumb down and I realized that I could actually select the warped texts and I could copy it.

11:05.800 --> 11:08.060
And I was like, wait, iOS has an OCR model?

11:08.240 --> 11:09.240
This is sick.

11:09.360 --> 11:11.680
And I could paste it and it got it exactly right.

11:11.680 --> 11:14.540
So I was like, there, there might be something here.

11:16.200 --> 11:21.340
And uh, not only is it available, you can actually like, if you just write an app, you can integrate with this API and automate it.

11:21.340 --> 11:32.620
So I wrote some of the ugliest Swift code any of you have probably ever seen and made a little HTTP server where I could send it an image and it would do OCR in English and Chinese and do barcode detection.

11:33.040 --> 11:34.920
And uh, this basically solved it.

11:34.920 --> 11:39.480
Um, but you're probably like, okay, you can use an iPhone, but that's gotta be expensive, right?

11:39.480 --> 11:41.060
Like iPhones are super expensive.

11:41.480 --> 11:47.980
But in fact, the GPU acceleration, uh, chip actually goes back as far as the iPhone, uh, second generation SE.

11:48.100 --> 11:52.780
And if you get those on like, you know, cricket wireless or some unpopular carrier, right?

11:52.780 --> 11:55.120
They're sold for as little as 40 bucks.

11:55.120 --> 12:00.200
Uh, so you can get these for super cheap and you can build yourself a high capacity OCR array.

12:00.800 --> 12:12.100
So I wired a bunch of these together, uh, and I had a high capacity array that could do around 50 HD images a second in English and Chinese, even with a lot of text and barcode detection as well.

12:12.200 --> 12:18.220
And to make it even better, it basically uses no power because the mobile, like, compute was actually super efficient.

12:18.220 --> 12:19.800
So it worked out really well.

12:20.920 --> 12:21.500
Great.

12:21.500 --> 12:28.260
So we script all this shit, we got all these images, we can do OCR on all these images, we index all of it, but now we need to know what we're looking for, right?

12:28.460 --> 12:36.080
So I started off with just looking like general examples of like prototypes and company laptops and sort of built a very early set of keywords to alert on.

12:36.100 --> 12:44.380
And when I found matches to those alerts for products that were listed, anything else on the laptops that they had, I then added those marks to my list of things to alert for, right?

12:44.440 --> 12:51.940
So maybe I had some text that was like property of, then I get a barcode and I'd see what their barcode format was and then I would add that to my rules and it's iterative, right?

12:51.940 --> 12:59.480
So every time I get more results, I'm improving my rule set and pretty soon I've got a huge alert list of keywords that when something comes up, I can immediately get notified of it.

13:00.200 --> 13:07.620
I made this a little easier by building like a nice little data lake UI so I can just type in, if I see type in a keyword, and it will immediately start showing me matching listings.

13:07.620 --> 13:09.840
So I can very quickly cook these things up.

13:11.800 --> 13:15.600
Talked about a lot of pieces overall, but this is kind of the 10 ,000 foot view.

13:15.600 --> 13:27.420
You've got the most convoluted set of like free to server bullshit combined with like exit proxying combined with like Elasticsearch and iPhone OCRs, but TLDR took a lot to do this with the level of data that we're doing.

13:28.780 --> 13:33.920
Overall we're talking about much more now , but probably like 50 million listings scraped, right?

13:33.920 --> 13:37.840
We're talking over 250 million images OCRed in total, right?

13:37.880 --> 13:40.380
None of the iPhones have exploded yet, very great work.

13:42.220 --> 13:45.480
I said there was only three challenges, there's actually kind of 3.5.

13:45.480 --> 13:52.520
So imagine you're selling something on eBay and some random person in like some remote province of China says, hey, could you just like ship this to me?

13:52.520 --> 13:58.060
And you'd be like, dude, I don't know how to do paperwork for Canada, let alone like, you know, this place in China, right?

13:58.120 --> 14:04.520
And it's so different if you ask somebody in domestic Chinese markets to say, hey, could you ship this to me in like, you know, Alabama or whatever it is, right?

14:04.660 --> 14:14.360
So we kind of have to figure out like, how can we work in these markets and buy from local sellers when we ourselves like don't, maybe don't speak the language, don't understand the culture and want to get it like exported to us?

14:15.000 --> 14:17.340
So where can this secret knowledge be found?

14:17.920 --> 14:25.620
Luckily, there's a community who's very familiar with the domestic Chinese market built around like really high -end fake fashion replicas.

14:25.620 --> 14:29.080
So yeah, your Gucci handbag that's like indistinguishable or whatever from the real one.

14:29.220 --> 14:33.600
There's a community that kind of focuses on basically getting these from inside of the domestic Chinese market.

14:33.600 --> 14:41.420
And they use these agents, which will actually do the work of communicating with the seller, they'll buy it and they'll actually like rewrap it for you and do all the export forms to get it to you.

14:41.640 --> 14:46.680
So we basically use the exact same stuff that they use to get these designer clothes and we kind of have this solved.

14:48.540 --> 14:50.360
So this is what you've all been waiting for, I'm sure.

14:50.360 --> 14:52.560
Let's go to the loot and see what we found here.

14:52.720 --> 14:55.400
Before we get, we'll start off with employee devices here.

14:55.620 --> 15:01.800
Before we sort of get into these, we'll dispel some very quick like, well, actually things that I'm sure you're going to want to say.

15:01.800 --> 15:10.140
And one of the common rebuttals I hear is like, sure, you can find this hardware leaking out, but it's probably all locked and it requires a passcode to access them or whatever.

15:10.140 --> 15:12.700
So there's no way that you can like actually do this, right?

15:13.060 --> 15:16.200
My rebuttal in this case is merely a slide.

15:16.200 --> 15:19.240
Obviously there's a lot more examples, but there's only so much space.

15:20.780 --> 15:23.500
Plenty of notable examples here, right?

15:25.580 --> 15:27.240
And you're like, okay, okay, okay.

15:27.360 --> 15:28.720
They're unlocked, I get it, I get it.

15:28.720 --> 15:32.100
But that doesn't mean that there's actually anything sensitive on the devices, right?

15:32.280 --> 15:34.460
And again, I only have a slide as a rebuttal.

15:34.880 --> 15:37.140
Again, many more examples, right?

15:38.940 --> 15:47.680
And if you're like, my company's not affected, if you work for a Fortune 500 company, I guarantee you I've seen your equipment end up on eBay or some other market, right?

15:47.680 --> 15:52.560
Super wide breadth of, if you do any volume of employee equipment or whatever, it's going to be here.

15:53.720 --> 15:55.720
So let's talk about the war stories.

15:55.960 --> 15:57.940
I want to actually do a quick little preface here.

15:57.940 --> 16:01.040
All of my examples are for a pretty popular company called Apple.

16:01.360 --> 16:03.960
This is not because Apple like fucked up especially.

16:03.960 --> 16:05.600
Actually, it's pretty much the opposite.

16:05.600 --> 16:14.920
They were like a mature hardware company and my point of the research targeting their stuff was more because if it affects them, we can be pretty sure that any other company is affected as well, right?

16:14.920 --> 16:17.360
They have resources to make this right.

16:17.380 --> 16:20.400
So we'll start out with the story of the time capsule.

16:21.040 --> 16:28.780
So I built up a good little database of alerts and keywords for those things and eventually I got alerted to a time capsule that was listed in the United Kingdom.

16:29.140 --> 16:33.700
And the reason why I got an alert is it had this cool sticker on the background which said property of Apple Computers, Inc.

16:33.700 --> 16:34.780
Expensed Equipment.

16:34.840 --> 16:37.880
And I was like, hmm, this might be interesting.

16:38.440 --> 16:40.720
And I looked at the description and it said this.

16:40.720 --> 16:42.640
It said, hey, it was part of an office clearance.

16:42.640 --> 16:43.520
Good sign.

16:43.800 --> 16:47.860
It's been powered up and lights up as expected but has not been tested beyond this point.

16:48.120 --> 16:53.120
This is the perfect description for if you think something is going to be good because it means the device works.

16:53.260 --> 16:57.060
We couldn't wipe it ourselves because we couldn't really get it turned on and all set up, right?

16:57.060 --> 17:01.280
But we can be pretty sure that it's at least in the original state that maybe they got it in, right?

17:02.220 --> 17:08.180
So I also did some Googling and there was actually an office clearance for Apple that like they moved offices so it seemed like it lined up.

17:08.940 --> 17:10.560
So I placed a bid.

17:10.740 --> 17:13.080
I didn't realize how big the shipping was.

17:13.080 --> 17:15.980
It was actually like almost like, it was like more than the actual device itself.

17:15.980 --> 17:17.660
So I kind of learned that lesson the hard way.

17:17.660 --> 17:19.520
But we'll take a risk.

17:19.600 --> 17:20.780
Got into the United States.

17:21.000 --> 17:30.540
After sweating with a heat gun and getting the back off and pulling the hard drive out, I was able to connect it up to my laptop to start doing like, to look at the drive, right?

17:30.960 --> 17:34.840
And initially I looked at it and I was like, oh shoot, there's no files.

17:34.840 --> 17:36.100
Looks like they deleted them.

17:36.680 --> 17:42.480
I was like, unless, unless they deleted it and they didn't actually do a secure wipe of it so maybe they're still hanging around.

17:42.480 --> 17:46.060
Let's just, just in case, let's do a forensic scan of this thing, right?

17:46.420 --> 17:47.660
So I let this thing run.

17:47.660 --> 17:51.920
That cooked for around 28 hours for 2 terabytes which is quite a while.

17:52.120 --> 17:54.920
And it turns out that's not entirely true.

17:55.080 --> 17:56.720
There was data on the device.

17:56.820 --> 18:16.040
Things like internal credentials, things like internal support tickets, sales reports and figures, internal documentation, apps, repair guides, internal emails, bank account information, passport and ID scans, and I swear this last one is true, dank internal memes from these Apple stores in Europe.

18:16.860 --> 18:23.580
There was literally an entire video done in like the Backstreet Boys style of how to count the inventory in your Apple store.

18:23.580 --> 18:24.680
I kid you not.

18:24.980 --> 18:27.460
It hurt me so much to like hand this back over.

18:30.120 --> 18:33.280
Anyways, I got this and I was like, alright, this is scary.

18:33.280 --> 18:35.080
I'm going to tell Apple about this, right?

18:35.080 --> 18:43.740
I used the only channel they had for reporting which was like their regular like sort of bug bounty reporting queue thing and said, hey, I've got this time capsule.

18:43.740 --> 18:45.300
Looks like it's from like the 2010s.

18:45.300 --> 18:48.720
It's got like a bunch of Euro store data and you probably want this.

18:50.160 --> 18:57.460
You know, I got this, I originally submitted this actually to them and I got I think some regular like product security person who's like, I do bugs.

18:57.520 --> 19:00.020
Like I don't know what this is or what I'm supposed to do with it.

19:00.020 --> 19:05.080
And he's just like, I sent an email to our internal people but there's nothing I can do with this.

19:05.080 --> 19:07.800
So I originally was like, oh, this is easiest disclosure ever.

19:07.800 --> 19:08.760
It's like already over.

19:08.900 --> 19:15.640
But then I got an email later from their GSOC in London which was like, hey, we actually do, we would very much like that drive.

19:15.660 --> 19:17.100
And you're in the Bay Area, right?

19:17.100 --> 19:19.560
Could you just like drive 10 minutes and drop that off for us?

19:22.280 --> 19:23.400
And I was like, sure.

19:23.400 --> 19:25.840
You know, lunch break, head over there, drop it off to them.

19:25.840 --> 19:27.160
And I was like, good deal.

19:27.160 --> 19:29.160
And I sent an email saying, we're all good.

19:29.300 --> 19:30.460
Disclosure's all finished.

19:30.560 --> 19:31.280
And I was like, cool.

19:31.280 --> 19:32.060
Done deal.

19:33.480 --> 19:41.440
Later on I received an update like later that night where they were like, hey, uh, any other POCs off that drive that you could send us just to assess the impact of the report?

19:41.500 --> 19:44.200
And I was kind of like, but I already gave you the drive.

19:44.200 --> 19:46.300
So like how would I, how would I do that?

19:46.300 --> 19:47.600
Because like obviously I don't have the data.

19:47.600 --> 19:48.680
I gave it back to you, right?

19:48.680 --> 19:54.840
So I was kind of like, I think it was just communication between the team, but I was kind of like a little bit like, what's the deal here?

19:59.160 --> 19:59.620
Cool.

19:59.620 --> 20:01.140
So let's talk about prototypes, right?

20:01.140 --> 20:03.100
Another one of those like main columns I mentioned.

20:03.840 --> 20:05.780
They usually look something like this, right?

20:05.780 --> 20:07.860
Lots of scary hardware labels in the back.

20:08.020 --> 20:10.200
Usually a phone number to report it being missing.

20:10.900 --> 20:14.340
And Apple actually has some pretty interesting prototypes.

20:14.360 --> 20:17.460
They're a little bit more valuable than your regular prototype that you might find.

20:18.040 --> 20:21.160
Um, here's a bunch of stuff that I was able to get over doing this research.

20:21.300 --> 20:23.940
Um, this is actually a small part of a lot of the prototypes those were able to find.

20:24.580 --> 20:33.720
Um, so the reason why Apple prototypes are a little bit more interesting is because they have something called dev fusing in a lot of their prototype versions of the iPhone, right?

20:33.720 --> 20:35.540
And you're like, what the hell is dev fusing?

20:35.700 --> 20:38.420
Essentially in a production iPhone that you buy from a store, right?

20:38.420 --> 20:45.200
They actually burn these fuses, which prevent you from being able to do debugging of the application processor and the secure enclave processor, right?

20:45.320 --> 20:55.780
And so when you do exploit development, so you've kind of heard these like million dollar or whatever iPhone exploits, having one of these phones is key because it allows you to really easily debug your exploit to make, you know, get a pull it off essentially.

20:55.780 --> 20:58.060
So there's like a big gray market spawned off of this.

20:58.060 --> 21:03.420
Apple actually has researcher devices that they'll give you , uh, if you follow a bunch of legal procedures to get yourself.

21:03.580 --> 21:05.780
Uh, but you know, there's still people that don't want to deal with that.

21:05.780 --> 21:07.680
So there's still this big gray market, right?

21:07.680 --> 21:12.080
But there's these TLDR, there's these super rare iPhones which are useful for security research, right?

21:12.400 --> 21:14.020
Um, this is sort of what that looks like.

21:14.020 --> 21:15.260
They have different fusing states.

21:15.260 --> 21:19.760
If you have the debugging cable, you can basically plug the iPhone in and say, yes, this is a deaf -used iPhone.

21:21.460 --> 21:29.220
So again, uh, on around November 23rd, 2023, I had my pipeline alerted to a bunch of listings being created at once in China.

21:29.440 --> 21:31.300
Uh, they were all iPhone 14s.

21:31.300 --> 21:36.540
And initially , you know, when I get a bunch of alerts at once, I'm like, oh, somebody's reposted their listing like eight times or whatever.

21:36.640 --> 21:41.160
But then I started to look at the photos and I was like, wait a minute, these are all distinct iPhones.

21:41.160 --> 21:43.860
This is not like one iPhone that's been repeatedly posted.

21:44.460 --> 21:51.280
Uh, so it turned out this was actually a huge cache of these prototype iPhone 14s, which at the time was the latest model of iPhone, right?

21:51.280 --> 21:54.020
So, um, this is like a video of the seller.

21:54.680 --> 22:06.120
Uh, furthermore, when I actually bought one of these iPhones and imported it here, uh, I realized that the seller, when he was sort of taking pictures to validate the camera worked, he didn't turn off the GPS tagging feature in the photos.

22:06.120 --> 22:09.940
So I actually had the exact location in China where the seller actually was.

22:10.020 --> 22:13.900
And, uh, worse than that, uh, he also took selfies to validate the camera.

22:14.600 --> 22:19.000
So in terms of like finding the source of these leaks, this is a pretty compelling way to do that, right?

22:20.160 --> 22:21.720
But I don't want to give you the wrong impression.

22:21.720 --> 22:26.560
It's not just that these, you know, prototype iPhones will only come from like, you know, wherever in China that they're made.

22:26.600 --> 22:33.400
Actually, ironically, so I live in the Bay Area, it's either in these remote provinces of China or it's a 10 minute drive from my house with very little in between.

22:33.760 --> 22:37.420
So in this case, like this was one that was leaked in, uh, San Francisco, right?

22:37.420 --> 22:41.740
It's a DVT model iPhone 14 and it did indeed have dev fusing, right?

22:41.840 --> 22:52.800
The most hilarious part about this actually is that the sellers oftentimes when they have these, they try to do like a regular restore of the device, only to realize like, this is a weird iPhone, I can't restore this, I have no idea what's going on here.

22:52.800 --> 22:55.040
They're just like, I'll sell it for parts, whatever.

22:55.080 --> 23:01.060
And so the listings are sold usually for parts when it's actually like a very, you know, expensive prototype iPhone, right?

23:02.640 --> 23:03.180
Cool.

23:03.180 --> 23:08.420
So we kind of covered a couple examples here, we talked about time capsule, we talked about these rare prototype devices, right?

23:08.420 --> 23:11.100
Let's go to the thing, the place where these things are made, right?

23:11.100 --> 23:15.260
So in this case the assembly line is Foxconn for Apple for the most part, right?

23:16.280 --> 23:23.060
So I looked at a lot of these Chinese listings, uh, things that had like, you know, a bunch of labels that appeared to be related to Foxconn, right?

23:23.060 --> 23:27.280
And I started to realize that there was a pattern that was starting to emerge when I looked at these things, right?

23:27.320 --> 23:36.420
So if it's used inside of Foxconn, I started to realize that, hey, it usually has this like, you know, three letter, four letter, six digit combo thing that they use to label like, internal equipment.

23:36.560 --> 23:43.100
And so I created a quick rule that anytime something like this shows up in China, why don't you let me know and I'll take a look at it, right?

23:43.180 --> 23:45.780
I'm sure all of you can sort of see where this might be going.

23:46.100 --> 23:51.220
Uh, sometime later, I got an alert for a listing like this, uh, for only 188 yuan.

23:51.220 --> 23:54.520
This is like 28 dollars, I think, in USD.

23:54.860 --> 23:58.480
And uh, when I took a closer look at it, it had all the markings that I wanted.

23:58.500 --> 24:03.180
Uh, and I looked at the bottom of it and there was an interesting hole drilled in the bottom.

24:03.320 --> 24:10.400
And I was like, oh, okay, so, like, they basically took a drill press to this thing to like, securely destroy it and, you know, what, get rid of the hard drive.

24:11.000 --> 24:15.940
Um, but then I thought about it a little bit more and I was like, wait a minute, let me look at a schematic of what this looks like inside.

24:15.940 --> 24:21.540
And I was like, okay, so like, the hard drive is here , and uh, that means the magnetic platter is here.

24:22.720 --> 24:24.980
And they drilled the hole, like, here.

24:29.760 --> 24:31.320
There might be a chance.

24:34.160 --> 24:38.180
And this is one of those things where I'm like, there's no way, but it would be too cool if it works.

24:38.180 --> 24:51.620
So I bought it, brought it into the United States, again, you know, uh, disassembled it, pulled the hard drive out, I looked inside and I saw that beautiful orange PCB color, and I was like, I think they might have missed it, but let's, let's send it to the experts.

24:52.240 --> 24:55.280
Uh, so, I shopped around a little bit, found a cheap lab down in L.A.

24:55.280 --> 25:07.380
to, to, that said, hey, they gave me the honest answer, which is exactly what I was looking for, where they were basically like, alright, listen, you drilled a hole in the damn thing, like, if, if you did that, and you didn't turn it on, and there's not a bunch of dust and all these other things,

25:07.380 --> 25:11.520
then yeah, I think we can recover it, but don't get your hopes up, like, be aware, right?

25:12.040 --> 25:22.900
So I sent it down to them, they basically after some time came back to me and they said, hey, uh, you know, we, we popped this thing open, it looks like it just hit the PCB, and, uh, in order to recover it, we basically had to buy a working drive, go into a clean room,

25:22.900 --> 25:24.920
and swap the magnetic platter from one to the other.

25:25.600 --> 25:37.300
Obviously, after getting this email , I was like, so just to be clear, you're saying they did miss the magnetic platter, and they were like, yep, it pretty much missed everything, uh, so, it looks like there might be a chance here, there's not a lot of dust even on the platter,

25:37.300 --> 25:38.920
so, I think we might be good.

25:40.080 --> 25:49.760
Sometime later, I got the email that I was looking for, where they said, hey, I got 99.99 whatever percent of the data, and I was like, oh, yeah, it's all coming together.

25:51.300 --> 26:01.060
But I was still, like, if you do a lot of this research, you always try to, like, hold off on being too excited, because your dreams have been crushed too many times by it not working out, so I was like, you know, maybe, maybe somebody actually bought it,

26:01.060 --> 26:06.440
reused it, and then they drilled the hole in it, so, like, you know, maybe it's not actually the real thing, but it was.

26:07.020 --> 26:14.660
Uh, these are the wallpapers from it being used on the factory line, it was used to do Q&A, for, actually, a couple things it looked like, but for iPad Q&A, it looked like.

26:15.060 --> 26:23.460
Uh, it came along with a bunch of really tasty internal Apple software for sort of interfacing with their prototype devices and doing Q&A on the line, all of that good stuff, right?

26:23.460 --> 26:28.280
It came with internal credentials for the Foxconn factory, and a bunch of other cool stuff.

26:28.280 --> 26:32.780
A lot of cool Apple tooling, too, with a bunch of, like, you could tell engineers came up with the name of these tools, right?

26:32.780 --> 26:34.600
Like, footing, whatever, so.

26:36.000 --> 26:43.560
Uh, another funny story about this one is when I gave this one to Apple, like, the first time there was a lot of mis- there was a lot of miscommunication when it came to the time capsule, like, back and forth to coordinate it.

26:43.640 --> 26:53.160
The second time, I was like, hey, I've got this random drive from the Foxconn line, I've got this forensics, I've got all this data, I want to give it back to you, they were just like, here's a prepaid FedEx envelope, you just drop that shit in the mail,

26:53.160 --> 26:54.180
get it right to us.

26:54.180 --> 26:55.360
I was like, sweet.

26:58.760 --> 26:59.300
Great.

26:59.300 --> 27:02.540
So we've got some cool POCs, we kind of show off the problem, right?

27:02.540 --> 27:06.740
Let's go into, like, maybe what are the high-level, like, takeaways of this whole stuff, right?

27:08.940 --> 27:19.500
Uh, so one thing that's kind of interesting is, like, this is not like, you know, you think of, like, the conventional hacking stories and sort of, like, um, you know, cracking code or whatever, but this research raises kind of an interesting question,

27:19.500 --> 27:23.320
which is, like, have I done anything sort of unethical or wrong here, right?

27:23.320 --> 27:27.120
If you talk about the source of a lot of these other prototypes, we're talking about pretty illicit stuff, right?

27:27.120 --> 27:30.340
They're paying somebody, I assume, to take it off the factory line or whatever it is.

27:30.400 --> 27:31.780
But we're not, we're not doing that.

27:31.780 --> 27:33.920
We're just literally looking for public listings.

27:34.100 --> 27:39.120
We come to the table with a little bit more information about what is in those, like, listings and what it actually means, right?

27:39.120 --> 27:43.500
And ostensibly they would have been sold anyways, but we just instead buy it in the first place, right?

27:43.500 --> 27:45.840
So have we, like, really done anything wrong?

27:45.840 --> 27:46.500
You know what I mean?

27:46.500 --> 27:48.460
So it's just a very interesting question there.

27:49.680 --> 27:59.820
Um, I think another potentially interesting takeaway here is, you know, you're probably more familiar when we have, like, very standardized, uh, full disk encryption and mobile device management for, like, the standard set of things.

27:59.840 --> 28:03.020
So you get your work laptop, things are pretty well understood there.

28:03.020 --> 28:06.720
You have your, like, work phone, MDM solutions, FD solutions are pretty straightforward.

28:06.880 --> 28:11.140
But then when you get into the more custom hardware side, you don't necessarily have that level of maturity.

28:11.140 --> 28:12.480
I think it's like the time capsule, right?

28:12.480 --> 28:17.140
It's like, is there a clear suite that can, that can actually do, ensure that these things work the way that you expect?

28:17.240 --> 28:24.440
And so I would assume that this probably extends to any other type of custom hardware where you don't have this very standardized format of software to protect this.

28:25.840 --> 28:30.300
This one is probably obvious for anybody who's done anything related to hardware or who lives through COVID.

28:30.540 --> 28:32.840
Uh, supply chains are incredibly difficult, right?

28:32.840 --> 28:37.260
You've got multiple sides of the globe on different time zones doing iterations on hardware.

28:37.260 --> 28:41.600
And it's not like software where you're halfway through and you're like, ah, let's just can all this and rewrite it.

28:41.600 --> 28:49.320
You're kind of, your parameters are slowly narrowing and you've got to like, uh, throughout all this time, make sure none of them leak out and everything's securely destroyed and all this stuff, right?

28:49.320 --> 28:51.060
You've got to keep everybody super tight-lipped.

28:51.120 --> 28:53.180
So it's very challenging to do this, right?

28:53.180 --> 28:56.120
Across many countries and to deliver this final product.

28:57.360 --> 29:02.880
Another interesting point, as you noted with one of these examples, is leaks very much point to sources.

29:03.120 --> 29:06.640
So you mentioned, like, we found listings where these things sort of bubbled up, right?

29:06.640 --> 29:10.540
And we can then take those to go to the sellers to figure out, like, what's the real story here?

29:10.540 --> 29:12.040
Where did this shit actually come from?

29:12.040 --> 29:15.420
And we can start to understand a full picture of, like, where is my stuff breaking apart?

29:15.420 --> 29:17.120
How is this stuff leaking out, right?

29:17.120 --> 29:21.860
So it becomes a very good opportunity to sort of identify these sources and ultimately close them if you're the company.

29:23.540 --> 29:29.160
I think another really interesting piece of this, too, is I would say that, like, e-waste is a particularly interesting point, right?

29:29.160 --> 29:33.560
So if you have your stuff going to e-waste, a lot of people sort of assume, like, oh, it's going to be destroyed.

29:33.780 --> 29:38.820
But then you get people who are at the e-waste side who are, like, why are they throwing away 50 good iPhones?

29:38.820 --> 29:40.660
Like, this could be resold right now.

29:40.660 --> 29:42.260
Like, it's very strange, right?

29:42.320 --> 29:46.060
And so a lot of these, I think, leaked out from sort of e-waste recycling centers, right?

29:46.060 --> 29:47.600
And this is what causes these problems.

29:47.600 --> 29:53.480
So you got to make sure that, like, your stuff is actually being destroyed and not being, you know, essentially diverted and potentially resold.

29:55.460 --> 29:58.620
I just want to give a quick special thanks to Apple Demo.

29:58.620 --> 30:00.840
He does a bunch of iPhone prototype stuff.

30:00.840 --> 30:04.560
Check out his YouTube for helping me sort of the initial research and understanding of this space.

30:04.900 --> 30:07.400
And I'd like to thank all of you for coming to this.

