Thank you, everyone, for coming. This is our penultimate talk of the day. This is Dennis. He's going to be doing a talk on, you know, privacy leaks by dumpster diving, more or less, correct? Yeah. So if you ever get, you know, cool technology at eBay or the Goodwill store or in the dumpster, maybe there's some stuff that got left over even after like a factory reset. So he's going to get into all that today. I think it's going to be pretty cool. Can everyone in the back hear me okay? If I talk like this, would you really hear me okay? Okay. So you have to talk as loud as that. Because he's going to start talking and he's going to be like, can you hear me? It's pretty good talk, right, guys? See? Negative thumbs. So you got to get real close. Are you ready? All right. I try. Can you hear me in the back? Yes, maybe. Should I speak louder? Loud enough? What about now? Yeah, okay. Great. All right. So welcome to my talk about privacy leaks in smart devices. The introduction was mostly correct in terms of like dumpster diving. What I do more is like shop on Amazon warehouse deals or like eBay. And the main idea of this talk is to speak about the extraction of data of used smart home devices. So the outline for this talk is the following. I start with the motivation. Then I will speak about how data is stored or what kind of data is stored on IoT devices. Then how is it stored and what kind of reset states you can imagine if you get like a used device. What kind of data is maybe there or won't be there. In the next topic, I will talk about the data extraction methods. So how you get the data off the device. And later on, I will have some example devices where I will tell you how I got the data off and how I found, for example, like the previous owner of that. So some information about me. I'm a PhD student at Northeastern University and I'm working there with Professor Gibraltar Beer. So we're doing mostly wireless security but I'm kind of into this IoT stuff. I'm also right now a grad student at DTU Darmstadt in Germany. I'm working there with Matthias Horlich. And my main interest is like reverse engineering with any kind of interesting devices. It can be nearly everything. But at the moment it's more like IoT and smart locks. But I do also physical locks which is kind of like the same thing. And so you find me also in the tool lockpicking village. Some side notes about my talk. It's not a Xiaomi bashing talk. So maybe some of you know me from last year where I was giving a lot of talks about Xiaomi. The problem is I have a lot of these devices so basically I need to talk about them. Most of the methods I present are already known and used for other things. There are some ethical and legal questions in this presentation so I had to censor most of the data and like mock it up a little bit. If you use any of the methods, for example if you want to do like BGA on soldering and you break it then it's kind of on you. I'm not responsible for that. And a lot of technical aspects I totally simplified. So basically NAND flash is way more complex but I did it for the sake of the talk to simplify. And there's particular things which are out of the scope of this talk. For example how to interpret NAND data or reassemble it or for example how to do device specific routing. I mean there's a lot of manuals out there so I won't cover that. So let's start with the motivation of this talk. Traditionally we had like nearly forever like the problem that there's a lot of second hand devices which still contain data. This issue literally existed forever since the hard drive exists. But I think it was increased as soon as people started to buy or sell hard drives on eBay. And most of those hard drives on eBay they still contain data like some personal information, emails, pictures or any other media. Sometimes even sensitive documents if the government sold hard drives. And the awareness for this kind of topic was raised like in the beginning of the 2000s. There was for example like a paper where the researchers analyzed like what kind of data is still there and what you have to do to basically get rid of all the data. Interestingly this not only affected like computers but it also affected like multi-function printers or lab instruments. And the NIST kind of recognized that in 2006 and they published a standard how to kind of wipe your devices to get rid of the data. And some of the solution was for example like you need to wipe your device and actually verify it or you sell devices without hard drive and destroy the hard drive like in the one picture which is like the example there we just shredded. But there was still like a big problem and the problem was that the lack of knowledge and awareness of the user. So for example most of the people didn't know how to securely erase hard drives. They format their USB stick and they thought like okay everything is fine. Some people didn't care. They said like yeah I have nothing to hide. And there's one particular problem if you have a broken device. For example a broken laptop. Most people don't know how to remove the hard drive and to format it. For a long time I thought this problem was actually kind of solved but this year there has been like a study where someone bought like 159 hard drives from Ebay and 66 of them still contain data. So it's like still apparently like an issue. The whole problem become a little bit more interesting with smartphones because smartphones also contain a lot of data. Sometimes even more than your personal computer. Pictures. All kind of pictures. Messages, accounts, credentials, call lists. And one thing which people didn't know for a long time is that the phones are not encrypted by default. At least not up to 2014, 2015. So very long time the phones were not encrypted. And this was, this was only introduced with iOS 8 for example by Apple in 2014. Or with Android 6 in 2015. There have been some researchers who didn't analyze on like um how the devices uh do the um factory reset and they figured out that most devices actually don't do it correctly but still there's a lot of data. And this was kind of addressed again by NIST in 2014. They figured out okay smartphones is a big risk so um we should address that in this new standard. So now the next topic comes with IOT. Um IOT in contrast to smartphones and uh PCs has like a big difference. And um there's literally no a small or like no user interface um available. So as a user you cannot really access directly the data which is on a device. Like you go in the file browser or something and look at that. Um so you don't know what kind of data is also collected by this device. So um you literally don't know anything about your device. If you do a factory reset then you cannot really verify that this device is really empty. Um the other thing is you kind of don't know what kind of implementation of the factory reset was done by the vendor. So and this depends from vendor to vendor, from device to device, and sometimes even from one version to another. So you could have a version which does it correctly and then the next version may do something completely different. So the main motivation for this talk is um when I was writing my master thesis uh at XAML and uh was analyzing a lot of security uh the security of a lot of uh IOT devices. I had to do like a lot of root access methods and had to factory reset them regularly. And I figured out every time I do a factory reset with this device all the data is still there or there's still data left. So I was kind of figuring out like hey maybe I should look into that. Um another important thing is um not only we as kind of hackers are interested in the data but other people are also uh interested in the data. And this is like an example from Germany where the police figured out like hmm smart devices that might be interesting to look at like for forensic to solve crimes. Um so more and more people come now on the idea to um actually do forensics analysis of um IOT devices. Um so this kind of talk is about like if you get a used device or if the cops bust your door and actually take your device so what kind of data you can expect there. Alright, let's talk about the data on IOT devices. Um in general the data that you find on a device is basically dependent on the device type. There's different device types which contain more or less data. However there's one important thing which is like the same for all IOT devices and this is basically we need to have Wi-Fi credentials. Without Wi-Fi credentials it's not IOT because it cannot connect to the internet. Um the other thing what you most of the time have is like some kind of cloud credentials because the device needs to authenticate itself against the cloud to like upload data to download data whatever. Um as a rule of thumb what I found is the more performance functions or storage a device has the more data is on it or will be collected. So it is like a thing if you have a very powerful device you can expect it to definitely collect something. So let's start with the first kind of group of devices and this are the vacuum cleaning robots which most of the time additional to create the credentials contain uh connection log files, maps, cleaning logs, user IDs. And you see like an example for like um uh like a map um like there on the screen. Um I did an analysis over a lot of vacuum cleaners. I have a lot of vacuum cleaners you see like a small collection there but I have even more. So I had a lot of fun with them. Um another second group is smart home gateways. Um this can be anything which controls any functions in your home. Um they also connect uh contain um connection log files, sensor actuators, binding bindings. So for example if you have like any sensors in your home they know obviously what kind of sensors you have. Sometimes they collect also data in terms of like if sensors are triggered like temperature sensors you have like log files about temperatures in your home. Um depending on the device you might have also key material on it or like user ID again. The next group, cameras. Um here again depending on what kind of camera you have um it might contain uh cache snapshots or video clips, recorded video, event logs. For example if you have this nice uh doorbell cameras and they detect if someone is in front of it then most of the time this device is sometimes or sometimes this device is locked that. Um it might contain again user IDs and for for cameras in particular they might have a cloud storage credentials because we need to upload like uh video files to some kind of space and um sometimes you can use the storage credentials to download data again so it's like depends on the device. Another thing which is not directly smart home but uh which is also important are routers. Um you can buy a lot of routers out of ebay by the way. So um people update them on a regular base but what they forgot is forget actually is to erase them. And interesting information for example is there a DCP leases so you see the MAC address to IP binding, you see time stamps, you see like log files you can potentially track down like when this person is home or not home because if you go home your smart phone is logging into your wifi so this kind of stuff is still stored in your device. Firewall configurations if you have any interesting service behind um like your firewall. Media files where it's like very powerful like media routers um which contain also like media files and all kind of other log files. Connections, DNS, some people activate actually DNS logging on their router and sell it later which is maybe not the best idea because you see all the DNS requests and especially parents are a little bit paranoid and set like um children like you know parenting filters and other things, other stuff. And also other credentials so some people put whatever in their router. Another interesting example, media players. Um this is a kind of a critical thing for me. Um so they contain again um connection logs, sometimes uh or most of the time media libraries, playlists, caches, um some people are using this kind of devices also for in their home to browse on a TV so basically we have Firefox or some other browser installed, we have e-mails installed and so on and they contain also um credentials like for Google Play Store or for network shares so people are using them for network shares. Um there's one important thing which I have to change in my presentation um and it's basically for ethical reasons I need to skip this device because uh this device contains um interesting information or interesting pictures let's say so. Um with a very interesting taste. Um I heard from someone else that um this is not that uncommon that someone bought a PlayStation 3 and it contained also like a lot of adult movies and whatever. Um another thing which I added also um are toys. Um most of the people don't know that toys can also record a lot of data. For example I have this nice drone. Um and this device can also like record uh audio and video data and if you crash it you have no way to reset it and most of the time like this device you cannot reset it anyway in the first place so yeah. Right. Um this is like a little bit more technical now, the storage of um IOT devices but this is like a little bit um this is actually important to understand why you kind of screwed up in particular situations. Um if you talk about storage on IOT devices you have um more or less 2 kinds of flash types which you use. You use the raw flash um and the block devices. Um for raw flash the typical things which most of you probably know or see in IOT devices is SPI flash uh which can come in 2 flavors NAND and NOR. For this presentation we just stick to NAND and uh the parallel uh NAND flash. Parallel NAND flash is in the green box more or less space also like different flavors of that. Uh the other group are the block devices which are EMMC, EMCP which is like in your smartphone or SD cards. And depending what kind of uh storage type you have chosen it affects more or less the um the selection of file systems which you can use for your IOT device and this becomes more or less later uh this becomes important later for the forensic analysis. Um let's start first with the with the raw NAND flash. Um if you have SPI flash for example most of the time it's like smaller than 64 megabyte and you see it like in small packages like um let's see like in this kind of uh like 8 pin package. If you have bigger uh sized uh NAND flash then um it's most of the time like parallel NAND flash. It's a raw NAND and um this can vary from 128 megabyte to 4 gigabyte and it can come in all kind of different like uh packages like BGA or TSOP or whatever. Um the reason why vendors are liking or love this kind of flash is because it's cheap and fast. Um but the problem with that is that it has uh that it produces a lot of bit errors which you need to correct. And you see on the right how the access is going so basically we have the raw NAND flash and um this is connected to the host processor and the host processor in this case need to take care of their leveling, the ECC correction, and the bad block management. If you work with Linux this is usually done by the memory technology devices subsystem which takes care of that and it's basically converts the character device into a block device and it kind of takes care of all the things for you. Um if you take a closer look like to the properties of NAND flash um then what you see at some point is that it's organized in blocks which are then organized uh like in blocks and pages and a block contains multiple pages. The problem with NAND flash is if you want to erase data you need to erase a whole block which contains a lot of pages. Um and erasing of a block means basically you set all the things to one. Um the typical size of these blocks are between 16 and 512 kilobyte so if you want to erase like one particular small area of memory then you need to erase like 512 kilobytes and you need to copy them somewhere. Interestingly the programming works on page level so the programming you can do it on uh on 2 kilobyte but if you want to erase it you need to erase a big block. Um the other thing in addition to the data um space there's also like an out of band data um space which is uh for management and for ECC reasons. Um because NAND flash is so unstable a lot of vendors are adding a lot of some like 2% of uh additional blocks for spare so if um if you have like a lot of bad blocks then basically they are used for that. And again like I said the ECC is computed by the host CPU and the problem here at some point is that depending on what kind of host CPU you use or NAND controller it can do particular computations differently so you you cannot really swap one flash to another maybe like and read it out. So let's talk about rare leveling of raw flash. Um and the problem of uh raw flash is basically that individuals flash cells have very limited uh uh lifetimes and writes. So you can write on one cell only 1000 times. And file systems like X2, X3, X4 are not uh rare leveling aware. So basically if you run an X2 or X3 system uh file system on a NAND flash uh without any other layer in between it will just destroy it with like multiple writes as soon as you write too much. And the solution for that is basically that you have flash aware file systems or additional layer. So on the right side you see like one example you might have like a um JFFS2 for example is like a file system which is like flash aware which works on a partition layer. A level. And um the other thing which you can do is like you can add an additional level between the flash and the file system. And this is um an example for that is like UBI or UBF- UBFS. And this works on the whole level. There's a particular pro and cons for the decision but this is like more or less depends on the vendor what they want to do. This is not that important for now. But uh the thing here is that the support for the bad block management and rare leveling is again done in the operation system. And the main idea of that is um of this rare leveling in particular. Um deleted blocks are not erased because that would cause again like many rights. Instead they are just marked as dirty or deleted. And uh the actual change information is copied into a new block. And at some point if necessary the garbage collector will take care of like the old data. But if you don't need to take care of it then it stays there. I did the graph for that. Um so this is again simplified. So um bear with me. It's like uh not totally correct in terms of like terms. Um but imagine we have like a data block. This one which we want to change. And it's assigned to the um use block um the physical use block there. And now what happens is if you want to change it the original the old use block is red. Then the information with the modified information is written to a new free block. Um the link is more or less um set to the new block. And the old block is just marked as dirty. And the important thing here is the data is still present. The data is not erased. It's still there. Um the interesting thing in particular for IOT is if you if you change a particular file more often then you have more more and more copies of that. So uh the thing is you have multiple copies on flash. Um and this data is also not erased as long as this whole block is not erased. And if you have some data in there which is never touched then it's probably never erased. Um the interesting thing for us is uh to reverse engineer or like to extract data is basically that the copies have like a size bigger than 2 kilobytes. So you can put like a text file, credentials file, whatever into that. And the more data gets changed, for example log files or wi-fi credentials or pictures, uh the more copies you have in NAND flash. So basically it's like kind of like a backup just without being a backup. Um so this was super simplified. If you are more interested in that there's a great talk uh from the back at USA 2014 about reverse engineering flash memory for fun of fun and benefit from Matt O. And you have given like an introduction into the communication protocol of NAND. Um the soldering of NAND flash and how to reverse engineer the um NAND formats. Uh another interesting talk is also like from uh or it's a block entry actually uh from NAND chips to files. Um from uh John Michael Picotte. And uh there's also like a recommended thing. As a side note, by the way, even vendors of devices are not aware of particular features of their file systems. For example, this is like from uh this is an example from my talk last year at DEF CON. Um where developers leaked actually like a key um where developer keys in the JFFS2 file system. So they basically deleted the file and just imaged the whole file system and put it on millions of devices. And all the millions of devices still had like somewhere the fragments of the key. So even vendors are not safe from that. Let's talk about block devices. Um so block devices are in general known as managed NAND. Um they have multiple standards uh uh EMMC4, EMMC5. The higher the standard, the more difficult it gets for us as reverse engineers or like forensics. Um the classical thing that most people know is like EMMC. And uh EMMC in tech- technically speaking is a flash with integrated controllers. So basically the controller is like on the chip. So it's not necessary anymore that you have- that you do the bare leveling or the other things in like in uh like on the operation system. Um another flavor of um of this kind of uh memory is EMCP. And this is typical things which you find on your smartphone. Um because it's basically EMMC with an additional DRAM on one chip. And the advantage is you- for the vendor for supply chain basically you have only one chip. It contains DRAM and flash at the same time. You see it gets a little bit more complicated with the pins down there. Um under Linux, this devices are kind of seen as normal block storage devices like an SD card. And so they support all file systems X2, X3, X4. Um and the advantage of them kind of is like for complexity reasons that um the bare leveling, the ECC and bad block management is already integrated in them. So you don't have to take care of that. Now if you want to access deleted data then it gets a little bit more complicated because the EMMC controller doesn't really allow us to get raw access on the- on the- on the device like with a raw NAND. Um so but the thing is that the- this kind of chips they're using a raw NAND internally. And they're like possibilities where you can just um bypass the EMMC controller and directly attach to the NAND internally and just bypass all the security things. Um the challenge is just that some EMMC controllers are doing some kind of weird format so you need to figure out what- what we do internally. Again recommended talk here is uh the EMMC chips data recovery beyond the controller. Uh by a company who is doing like a lot of um recovery things. Resolute I think. And the summary is basically even if you delete all the data from the EMMC, all the data is still in there in the- in the- in the chip. So you can extract it. Uh but this is a little bit out of scope for this talk. Alright um let's talk about reset states which you can find if you buy like a used device or if you do dumpster diving or if your neighbor gives you some broken device. So the reset states most of the time depend on the previous owner. So some previous owner think like yeah I have nothing to hide so for example for this media box um for the critical one um I don't need to- to reset it at all so basically this device contains still all the data, all the configurations. Um and one of the reasons why it might be the case is that the knowledge is just missing so the people don't know how to reset this thing. Another level which can be uh the Wi-Fi configuration reset. So this device might still contain all the data or most of the data but it's like in an unprovisioned state. That means if you power it on it won't connect to any Wi-Fi. It expects more or less you to provision it again to a new Wi-Fi. And um interestingly many devices only offer this Wi-Fi reset. Uh so basically if you see a reset button on your device then most of the time it's a Wi-Fi reset it's not the device wipe which is the next thing. Um device wipes in contrast to that they just delete all the data uh put the device back in a factory state and um but even in this case there might be still traces of data there. Um interestingly not all the devices support that because it's basically from technical reasons if they built a device incorrectly then they can't just wipe the device. So in comparison both so some devices actually support both features. Um so Wi-Fi reset is usually marked by a special button if you have a reset button you click it um it's basically doing a Wi-Fi reset. Um device wipe um is usually available over the app if you have an app or you need to press like multiple keys. And now the idea of this Wi-Fi reset is like a very logical one. So basically you don't want to erase the whole device every time you do want to change the Wi-Fi. So basically this device can be reconnected quickly to a new Wi-Fi. So you don't have to wait like for 5 minutes or 10 minutes until the flash gets erased so you want to just move the thing. In contrast to that I mean with the device wipe you want to erase all the data and you want to get rid of everything and get bring it back in a factory mode. But this is like these things are like not necessarily the same in terms of like um what people understand under reset you know. So it's basically for people think they reset the device most of the time it's a Wi-Fi reset. Alright let's talk about data extraction methods. Um for me the idea is extract all available data. Everything which I can get from this device. And there are multiple methods to do that. For example if I somehow can get root access on a device then I can extract it by software. Um sometimes I can dump the flash contents without actually disordering anything. In the worst case I need to disorder like the flash for example. So this is like typically the chip off method. So if you talk about software methods for many IOT devices especially for the cheap ones where like some public methods are available where people tell you how to access like the file system. How to root a device. How to do like whatever. Um and most devices support also like installation of custom firmware or access over USB. For example ADB or UART. Um for some devices especially for cameras there's like some special modes where you can boot a system from the uh SD card for example. And if you have no root shell at some point what you, the thing what you want to do is like basically dump all the flash contents via DD. Um the advantage for DD is basically DD is not flash aware. So it doesn't know anything about out of uh out of um data blocks, out of band blocks or ECC. So it just dumps everything. Um which is very helpful for us. Usually you shouldn't use DD by the way if you ever do backups of NAND flashes because you can't restore them again without breaking a system. Um you extract the data usually by external media SSH or Netcat. Netcat is probably the most easiest thing to do. Uh this method of software works especially good for uh file systems if it's like JFFS2 or UBFS. The disadvantage here is you can only do things with the kernels allowing you. So basically sometimes the kernel is not allowing you low level access on the flash. So you might be a little bit limited there. Um the other thing which you can do is like um you can dump flash without disordering. And it works mainly very good for SPI flash or EMMC. Um some of the devices if you get them they allow in system programming. And how it works basically you take your uh flash reader and you attach it to particular test pins and then you can directly access the memory. The problem is um the processor shouldn't interfere with this process. So you need to kind of make sure that the processor or the sock is kind of like not working. And you can do that um sometimes by pulling like the reset pin or you just ground the uh clock, the crystal so that it doesn't do anything. The advantage of this thing is well you have a reduced risk of destroying your hardware. If you're not very good in BGA re-soldering or like um un-soldering then you probably break your device. The disadvantage is you need to fight the test pins first or you get the traces. And some vendors do um the four layer PCBs they do so that they hide things like in the middle layers and it's kind of nasty. Um the last method of re-sort is more or less dumping the flash by de-soldering. So this works literally for all the flash methods uh for all the flash chips. Um I'm confused. Well ok so how does ok um how this works is usually that um the recommended thing is you heat up the PCB um before you do any soldering because if you don't heat up the PCB then um at some point you might accidentally pull pins because you have like a ground pin. Um if you have accessible pins for like for TSOP um one one trick which you can do is like basically create like a low temperature alloy and a low temperature alloy you just take like a um like an alloy like a soldering alloy which is like 120 137 uh degrees Celsius and then you just mix it with the existing alloy and you can do that uh with a normal soldering iron so you don't need too much special tools. For BGA chips it gets a little bit more complicated. Um you most of the time need like some hot air station, infrared or a flow oven or a flow soldering station. Some people use also a pizza oven but I might not recommend that. Um in general the disadvantage of BGA chips is um if you want to reuse the device later you need to um re-bore the chip and um to re-solder it and this might be complicated and might be might require a lot of um patience. Um especially one one thing about NAND devices is that you might need um a special adapter to use them because of the high pin count. Alright let's start with the tools which you need to do uh which you which you can use for particular things. Um if you want to access SPI flash um you can literally take any device which can bit ba- do bit banging on GPIOs. You can use a Raspberry Pi, you can use Adrenos, you can use Bus Pirates. Um for Raspberry Pi you have the software FlashROM which can natively speak to most of the um flash chips. So that's kind of easy. My favorite tool because I use it also for other things is FlashCat USB which is I don't know a couple like 30-40 bucks or so. Um this is also for that purpose. Um if you if you want to access EMMC flash um the advantage of EMMC flash is it speaks the same protocol like SD card so you can use potentially like SD card readers. Um here the important thing is you want to double check the data sheet of the EMMC flash because some of them are low voltage. So it's like 1.8 volt if you connect it with 3.3 then you have a very hard time and you need to buy new devices. Um one very cheap method is here um there's a like an um expert tiers uh EMMC adapter for 10 bucks which you can get. You can just connect it into a SD card reader. You sort of the um um the cables uh um to to the chip and you can can read it out. The disadvantage of that is um the chips are very small and um so you might have good eyes to do that or you need a microscope or something. Um and uh the disadvantage of this particular method is also that you might not be able to access all the partitions which might be which is actually not a real problem for us in this our use case of getting data from those devices but if you do more reverse engineering you also want to access the special partitions like the boot partitions but this doesn't matter here. Um another method um by the way for EMMC flash is if you get some cheap stuff from China like this uh BGA adapters where you can just put your BGA chip in there and j-jiggle a little bit around and then get a very good connection. Um the advantage of this is that they support dual volag- uh dual voltage chips. So uh you should be good to go with that. Disadvantages with that by the way um you need to find the correct position of the uh of the chip so you need to try a little bit. And I wouldn't recommend to use the original software because it's detected as malware and the typical recommendation of the developers of the software is yeah it's fine just disable your antivirus and uh doesn't sound very um trustworthy. Alright um if you want to access uh raw NAND this gets a little bit more complicated because the pin count gets higher so you need like at least um uh I think 16 pins uh which you need to connect um to the chip. Um and this requires some kind of NAND controller. You can again look into the uh talk about the reverse engineering flash memory for fun and benefit. They have like very very cheap method to do that. But again here there's like more or less professional um devices available where you can just um use like a socket to put the chip in and read it out um and dump all the data. The problem with that kind of devices is um most of the time that they cannot interpret uh the ECC or the band data so it might be a hit or miss. Um another method if you have access to that, evaluation boards. So just take a look at the processor which is used in your device. So I did a lot of vacuum cleaners. I have some development boards which I have exactly the same chip. So I can just solder the chip onto this evaluation board and can just use the processor like it is to read and dump all the information. And can also use it to write information to that without thinking on how to calculate the ECC and how to do other things. Um the disadvantage of this method is obviously you need to get this board somehow and sometimes they're not available or if they're available they're extremely expensive. So it's kind of yeah, difficult. Um at the moment we extracted the data. There's like a lot of um there's a whole zoo of tools which you can use. Um the typical thing that most people just do is like bin walk. Um if you just extract if you just want to extract some data like credentials then you can just use a hex editor. Um at some point if you want to interpret uh NAND flash dumps um there's like some tools like the dump flash tool or uh NAND's dump tool. The problem with this particular tool is um even though that they're open source um they don't handle exotic out of band data sizes correctly sometimes or also the ECC data is kind of like uh difficult. So it depends more or less on the sock which was used. If you at some point have like a UB image you can just dump the whole content of that. Um JFFS images uh it's also easy but it's like also tools for that. So basically for most of the things you have open source tools available. Um you should be good to go with that. Alright let's start with the device analysis. Um so some of the methods which I use um where basically disassemble the device, um unsolder the flash, dump the flash, put the flash on again, then power the device on again and um maybe try to root it. Sometimes it works sometimes it doesn't work. Um the one thing which I try to do is I basically try to connect the device also to the app. So as a new user kind of I connect to um the device to the app and hope that I still get some old information. Um the other thing is like as a kind of test I do um I use the devices for example uh I ran vacuum cleaners in my uh in my lab and then I reset them and then I just compare the data which I had before and after that. So to get an idea of what kind of how good the factory set is. So the first device where I would start is uh the Echovox D-Bot 900. I think it's mostly it's very popular in Europe. I'm not sure how popular it is in America. I got this device in 2019 and the previous owner told me that he erased it. So I was kind of curious about that. This thing runs Linux. Um it has this weird rock chip, a sock. And we use a 128 megabyte of uh NAND flash in TSOP um 48 format. So you see like this green thing on the on the left. Um the approach that I use is basically I dump the NAND flash and then I connect to the UI to get some additional information uh to figure out what's going on. After I unsoldered the flash, I wanted to verify um that this device was actually factory resetted because otherwise it's kind of like a little bit unfair. And the thing is what I found is actually that um I found a log file which is where it says that this device was erased before I got it. So basically it was it was new for sure but this device was erased. The next thing what I found there is like lots lots of fragments of log files, keys, maps, bifurc credentials. The only problem with what I had with this particular device is that I didn't know how to how to uh how to read uh the out of band data to reassign all the blocks correctly. So this is like still something which I'm working on. Um the next step what I did is I connected over UART and was hoping that I can get some shell to extract the data very easy. But unfortunately they did um protect that by making the uh like UART read only. But I found some information about it. So the one information I could figure out is that the rock chip is using this very specific like driver to communicate with the uh with the flash and they do a variable link by themselves. And the other thing what I knew is um that the root partition is squashfs and that the data partition x4 is x4. So um basically I could expect that I find more more traces. So this is like the example with the credentials. So basically um this device um at some point you need obviously to have files which store the credentials. And what you can see here from the from the top to the bottom uh this was the original file which was created in the factory. So you still see the factory credentials of the SDSSID and the Wi-Fi password for the factory somewhere in Changshan or wherever this vacuum cleaner was designed. And over the time when the previous owner was adding Wi-Fi's or was connecting this device to the Wi-Fi, you see that more and more Wi-Fi's were like added to this. Um the other, I had to censor things. So the blue things are censored. Um the other thing what you see out of the log files is every time uh when the vacuum cleaner was connected to the Wi-Fi or when the original point where the owner was provisioning this device first time to the Wi-Fi. So in this case I knew that this the person had like a Galaxy phone because you can see it in the in the log files that the Galaxy phone was connected to this. So now we have some of the information so what about locating the former owner? And um there's like a very useful uh API for that, the Google geolocation API. And what it does is you give it uh two MAC addresses and the signal strength and it gives you back the coordinates and the accuracy rating. Um the problem with this particular device was um unfortunately it had only one MAC address so I couldn't use this API to find the original position of that. Um but there's another website where you can just enter the SSID and then you can just look around the world where this SSID is coming from. And the thing about this particular SSID is that it was like a provider modem which had like a random random number SSID so I found exactly only one um position where this SSID was used. At the second SSID from the same owner, I checked, double checked it and figured out it's somewhere in the middle of Germany so I have also the exact address but I didn't have it here. Um right, so as a summary for this particular device, uh most of the user data was still existing on this device even though it was swiped. Um I could see the XMMP log files um this device is using XMMP for the communication with the cloud. Um I could see the maps, the credentials. Um because the maps are using some kind of weird format I couldn't really reassemble them but I might at some point. Um I also tried to reset this device 3 times in a row and still could get all the fragments so factory resetting is not very effective there. Um one interesting aspect is I also found the factory locks so where the sensors and all the other stuff was tested and I think these files are actually not existing anymore in the logical space but they're still on this thing. Um again I could uh track the previous owner of this device. However there's one small good news. Um if you connect this vacuum cleaner now to the to the um wifi and to your uh account then basically the app doesn't leak previous information so it's kind of this is kind of okay so the data is apparently not there anymore in the form that everyone can see it. Um interesting thing is I found the similar results also for other vacuum cleaners. I'm not sure if I mean everyone who's using um this kind of raw NAND chips is kind of like want to save money so a lot of devices have exactly the same issue. Right um the second device which I analyzed um because I do many research on Xiaomi so I bought random used devices and broken devices out of ebay. Um this is a device which I got in 2018. Um I didn't really know what kind of condition it had because it was broken. Um in general the Xiaomi devices they have uh they run an Ubuntu 14.4 uh with a quad core um and they have a 4 gigabyte of EMMC. And here the approach was that I connect over uh UART and dump the partitions um over UART and then later on I tried to connect it again to the cloud. Um the good thing about the Xiaomi vacuum cleaners is that routing methods exist. Um I found them I think 2 years ago and presented them. Um you can get root shell over UART or you just can push your custom firmware onto that. The good thing with pushing custom firmware is it doesn't destroy the data so the data is still there so which is kind of good. Um and later on you can exfiltrate all the data via SSH. Um the alternative method is if this device is totally broken um you can still remove and dump the flash content but still works. Um to give you like an idea of for what to look for um this system this is like the EMMC layout um how it looks like. So you see that it has like 3 copies of the operation system. Uh then on the um pre last line there's the reserve partition which contains all the usage data so how much how often this device was used. Um what is the status of like all the sensors, the uh HEPA filter and so on. And then there's a user partition which is the udisk partition which contains all the logs uh maps, wifi configuration and user ID. Um and this is like the partition which we're interested for. So uh 1 thing about this vacuum cleaner in particular this device is actually support 2 modes of uh reset. So the first thing is wifi reset which is which is a button which is called reset. Um and the second is like the uh factory reset. Um the wifi reset what it does is just deletes the wifi credentials but everything else remains there. And the factory reset needs a special procedure where you need to press multiple buttons to wait and then it resets uh the device in the factory. Um it's mentioned in the manual but I figured out that nearly no one knows about it. So probably the first thing what you do is like if you get the manual you just throw it away. And um yeah. What this factory reset actually is doing is it restores the um operation system from the recovery and the formats the data partition. But interestingly here is it doesn't wipe it really so there might be still some traces. Um the partition of the usage data is not erased so basically all the usage data is still there but not kind of the user data. So what I did is I just connected it then to the cloud and I figured out oh hey um all the data is still visible in the app so I could figure out like okay when when was the apartment cleaned of the person? What the apartment is looking like? And um so the assumption was that this device was only wifi resetted so they pressed only the reset button nothing more. Um and even though that I connected it to a totally different account uh this device was re-uploading all the data from the vacuum cleaner up in the cloud. So I had it as a new owner. I had all the previous data before. Also all the log files were still um locally available. And I was kind of curious what happens if I do a factory reset. So at the end of the day I did the factory reset. The good news is if you do like a real factory reset and press the real buttons then the data is at least not visible in the app anymore. Um I was looking at the log files and figured out hey I have two mega addresses. Um and actually the geo uh the Google geo RP have given me like some coordinates back and um I figured I mean I again censored it so it's like somewhere in the area but I knew the exact address. Um as soon as I knew the address I was looking at the at the street and I figured out that the Wi-Fi credentials have uh SSID had part of the street name in it and the street number because I don't know someone figured out it's maybe a good idea to use the street name and street number as a Wi-Fi SSID. And the password contains some uh personal information like probably the dog's name. I don't know. Not sure. Um however because this data is like stored in plain text in the device you can just read it out. Another magic trick is by the way um the device has a user ID of the user and if you use like the app you can share devices with other users and one thing which I did is basically I created like a fake account connected like a fake device and then I was just sharing this device with this user with the previous owner and had also the profile picture and the name so yeah. Yeah um so as a summary um for this particular device all the data was still there. The rest was not wiped. Um the reset button is very misleading like for many devices so reset is not doing actually reset. Um however in this case the correct procedure is actually documented in the menu but most of the people don't read that. Um again here I could track the owner um with the due to the log files and this kind of devices that create a lot of log files and there we are both so you have like a nice um nice idea what's going on there. Alright um some other example which I have here um are like this doorbelts. I figured out like I have like now I think 8 doorbelts and 7 of them are more or less from the same I think SDK. Um in terms of like um if you buy like 8 doorbelts from Amazon you have probably um internally 7 times the same hardware but different interior like exterior. Most of them are based on the high 3518 chip. Um they have like an SPI um nor flash in there. They use again JFS 2 and QBFS so you can happily um recover all the credentials. Um they have some log files so you might get one MAC address of the of the Wi-Fi access point so it's kind of like a little bit more difficult but actually you could track it down. The sad thing about this kind of devices is they have unfortunately like a SD card slot so they don't contain video data so it was like a little bit sad about that. Um not necessarily all IT devices are bad so I found actually one device which I didn't disclose yet um which was also a vacuum cleaner from a different company who used trust zone for key storage. They encrypted all the user partitions with looks. Um the um the keys were managed by this trusted execution engine and they're device specific and every time this thing boots up it checks like some states and then unlocks the partitions. Interesting thing here is if you do a factory reset it just throws away the keys and recreates the partitions so in this kind of case it would be kind of safe but this is like this is one example I've I saw so far so it's very very rare. Um as a conclusion um in general I had like a sample size of like 26 devices which I had found uh got or found like in like some swap fest. Um I figured out that apparently um secure or correct factory sets are very difficult to implement. Um especially if you use raw net uh flash it nearly defeats all the time like uh full vibes. And there's no real way to ensure that the device has actually waived uh waived uh wiped sorry. Um many also many of the vendors actually don't release all the user generated data. So you have like usage data which still remains there. Log files are not erased. Um the only thing that sometimes is erased is like the buffer confirmation files. Um but all the other information is more or less still like on this device. Um another problem what you have again is uh the missing knowledge of the user. So if the people don't know how to reset devices then in in the first place then we cannot even complain about the vendors because the user don't reset them. Um as a recommendation if you ever want to get rid of um devices uh don't sell them and throw them away. Um especially if you expect that they contain any sensitive information. So especially don't throw away like this media stuff uh the media players. Um and also don't throw away devices if you cannot verify that they have been uh done a full wiped. One example is destroy the physical memory. If it's a cheap device or just use this device to practice soldering that unsolder resolder things. Um in general it might be a good idea if you had to throw away devices maybe change your wi-fi credentials so at least that someone who has the credentials cannot break into your local network. Or the other thing is just put all your devices into a separate IOT wi-fi which kind of also limits the impact if someone gets the credentials. Alright um that's it. Uh for here I want to thank uh thank professor Nubir and uh professor uh John Manfidelli from uh the University and also the Zemo team from Darmstadt. And if you have any questions I'm happily here to answer them and I have also some devices if you want to take a look at this kind of weird adapters. I'm here for a while. Thank you.