[00:00.000 --> 00:04.580] Good deal. Thank you all for coming. This is the secret life of a rogue device. [00:05.260 --> 00:09.680] My wife told me not to tell anybody who helped me with these slides and make them look beautiful, [00:09.680 --> 00:13.160] so I'm just going to say a beautiful, anonymous woman helped me make these look nice, [00:13.160 --> 00:16.200] and the earlier format was much uglier, I assure you. [00:18.460 --> 00:23.500] So, quick background, I'm Matthew. My friends call me Mandatory. I've worked on a variety of [00:23.500 --> 00:28.500] security projects, things like XSS Hunter, Cursed Chrome, and I write security research [00:28.500 --> 00:32.940] at TheHackerBlog.com. In my professional life, I also lead the red team at Snap. [00:34.500 --> 00:38.080] So, this talk is sort of about, quote-unquote, rogue hardware, [00:38.080 --> 00:44.220] ending up on the second-hand online electronics markets. So, what do I mean by rogue? I mean [00:44.220 --> 00:48.540] things that shouldn't end up there, so this is kind of a few key categories, right? Things like [00:48.540 --> 00:52.760] employee laptops, which you're probably familiar with, right, that shouldn't be resold, maybe has [00:52.760 --> 00:57.760] sensitive data on it, stuff like that. It means things like prototypes, so early development [00:57.760 --> 01:01.880] version of your favorite products, maybe like the iPhones that you enjoy, right, earlier stages [01:01.880 --> 01:06.660] when they were first being built, right, and then sort of like more specialized things like [01:06.660 --> 01:11.240] factory line equipment and, you know, backup hard drives, stuff like that. So, that's sort of what [01:11.240 --> 01:17.000] we'll be covering. The main questions we're going to be answering here is, some of them are [01:17.000 --> 01:20.560] pretty obvious, right, it's like how often does this actually happen, right? Is this a problem, [01:20.560 --> 01:24.360] right? And then for the stuff that does end up here, you know, on these secondary markets, [01:24.360 --> 01:28.880] what's the impact? Is there anything security related that we have to worry about? And then, [01:28.880 --> 01:32.000] you know, ultimately, what is it that actually ends up getting resold like this? [01:33.340 --> 01:37.300] Along the way, we'll sort of figure out like, you know, what are the challenges of doing research [01:37.300 --> 01:41.380] in this space? Once we figure those out, we'll have to scale it up to sort of do all of the [01:41.380 --> 01:45.880] listings across western and eastern markets, and then we'll finish up with everybody's favorite [01:45.880 --> 01:53.680] part, which is like war stories and loot and all that cool stuff. Great, so what are the challenges [01:53.680 --> 01:59.300] to finding rogue hardware? First one is probably pretty obvious, you probably already guessed it, [01:59.300 --> 02:03.580] we've got to get it from somewhere. So what are the places that stuff gets resold on, right? So, [02:03.580 --> 02:07.260] if you're, you know, from the US, you're probably familiar with eBay, right, for the western side [02:07.260 --> 02:11.120] of things. There's also other things like Craigslist and Facebook Marketplace, but those [02:11.120 --> 02:15.160] are generally a little bit more local, right? They might expect you to show up, and, you know, [02:15.160 --> 02:18.620] that's kind of hard to scale out, so we want stuff where you can sort of ship it. So we'll kind of [02:18.620 --> 02:23.800] focus on eBay on this side. On the eastern side, you have sort of where all the electronics are [02:23.800 --> 02:27.840] assembled and actually put together, right, where things are manufactured. There's another market [02:27.840 --> 02:32.020] which you may not be as familiar with. I apologize to the native Chinese speakers here, I'm going to [02:32.020 --> 02:37.420] butcher this word, but ShenYu is the app that they have there, which is much larger than I thought [02:37.420 --> 02:41.060] it was going to be, but this is basically the second-hand market in China, so if you want to [02:41.060 --> 02:47.320] resell something there. So we know the where, but the second challenge is like, sellers don't [02:47.320 --> 02:51.520] usually make listings like this. They're not like, hey, this is a secret, you know, prototype for [02:51.520 --> 02:55.940] this crazy product thing, right? Usually the sellers don't even know what it is that they're [02:55.940 --> 02:59.540] selling, right, in many of these cases, and they're not just going to put that in a listing where we [02:59.540 --> 03:05.220] can easily find it. So how do we deal with that? I'll give you a little spoiler. A lot of the [03:05.220 --> 03:08.920] information that we actually want is more in the images, right? So it's not in any text, but it's [03:08.920 --> 03:13.200] actually in the text embedded in the images themselves. If you have, again, a company laptop, [03:13.200 --> 03:18.460] sticker on the bottom that says property of whatever, or asset tag, you know, whatever. So we [03:18.460 --> 03:21.780] have to dig a little bit deeper to find the answer to this stuff, right, to figure out the real truth [03:21.780 --> 03:27.680] of where these are. So assuming that we get all this stuff from where we've talked about, and then [03:27.680 --> 03:31.280] we sort of analyze those images and do all this stuff, right, we still have to know kind of like [03:31.280 --> 03:35.900] what we're looking for, right? So in the case of prototypes, like I mentioned, there's like secret [03:35.900 --> 03:40.840] code words, secret labeling conventions they use. For, I mentioned before, for employee laptops, [03:40.840 --> 03:44.400] there's special barcode formats and whatever else, right? So we have to sort of figure out what [03:44.400 --> 03:51.000] these are in order to identify when these things show up. And let's talk about sort of building a [03:51.000 --> 03:56.080] pipeline for detecting this rogue hardware at scale. Probably unsurprisingly, the first [03:56.080 --> 03:59.900] challenge is we got to scrape the hell out of a bunch of sites, right? So I mentioned before, we'll [03:59.900 --> 04:05.120] focus on two main sites here, eBay and Sinyou. We'll start off with eBay because it's dramatically [04:05.120 --> 04:09.720] easier to scrape. You'll see why. So on the eBay side, this is pretty simple. You just do searches [04:09.720 --> 04:13.660] for the kind of products you're looking for, right? Something like laptop or phone or whatever [04:13.660 --> 04:17.720] it is. You scrape the resulting listings and you extract the images out of them so you can do [04:17.720 --> 04:23.500] analysis on them. But we have a hurdle. And this is pretty much the case for any major site, [04:23.500 --> 04:27.680] right? They'll have some form of rate limiting, right? To prevent either bots or whatever it is. [04:27.880 --> 04:32.560] In the case of eBay, if you do too many requests, they give you this fake 404 page saying, hey, [04:32.560 --> 04:35.820] you know, you're doing that too much and they're trying to fool you into thinking this page [04:35.820 --> 04:41.440] doesn't exist. Luckily, the modern internet is not quite as simple as it used to be, right? We [04:41.440 --> 04:45.440] have like CDN services in the middle of a lot of things to sort of speed up page loads and [04:45.440 --> 04:49.480] optimize content being served at the edge, right? And we can use this to our advantage to [04:49.480 --> 04:53.800] circumvent this rate limiting. So in the case of eBay, you know, they essentially have an allow [04:53.800 --> 04:58.060] list from all of CloudFlare, which is a popular CDN. It's like IP ranges that said, hey, if it's [04:58.060 --> 05:02.260] coming from here, don't bother with the rate limiting, just allow unlimited requests, right? [05:02.260 --> 05:06.140] So CloudFlare allows you to make workers, which come from like their space, right? So I just [05:06.140 --> 05:11.340] simply upload a CloudFlare worker, which proxy to eBay. And so by using this as a proxy, I can get [05:11.340 --> 05:16.140] around all the rate limiting and do unlimited requests. So super easy. We've got that problem [05:16.140 --> 05:25.040] solved. Moving right along. All right. So in the China side, right, Shen Yu, it's not quite as [05:25.040 --> 05:28.340] easy. In fact, you go to their website and you don't see like anything at all. It just says [05:28.340 --> 05:33.380] like, hey, download our app to continue. You're like, all right. So you go to their, you know, [05:33.380 --> 05:37.200] your local app store, you download their web, their little app, and you start browsing for [05:37.200 --> 05:41.360] listings on this, right? Of course, if we want to do this at scale and do any scraping, this is [05:41.360 --> 05:46.000] not going to cut it. So we got to crack open the app. We remove cert pinning. And under the hood, [05:46.000 --> 05:51.880] we find that it has a total custom signing API for all of their requests. So they basically [05:51.880 --> 05:55.280] generate some cryptographic material. They sign all their requests. They have to be byte perfect [05:55.280 --> 06:00.040] and be signed properly. Otherwise, the servers will just reject your requests. On top of this, [06:00.040 --> 06:03.880] even if you do those requests, you get responses where the fields are actually encrypted in their [06:03.880 --> 06:08.640] proprietary format. So you have to be able to figure out how to get rid of that as well. And of [06:08.640 --> 06:12.280] course, they implement their own capture system. So if you're doing a lot of these requests, [06:12.280 --> 06:16.740] right, you're not logged in, they're going to spawn this and you have to solve this. And you're [06:16.740 --> 06:22.520] like, it's too easy. There's still more. All of that stuff is not done like in the Java where it [06:22.520 --> 06:27.320] might be easier to reverse, right? It's done deep inside the obfuscated JNA binary. So you're [06:27.320 --> 06:31.520] going to have to pull out some assembly and start cooking, right? Really great job, actually, [06:31.520 --> 06:36.460] like by the team. They did a good job of doing the anti-bot stuff here. But for us, this is just [06:36.460 --> 06:41.880] like a skill issue. So we're going to have to get around all of this shit, right? If any of you [06:41.880 --> 06:45.860] have ever done Android reverse engineering before, you have personally been on this scale. You [06:45.860 --> 06:49.840] start off and you're like reading a blog post. You're like, dude, Frida is sick. I can just hook [06:49.840 --> 06:54.060] all of these functions and I don't have to do any reverse engineering. It looked like easy. [06:54.180 --> 06:58.080] But then eventually you start becoming like, I'm the real deal. I learned assembly. I can [06:58.080 --> 07:02.560] reverse engineer stuff. I can actually just figure out their custom thing and re-implement it in my [07:02.560 --> 07:06.620] own language and it's super leet. And then they do an update and it breaks all your shit and [07:06.620 --> 07:10.580] you're like, wait a minute. Every update I'm going to have to do three hours of reversing? No [07:10.580 --> 07:15.200] fucking thank you. And so you go back to Frida, right? So in this case we just skip to the end. [07:15.820 --> 07:21.340] So I wrote a custom thing to basically open the app, click through all the prompts, do an [07:21.340 --> 07:26.520] initial request and do the fun like thumb capsule sliding thing automatically. And then once [07:26.520 --> 07:30.760] it's into the state where it can start actually doing these requests, it does a Frida server and [07:30.760 --> 07:35.720] does an injection. So we can basically hand it an HTTP request that we want it to sign for us and [07:35.720 --> 07:42.180] it will return us the signed request that we can then send to their API server. So this is [07:42.180 --> 07:45.480] essentially what it looks like. You've got like a rooted phone with a server and essentially it [07:45.480 --> 07:48.840] does the signing proxying for us, right? And then we send that off over our residential proxy [07:48.840 --> 07:53.680] to make the request. And the result looks something like this. Again, cable management was [07:53.680 --> 07:59.460] not me. It was much uglier when I did it. So this gives us a good way to sort of find new [07:59.460 --> 08:02.880] sellers, right? We do searches, we get their seller IDs and now we've got a good base to [08:02.880 --> 08:08.300] actually scrape the items that we want here. So when I said that there's like no websites, that [08:08.300 --> 08:13.200] was kind of a lie. They do have a special like preview thing for ostensibly growth reasons, [08:13.200 --> 08:16.460] right? So you can like share a link in the app with somebody else and they don't have to have [08:16.460 --> 08:20.120] the app to see it. And it's like a little, it'll show you the listing information. But then when [08:20.120 --> 08:24.140] you try to buy it, right, it's like download our app. So that sounds like a great way to get [08:24.140 --> 08:29.040] around this, but there's kind of a caveat, right? The rate limiting here is severe. And I don't [08:29.040 --> 08:33.460] mean like, you're like, wow, this is like three previews, you view it and it's like, no, no, no, [08:33.460 --> 08:37.820] no more, no more previews. You've got to log in. And so this means that we're going to need [08:37.820 --> 08:42.620] like a lot of IP addresses. So even for like the crappy budget networks, this is going to be a [08:42.620 --> 08:49.460] lot of IP addresses. So I had to do a little bit of digging, pun intended. And I was like, oh, [08:49.460 --> 08:54.800] it's available over IPv6. Last time I checked, I think there's a lot more IPv6 IPs out there [08:54.800 --> 09:01.580] than IPv4. So I think there might be a solution here. So I went straight to the source for, you [09:01.580 --> 09:05.740] know, for me this is like the North American number registry, which is ARIN, right? You can [09:05.740 --> 09:11.640] apparently get a fat 36 range IPv6, right? Allocation. And it only costs like 250 bucks a [09:11.640 --> 09:15.840] year. And so with this, you actually, the number of IPs is a bigger number that I can even [09:15.840 --> 09:20.600] pronounce. But you essentially have unlimited IP space that you can now utilize. I combine [09:20.600 --> 09:23.720] this with a piece of software that my friend wrote, which essentially takes like if you have a [09:23.720 --> 09:28.240] box where you write all the IP addresses to, this turns it into like a SOCKS proxy server [09:28.240 --> 09:31.660] where every request you make to it, it will randomize it through the outbound range that you [09:31.660 --> 09:35.500] have set up, right? So now we can just start blasting from unlimited, this huge range, right? [09:35.500 --> 09:40.800] With unlimited IPs and rate limiting is, we'll call it more or less solved, right? We may never [09:40.800 --> 09:47.240] come from the same IP twice. Great. Scraping is solved. Let's talk about that second [09:47.240 --> 09:51.300] challenge, right? Again, that challenge is that the secrets that we want are probably not [09:51.300 --> 09:54.880] outright in the listing description, right? They're hidden, right? Maybe the seller doesn't [09:54.880 --> 09:59.580] even know what it is that they're selling. So how do we address this, right? The key way that [09:59.580 --> 10:05.000] we do this is via OCR, right? So there's some problems with this in practice. You've probably [10:05.000 --> 10:09.220] heard of open source solutions, but they have things like this where Apple does their very [10:09.220 --> 10:14.380] chic gray on silver design. And even some humans have issues reading this text, right? And [10:14.380 --> 10:18.760] computers are no different. When I plugged this into the open source Tesseract's model, right? [10:18.760 --> 10:23.540] It basically said, there's no text on this. I have no idea what you're talking about. So that [10:23.540 --> 10:28.740] was like not going to fly. Um, I looked at some like proprietary APIs, right? There's Google [10:28.740 --> 10:32.480] Vision. Google Vision actually did a great job. I was like, wow, it got all the text that I [10:32.480 --> 10:36.600] could, you know, want people to get out of this, right? But then I sort of looked at the pricing [10:38.320 --> 10:42.820] and I was like, oh, one penny for seven images. That's pretty good. But then I was like, wait, [10:42.820 --> 10:47.580] so for a million images, that's 1500 bucks and we're doing hundreds of millions of images. So [10:48.220 --> 10:53.120] yeah, that's not really tenable. Um, but I had sort of a eureka moment when I was actually [10:53.120 --> 10:56.920] using my iPhone. I had one of those old school captures, you know, before the current more [10:56.920 --> 11:02.140] annoying like grid ones, uh, where essentially I held my thumb down and I realized that I could [11:02.140 --> 11:07.400] actually select the warped texts and I could copy it. And I was like, wait, iOS has an OCR [11:07.400 --> 11:13.000] model? This is sick. And I could paste it and it got it exactly right. So I was like, there, [11:13.000 --> 11:18.900] there might be something here. And uh, not only is it available, you can actually like, if you [11:18.900 --> 11:22.500] just write an app, you can integrate with this API and automate it. So I wrote some of the [11:22.500 --> 11:26.920] ugliest Swift code any of you have probably ever seen and made a little HTTP server where I [11:26.920 --> 11:31.840] could send it an image and it would do OCR in English and Chinese and do barcode [11:31.840 --> 11:37.900] detection. And uh, this basically solved it. Um, but you're probably like, okay, you can use an [11:37.900 --> 11:42.340] iPhone, but that's gotta be expensive, right? Like iPhones are super expensive. But in fact, [11:42.340 --> 11:46.740] the GPU acceleration, uh, chip actually goes back as far as the iPhone, uh, second [11:46.740 --> 11:51.740] generation SE. And if you get those on like, you know, cricket wireless or some unpopular [11:51.740 --> 11:56.520] carrier, right? They're sold for as little as 40 bucks. Uh, so you can get these for super [11:56.520 --> 12:02.000] cheap and you can build yourself a high capacity OCR array. So I wired a bunch of these [12:02.000 --> 12:08.300] together, uh, and I had a high capacity array that could do around 50 HD images a second in [12:08.300 --> 12:13.140] English and Chinese, even with a lot of text and barcode detection as well. And to make it [12:13.140 --> 12:17.500] even better, it basically uses no power because the mobile, like, compute was actually super [12:17.500 --> 12:23.000] efficient. So it worked out really well. Great. So we script all this shit, we got all these [12:23.000 --> 12:26.800] images, we can do OCR on all these images, we index all of it, but now we need to know what [12:26.800 --> 12:31.340] we're looking for, right? So I started off with just looking like general examples of like [12:31.340 --> 12:36.420] prototypes and company laptops and sort of built a very early set of keywords to alert on. And [12:36.420 --> 12:39.880] when I found matches to those alerts for products that were listed, anything else on the [12:39.880 --> 12:44.580] laptops that they had, I then added those marks to my list of things to alert for, right? So [12:44.580 --> 12:48.120] maybe I had some text that was like property of, then I get a barcode and I'd see what their [12:48.120 --> 12:52.180] barcode format was and then I would add that to my rules and it's iterative, right? So every [12:52.180 --> 12:56.200] time I get more results, I'm improving my rule set and pretty soon I've got a huge alert list of [12:56.200 --> 13:00.980] keywords that when something comes up, I can immediately get notified of it. I made this a [13:00.980 --> 13:04.780] little easier by building like a nice little data lake UI so I can just type in, if I see [13:04.780 --> 13:08.360] type in a keyword, and it will immediately start showing me matching listings. So I can very [13:08.360 --> 13:14.400] quickly cook these things up. Talked about a lot of pieces overall, but this is kind of the [13:14.400 --> 13:18.940] 10,000 foot view. You've got the most convoluted set of like free to server bullshit combined [13:18.940 --> 13:25.040] with like exit proxying combined with like Elasticsearch and iPhone OCRs, but TLDR took a [13:25.040 --> 13:31.640] lot to do this with the level of data that we're doing. Overall we're talking about much more [13:31.640 --> 13:36.060] now, but probably like 50 million listings scraped, right? We're talking over 250 million [13:36.060 --> 13:42.680] images OCRed in total, right? None of the iPhones have exploded yet, very great work. I said [13:42.680 --> 13:47.060] there was only three challenges, there's actually kind of 3.5. So imagine you're selling [13:47.060 --> 13:51.000] something on eBay and some random person in like some remote province of China says, hey, [13:51.000 --> 13:54.360] could you just like ship this to me? And you'd be like, dude, I don't know how to do [13:54.360 --> 13:58.440] paperwork for Canada, let alone like, you know, this place in China, right? And it's so [13:58.440 --> 14:01.960] different if you ask somebody in domestic Chinese markets to say, hey, could you ship this [14:01.960 --> 14:06.000] to me in like, you know, Alabama or whatever it is, right? So we kind of have to figure out [14:06.000 --> 14:10.120] like, how can we work in these markets and buy from local sellers when we ourselves like [14:10.120 --> 14:12.920] don't, maybe don't speak the language, don't understand the culture and want to get it [14:12.920 --> 14:19.140] like exported to us? So where can this secret knowledge be found? Luckily, there's a [14:19.140 --> 14:22.920] community who's very familiar with the domestic Chinese market built around like really [14:22.920 --> 14:27.900] high-end fake fashion replicas. So yeah, your Gucci handbag that's like indistinguishable [14:27.900 --> 14:31.540] or whatever from the real one. There's a community that kind of focuses on basically [14:31.540 --> 14:35.080] getting these from inside of the domestic Chinese market. And they use these agents, which [14:35.080 --> 14:38.280] will actually do the work of communicating with the seller, they'll buy it and they'll [14:38.280 --> 14:41.960] actually like rewrap it for you and do all the export forms to get it to you. So we [14:41.960 --> 14:45.540] basically use the exact same stuff that they use to get these designer clothes and we kind [14:45.540 --> 14:50.900] of have this solved. So this is what you've all been waiting for, I'm sure. Let's go to the [14:50.900 --> 14:54.740] loot and see what we found here. Before we get, we'll start off with employee devices [14:54.740 --> 15:00.020] here. Before we sort of get into these, we'll dispel some very quick like, well, actually [15:00.020 --> 15:03.300] things that I'm sure you're going to want to say. And one of the common rebuttals I hear is [15:03.300 --> 15:08.000] like, sure, you can find this hardware leaking out, but it's probably all locked and it [15:08.000 --> 15:11.420] requires a passcode to access them or whatever. So there's no way that you can like [15:11.420 --> 15:17.020] actually do this, right? My rebuttal in this case is merely a slide. Obviously there's a lot [15:17.020 --> 15:25.980] more examples, but there's only so much space. Plenty of notable examples here, right? And [15:25.980 --> 15:29.580] you're like, okay, okay, okay. They're unlocked, I get it, I get it. But that doesn't mean [15:29.580 --> 15:33.460] that there's actually anything sensitive on the devices, right? And again, I only have a [15:33.460 --> 15:41.120] slide as a rebuttal. Again, many more examples, right? And if you're like, my company's not [15:41.120 --> 15:45.380] affected, if you work for a Fortune 500 company, I guarantee you I've seen your equipment end [15:45.380 --> 15:50.200] up on eBay or some other market, right? Super wide breadth of, if you do any volume of [15:50.200 --> 15:56.220] employee equipment or whatever, it's going to be here. So let's talk about the war stories. I [15:56.220 --> 15:59.780] want to actually do a quick little preface here. All of my examples are for a pretty popular [15:59.780 --> 16:04.760] company called Apple. This is not because Apple like fucked up especially. Actually, it's [16:04.760 --> 16:08.180] pretty much the opposite. They were like a mature hardware company and my point of the [16:08.180 --> 16:12.940] research targeting their stuff was more because if it affects them, we can be pretty sure that [16:12.940 --> 16:18.320] any other company is affected as well, right? They have resources to make this right. So we'll [16:18.320 --> 16:23.840] start out with the story of the time capsule. So I built up a good little database of alerts and [16:23.840 --> 16:27.880] keywords for those things and eventually I got alerted to a time capsule that was listed in the [16:27.880 --> 16:31.500] United Kingdom. And the reason why I got an alert is it had this cool sticker on the [16:31.500 --> 16:35.520] background which said property of Apple Computers, Inc. Expensed Equipment. And I was [16:35.520 --> 16:40.800] like, hmm, this might be interesting. And I looked at the description and it said this. It [16:40.800 --> 16:45.120] said, hey, it was part of an office clearance. Good sign. It's been powered up and lights up as [16:45.120 --> 16:50.100] expected but has not been tested beyond this point. This is the perfect description for if you [16:50.100 --> 16:53.900] think something is going to be good because it means the device works. We couldn't wipe it [16:53.900 --> 16:57.700] ourselves because we couldn't really get it turned on and all set up, right? But we can be [16:57.700 --> 17:02.820] pretty sure that it's at least in the original state that maybe they got it in, right? So I [17:02.820 --> 17:05.980] also did some Googling and there was actually an office clearance for Apple that like they [17:05.980 --> 17:12.560] moved offices so it seemed like it lined up. So I placed a bid. I didn't realize how big the [17:12.560 --> 17:15.380] shipping was. It was actually like almost like, it was like more than the actual device [17:15.380 --> 17:19.940] itself. So I kind of learned that lesson the hard way. But we'll take a risk. Got into the [17:19.940 --> 17:24.400] United States. After sweating with a heat gun and getting the back off and pulling the hard [17:24.400 --> 17:30.160] drive out, I was able to connect it up to my laptop to start doing like, to look at the drive, [17:30.160 --> 17:35.080] right? And initially I looked at it and I was like, oh shoot, there's no files. Looks like [17:35.080 --> 17:40.620] they deleted them. I was like, unless, unless they deleted it and they didn't actually do a [17:40.620 --> 17:44.760] secure wipe of it so maybe they're still hanging around. Let's just, just in case, let's do a [17:44.760 --> 17:50.300] forensic scan of this thing, right? So I let this thing run. That cooked for around 28 hours [17:50.300 --> 17:55.400] for 2 terabytes which is quite a while. And it turns out that's not entirely true. There was [17:55.400 --> 17:59.920] data on the device. Things like internal credentials, things like internal support [17:59.920 --> 18:06.240] tickets, sales reports and figures, internal documentation, apps, repair guides, internal [18:06.240 --> 18:13.040] emails, bank account information, passport and ID scans, and I swear this last one is true, [18:13.040 --> 18:18.500] dank internal memes from these Apple stores in Europe. There was literally an entire video [18:18.500 --> 18:23.880] done in like the Backstreet Boys style of how to count the inventory in your Apple store. I kid [18:23.880 --> 18:32.080] you not. It hurt me so much to like hand this back over. Anyways, I got this and I was like, [18:32.080 --> 18:36.860] alright, this is scary. I'm going to tell Apple about this, right? I used the only channel [18:36.860 --> 18:41.060] they had for reporting which was like their regular like sort of bug bounty reporting queue [18:41.060 --> 18:45.540] thing and said, hey, I've got this time capsule. Looks like it's from like the 2010s. It's got [18:45.540 --> 18:51.660] like a bunch of Euro store data and you probably want this. You know, I got this, I [18:51.660 --> 18:54.800] originally submitted this actually to them and I got I think some regular like product [18:54.800 --> 18:59.620] security person who's like, I do bugs. Like I don't know what this is or what I'm supposed to [18:59.620 --> 19:04.460] do with it. And he's just like, I sent an email to our internal people but there's nothing I [19:04.460 --> 19:08.040] can do with this. So I originally was like, oh, this is easiest disclosure ever. It's like [19:08.040 --> 19:13.640] already over. But then I got an email later from their GSOC in London which was like, hey, we [19:13.640 --> 19:17.300] actually do, we would very much like that drive. And you're in the Bay Area, right? Could you [19:17.300 --> 19:23.900] just like drive 10 minutes and drop that off for us? And I was like, sure. You know, lunch [19:23.900 --> 19:28.020] break, head over there, drop it off to them. And I was like, good deal. And I sent an email [19:28.020 --> 19:33.800] saying, we're all good. Disclosure's all finished. And I was like, cool. Done deal. Later [19:33.800 --> 19:38.200] on I received an update like later that night where they were like, hey, uh, any other POCs [19:38.200 --> 19:41.800] off that drive that you could send us just to assess the impact of the report? And I was [19:41.800 --> 19:46.300] kind of like, but I already gave you the drive. So like how would I, how would I do that? [19:46.300 --> 19:49.120] Because like obviously I don't have the data. I gave it back to you, right? So I was kind of [19:49.120 --> 19:53.100] like, I think it was just communication between the team, but I was kind of like a little bit [19:53.100 --> 20:01.640] like, what's the deal here? Cool. So let's talk about prototypes, right? Another one of those [20:01.640 --> 20:06.320] like main columns I mentioned. They usually look something like this, right? Lots of scary [20:06.320 --> 20:11.540] hardware labels in the back. Usually a phone number to report it being missing. And Apple [20:11.540 --> 20:15.660] actually has some pretty interesting prototypes. They're a little bit more valuable than your [20:15.660 --> 20:19.840] regular prototype that you might find. Um, here's a bunch of stuff that I was able to get [20:19.840 --> 20:23.160] over doing this research. Um, this is actually a small part of a lot of the prototypes those [20:23.160 --> 20:28.720] were able to find. Um, so the reason why Apple prototypes are a little bit more interesting is [20:28.720 --> 20:32.840] because they have something called dev fusing in a lot of their prototype versions of the [20:32.840 --> 20:37.040] iPhone, right? And you're like, what the hell is dev fusing? Essentially in a production iPhone [20:37.040 --> 20:40.680] that you buy from a store, right? They actually burn these fuses, which prevent you from being [20:40.680 --> 20:45.480] able to do debugging of the application processor and the secure enclave processor, right? And [20:45.480 --> 20:48.500] so when you do exploit development, so you've kind of heard these like million dollar or [20:48.500 --> 20:52.500] whatever iPhone exploits, having one of these phones is key because it allows you to really [20:52.500 --> 20:56.640] easily debug your exploit to make, you know, get a pull it off essentially. So there's like a [20:56.640 --> 21:00.180] big gray market spawned off of this. Apple actually has researcher devices that they'll give [21:00.180 --> 21:04.600] you, uh, if you follow a bunch of legal procedures to get yourself. Uh, but you know, [21:04.600 --> 21:07.680] there's still people that don't want to deal with that. So there's still this big gray market, [21:07.680 --> 21:11.520] right? But there's these TLDR, there's these super rare iPhones which are useful for security [21:11.520 --> 21:15.260] research, right? Um, this is sort of what that looks like. They have different fusing states. [21:15.260 --> 21:18.920] If you have the debugging cable, you can basically plug the iPhone in and say, yes, this is a [21:18.920 --> 21:27.220] deaf-used iPhone. So again, uh, on around November 23rd, 2023, I had my pipeline alerted to a [21:27.220 --> 21:31.820] bunch of listings being created at once in China. Uh, they were all iPhone 14s. And [21:31.820 --> 21:34.740] initially, you know, when I get a bunch of alerts at once, I'm like, oh, somebody's [21:34.740 --> 21:38.260] reposted their listing like eight times or whatever. But then I started to look at the photos [21:38.260 --> 21:42.260] and I was like, wait a minute, these are all distinct iPhones. This is not like one iPhone [21:42.260 --> 21:46.700] that's been repeatedly posted. Uh, so it turned out this was actually a huge cache of these [21:47.120 --> 21:52.200] prototype iPhone 14s, which at the time was the latest model of iPhone, right? So, um, this is [21:52.200 --> 21:57.800] like a video of the seller. Uh, furthermore, when I actually bought one of these iPhones and [21:57.800 --> 22:02.000] imported it here, uh, I realized that the seller, when he was sort of taking pictures to [22:02.000 --> 22:06.460] validate the camera worked, he didn't turn off the GPS tagging feature in the photos. So I [22:06.460 --> 22:11.140] actually had the exact location in China where the seller actually was. And, uh, worse than [22:11.140 --> 22:16.340] that, uh, he also took selfies to validate the camera. So in terms of like finding the source of [22:16.340 --> 22:21.040] these leaks, this is a pretty compelling way to do that, right? But I don't want to give you the [22:21.040 --> 22:24.480] wrong impression. It's not just that these, you know, prototype iPhones will only come from [22:24.480 --> 22:28.060] like, you know, wherever in China that they're made. Actually, ironically, so I live in the [22:28.060 --> 22:31.900] Bay Area, it's either in these remote provinces of China or it's a 10 minute drive from my [22:31.900 --> 22:36.320] house with very little in between. So in this case, like this was one that was leaked in, uh, [22:36.320 --> 22:42.040] San Francisco, right? It's a DVT model iPhone 14 and it did indeed have dev fusing, right? The [22:42.040 --> 22:45.640] most hilarious part about this actually is that the sellers oftentimes when they have these, [22:45.640 --> 22:50.160] they try to do like a regular restore of the device, only to realize like, this is a weird [22:50.160 --> 22:53.700] iPhone, I can't restore this, I have no idea what's going on here. They're just like, I'll [22:53.700 --> 22:58.260] sell it for parts, whatever. And so the listings are sold usually for parts when it's actually [22:58.260 --> 23:03.960] like a very, you know, expensive prototype iPhone, right? Cool. So we kind of covered a [23:03.960 --> 23:07.460] couple examples here, we talked about time capsule, we talked about these rare prototype [23:07.460 --> 23:11.820] devices, right? Let's go to the thing, the place where these things are made, right? So in this [23:11.820 --> 23:17.260] case the assembly line is Foxconn for Apple for the most part, right? So I looked at a lot of [23:17.260 --> 23:21.420] these Chinese listings, uh, things that had like, you know, a bunch of labels that appeared to [23:21.420 --> 23:25.020] be related to Foxconn, right? And I started to realize that there was a pattern that was [23:25.020 --> 23:29.020] starting to emerge when I looked at these things, right? So if it's used inside of Foxconn, I [23:29.020 --> 23:33.160] started to realize that, hey, it usually has this like, you know, three letter, four letter, six [23:33.160 --> 23:38.180] digit combo thing that they use to label like, internal equipment. And so I created a quick [23:38.180 --> 23:41.920] rule that anytime something like this shows up in China, why don't you let me know and I'll [23:41.920 --> 23:46.320] take a look at it, right? I'm sure all of you can sort of see where this might be going. Uh, [23:46.320 --> 23:51.860] sometime later, I got an alert for a listing like this, uh, for only 188 yuan. This is like [23:51.860 --> 23:57.360] 28 dollars, I think, in USD. And uh, when I took a closer look at it, it had all the markings [23:57.360 --> 24:02.360] that I wanted. Uh, and I looked at the bottom of it and there was an interesting hole drilled [24:02.360 --> 24:06.840] in the bottom. And I was like, oh, okay, so, like, they basically took a drill press to this [24:06.840 --> 24:11.440] thing to like, securely destroy it and, you know, what, get rid of the hard drive. Um, but [24:11.440 --> 24:14.500] then I thought about it a little bit more and I was like, wait a minute, let me look at a [24:14.500 --> 24:17.860] schematic of what this looks like inside. And I was like, okay, so like, the hard drive is [24:18.600 --> 24:24.260] here, and uh, that means the magnetic platter is here. And they drilled the hole, like, [24:24.260 --> 24:36.260] here. There might be a chance. And this is one of those things where I'm like, there's no way, [24:36.260 --> 24:41.240] but it would be too cool if it works. So I bought it, brought it into the United States, again, [24:41.240 --> 24:44.860] you know, uh, disassembled it, pulled the hard drive out, I looked inside and I saw that [24:44.860 --> 24:50.460] beautiful orange PCB color, and I was like, I think they might have missed it, but let's, let's [24:50.460 --> 24:55.280] send it to the experts. Uh, so, I shopped around a little bit, found a cheap lab down in L.A. [24:55.280 --> 24:58.820] to, to, that said, hey, they gave me the honest answer, which is exactly what I was looking [24:58.820 --> 25:03.100] for, where they were basically like, alright, listen, you drilled a hole in the damn thing, [25:03.100 --> 25:06.560] like, if, if you did that, and you didn't turn it on, and there's not a bunch of dust and all [25:06.560 --> 25:10.520] these other things, then yeah, I think we can recover it, but don't get your hopes up, like, be [25:10.520 --> 25:15.020] aware, right? So I sent it down to them, they basically after some time came back to me and [25:15.020 --> 25:18.360] they said, hey, uh, you know, we, we popped this thing open, it looks like it just hit the [25:18.360 --> 25:22.560] PCB, and, uh, in order to recover it, we basically had to buy a working drive, go into a [25:22.560 --> 25:26.980] clean room, and swap the magnetic platter from one to the other. Obviously, after getting this [25:26.980 --> 25:31.320] email, I was like, so just to be clear, you're saying they did miss the magnetic platter, and [25:31.320 --> 25:35.660] they were like, yep, it pretty much missed everything, uh, so, it looks like there might be a [25:35.660 --> 25:40.400] chance here, there's not a lot of dust even on the platter, so, I think we might be good. [25:40.400 --> 25:45.060] Sometime later, I got the email that I was looking for, where they said, hey, I got 99.99 [25:45.060 --> 25:51.820] whatever percent of the data, and I was like, oh, yeah, it's all coming together. But I was [25:51.820 --> 25:55.380] still, like, if you do a lot of this research, you always try to, like, hold off on being too [25:55.380 --> 25:59.000] excited, because your dreams have been crushed too many times by it not working out, so I was [25:59.000 --> 26:02.240] like, you know, maybe, maybe somebody actually bought it, reused it, and then they drilled the [26:02.240 --> 26:07.460] hole in it, so, like, you know, maybe it's not actually the real thing, but it was. Uh, these [26:07.460 --> 26:11.060] are the wallpapers from it being used on the factory line, it was used to do Q&A, [26:11.060 --> 26:15.520] for, actually, a couple things it looked like, but for iPad Q&A, it looked like. Uh, it came [26:15.520 --> 26:19.480] along with a bunch of really tasty internal Apple software for sort of interfacing with their [26:19.480 --> 26:23.920] prototype devices and doing Q&A on the line, all of that good stuff, right? It came with [26:23.920 --> 26:28.720] internal credentials for the Foxconn factory, and a bunch of other cool stuff. A lot of cool [26:28.720 --> 26:31.840] Apple tooling, too, with a bunch of, like, you could tell engineers came up with the name of [26:31.840 --> 26:37.540] these tools, right? Like, footing, whatever, so. Uh, another funny story about this one is [26:37.540 --> 26:40.400] when I gave this one to Apple, like, the first time there was a lot of mis- there was a lot of [26:40.400 --> 26:43.780] miscommunication when it came to the time capsule, like, back and forth to coordinate it. The [26:43.780 --> 26:47.320] second time, I was like, hey, I've got this random drive from the Foxconn line, I've got this [26:47.320 --> 26:50.740] forensics, I've got all this data, I want to give it back to you, they were just like, here's a [26:50.740 --> 26:55.360] prepaid FedEx envelope, you just drop that shit in the mail, get it right to us. I was like, [26:58.760 --> 27:03.300] sweet. Great. So we've got some cool POCs, we kind of show off the problem, right? Let's go [27:03.300 --> 27:09.560] into, like, maybe what are the high-level, like, takeaways of this whole stuff, right? Uh, so [27:09.560 --> 27:13.300] one thing that's kind of interesting is, like, this is not like, you know, you think of, like, [27:13.300 --> 27:17.300] the conventional hacking stories and sort of, like, um, you know, cracking code or whatever, [27:17.300 --> 27:21.220] but this research raises kind of an interesting question, which is, like, have I done anything [27:21.220 --> 27:24.860] sort of unethical or wrong here, right? If you talk about the source of a lot of these other [27:24.860 --> 27:28.240] prototypes, we're talking about pretty illicit stuff, right? They're paying somebody, I assume, [27:28.240 --> 27:31.880] to take it off the factory line or whatever it is. But we're not, we're not doing that. We're [27:31.880 --> 27:35.640] just literally looking for public listings. We come to the table with a little bit more [27:35.640 --> 27:39.380] information about what is in those, like, listings and what it actually means, right? And [27:39.380 --> 27:43.020] ostensibly they would have been sold anyways, but we just instead buy it in the first place, [27:43.020 --> 27:47.220] right? So have we, like, really done anything wrong? You know what I mean? So it's just a very [27:47.220 --> 27:52.880] interesting question there. Um, I think another potentially interesting takeaway here is, you [27:52.880 --> 27:56.180] know, you're probably more familiar when we have, like, very standardized, uh, full disk [27:56.180 --> 28:00.220] encryption and mobile device management for, like, the standard set of things. So you get your [28:00.220 --> 28:04.660] work laptop, things are pretty well understood there. You have your, like, work phone, MDM [28:04.660 --> 28:07.880] solutions, FD solutions are pretty straightforward. But then when you get into the more [28:07.880 --> 28:11.700] custom hardware side, you don't necessarily have that level of maturity. I think it's like the [28:11.700 --> 28:15.280] time capsule, right? It's like, is there a clear suite that can, that can actually do, ensure [28:15.280 --> 28:18.680] that these things work the way that you expect? And so I would assume that this probably [28:18.680 --> 28:22.200] extends to any other type of custom hardware where you don't have this very standardized [28:22.200 --> 28:27.660] format of software to protect this. This one is probably obvious for anybody who's done [28:27.660 --> 28:32.020] anything related to hardware or who lives through COVID. Uh, supply chains are incredibly [28:32.020 --> 28:35.700] difficult, right? You've got multiple sides of the globe on different time zones doing [28:35.700 --> 28:39.440] iterations on hardware. And it's not like software where you're halfway through and you're [28:39.440 --> 28:43.140] like, ah, let's just can all this and rewrite it. You're kind of, your parameters are slowly [28:43.140 --> 28:46.820] narrowing and you've got to like, uh, throughout all this time, make sure none of them leak [28:46.820 --> 28:49.740] out and everything's securely destroyed and all this stuff, right? You've got to keep [28:49.740 --> 28:53.820] everybody super tight-lipped. So it's very challenging to do this, right? Across many [28:53.820 --> 28:59.240] countries and to deliver this final product. Another interesting point, as you noted with [28:59.240 --> 29:04.200] one of these examples, is leaks very much point to sources. So you mentioned, like, we [29:04.200 --> 29:08.060] found listings where these things sort of bubbled up, right? And we can then take those to go to [29:08.060 --> 29:11.560] the sellers to figure out, like, what's the real story here? Where did this shit actually come [29:11.560 --> 29:15.020] from? And we can start to understand a full picture of, like, where is my stuff breaking [29:15.020 --> 29:19.120] apart? How is this stuff leaking out, right? So it becomes a very good opportunity to sort of [29:19.120 --> 29:24.340] identify these sources and ultimately close them if you're the company. I think another [29:24.340 --> 29:27.980] really interesting piece of this, too, is I would say that, like, e-waste is a particularly [29:27.980 --> 29:31.800] interesting point, right? So if you have your stuff going to e-waste, a lot of people sort of [29:31.800 --> 29:35.300] assume, like, oh, it's going to be destroyed. But then you get people who are at the e-waste [29:35.300 --> 29:39.460] side who are, like, why are they throwing away 50 good iPhones? Like, this could be [29:39.460 --> 29:44.140] resold right now. Like, it's very strange, right? And so a lot of these, I think, leaked out [29:44.140 --> 29:47.760] from sort of e-waste recycling centers, right? And this is what causes these problems. So you [29:47.760 --> 29:51.280] got to make sure that, like, your stuff is actually being destroyed and not being, you know, [29:51.280 --> 29:57.880] essentially diverted and potentially resold. I just want to give a quick special thanks to [29:57.880 --> 30:02.120] Apple Demo. He does a bunch of iPhone prototype stuff. Check out his YouTube for helping me [30:02.120 --> 30:06.300] sort of the initial research and understanding of this space. And I'd like to thank all of you [30:06.300 --> 30:07.400] for coming to this.