[00:00.000 --> 00:07.780] Thank you, everyone, for coming. This is our penultimate talk of the day. This is Dennis. [00:07.780 --> 00:12.640] He's going to be doing a talk on, you know, privacy leaks by dumpster diving, more or [00:12.640 --> 00:19.160] less, correct? Yeah. So if you ever get, you know, cool technology at eBay or the Goodwill [00:19.160 --> 00:24.720] store or in the dumpster, maybe there's some stuff that got left over even after like a [00:24.720 --> 00:28.180] factory reset. So he's going to get into all that today. I think it's going to be pretty [00:28.180 --> 00:35.320] cool. Can everyone in the back hear me okay? If I talk like this, would you really hear [00:35.320 --> 00:42.500] me okay? Okay. So you have to talk as loud as that. Because he's going to start talking [00:42.500 --> 00:47.420] and he's going to be like, can you hear me? It's pretty good talk, right, guys? See? Negative [00:47.420 --> 00:50.800] thumbs. So you got to get real close. Are you ready? [00:50.800 --> 00:59.660] All right. I try. Can you hear me in the back? Yes, maybe. Should I speak louder? Loud enough? [01:01.080 --> 01:09.560] What about now? Yeah, okay. Great. All right. So welcome to my talk about privacy leaks [01:09.560 --> 01:13.840] in smart devices. The introduction was mostly correct in terms of like dumpster diving. [01:13.840 --> 01:20.280] What I do more is like shop on Amazon warehouse deals or like eBay. And the main idea of this [01:20.280 --> 01:26.560] talk is to speak about the extraction of data of used smart home devices. So the outline [01:26.560 --> 01:30.980] for this talk is the following. I start with the motivation. Then I will speak about how [01:30.980 --> 01:36.260] data is stored or what kind of data is stored on IoT devices. Then how is it stored and what [01:36.260 --> 01:40.840] kind of reset states you can imagine if you get like a used device. What kind of data is [01:40.840 --> 01:47.200] maybe there or won't be there. In the next topic, I will talk about the data extraction [01:47.200 --> 01:51.420] methods. So how you get the data off the device. And later on, I will have some example [01:51.420 --> 01:56.280] devices where I will tell you how I got the data off and how I found, for example, like the [01:56.280 --> 02:00.740] previous owner of that. So some information about me. I'm a PhD student at Northeastern [02:00.740 --> 02:05.080] University and I'm working there with Professor Gibraltar Beer. So we're doing mostly wireless [02:05.080 --> 02:10.060] security but I'm kind of into this IoT stuff. I'm also right now a grad student at DTU [02:10.060 --> 02:14.180] Darmstadt in Germany. I'm working there with Matthias Horlich. And my main interest is [02:14.180 --> 02:19.380] like reverse engineering with any kind of interesting devices. It can be nearly everything. [02:19.420 --> 02:24.820] But at the moment it's more like IoT and smart locks. But I do also physical locks which is [02:24.820 --> 02:30.180] kind of like the same thing. And so you find me also in the tool lockpicking village. Some [02:30.180 --> 02:34.800] side notes about my talk. It's not a Xiaomi bashing talk. So maybe some of you know me from [02:34.800 --> 02:39.680] last year where I was giving a lot of talks about Xiaomi. The problem is I have a lot of [02:39.680 --> 02:44.100] these devices so basically I need to talk about them. Most of the methods I present are [02:44.100 --> 02:49.300] already known and used for other things. There are some ethical and legal questions in this [02:49.300 --> 02:54.380] presentation so I had to censor most of the data and like mock it up a little bit. If you use [02:54.380 --> 02:58.220] any of the methods, for example if you want to do like BGA on soldering and you break it then [02:58.220 --> 03:04.780] it's kind of on you. I'm not responsible for that. And a lot of technical aspects I totally [03:04.780 --> 03:09.680] simplified. So basically NAND flash is way more complex but I did it for the sake of the [03:09.680 --> 03:14.160] talk to simplify. And there's particular things which are out of the scope of this talk. For [03:14.160 --> 03:19.920] example how to interpret NAND data or reassemble it or for example how to do device specific [03:19.920 --> 03:25.380] routing. I mean there's a lot of manuals out there so I won't cover that. So let's start with [03:25.380 --> 03:31.580] the motivation of this talk. Traditionally we had like nearly forever like the problem that [03:31.580 --> 03:36.440] there's a lot of second hand devices which still contain data. This issue literally existed [03:36.440 --> 03:40.980] forever since the hard drive exists. But I think it was increased as soon as people started to [03:40.980 --> 03:45.960] buy or sell hard drives on eBay. And most of those hard drives on eBay they still contain [03:45.960 --> 03:52.040] data like some personal information, emails, pictures or any other media. Sometimes even [03:52.040 --> 03:55.740] sensitive documents if the government sold hard drives. And the awareness for this kind of [03:55.740 --> 04:00.880] topic was raised like in the beginning of the 2000s. There was for example like a paper where [04:00.880 --> 04:04.880] the researchers analyzed like what kind of data is still there and what you have to do to [04:04.880 --> 04:10.680] basically get rid of all the data. Interestingly this not only affected like computers but it [04:10.680 --> 04:14.700] also affected like multi-function printers or lab instruments. And the NIST kind of [04:14.700 --> 04:19.400] recognized that in 2006 and they published a standard how to kind of wipe your devices to get [04:19.400 --> 04:23.360] rid of the data. And some of the solution was for example like you need to wipe your device [04:23.360 --> 04:29.640] and actually verify it or you sell devices without hard drive and destroy the hard drive like in [04:29.640 --> 04:34.400] the one picture which is like the example there we just shredded. But there was still like a [04:34.400 --> 04:39.540] big problem and the problem was that the lack of knowledge and awareness of the user. So for [04:39.540 --> 04:44.080] example most of the people didn't know how to securely erase hard drives. They format their USB [04:44.080 --> 04:48.360] stick and they thought like okay everything is fine. Some people didn't care. They said like [04:48.360 --> 04:52.800] yeah I have nothing to hide. And there's one particular problem if you have a broken device. For [04:52.800 --> 04:57.060] example a broken laptop. Most people don't know how to remove the hard drive and to format it. [04:58.440 --> 05:02.520] For a long time I thought this problem was actually kind of solved but this year there has been [05:02.520 --> 05:07.580] like a study where someone bought like 159 hard drives from Ebay and 66 of them still contain [05:07.580 --> 05:12.220] data. So it's like still apparently like an issue. The whole problem become a little bit more [05:12.220 --> 05:16.640] interesting with smartphones because smartphones also contain a lot of data. Sometimes even [05:16.640 --> 05:21.880] more than your personal computer. Pictures. All kind of pictures. Messages, accounts, [05:21.880 --> 05:26.300] credentials, call lists. And one thing which people didn't know for a long time is that the [05:26.300 --> 05:31.360] phones are not encrypted by default. At least not up to 2014, 2015. So very long time the phones [05:31.360 --> 05:35.800] were not encrypted. And this was, this was only introduced with iOS 8 for example by Apple in [05:35.800 --> 05:41.720] 2014. Or with Android 6 in 2015. There have been some researchers who didn't analyze on like [05:41.720 --> 05:47.520] um how the devices uh do the um factory reset and they figured out that most devices actually [05:47.520 --> 05:51.500] don't do it correctly but still there's a lot of data. And this was kind of addressed again by [05:51.500 --> 05:56.480] NIST in 2014. They figured out okay smartphones is a big risk so um we should address that in [05:56.480 --> 06:03.520] this new standard. So now the next topic comes with IOT. Um IOT in contrast to smartphones and [06:03.520 --> 06:09.680] uh PCs has like a big difference. And um there's literally no a small or like no user [06:09.680 --> 06:15.300] interface um available. So as a user you cannot really access directly the data which is on a [06:15.300 --> 06:20.120] device. Like you go in the file browser or something and look at that. Um so you don't know [06:20.120 --> 06:24.440] what kind of data is also collected by this device. So um you literally don't know anything [06:24.440 --> 06:28.740] about your device. If you do a factory reset then you cannot really verify that this device is [06:28.740 --> 06:33.120] really empty. Um the other thing is you kind of don't know what kind of implementation of the [06:33.120 --> 06:37.600] factory reset was done by the vendor. So and this depends from vendor to vendor, from device to [06:37.600 --> 06:41.080] device, and sometimes even from one version to another. So you could have a version which does [06:41.080 --> 06:45.980] it correctly and then the next version may do something completely different. So the main [06:45.980 --> 06:50.160] motivation for this talk is um when I was writing my master thesis uh at XAML and uh was [06:50.160 --> 06:54.740] analyzing a lot of security uh the security of a lot of uh IOT devices. I had to do like a [06:54.740 --> 06:59.020] lot of root access methods and had to factory reset them regularly. And I figured out every [06:59.020 --> 07:02.940] time I do a factory reset with this device all the data is still there or there's still data [07:02.940 --> 07:07.300] left. So I was kind of figuring out like hey maybe I should look into that. Um another [07:07.300 --> 07:11.940] important thing is um not only we as kind of hackers are interested in the data but other [07:11.940 --> 07:15.860] people are also uh interested in the data. And this is like an example from Germany where the [07:15.860 --> 07:20.540] police figured out like hmm smart devices that might be interesting to look at like for [07:20.540 --> 07:26.760] forensic to solve crimes. Um so more and more people come now on the idea to um actually do [07:26.760 --> 07:33.020] forensics analysis of um IOT devices. Um so this kind of talk is about like if you get a [07:33.020 --> 07:36.800] used device or if the cops bust your door and actually take your device so what kind of data [07:36.800 --> 07:43.080] you can expect there. Alright, let's talk about the data on IOT devices. Um in general the [07:43.080 --> 07:46.420] data that you find on a device is basically dependent on the device type. There's different [07:46.420 --> 07:50.600] device types which contain more or less data. However there's one important thing which is [07:50.600 --> 07:54.680] like the same for all IOT devices and this is basically we need to have Wi-Fi credentials. [07:54.800 --> 07:59.480] Without Wi-Fi credentials it's not IOT because it cannot connect to the internet. Um the [07:59.480 --> 08:02.880] other thing what you most of the time have is like some kind of cloud credentials because the [08:02.880 --> 08:07.280] device needs to authenticate itself against the cloud to like upload data to download data [08:07.280 --> 08:12.400] whatever. Um as a rule of thumb what I found is the more performance functions or storage [08:12.500 --> 08:17.380] a device has the more data is on it or will be collected. So it is like a thing if you have a [08:17.380 --> 08:22.060] very powerful device you can expect it to definitely collect something. So let's start with [08:22.060 --> 08:25.880] the first kind of group of devices and this are the vacuum cleaning robots which most of the [08:25.880 --> 08:30.360] time additional to create the credentials contain uh connection log files, maps, cleaning [08:30.360 --> 08:36.100] logs, user IDs. And you see like an example for like um uh like a map um like there on the [08:36.100 --> 08:39.840] screen. Um I did an analysis over a lot of vacuum cleaners. I have a lot of vacuum cleaners [08:39.840 --> 08:44.760] you see like a small collection there but I have even more. So I had a lot of fun with them. [08:45.140 --> 08:49.900] Um another second group is smart home gateways. Um this can be anything which controls any [08:49.900 --> 08:55.300] functions in your home. Um they also connect uh contain um connection log files, sensor [08:55.300 --> 08:59.120] actuators, binding bindings. So for example if you have like any sensors in your home they [08:59.120 --> 09:03.400] know obviously what kind of sensors you have. Sometimes they collect also data in terms of [09:03.400 --> 09:07.020] like if sensors are triggered like temperature sensors you have like log files about [09:07.020 --> 09:11.620] temperatures in your home. Um depending on the device you might have also key material on it [09:11.620 --> 09:19.460] or like user ID again. The next group, cameras. Um here again depending on what kind of [09:19.460 --> 09:24.840] camera you have um it might contain uh cache snapshots or video clips, recorded video, event [09:24.840 --> 09:28.880] logs. For example if you have this nice uh doorbell cameras and they detect if someone is [09:28.880 --> 09:32.780] in front of it then most of the time this device is sometimes or sometimes this device is [09:32.780 --> 09:38.840] locked that. Um it might contain again user IDs and for for cameras in particular they might [09:38.840 --> 09:43.600] have a cloud storage credentials because we need to upload like uh video files to some kind [09:43.600 --> 09:49.700] of space and um sometimes you can use the storage credentials to download data again so it's [09:49.700 --> 09:54.860] like depends on the device. Another thing which is not directly smart home but uh which is [09:54.860 --> 10:00.340] also important are routers. Um you can buy a lot of routers out of ebay by the way. So um [10:00.340 --> 10:05.940] people update them on a regular base but what they forgot is forget actually is to erase them. [10:06.080 --> 10:10.400] And interesting information for example is there a DCP leases so you see the MAC address to IP [10:10.400 --> 10:15.400] binding, you see time stamps, you see like log files you can potentially track down like when [10:15.400 --> 10:19.260] this person is home or not home because if you go home your smart phone is logging into your [10:19.260 --> 10:23.880] wifi so this kind of stuff is still stored in your device. Firewall configurations if you have [10:23.880 --> 10:29.440] any interesting service behind um like your firewall. Media files where it's like very [10:29.440 --> 10:35.300] powerful like media routers um which contain also like media files and all kind of other log [10:35.300 --> 10:40.040] files. Connections, DNS, some people activate actually DNS logging on their router and sell [10:40.040 --> 10:44.320] it later which is maybe not the best idea because you see all the DNS requests and especially [10:44.320 --> 10:48.740] parents are a little bit paranoid and set like um children like you know parenting filters [10:48.740 --> 10:54.100] and other things, other stuff. And also other credentials so some people put whatever in [10:54.100 --> 10:59.880] their router. Another interesting example, media players. Um this is a kind of a critical [10:59.880 --> 11:06.380] thing for me. Um so they contain again um connection logs, sometimes uh or most of the [11:06.380 --> 11:12.120] time media libraries, playlists, caches, um some people are using this kind of devices also [11:12.120 --> 11:16.200] for in their home to browse on a TV so basically we have Firefox or some other browser [11:16.200 --> 11:20.720] installed, we have e-mails installed and so on and they contain also um credentials like for [11:20.720 --> 11:24.800] Google Play Store or for network shares so people are using them for network shares. Um [11:24.800 --> 11:29.540] there's one important thing which I have to change in my presentation um and it's basically [11:29.540 --> 11:35.340] for ethical reasons I need to skip this device because uh this device contains um interesting [11:35.340 --> 11:40.780] information or interesting pictures let's say so. Um with a very interesting taste. Um I [11:40.780 --> 11:45.140] heard from someone else that um this is not that uncommon that someone bought a [11:45.140 --> 11:50.100] PlayStation 3 and it contained also like a lot of adult movies and whatever. Um another [11:50.100 --> 11:54.740] thing which I added also um are toys. Um most of the people don't know that toys can also [11:54.740 --> 11:59.640] record a lot of data. For example I have this nice drone. Um and this device can also like [11:59.640 --> 12:04.580] record uh audio and video data and if you crash it you have no way to reset it and most of [12:04.580 --> 12:10.040] the time like this device you cannot reset it anyway in the first place so yeah. Right. Um [12:10.040 --> 12:13.660] this is like a little bit more technical now, the storage of um IOT devices but this is [12:13.660 --> 12:17.860] like a little bit um this is actually important to understand why you kind of screwed up in [12:17.860 --> 12:23.400] particular situations. Um if you talk about storage on IOT devices you have um more or less [12:23.400 --> 12:28.900] 2 kinds of flash types which you use. You use the raw flash um and the block devices. Um for [12:28.900 --> 12:34.980] raw flash the typical things which most of you probably know or see in IOT devices is SPI [12:34.980 --> 12:40.180] flash uh which can come in 2 flavors NAND and NOR. For this presentation we just stick to [12:40.180 --> 12:45.360] NAND and uh the parallel uh NAND flash. Parallel NAND flash is in the green box more or [12:45.360 --> 12:49.720] less space also like different flavors of that. Uh the other group are the block devices which [12:49.720 --> 12:55.880] are EMMC, EMCP which is like in your smartphone or SD cards. And depending what kind of uh [12:55.880 --> 13:01.760] storage type you have chosen it affects more or less the um the selection of file systems [13:01.760 --> 13:05.540] which you can use for your IOT device and this becomes more or less later uh this becomes [13:05.540 --> 13:11.040] important later for the forensic analysis. Um let's start first with the with the raw NAND [13:11.040 --> 13:15.760] flash. Um if you have SPI flash for example most of the time it's like smaller than 64 [13:15.760 --> 13:21.140] megabyte and you see it like in small packages like um let's see like in this kind of uh like [13:21.140 --> 13:27.480] 8 pin package. If you have bigger uh sized uh NAND flash then um it's most of the time like [13:27.480 --> 13:33.100] parallel NAND flash. It's a raw NAND and um this can vary from 128 megabyte to 4 gigabyte and [13:33.100 --> 13:38.740] it can come in all kind of different like uh packages like BGA or TSOP or whatever. Um the [13:38.740 --> 13:44.340] reason why vendors are liking or love this kind of flash is because it's cheap and fast. Um but [13:44.340 --> 13:47.840] the problem with that is that it has uh that it produces a lot of bit errors which you need to [13:47.840 --> 13:52.320] correct. And you see on the right how the access is going so basically we have the raw NAND flash [13:52.900 --> 13:56.980] and um this is connected to the host processor and the host processor in this case need to take [13:56.980 --> 14:01.940] care of their leveling, the ECC correction, and the bad block management. If you work with [14:01.940 --> 14:06.360] Linux this is usually done by the memory technology devices subsystem which takes care of [14:06.360 --> 14:10.400] that and it's basically converts the character device into a block device and it kind of takes [14:10.400 --> 14:16.420] care of all the things for you. Um if you take a closer look like to the properties of NAND [14:16.420 --> 14:20.740] flash um then what you see at some point is that it's organized in blocks which are then [14:20.740 --> 14:27.060] organized uh like in blocks and pages and a block contains multiple pages. The problem with [14:27.060 --> 14:31.640] NAND flash is if you want to erase data you need to erase a whole block which contains a lot [14:31.640 --> 14:37.640] of pages. Um and erasing of a block means basically you set all the things to one. Um the [14:37.640 --> 14:42.960] typical size of these blocks are between 16 and 512 kilobyte so if you want to erase like one [14:42.960 --> 14:48.340] particular small area of memory then you need to erase like 512 kilobytes and you need to copy [14:48.340 --> 14:53.320] them somewhere. Interestingly the programming works on page level so the programming you can [14:53.320 --> 14:59.080] do it on uh on 2 kilobyte but if you want to erase it you need to erase a big block. Um the [14:59.080 --> 15:04.900] other thing in addition to the data um space there's also like an out of band data um space [15:05.420 --> 15:11.620] which is uh for management and for ECC reasons. Um because NAND flash is so unstable a lot of [15:11.620 --> 15:16.980] vendors are adding a lot of some like 2% of uh additional blocks for spare so if um if you [15:16.980 --> 15:21.160] have like a lot of bad blocks then basically they are used for that. And again like I said the [15:21.160 --> 15:25.960] ECC is computed by the host CPU and the problem here at some point is that depending on what [15:25.960 --> 15:30.560] kind of host CPU you use or NAND controller it can do particular computations differently so [15:30.560 --> 15:37.260] you you cannot really swap one flash to another maybe like and read it out. So let's talk [15:37.260 --> 15:41.720] about rare leveling of raw flash. Um and the problem of uh raw flash is basically that [15:41.720 --> 15:46.280] individuals flash cells have very limited uh uh lifetimes and writes. So you can write on [15:46.280 --> 15:52.600] one cell only 1000 times. And file systems like X2, X3, X4 are not uh rare leveling aware. So [15:52.600 --> 15:58.900] basically if you run an X2 or X3 system uh file system on a NAND flash uh without any other [15:58.900 --> 16:02.920] layer in between it will just destroy it with like multiple writes as soon as you write too [16:02.920 --> 16:06.560] much. And the solution for that is basically that you have flash aware file systems or [16:06.560 --> 16:11.020] additional layer. So on the right side you see like one example you might have like a um [16:11.840 --> 16:15.700] JFFS2 for example is like a file system which is like flash aware which works on a partition [16:15.700 --> 16:20.420] layer. A level. And um the other thing which you can do is like you can add an additional [16:20.420 --> 16:24.600] level between the flash and the file system. And this is um an example for that is like [16:24.600 --> 16:30.860] UBI or UBF- UBFS. And this works on the whole level. There's a particular pro and cons for [16:30.860 --> 16:33.740] the decision but this is like more or less depends on the vendor what they want to do. This [16:33.740 --> 16:37.760] is not that important for now. But uh the thing here is that the support for the bad block [16:37.760 --> 16:41.620] management and rare leveling is again done in the operation system. And the main idea of [16:41.620 --> 16:46.960] that is um of this rare leveling in particular. Um deleted blocks are not erased because that [16:46.960 --> 16:52.720] would cause again like many rights. Instead they are just marked as dirty or deleted. And [16:52.720 --> 16:57.440] uh the actual change information is copied into a new block. And at some point if necessary [16:57.440 --> 17:00.940] the garbage collector will take care of like the old data. But if you don't need to take [17:00.940 --> 17:07.320] care of it then it stays there. I did the graph for that. Um so this is again simplified. [17:07.320 --> 17:12.480] So um bear with me. It's like uh not totally correct in terms of like terms. Um but imagine [17:12.480 --> 17:16.940] we have like a data block. This one which we want to change. And it's assigned to the [17:16.940 --> 17:22.000] um use block um the physical use block there. And now what happens is if you want to change [17:22.000 --> 17:26.940] it the original the old use block is red. Then the information with the modified information [17:26.940 --> 17:33.220] is written to a new free block. Um the link is more or less um set to the new block. And [17:33.220 --> 17:37.840] the old block is just marked as dirty. And the important thing here is the data is still [17:37.840 --> 17:42.560] present. The data is not erased. It's still there. Um the interesting thing in particular [17:42.560 --> 17:46.980] for IOT is if you if you change a particular file more often then you have more more and [17:46.980 --> 17:53.820] more copies of that. So uh the thing is you have multiple copies on flash. Um and this [17:53.820 --> 17:57.280] data is also not erased as long as this whole block is not erased. And if you have some [17:57.280 --> 18:01.900] data in there which is never touched then it's probably never erased. Um the interesting [18:01.900 --> 18:06.220] thing for us is uh to reverse engineer or like to extract data is basically that the [18:06.220 --> 18:10.660] copies have like a size bigger than 2 kilobytes. So you can put like a text file, credentials [18:10.660 --> 18:15.320] file, whatever into that. And the more data gets changed, for example log files or [18:15.320 --> 18:20.120] wi-fi credentials or pictures, uh the more copies you have in NAND flash. So basically it's [18:20.120 --> 18:25.920] like kind of like a backup just without being a backup. Um so this was super simplified. If [18:25.920 --> 18:30.640] you are more interested in that there's a great talk uh from the back at USA 2014 about [18:30.640 --> 18:34.680] reverse engineering flash memory for fun of fun and benefit from Matt O. And you have [18:34.680 --> 18:38.340] given like an introduction into the communication protocol of NAND. Um the soldering [18:38.740 --> 18:44.040] of NAND flash and how to reverse engineer the um NAND formats. Uh another interesting talk [18:44.040 --> 18:50.120] is also like from uh or it's a block entry actually uh from NAND chips to files. Um from uh [18:50.120 --> 18:55.920] John Michael Picotte. And uh there's also like a recommended thing. As a side note, by the [18:55.920 --> 19:00.900] way, even vendors of devices are not aware of particular features of their file systems. For [19:00.900 --> 19:05.400] example, this is like from uh this is an example from my talk last year at DEF CON. Um where [19:05.400 --> 19:10.880] developers leaked actually like a key um where developer keys in the JFFS2 file system. So [19:10.880 --> 19:14.780] they basically deleted the file and just imaged the whole file system and put it on millions of [19:14.780 --> 19:18.820] devices. And all the millions of devices still had like somewhere the fragments of the key. So [19:18.820 --> 19:26.020] even vendors are not safe from that. Let's talk about block devices. Um so block devices are [19:26.020 --> 19:32.180] in general known as managed NAND. Um they have multiple standards uh uh EMMC4, EMMC5. The [19:32.180 --> 19:36.740] higher the standard, the more difficult it gets for us as reverse engineers or like forensics. Um [19:36.740 --> 19:42.000] the classical thing that most people know is like EMMC. And uh EMMC in tech- technically [19:42.000 --> 19:46.760] speaking is a flash with integrated controllers. So basically the controller is like on the chip. [19:46.760 --> 19:50.320] So it's not necessary anymore that you have- that you do the bare leveling or the other things [19:50.760 --> 19:57.680] in like in uh like on the operation system. Um another flavor of um of this kind of uh memory [19:57.680 --> 20:02.220] is EMCP. And this is typical things which you find on your smartphone. Um because it's [20:02.220 --> 20:07.200] basically EMMC with an additional DRAM on one chip. And the advantage is you- for the vendor [20:07.200 --> 20:11.080] for supply chain basically you have only one chip. It contains DRAM and flash at the same [20:11.080 --> 20:15.460] time. You see it gets a little bit more complicated with the pins down there. Um under [20:15.460 --> 20:20.240] Linux, this devices are kind of seen as normal block storage devices like an SD card. And so [20:20.240 --> 20:26.240] they support all file systems X2, X3, X4. Um and the advantage of them kind of is like for [20:26.240 --> 20:31.060] complexity reasons that um the bare leveling, the ECC and bad block management is already [20:31.060 --> 20:35.780] integrated in them. So you don't have to take care of that. Now if you want to access [20:35.780 --> 20:39.560] deleted data then it gets a little bit more complicated because the EMMC controller doesn't [20:39.560 --> 20:46.340] really allow us to get raw access on the- on the- on the device like with a raw NAND. Um so [20:46.850 --> 20:51.220] but the thing is that the- this kind of chips they're using a raw NAND internally. And [20:51.220 --> 20:55.180] they're like possibilities where you can just um bypass the EMMC controller and directly [20:55.180 --> 21:00.100] attach to the NAND internally and just bypass all the security things. Um the challenge is [21:00.100 --> 21:03.420] just that some EMMC controllers are doing some kind of weird format so you need to figure [21:03.420 --> 21:07.980] out what- what we do internally. Again recommended talk here is uh the EMMC chips data [21:07.980 --> 21:12.220] recovery beyond the controller. Uh by a company who is doing like a lot of um recovery [21:12.220 --> 21:16.880] things. Resolute I think. And the summary is basically even if you delete all the data from [21:16.880 --> 21:22.340] the EMMC, all the data is still in there in the- in the- in the chip. So you can extract it. [21:22.340 --> 21:28.600] Uh but this is a little bit out of scope for this talk. Alright um let's talk about reset states [21:28.600 --> 21:32.840] which you can find if you buy like a used device or if you do dumpster diving or if your [21:32.840 --> 21:37.880] neighbor gives you some broken device. So the reset states most of the time depend on the [21:37.880 --> 21:42.040] previous owner. So some previous owner think like yeah I have nothing to hide so for example [21:42.040 --> 21:47.160] for this media box um for the critical one um I don't need to- to reset it at all so [21:47.160 --> 21:52.100] basically this device contains still all the data, all the configurations. Um and one of [21:52.100 --> 21:56.340] the reasons why it might be the case is that the knowledge is just missing so the people [21:56.340 --> 22:01.600] don't know how to reset this thing. Another level which can be uh the Wi-Fi configuration [22:01.600 --> 22:07.160] reset. So this device might still contain all the data or most of the data but it's like in [22:07.160 --> 22:10.740] an unprovisioned state. That means if you power it on it won't connect to any Wi-Fi. It [22:10.740 --> 22:16.580] expects more or less you to provision it again to a new Wi-Fi. And um interestingly many [22:16.580 --> 22:20.380] devices only offer this Wi-Fi reset. Uh so basically if you see a reset button on your [22:20.380 --> 22:24.020] device then most of the time it's a Wi-Fi reset it's not the device wipe which is the next [22:24.020 --> 22:29.960] thing. Um device wipes in contrast to that they just delete all the data uh put the device [22:29.960 --> 22:35.320] back in a factory state and um but even in this case there might be still traces of data [22:35.320 --> 22:39.320] there. Um interestingly not all the devices support that because it's basically from [22:39.320 --> 22:44.180] technical reasons if they built a device incorrectly then they can't just wipe the device. [22:45.680 --> 22:51.740] So in comparison both so some devices actually support both features. Um so Wi-Fi reset is [22:51.740 --> 22:55.420] usually marked by a special button if you have a reset button you click it um it's basically [22:55.420 --> 23:01.060] doing a Wi-Fi reset. Um device wipe um is usually available over the app if you have an app or [23:01.060 --> 23:05.740] you need to press like multiple keys. And now the idea of this Wi-Fi reset is like a very [23:05.740 --> 23:10.840] logical one. So basically you don't want to erase the whole device every time you do want to [23:10.840 --> 23:15.840] change the Wi-Fi. So basically this device can be reconnected quickly to a new Wi-Fi. So you [23:15.840 --> 23:20.460] don't have to wait like for 5 minutes or 10 minutes until the flash gets erased so you want [23:20.460 --> 23:26.040] to just move the thing. In contrast to that I mean with the device wipe you want to erase all [23:26.040 --> 23:29.880] the data and you want to get rid of everything and get bring it back in a factory mode. But [23:29.880 --> 23:34.040] this is like these things are like not necessarily the same in terms of like um what people [23:34.040 --> 23:37.700] understand under reset you know. So it's basically for people think they reset the device [23:37.700 --> 23:44.380] most of the time it's a Wi-Fi reset. Alright let's talk about data extraction methods. Um for [23:44.380 --> 23:49.460] me the idea is extract all available data. Everything which I can get from this device. And [23:49.460 --> 23:53.900] there are multiple methods to do that. For example if I somehow can get root access on a [23:53.900 --> 23:59.260] device then I can extract it by software. Um sometimes I can dump the flash contents without [23:59.260 --> 24:03.120] actually disordering anything. In the worst case I need to disorder like the flash for [24:03.120 --> 24:09.000] example. So this is like typically the chip off method. So if you talk about software methods [24:09.000 --> 24:15.000] for many IOT devices especially for the cheap ones where like some public methods are [24:15.000 --> 24:20.060] available where people tell you how to access like the file system. How to root a device. How [24:20.060 --> 24:25.380] to do like whatever. Um and most devices support also like installation of custom firmware [24:25.380 --> 24:32.260] or access over USB. For example ADB or UART. Um for some devices especially for cameras [24:32.260 --> 24:36.160] there's like some special modes where you can boot a system from the uh SD card for [24:36.160 --> 24:40.740] example. And if you have no root shell at some point what you, the thing what you want to do [24:40.740 --> 24:46.760] is like basically dump all the flash contents via DD. Um the advantage for DD is basically DD [24:46.760 --> 24:52.740] is not flash aware. So it doesn't know anything about out of uh out of um data blocks, out of [24:52.740 --> 24:58.180] band blocks or ECC. So it just dumps everything. Um which is very helpful for us. Usually you [24:58.180 --> 25:03.000] shouldn't use DD by the way if you ever do backups of NAND flashes because you can't [25:03.000 --> 25:08.300] restore them again without breaking a system. Um you extract the data usually by external [25:08.300 --> 25:13.580] media SSH or Netcat. Netcat is probably the most easiest thing to do. Uh this method of [25:13.580 --> 25:18.320] software works especially good for uh file systems if it's like JFFS2 or UBFS. The [25:18.320 --> 25:22.280] disadvantage here is you can only do things with the kernels allowing you. So basically [25:22.280 --> 25:25.560] sometimes the kernel is not allowing you low level access on the flash. So you might be a [25:25.560 --> 25:31.380] little bit limited there. Um the other thing which you can do is like um you can dump flash [25:31.380 --> 25:37.460] without disordering. And it works mainly very good for SPI flash or EMMC. Um some of the [25:37.460 --> 25:41.900] devices if you get them they allow in system programming. And how it works basically you [25:41.900 --> 25:45.520] take your uh flash reader and you attach it to particular test pins and then you can [25:45.520 --> 25:50.320] directly access the memory. The problem is um the processor shouldn't interfere with this [25:50.320 --> 25:53.460] process. So you need to kind of make sure that the processor or the sock is kind of like [25:53.460 --> 25:58.380] not working. And you can do that um sometimes by pulling like the reset pin or you just [25:58.380 --> 26:03.980] ground the uh clock, the crystal so that it doesn't do anything. The advantage of this [26:03.980 --> 26:08.280] thing is well you have a reduced risk of destroying your hardware. If you're not very good [26:08.280 --> 26:13.320] in BGA re-soldering or like um un-soldering then you probably break your device. The [26:13.320 --> 26:17.800] disadvantage is you need to fight the test pins first or you get the traces. And some [26:17.800 --> 26:22.700] vendors do um the four layer PCBs they do so that they hide things like in the middle [26:22.700 --> 26:29.240] layers and it's kind of nasty. Um the last method of re-sort is more or less dumping the [26:29.240 --> 26:33.960] flash by de-soldering. So this works literally for all the flash methods uh for all the flash [26:33.960 --> 26:51.420] chips. Um I'm confused. Well ok so how does ok um how this works is usually that um the [26:51.420 --> 26:56.200] recommended thing is you heat up the PCB um before you do any soldering because if you don't [26:56.200 --> 27:00.600] heat up the PCB then um at some point you might accidentally pull pins because you have like a [27:00.600 --> 27:07.000] ground pin. Um if you have accessible pins for like for TSOP um one one trick which you can [27:07.000 --> 27:10.760] do is like basically create like a low temperature alloy and a low temperature alloy you [27:10.760 --> 27:16.560] just take like a um like an alloy like a soldering alloy which is like 120 137 uh degrees [27:16.560 --> 27:20.840] Celsius and then you just mix it with the existing alloy and you can do that uh with a normal [27:20.840 --> 27:24.840] soldering iron so you don't need too much special tools. For BGA chips it gets a little bit [27:24.840 --> 27:29.740] more complicated. Um you most of the time need like some hot air station, infrared or a [27:29.740 --> 27:35.320] flow oven or a flow soldering station. Some people use also a pizza oven but I might not [27:35.320 --> 27:41.680] recommend that. Um in general the disadvantage of BGA chips is um if you want to reuse the [27:41.680 --> 27:47.100] device later you need to um re-bore the chip and um to re-solder it and this might be [27:47.100 --> 27:54.760] complicated and might be might require a lot of um patience. Um especially one one thing [27:54.760 --> 27:59.040] about NAND devices is that you might need um a special adapter to use them because of the [27:59.040 --> 28:03.200] high pin count. Alright let's start with the tools which you need to do uh which you which you [28:03.200 --> 28:07.860] can use for particular things. Um if you want to access SPI flash um you can literally take [28:07.860 --> 28:12.480] any device which can bit ba- do bit banging on GPIOs. You can use a Raspberry Pi, you can use [28:12.480 --> 28:17.200] Adrenos, you can use Bus Pirates. Um for Raspberry Pi you have the software FlashROM which can [28:17.200 --> 28:22.280] natively speak to most of the um flash chips. So that's kind of easy. My favorite tool [28:22.280 --> 28:26.180] because I use it also for other things is FlashCat USB which is I don't know a couple like [28:26.180 --> 28:33.060] 30-40 bucks or so. Um this is also for that purpose. Um if you if you want to access EMMC [28:33.060 --> 28:37.740] flash um the advantage of EMMC flash is it speaks the same protocol like SD card so you can [28:37.740 --> 28:42.160] use potentially like SD card readers. Um here the important thing is you want to double [28:42.160 --> 28:46.660] check the data sheet of the EMMC flash because some of them are low voltage. So it's like 1.8 [28:46.660 --> 28:51.280] volt if you connect it with 3.3 then you have a very hard time and you need to buy new [28:51.280 --> 28:58.120] devices. Um one very cheap method is here um there's a like an um expert tiers uh EMMC adapter [28:58.120 --> 29:02.300] for 10 bucks which you can get. You can just connect it into a SD card reader. You sort of [29:02.300 --> 29:09.620] the um um the cables uh um to to the chip and you can can read it out. The disadvantage of [29:09.620 --> 29:15.800] that is um the chips are very small and um so you might have good eyes to do that or you need a [29:15.800 --> 29:20.240] microscope or something. Um and uh the disadvantage of this particular method is also [29:20.240 --> 29:24.620] that you might not be able to access all the partitions which might be which is actually not a [29:25.080 --> 29:28.820] real problem for us in this our use case of getting data from those devices but if you do [29:28.820 --> 29:32.260] more reverse engineering you also want to access the special partitions like the boot [29:32.260 --> 29:37.720] partitions but this doesn't matter here. Um another method um by the way for EMMC flash is [29:37.720 --> 29:42.400] if you get some cheap stuff from China like this uh BGA adapters where you can just put your [29:42.400 --> 29:47.840] BGA chip in there and j-jiggle a little bit around and then get a very good connection. Um [29:47.840 --> 29:53.380] the advantage of this is that they support dual volag- uh dual voltage chips. So uh you [29:53.380 --> 29:58.300] should be good to go with that. Disadvantages with that by the way um you need to find the [29:58.300 --> 30:02.700] correct position of the uh of the chip so you need to try a little bit. And I wouldn't [30:02.700 --> 30:05.880] recommend to use the original software because it's detected as malware and the typical [30:05.880 --> 30:10.020] recommendation of the developers of the software is yeah it's fine just disable your [30:10.020 --> 30:19.800] antivirus and uh doesn't sound very um trustworthy. Alright um if you want to access uh raw [30:19.800 --> 30:23.200] NAND this gets a little bit more complicated because the pin count gets higher so you need [30:23.200 --> 30:31.580] like at least um uh I think 16 pins uh which you need to connect um to the chip. Um and this [30:31.580 --> 30:35.600] requires some kind of NAND controller. You can again look into the uh talk about the [30:35.600 --> 30:38.780] reverse engineering flash memory for fun and benefit. They have like very very cheap [30:38.780 --> 30:43.560] method to do that. But again here there's like more or less professional um devices [30:43.560 --> 30:48.740] available where you can just um use like a socket to put the chip in and read it out um and [30:48.740 --> 30:52.760] dump all the data. The problem with that kind of devices is um most of the time that they [30:52.760 --> 30:59.800] cannot interpret uh the ECC or the band data so it might be a hit or miss. Um another method [30:59.800 --> 31:03.700] if you have access to that, evaluation boards. So just take a look at the processor which [31:03.700 --> 31:07.880] is used in your device. So I did a lot of vacuum cleaners. I have some development boards [31:07.880 --> 31:13.420] which I have exactly the same chip. So I can just solder the chip onto this evaluation board [31:13.420 --> 31:18.920] and can just use the processor like it is to read and dump all the information. And can also [31:18.920 --> 31:23.080] use it to write information to that without thinking on how to calculate the ECC and how to [31:23.080 --> 31:26.960] do other things. Um the disadvantage of this method is obviously you need to get this board [31:26.960 --> 31:30.800] somehow and sometimes they're not available or if they're available they're extremely [31:30.800 --> 31:37.180] expensive. So it's kind of yeah, difficult. Um at the moment we extracted the data. There's [31:37.180 --> 31:40.800] like a lot of um there's a whole zoo of tools which you can use. Um the typical thing that [31:40.800 --> 31:45.720] most people just do is like bin walk. Um if you just extract if you just want to extract some [31:45.720 --> 31:50.340] data like credentials then you can just use a hex editor. Um at some point if you want to [31:50.340 --> 31:55.200] interpret uh NAND flash dumps um there's like some tools like the dump flash tool or uh [31:55.200 --> 31:59.480] NAND's dump tool. The problem with this particular tool is um even though that they're [31:59.480 --> 32:07.080] open source um they don't handle exotic out of band data sizes correctly sometimes or also [32:07.080 --> 32:11.080] the ECC data is kind of like uh difficult. So it depends more or less on the sock which was [32:11.080 --> 32:17.340] used. If you at some point have like a UB image you can just dump the whole content of that. Um [32:17.340 --> 32:21.880] JFFS images uh it's also easy but it's like also tools for that. So basically for most of the [32:21.880 --> 32:26.560] things you have open source tools available. Um you should be good to go with that. Alright [32:26.560 --> 32:32.540] let's start with the device analysis. Um so some of the methods which I use um where [32:32.540 --> 32:37.580] basically disassemble the device, um unsolder the flash, dump the flash, put the flash on [32:37.580 --> 32:42.100] again, then power the device on again and um maybe try to root it. Sometimes it works [32:42.100 --> 32:47.440] sometimes it doesn't work. Um the one thing which I try to do is I basically try to connect [32:47.440 --> 32:53.380] the device also to the app. So as a new user kind of I connect to um the device to the app and [32:53.380 --> 32:58.560] hope that I still get some old information. Um the other thing is like as a kind of test I [32:58.560 --> 33:03.860] do um I use the devices for example uh I ran vacuum cleaners in my uh in my lab and then I [33:03.860 --> 33:07.180] reset them and then I just compare the data which I had before and after that. So to get an [33:07.180 --> 33:11.880] idea of what kind of how good the factory set is. So the first device where I would start is [33:11.880 --> 33:17.100] uh the Echovox D-Bot 900. I think it's mostly it's very popular in Europe. I'm not sure how [33:17.100 --> 33:22.260] popular it is in America. I got this device in 2019 and the previous owner told me that he [33:22.260 --> 33:27.460] erased it. So I was kind of curious about that. This thing runs Linux. Um it has this weird [33:27.460 --> 33:34.160] rock chip, a sock. And we use a 128 megabyte of uh NAND flash in TSOP um 48 format. So you [33:34.160 --> 33:38.720] see like this green thing on the on the left. Um the approach that I use is basically I dump [33:38.720 --> 33:42.220] the NAND flash and then I connect to the UI to get some additional information uh to figure [33:42.220 --> 33:49.080] out what's going on. After I unsoldered the flash, I wanted to verify um that this device was [33:49.080 --> 33:53.600] actually factory resetted because otherwise it's kind of like a little bit unfair. And the [33:53.600 --> 33:59.180] thing is what I found is actually that um I found a log file which is where it says that this [33:59.180 --> 34:04.460] device was erased before I got it. So basically it was it was new for sure but this device was [34:04.460 --> 34:09.180] erased. The next thing what I found there is like lots lots of fragments of log files, keys, [34:09.180 --> 34:13.500] maps, bifurc credentials. The only problem with what I had with this particular device is that I [34:13.500 --> 34:18.260] didn't know how to how to uh how to read uh the out of band data to reassign all the blocks [34:18.260 --> 34:23.220] correctly. So this is like still something which I'm working on. Um the next step what I did is [34:23.220 --> 34:27.640] I connected over UART and was hoping that I can get some shell to extract the data very easy. [34:27.640 --> 34:33.680] But unfortunately they did um protect that by making the uh like UART read only. But I found [34:33.680 --> 34:37.240] some information about it. So the one information I could figure out is that the rock chip is [34:37.240 --> 34:41.760] using this very specific like driver to communicate with the uh with the flash and they do a [34:41.760 --> 34:45.920] variable link by themselves. And the other thing what I knew is um that the root partition is [34:45.920 --> 34:51.260] squashfs and that the data partition x4 is x4. So um basically I could expect that I find [34:51.260 --> 34:57.600] more more traces. So this is like the example with the credentials. So basically um this [34:57.600 --> 35:00.660] device um at some point you need obviously to have files which store the credentials. And what [35:00.660 --> 35:04.600] you can see here from the from the top to the bottom uh this was the original file which was [35:04.600 --> 35:09.080] created in the factory. So you still see the factory credentials of the SDSSID and the Wi-Fi [35:09.080 --> 35:12.960] password for the factory somewhere in Changshan or wherever this vacuum cleaner was [35:12.960 --> 35:18.100] designed. And over the time when the previous owner was adding Wi-Fi's or was connecting this [35:18.100 --> 35:23.540] device to the Wi-Fi, you see that more and more Wi-Fi's were like added to this. Um the [35:23.540 --> 35:28.020] other, I had to censor things. So the blue things are censored. Um the other thing what you [35:28.020 --> 35:32.000] see out of the log files is every time uh when the vacuum cleaner was connected to the Wi-Fi [35:32.000 --> 35:37.320] or when the original point where the owner was provisioning this device first time to the [35:37.320 --> 35:42.040] Wi-Fi. So in this case I knew that this the person had like a Galaxy phone because you can [35:42.040 --> 35:47.640] see it in the in the log files that the Galaxy phone was connected to this. So now we have [35:47.640 --> 35:52.100] some of the information so what about locating the former owner? And um there's like a very [35:52.100 --> 35:57.820] useful uh API for that, the Google geolocation API. And what it does is you give it uh two [35:57.820 --> 36:01.820] MAC addresses and the signal strength and it gives you back the coordinates and the [36:01.820 --> 36:06.420] accuracy rating. Um the problem with this particular device was um unfortunately it had [36:06.420 --> 36:11.440] only one MAC address so I couldn't use this API to find the original position of that. Um [36:11.440 --> 36:15.420] but there's another website where you can just enter the SSID and then you can just look [36:15.420 --> 36:19.400] around the world where this SSID is coming from. And the thing about this particular SSID [36:19.400 --> 36:25.600] is that it was like a provider modem which had like a random random number SSID so I found [36:25.600 --> 36:31.600] exactly only one um position where this SSID was used. At the second SSID from the same [36:31.600 --> 36:35.300] owner, I checked, double checked it and figured out it's somewhere in the middle of Germany [36:35.300 --> 36:44.360] so I have also the exact address but I didn't have it here. Um right, so as a summary for [36:44.360 --> 36:47.780] this particular device, uh most of the user data was still existing on this device even [36:47.780 --> 36:53.120] though it was swiped. Um I could see the XMMP log files um this device is using XMMP for [36:53.120 --> 36:58.080] the communication with the cloud. Um I could see the maps, the credentials. Um because the [36:58.080 --> 37:02.060] maps are using some kind of weird format I couldn't really reassemble them but I might at [37:02.060 --> 37:06.900] some point. Um I also tried to reset this device 3 times in a row and still could get all the [37:06.900 --> 37:12.080] fragments so factory resetting is not very effective there. Um one interesting aspect is I [37:12.080 --> 37:17.320] also found the factory locks so where the sensors and all the other stuff was tested and I [37:17.320 --> 37:21.060] think these files are actually not existing anymore in the logical space but they're still [37:21.060 --> 37:27.300] on this thing. Um again I could uh track the previous owner of this device. However there's [37:27.300 --> 37:32.920] one small good news. Um if you connect this vacuum cleaner now to the to the um wifi and to [37:32.920 --> 37:37.080] your uh account then basically the app doesn't leak previous information so it's kind of [37:37.080 --> 37:42.220] this is kind of okay so the data is apparently not there anymore in the form that everyone [37:42.220 --> 37:46.920] can see it. Um interesting thing is I found the similar results also for other vacuum [37:46.920 --> 37:52.300] cleaners. I'm not sure if I mean everyone who's using um this kind of raw NAND chips is [37:52.300 --> 37:59.080] kind of like want to save money so a lot of devices have exactly the same issue. Right um the [37:59.080 --> 38:03.720] second device which I analyzed um because I do many research on Xiaomi so I bought random [38:03.720 --> 38:09.040] used devices and broken devices out of ebay. Um this is a device which I got in 2018. Um I [38:09.040 --> 38:13.020] didn't really know what kind of condition it had because it was broken. Um in general the [38:13.020 --> 38:18.540] Xiaomi devices they have uh they run an Ubuntu 14.4 uh with a quad core um and they have a [38:18.540 --> 38:23.420] 4 gigabyte of EMMC. And here the approach was that I connect over uh UART and dump the [38:23.420 --> 38:28.760] partitions um over UART and then later on I tried to connect it again to the cloud. Um the [38:28.760 --> 38:32.600] good thing about the Xiaomi vacuum cleaners is that routing methods exist. Um I found them [38:32.600 --> 38:37.680] I think 2 years ago and presented them. Um you can get root shell over UART or you just can [38:37.680 --> 38:41.180] push your custom firmware onto that. The good thing with pushing custom firmware is it [38:41.180 --> 38:45.920] doesn't destroy the data so the data is still there so which is kind of good. Um and later on [38:45.920 --> 38:50.760] you can exfiltrate all the data via SSH. Um the alternative method is if this device is [38:50.760 --> 38:57.240] totally broken um you can still remove and dump the flash content but still works. Um to [38:57.240 --> 39:02.880] give you like an idea of for what to look for um this system this is like the EMMC layout um [39:02.880 --> 39:07.260] how it looks like. So you see that it has like 3 copies of the operation system. Uh then on [39:07.260 --> 39:12.040] the um pre last line there's the reserve partition which contains all the usage data so how [39:12.040 --> 39:17.940] much how often this device was used. Um what is the status of like all the sensors, the uh [39:17.940 --> 39:22.180] HEPA filter and so on. And then there's a user partition which is the udisk partition which [39:22.180 --> 39:29.040] contains all the logs uh maps, wifi configuration and user ID. Um and this is like the [39:29.040 --> 39:33.820] partition which we're interested for. So uh 1 thing about this vacuum cleaner in particular [39:33.820 --> 39:38.880] this device is actually support 2 modes of uh reset. So the first thing is wifi reset which [39:38.880 --> 39:46.960] is which is a button which is called reset. Um and the second is like the uh factory reset. Um [39:46.960 --> 39:50.820] the wifi reset what it does is just deletes the wifi credentials but everything else remains [39:50.820 --> 39:55.100] there. And the factory reset needs a special procedure where you need to press multiple [39:55.100 --> 40:00.300] buttons to wait and then it resets uh the device in the factory. Um it's mentioned in the [40:00.300 --> 40:04.020] manual but I figured out that nearly no one knows about it. So probably the first thing [40:04.020 --> 40:08.620] what you do is like if you get the manual you just throw it away. And um yeah. What this [40:08.620 --> 40:14.160] factory reset actually is doing is it restores the um operation system from the recovery and [40:14.160 --> 40:18.340] the formats the data partition. But interestingly here is it doesn't wipe it really so there [40:18.340 --> 40:22.980] might be still some traces. Um the partition of the usage data is not erased so basically all [40:22.980 --> 40:28.620] the usage data is still there but not kind of the user data. So what I did is I just [40:28.620 --> 40:32.920] connected it then to the cloud and I figured out oh hey um all the data is still visible in [40:32.920 --> 40:36.720] the app so I could figure out like okay when when was the apartment cleaned of the person? [40:36.880 --> 40:40.740] What the apartment is looking like? And um so the assumption was that this device was only [40:40.740 --> 40:46.220] wifi resetted so they pressed only the reset button nothing more. Um and even though that I [40:46.220 --> 40:50.520] connected it to a totally different account uh this device was re-uploading all the data from [40:50.520 --> 40:54.320] the vacuum cleaner up in the cloud. So I had it as a new owner. I had all the previous data [40:54.320 --> 40:59.980] before. Also all the log files were still um locally available. And I was kind of curious what [40:59.980 --> 41:03.880] happens if I do a factory reset. So at the end of the day I did the factory reset. The good [41:03.880 --> 41:07.760] news is if you do like a real factory reset and press the real buttons then the data is at [41:07.760 --> 41:12.540] least not visible in the app anymore. Um I was looking at the log files and figured out hey I [41:12.540 --> 41:19.320] have two mega addresses. Um and actually the geo uh the Google geo RP have given me like some [41:19.320 --> 41:24.060] coordinates back and um I figured I mean I again censored it so it's like somewhere in the [41:24.060 --> 41:28.640] area but I knew the exact address. Um as soon as I knew the address I was looking at the at the [41:28.640 --> 41:33.040] street and I figured out that the Wi-Fi credentials have uh SSID had part of the street name [41:33.040 --> 41:37.280] in it and the street number because I don't know someone figured out it's maybe a good idea to [41:37.280 --> 41:42.160] use the street name and street number as a Wi-Fi SSID. And the password contains some uh [41:42.160 --> 41:46.560] personal information like probably the dog's name. I don't know. Not sure. Um however because [41:46.560 --> 41:50.920] this data is like stored in plain text in the device you can just read it out. Another magic [41:50.920 --> 41:56.080] trick is by the way um the device has a user ID of the user and if you use like the app you can [41:56.080 --> 42:00.280] share devices with other users and one thing which I did is basically I created like a fake [42:00.280 --> 42:06.300] account connected like a fake device and then I was just sharing this device with this user [42:06.300 --> 42:14.300] with the previous owner and had also the profile picture and the name so yeah. Yeah um so as a [42:14.300 --> 42:20.740] summary um for this particular device all the data was still there. The rest was not wiped. Um [42:20.920 --> 42:28.460] the reset button is very misleading like for many devices so reset is not doing actually reset. [42:28.740 --> 42:32.620] Um however in this case the correct procedure is actually documented in the menu but most of [42:32.620 --> 42:38.340] the people don't read that. Um again here I could track the owner um with the due to the log [42:38.340 --> 42:43.380] files and this kind of devices that create a lot of log files and there we are both so you have [42:43.380 --> 42:49.180] like a nice um nice idea what's going on there. Alright um some other example which I have [42:49.180 --> 42:55.920] here um are like this doorbelts. I figured out like I have like now I think 8 doorbelts and 7 [42:55.920 --> 43:01.980] of them are more or less from the same I think SDK. Um in terms of like um if you buy like [43:01.980 --> 43:07.380] 8 doorbelts from Amazon you have probably um internally 7 times the same hardware but [43:07.380 --> 43:12.680] different interior like exterior. Most of them are based on the high 3518 chip. Um they have [43:12.680 --> 43:18.960] like an SPI um nor flash in there. They use again JFS 2 and QBFS so you can happily um [43:18.960 --> 43:24.800] recover all the credentials. Um they have some log files so you might get one MAC address of [43:24.800 --> 43:27.420] the of the Wi-Fi access point so it's kind of like a little bit more difficult but [43:27.940 --> 43:31.180] actually you could track it down. The sad thing about this kind of devices is they have [43:31.180 --> 43:36.500] unfortunately like a SD card slot so they don't contain video data so it was like a little bit [43:36.500 --> 43:43.360] sad about that. Um not necessarily all IT devices are bad so I found actually one device [43:43.360 --> 43:47.840] which I didn't disclose yet um which was also a vacuum cleaner from a different company who [43:47.840 --> 43:53.880] used trust zone for key storage. They encrypted all the user partitions with looks. Um the um [43:53.880 --> 43:59.760] the keys were managed by this trusted execution engine and they're device specific and every [43:59.760 --> 44:03.040] time this thing boots up it checks like some states and then unlocks the partitions. [44:03.040 --> 44:06.480] Interesting thing here is if you do a factory reset it just throws away the keys and [44:06.480 --> 44:09.780] recreates the partitions so in this kind of case it would be kind of safe but this is like [44:09.780 --> 44:16.240] this is one example I've I saw so far so it's very very rare. Um as a conclusion um in [44:16.240 --> 44:21.180] general I had like a sample size of like 26 devices which I had found uh got or found like [44:21.180 --> 44:26.840] in like some swap fest. Um I figured out that apparently um secure or correct factory sets [44:26.840 --> 44:32.420] are very difficult to implement. Um especially if you use raw net uh flash it nearly defeats [44:32.420 --> 44:36.800] all the time like uh full vibes. And there's no real way to ensure that the device has [44:36.800 --> 44:42.180] actually waived uh waived uh wiped sorry. Um many also many of the vendors actually [44:42.180 --> 44:45.300] don't release all the user generated data. So you have like usage data which still remains [44:45.300 --> 44:48.960] there. Log files are not erased. Um the only thing that sometimes is erased is like the [44:48.960 --> 44:53.460] buffer confirmation files. Um but all the other information is more or less still like on [44:53.460 --> 44:57.820] this device. Um another problem what you have again is uh the missing knowledge of the [44:57.820 --> 45:02.120] user. So if the people don't know how to reset devices then in in the first place then we [45:02.120 --> 45:06.420] cannot even complain about the vendors because the user don't reset them. Um as a [45:06.420 --> 45:10.940] recommendation if you ever want to get rid of um devices uh don't sell them and throw them [45:10.940 --> 45:15.800] away. Um especially if you expect that they contain any sensitive information. So [45:16.580 --> 45:23.040] especially don't throw away like this media stuff uh the media players. Um and also don't [45:23.040 --> 45:27.620] throw away devices if you cannot verify that they have been uh done a full wiped. One [45:27.620 --> 45:32.000] example is destroy the physical memory. If it's a cheap device or just use this device [45:32.000 --> 45:37.460] to practice soldering that unsolder resolder things. Um in general it might be a good idea [45:37.460 --> 45:41.160] if you had to throw away devices maybe change your wi-fi credentials so at least that [45:41.160 --> 45:46.000] someone who has the credentials cannot break into your local network. Or the other thing is [45:46.000 --> 45:50.780] just put all your devices into a separate IOT wi-fi which kind of also limits the impact [45:50.780 --> 45:58.080] if someone gets the credentials. Alright um that's it. Uh for here I want to thank uh thank [45:58.080 --> 46:03.460] professor Nubir and uh professor uh John Manfidelli from uh the University and also the [46:03.460 --> 46:09.300] Zemo team from Darmstadt. And if you have any questions I'm happily here to answer them [46:09.300 --> 46:12.960] and I have also some devices if you want to take a look at this kind of weird adapters. I'm [46:12.960 --> 46:15.120] here for a while. Thank you.