1 00:00:00,000 --> 00:00:04,200 I want to introduce a good friend of the village, Jay Ballon. 2 00:00:04,200 --> 00:00:05,700 He works at Bitdefender. 3 00:00:06,120 --> 00:00:07,920 They do a lot of great research. 4 00:00:07,940 --> 00:00:20,220 And he's going to expand upon a series of talks he's been doing and research he's been doing about hacking massive exploits across, you know, 500,000 devices. 5 00:00:20,220 --> 00:00:21,820 Maybe 450,000. 6 00:00:22,700 --> 00:00:24,740 A million devices. 7 00:00:26,760 --> 00:00:27,400 Okay. 8 00:00:27,400 --> 00:00:28,080 Seems legit. 9 00:00:28,080 --> 00:00:29,680 A million devices. 10 00:00:30,260 --> 00:00:31,440 Next gen. 11 00:00:32,040 --> 00:00:32,800 Botnets. 12 00:00:32,800 --> 00:00:33,760 Sounds cool? 13 00:00:33,900 --> 00:00:40,600 Without any other delays that I might be doing right now for people to be sitting down in the back and having a good time. 14 00:00:41,140 --> 00:00:44,120 Make sure to speak very loudly and clearly into the mic. 15 00:00:44,180 --> 00:00:46,000 And enjoy the talk. 16 00:00:46,000 --> 00:00:47,440 Thank you, everyone, for being here. 17 00:00:47,440 --> 00:00:48,140 Next call. 18 00:00:53,330 --> 00:00:54,730 Hello, everyone. 19 00:00:54,830 --> 00:00:58,330 Uh, thanks so much for coming to see this talk. 20 00:00:58,330 --> 00:01:01,030 Uh, my name is Alex Ballon, aka Jay. 21 00:01:01,030 --> 00:01:03,830 I work for this nice company called Bitdefender. 22 00:01:03,830 --> 00:01:06,530 Probably none of you, most of you have heard of it. 23 00:01:06,590 --> 00:01:11,650 Um, and this is the team that kind of put together just this research. 24 00:01:11,650 --> 00:01:17,210 We've been doing it, IoT, uh, research as of 2013, I would say. 25 00:01:17,210 --> 00:01:18,430 Something like that. 26 00:01:18,490 --> 00:01:34,330 Um, this talk is going to be focused on a specific particular topic and that is leveraging the cloud implementations to get unauthorized access, uh, root access on as many devices as possible. 27 00:01:34,330 --> 00:01:42,570 And we've actually focused on, on cloud implementations or actually bad cloud implementations for, for a while now. 28 00:01:42,570 --> 00:01:51,490 And this is kind of, I've prepared this small montage about what vendors talk about when they receive a report from us. 29 00:01:51,490 --> 00:01:59,870 Because we've been sending reports on bad cloud implementations to a number of vendors and every so often we actually get replies saying, yeah, that's cool stuff. 30 00:01:59,870 --> 00:02:05,770 Uh, unfortunately many times we get no replies because that's how responsible disclosure unfortunately works. 31 00:02:06,010 --> 00:02:15,930 But just, you know, for laughs and gigs, this is what, kind of what we imagine happens on the vendor side when we send our, our kind of, our reports through them. 32 00:02:17,510 --> 00:02:19,690 And you see, the sound doesn't work. 33 00:02:22,150 --> 00:02:23,330 It worked. 34 00:02:23,870 --> 00:02:24,750 Hang on. 35 00:02:24,890 --> 00:02:26,150 We hacked stuff. 36 00:02:31,980 --> 00:02:33,480 Uh, do, do, do, do, do. 37 00:02:33,480 --> 00:02:34,160 So. 38 00:02:42,040 --> 00:02:44,560 This microphone, oh, again. 39 00:02:50,960 --> 00:02:52,460 You know, the cloud. 40 00:02:54,040 --> 00:02:55,900 Nobody understands the cloud. 41 00:03:00,600 --> 00:03:08,820 Yeah, well pretty much, actually that was kind of the vibe that we got from, from most of the company that we sent our, our, our reports to. 42 00:03:09,280 --> 00:03:17,840 Um, essentially, yeah, none of them or at least most of them don't really understand how to, how to implement cloud for, for IoT. 43 00:03:17,900 --> 00:03:21,800 So with that in mind, I'm just going to stop, start, kind of move into it. 44 00:03:21,800 --> 00:03:29,720 So IoT, we kind of see it as a, this stack of hardware, operating system and, and cloud. 45 00:03:30,720 --> 00:03:33,400 So, it's, it's an analogy that I like to do. 46 00:03:33,400 --> 00:03:38,740 What if I told you that IoT is pretty much like a WordPress website? 47 00:03:39,960 --> 00:03:45,700 Can, no, just out of curiosity, show of hands who sees the analogy between IoT and WordPress? 48 00:03:46,880 --> 00:03:47,660 Cool, right? 49 00:03:47,660 --> 00:03:56,380 I mean, you, you look at this stack, you have like, for those older, as old as I am, you have like hardware, Red Hat 6.2 and VFTPD. 50 00:03:56,520 --> 00:04:06,000 Uh, this FTPD server that was known to provide root access to, to, to Red Hat servers back in the, I guess 1998, 1999 and the likes. 51 00:04:06,000 --> 00:04:10,940 Uh, then you had like, um, hardware, Windows operating system, IS 5.0. 52 00:04:11,040 --> 00:04:15,020 Um, and, and the stack goes on, right? 53 00:04:15,160 --> 00:04:20,340 So essentially, IoT is like hardware, a busy box environment, mostly Linux or whatever. 54 00:04:20,400 --> 00:04:25,580 And then there's an application layer which is in, in, in most parts like this web app, right? 55 00:04:25,680 --> 00:04:31,740 And being a web app is like susceptible to most of the vulnerabilities specific to a web app. 56 00:04:31,740 --> 00:04:33,620 But here's, here's the magic thing about this. 57 00:04:33,620 --> 00:04:39,200 You have like this huge threat landscape, huge attack surface because of that web app, right? 58 00:04:39,200 --> 00:04:43,900 So it's like command injection, all types of injection like cross-site scripting, all that stuff, right? 59 00:04:43,940 --> 00:05:02,540 And then you have another layer added on top of it by the manufacturer for IoT functionality and they have like this new whole set of binaries stuck inside that IoT that get input from the cloud and this is you, you're going to see what I'm getting with this because the cloud is going to send input to those binaries, 60 00:05:02,540 --> 00:05:08,980 these new binaries on top, in, in, in that operating system and you're going to be able to do stuff like cool stuff with it. 61 00:05:09,160 --> 00:05:17,780 So essentially, IoTs are just websites running on Linux but with a significantly bigger attack surface due to mobile apps and cloud. 62 00:05:18,320 --> 00:05:24,680 If you want to get into IoT hacking, this is going to be like just a quick crash course on stuff to look for. 63 00:05:24,740 --> 00:05:30,840 Obviously look for software, there's still Telnet in 2019, like 6 million Telnet servers open in the internet. 64 00:05:31,100 --> 00:05:36,540 Uh, definitely the first thing that you look for is the, the way the mobile app communicates with the cloud. 65 00:05:36,620 --> 00:05:39,440 That's, that's the golden nugget right there. 66 00:05:39,440 --> 00:05:50,720 If you look at the way the mobile app communicates with the cloud and start impersonating the mobile app and start fuzzing those requests, you're going to see like a number of very interesting things that the cloud replies back to you. 67 00:05:50,920 --> 00:05:53,820 Um, as we, as you're going to actually see later on. 68 00:05:54,820 --> 00:06:01,180 Uh, fun thing, um, who here is familiar with the flag pi in, in compilers? 69 00:06:01,660 --> 00:06:05,180 Right, so pi is, pi is not used in, in IoT. 70 00:06:05,660 --> 00:06:10,400 So essentially if you get a buffer overflow in a binary on an IoT, you get a shell. 71 00:06:11,160 --> 00:06:16,520 You get a command execution, a connect back shell actually because a lot of them are behind NAT these days. 72 00:06:16,580 --> 00:06:26,120 So if you get any kind of buffer overflow on, on an IoT in any binary on an IoT, then you get almost a guaranteed remote command execution on that IoT. 73 00:06:26,120 --> 00:06:30,360 And that command is going to be a connect back shell to you and there you go, boom, shell. 74 00:06:31,080 --> 00:06:44,020 Um, the reason why they're not implementing pi, so ASLR is enabled on most operating systems running on IoT, but enabling pi, pi for those of you who don't know, uh, it stands for position independent executable. 75 00:06:44,020 --> 00:06:56,020 It's a, it's a flag at compile time which enables an executable to be moved in memory at random memory addresses in order to not have a predictable memory address to get code execution. 76 00:06:56,020 --> 00:07:02,200 So you can just crash it, so ASLR says where you just crash it, you don't get RC, right? 77 00:07:02,200 --> 00:07:13,500 But you need to compile your executables with the pi flag in order to allow it to be moved at different memory addresses to be able to benefit from ASLR. 78 00:07:14,080 --> 00:07:20,880 Uh, literally none of the IOTs that we've investigated had any binaries compiled with pi. 79 00:07:20,920 --> 00:07:25,560 So if you get a buffer overflow, again, full RC, full compromise. 80 00:07:26,300 --> 00:07:32,300 Um, arguably good old stuff, you know, back doors, traditional reuse and look for cloud chatter. 81 00:07:32,940 --> 00:07:49,700 If you want to dump the file system of an IOT, the easiest way to do it and the most popular way to do it is via serial interface and for those of you who didn't know, now you know, you can hijack the bootloader of an IOT much like you would hijack the bootloader, 82 00:07:49,700 --> 00:07:51,420 uh, of your Linux machine. 83 00:07:51,580 --> 00:07:55,660 So for those of you who sometimes forget your root password, right? 84 00:07:55,740 --> 00:08:13,980 And you like pause, grab and like init equals, BNSH and all that stuff, well you can do the same thing with IOTs and, uh, that's kind of the string over there, just serenv, bootargs, that's the memory, blah, blah, blah, init equals BNSH at the end of the bootloader. 85 00:08:13,980 --> 00:08:20,060 And you can just pause the bootloader via the serial interface and bam, you get root access. 86 00:08:20,960 --> 00:08:29,760 And from that point onwards you just plant a small, let's call it a back door or whatever you want to call it, to be able to access the system after the next boot and you dump the file system. 87 00:08:30,440 --> 00:08:34,220 Now we come to the cool part, the first cool part of the presentation. 88 00:08:34,220 --> 00:08:36,700 Let's look at traditional IOT botnets. 89 00:08:37,560 --> 00:08:53,020 The way it used to be done and the way it's currently being done, we're tracking a lot of them with our honeypots, is they iterate IP addresses, check if there's telnet enabled, if there's telnet enabled then they go like brute forcing telnet and maybe they get in. 90 00:08:53,280 --> 00:09:02,360 Uh, then they look for web interfaces and they look for stuff like Netgear exploits, like, you know, command injection in the web interface or stuff like that. 91 00:09:02,360 --> 00:09:05,600 And we see a lot of that in our IOT honeypots. 92 00:09:05,600 --> 00:09:12,160 There's like, I don't know, about a few hundred IOT botnets roaming, families roaming around. 93 00:09:12,160 --> 00:09:13,100 Mirai is one of them. 94 00:09:13,100 --> 00:09:22,660 So there's probably thousands of IOT botnets right now based on the code base of different types like Mirai, Hajime, uh, Hire and Seek and so on and so forth. 95 00:09:22,920 --> 00:09:30,860 Uh, just for trivia, if you're curious what they're doing with those botnets, just out of curiosity, anybody know what they're doing with the IOT botnets? 96 00:09:31,840 --> 00:09:32,800 Really? 97 00:09:33,100 --> 00:09:34,800 Okay, that guy knows. 98 00:09:35,600 --> 00:09:37,680 That's, that's right, it's DDoS. 99 00:09:37,680 --> 00:09:41,060 Um, are you familiar with the concept of stressor services? 100 00:09:41,860 --> 00:09:50,680 Right, so those, those services that you pay to stress test your infrastructure or somebody else's infrastructure, right? 101 00:09:50,680 --> 00:10:02,040 And, and you get, you get, you like pay, um, I don't know, like $15 or $35 for, uh, a 5,000 zombie botnet to DDoS for half an hour. 102 00:10:02,040 --> 00:10:05,520 And for $35 you can take somebody else's website down. 103 00:10:05,520 --> 00:10:21,180 We've seen a direct correlation between the functionalities offered by the stressor services, you know, uh, sync flood or, uh, NTP amplified flood or DNS amplified flood and all that stuff and the functionalities extracted from the binaries in our honeypots. 104 00:10:21,540 --> 00:10:28,800 So there's an, a direct correlation between the IOT botnets and the online stressor services. 105 00:10:29,900 --> 00:10:35,720 So that's the old way, now our prediction is that this is going to be the new way. 106 00:10:35,720 --> 00:10:42,360 And with that in mind, let me tell you a few things about how cloud is implemented in IOT. 107 00:10:43,500 --> 00:10:54,880 Because, you know, direct connection to IOTs is like so last Tuesday you need like port forwarding and you need, uh, direct access to some port on that IOT. 108 00:10:55,040 --> 00:11:10,760 So this is why many vendors implemented the cloud to relay, um, you know, any commands you would want to give that IOT or to give you access to that IOT, uh, if it's a video camera to give you the feed of that IOT and so on and so forth. 109 00:11:11,460 --> 00:11:16,720 And the way it works is that it provides more efficient management, right? 110 00:11:16,720 --> 00:11:21,080 Because you have like all this IOT registered to a cloud and the cloud relays commands. 111 00:11:21,720 --> 00:11:31,400 Um, it has a modular architecture, so nowadays vendors integrate each component of that IOT from different types of vendors, right? 112 00:11:31,400 --> 00:11:39,900 I mean, personally I think that's a good thing because maybe they don't know how to do their stuff and maybe somebody else knows better than them, but that's just me. 113 00:11:40,400 --> 00:11:47,120 Um, as far as cloud goes, this is a rough implementation in most cloud platforms. 114 00:11:47,120 --> 00:11:53,680 So you've seen at security conferences, we provide an IOT security, an IOT cloud platform. 115 00:11:53,680 --> 00:11:56,520 There are like dozens of companies that provide that. 116 00:11:56,520 --> 00:11:59,180 Their architecture is quite similar. 117 00:11:59,440 --> 00:12:06,900 Um, you provide, they generate a unique device ID which is, um, like that. 118 00:12:06,920 --> 00:12:17,960 It's a string, usually 32-bit string, uh, that's kind of non-predictable and that's roughly the bulk of authentication that happens in IOT clouds. 119 00:12:17,960 --> 00:12:20,920 If you know that string that you can interact with the device. 120 00:12:22,240 --> 00:12:32,840 Um, any commands that the application sends are just sent, I want to talk to that device ID and then some of them actually have decent encryption. 121 00:12:32,840 --> 00:12:44,360 We've seen, and thumbs up to the companies that have, um, unique symmetric keys between each app and their cloud and between, between each device and their cloud and that's great. 122 00:12:44,540 --> 00:12:53,620 Um, and arguably there is a, this is a genetic description but it applies to 90% of all the things that we've seen so far. 123 00:12:54,180 --> 00:12:55,940 And that's great. 124 00:12:56,640 --> 00:12:59,540 Anybody see anything wrong with this implementation? 125 00:13:00,440 --> 00:13:01,840 Not so far. 126 00:13:02,960 --> 00:13:12,800 However, as it turns out, when you look in depth, you see that not all cloud implementations, you know, are that good. 127 00:13:12,800 --> 00:13:23,140 And actually a thing that we've discovered is many of these third-party modules that IOT vendors integrate in their stuff are good. 128 00:13:23,240 --> 00:13:30,520 However, it very often, it's very often the case that it's the way they implement the stuff that's shit. 129 00:13:30,800 --> 00:13:32,880 Like so bad. 130 00:13:36,620 --> 00:13:48,990 So, for example, you know, if you want to, if you want to test Amazon S3, have you ever heard of bad implementations of Amazon S3? 131 00:13:49,530 --> 00:13:51,590 Of course not, right? 132 00:13:52,470 --> 00:13:56,730 Yeah, well, um, MQTT is this new kid on the block that's actually kind of cool. 133 00:13:56,730 --> 00:13:59,210 Uh, also poorly implemented by a lot of vendors. 134 00:13:59,210 --> 00:14:04,570 So this is kind of what we're going to go and talk about further on in this, uh, in this presentation. 135 00:14:04,870 --> 00:14:07,590 So a few words on Amazon S3 buckets. 136 00:14:07,730 --> 00:14:11,110 How many of you are familiar with how Amazon S3 works? 137 00:14:11,630 --> 00:14:12,310 A few. 138 00:14:12,310 --> 00:14:13,050 Cool, cool, cool. 139 00:14:13,050 --> 00:14:19,670 So you can correct me because this is me just, you know, babbling on about something so you can correct me if I'm wrong. 140 00:14:19,670 --> 00:14:20,470 Thank you. 141 00:14:21,210 --> 00:14:31,990 Uh, in many cases the bulk of authentication or security that comes with Amazon S3, and I'm talking about the vast majority of implementation, is that a device generates a path for a file. 142 00:14:31,990 --> 00:14:36,410 So Amazon S3 is used for storage, for those of you who didn't know. 143 00:14:36,490 --> 00:14:45,510 So, the device generates a path for a file and that's the file that I created and then passes on that path to whoever is allowed to read it. 144 00:14:45,510 --> 00:14:51,290 That would be the management mobile app of the, you know, uh, IOT device. 145 00:14:51,810 --> 00:15:00,910 Now, um, in most implementations of Amazon S3 you cannot do a listing of your bucket. 146 00:15:00,930 --> 00:15:01,810 Right? 147 00:15:01,910 --> 00:15:05,490 So, um, that's the way it's supposed to be. 148 00:15:05,490 --> 00:15:11,230 However, um, unfortunately in some implementations you can. 149 00:15:11,890 --> 00:15:25,810 So, just out of curiosity, if you're ever doing kind of research on Amazon S3 buckets, try to go list my own bucket or even more than that, try to go list the root folder of that vendor. 150 00:15:26,170 --> 00:15:31,730 And, um, you're going to be surprised what, about what you're going to find. 151 00:15:32,250 --> 00:15:43,250 Um, so we've seen a really big number of vendors allowing the equivalent of recursively listing the root folder of that company. 152 00:15:43,250 --> 00:15:45,370 So, not that bucket, of that company. 153 00:15:45,370 --> 00:15:54,170 So, that means all the devices, all the recordings, absolutely everything that's belonging to that company and that's ridiculous. 154 00:15:54,670 --> 00:16:14,550 Um, MQTT, um, essentially you have a device that registered to a server and it registers to, uh, something like, you know, vendor device ID slash topic where topic is I'm on, I'm off, I can do this, I can do that, I'm doing this, I'm doing that and so on and so forth. 155 00:16:14,910 --> 00:16:24,490 Um, now arguably, as I was saying earlier, one of the major security components of IoT cloud architecture is the device ID. 156 00:16:25,230 --> 00:16:34,430 So the way the app communicates is that I've received that I can register to vendor device ID topic and I can read that information. 157 00:16:35,270 --> 00:16:37,450 This is MQTT, it's not that complicated. 158 00:16:37,450 --> 00:16:39,790 I've learned about it literally three weeks ago. 159 00:16:40,590 --> 00:16:43,550 That's when I added, these slides were added very recently. 160 00:16:44,270 --> 00:16:50,570 Um, ideally security counter mergers will prevent attackers from tapping into another device. 161 00:16:51,490 --> 00:16:53,710 But it gets worse than that. 162 00:16:54,670 --> 00:17:10,590 You can actually, when it's poorly implemented, you can tap into slash root, much like with the S3 bucket, you can tap into slash vendor and then get swarmed by absolutely all the device IDs and all their statuses belonging to that vendor. 163 00:17:10,870 --> 00:17:22,630 And it can be, again, whenever somebody implements MQTT, again, I'm going to go to a hypothetical scenario here, purely hypothetical. 164 00:17:23,070 --> 00:17:26,890 We want to hack Irene's baby monitor and we want to do a targeted attack. 165 00:17:26,890 --> 00:17:32,050 So not just hack everybody but we want to do a targeted attack against a specific person. 166 00:17:32,390 --> 00:17:51,250 And what we're going to do is just register to slash vendor, get swarmed with all the device IDs, use the mobile app API to pull the config for each device ID because, I don't know if you noticed, when you use a mobile app on IoT, it refreshes its config from the cloud. 167 00:17:51,270 --> 00:17:56,850 It sends, I'm this application for this device, for this customer, give me my config. 168 00:17:57,130 --> 00:18:01,890 And then it displays it in the settings section of the mobile app. 169 00:18:01,930 --> 00:18:10,890 So you can essentially, if you have the device ID, you can pull the config, like name, last name, email address, location, and so on and so forth, for each one of their customers. 170 00:18:12,110 --> 00:18:20,230 So when you see the email of Irene popping up, you just correlate because you see now that's the device ID corresponding to Irene. 171 00:18:20,270 --> 00:18:25,890 So you go to S3 and fetch all her recordings. 172 00:18:25,890 --> 00:18:31,770 And of course, again, for some purposes, this is a purely hypothetical scenario. 173 00:18:32,810 --> 00:18:38,270 So onwards, we've been doing a lot of papers on IoT, especially cloud related. 174 00:18:38,410 --> 00:18:39,410 Erimax is one of them. 175 00:18:39,410 --> 00:18:49,150 It's quite relevant because you can get like RCE and you can get a lot of information on that just by knowing the MAC address of the power outlet. 176 00:18:49,630 --> 00:18:53,030 And essentially, you could just iterate all the MAC addresses, like 16 million of them. 177 00:18:53,030 --> 00:18:57,290 We can iterate them over Tor and still get RCE and all that good stuff. 178 00:18:58,150 --> 00:19:00,790 And we come to our star of the day. 179 00:19:00,790 --> 00:19:08,630 So as an example of some of the things that I've mentioned before, I'm going to talk to you about this security camera called Godzilla. 180 00:19:10,170 --> 00:19:12,430 I think I have a sample here somewhere. 181 00:19:20,080 --> 00:19:21,600 So this is one sample. 182 00:19:22,960 --> 00:19:24,660 The other one is in my room. 183 00:19:25,140 --> 00:19:28,320 And if the demo guys are good with us, we're going to try to hack it. 184 00:19:28,920 --> 00:19:32,280 So here's how it works. 185 00:19:32,720 --> 00:19:36,520 There's an API at apps.Godzilla.com. 186 00:19:36,520 --> 00:19:45,720 And after the application authenticates, you register an account with them, you're assigned something called a client ID by us, but they call it a UID. 187 00:19:45,720 --> 00:19:49,780 But we're going to call it both, but just so you know, it's a client ID. 188 00:19:50,420 --> 00:19:53,620 Essentially, this is a bad implementation for Godzilla. 189 00:19:54,060 --> 00:19:57,360 And does anybody see anything wrong here? 190 00:19:57,480 --> 00:20:00,680 Ours was 408,311. 191 00:20:01,400 --> 00:20:03,840 Show of hands who see something wrong here. 192 00:20:05,180 --> 00:20:06,900 I mean, yeah. 193 00:20:07,620 --> 00:20:09,720 It's a goddamn number. 194 00:20:11,540 --> 00:20:24,260 I mean, the cloud platform did a good job of providing them with like really long string device IDs and they've added a layer on top of that with sequential numbers. 195 00:20:24,260 --> 00:20:27,060 So you go like 408,312, 408,313. 196 00:20:27,060 --> 00:20:31,860 You can go like a hundred and you're still going to get somebody's. 197 00:20:31,900 --> 00:20:35,180 Because there's more devices per client. 198 00:20:35,180 --> 00:20:39,480 So they wanted to have this three architecture where client and devices per client. 199 00:20:39,480 --> 00:20:40,280 So yeah. 200 00:20:40,580 --> 00:20:42,660 The UID cannot be changed. 201 00:20:42,880 --> 00:20:45,520 So if you wanted to secure yourself, tough luck. 202 00:20:46,160 --> 00:20:50,100 And yeah, it's incremented by one for each account. 203 00:20:50,700 --> 00:20:57,580 So essentially the user, there's a username and password actually that's being used in communication with the cloud. 204 00:20:57,580 --> 00:21:05,600 However, they are hard coded in the app and they're the same for all of the apps and all of the devices of all of the Godzillas around the world. 205 00:21:05,820 --> 00:21:11,040 So it's cool that they're using the username and password, but not that cool that it's the same and it's hard coded. 206 00:21:14,600 --> 00:21:17,320 The post requests are actually sent using encryption. 207 00:21:17,820 --> 00:21:19,760 AS256 with CBC mode. 208 00:21:20,180 --> 00:21:25,680 However, the encryption key and the initialization vector are hard coded in the app as well. 209 00:21:25,920 --> 00:21:26,720 So yeah. 210 00:21:27,040 --> 00:21:30,580 So what we did, we kind of, and there's also the UID. 211 00:21:30,920 --> 00:21:34,220 So we kind of replicated that. 212 00:21:35,540 --> 00:21:39,700 And let's see if we can do our first demo. 213 00:21:46,790 --> 00:21:48,690 I hope that the fonts are okay. 214 00:21:49,110 --> 00:21:50,510 I can make them bigger. 215 00:21:50,790 --> 00:21:51,990 Can everybody see? 216 00:21:52,210 --> 00:21:52,790 Pretty much. 217 00:21:52,790 --> 00:21:53,350 Okay. 218 00:21:53,350 --> 00:21:58,710 So what we're going to do now is kind of try to pull our data from the Godzilla cloud from a server. 219 00:21:58,710 --> 00:22:00,470 This is my VPS in Canada. 220 00:22:00,630 --> 00:22:08,230 I usually like to do a lot of remote code execution, so not local area network, just because that's cooler than local attacks. 221 00:22:08,230 --> 00:22:13,770 So I'm going to use my VPS in Canada, which obviously is disconnected. 222 00:22:14,310 --> 00:22:15,570 Hang on. 223 00:22:33,110 --> 00:22:34,550 Hello. 224 00:22:35,310 --> 00:22:39,250 So BD research, Godzilla. 225 00:22:39,430 --> 00:22:49,310 And we have this very small crip called CMDS, which essentially emulates the mobile app. 226 00:22:54,010 --> 00:23:08,730 So again, Python, CMDS.py, I'm going to like get UID from 408311. 227 00:23:09,630 --> 00:23:17,970 And actually just for beautification, I'm going to go, just because I already know what the output is going to look like, I'm going to prettify it just a little bit. 228 00:23:19,650 --> 00:23:25,510 And it's a JSON, so JQ it. 229 00:23:27,130 --> 00:23:28,110 And there we go. 230 00:23:28,610 --> 00:23:32,310 So it's really not that complicated. 231 00:23:32,310 --> 00:23:34,890 It's literally emulating the mobile app. 232 00:23:34,890 --> 00:23:38,510 And I can do that for obviously 312, I can do that for 313. 233 00:23:38,750 --> 00:23:42,450 It's up to about 500 thousand and something right now. 234 00:23:42,450 --> 00:23:46,770 And each one of those people has more than one cameras associated with them. 235 00:23:46,870 --> 00:23:51,370 So this is why, you know, Sam was talking earlier about millions and millions. 236 00:23:51,370 --> 00:23:54,190 Well actually that's not very far fetched. 237 00:23:54,190 --> 00:23:59,990 Because if there's like 500,000 users with at least one camera each, you have 500,000 cameras. 238 00:23:59,990 --> 00:24:03,570 But more of them, many of them have like two or three cameras, right? 239 00:24:03,890 --> 00:24:09,510 So you get the information that you get is like the device IDs associated with that camera. 240 00:24:09,690 --> 00:24:11,110 So this one. 241 00:24:11,530 --> 00:24:14,150 And then you get the password set for each. 242 00:24:14,470 --> 00:24:22,370 Now mind you, you may want to change that password but tough luck because I'm going to see it anyway by making this query, right? 243 00:24:22,370 --> 00:24:26,950 Because you can change the device password but it's not going to matter. 244 00:24:27,750 --> 00:24:31,010 So there's 245 00:24:39,080 --> 00:24:41,140 a number of functions available in that API. 246 00:24:41,180 --> 00:24:43,240 One of them is update user. 247 00:24:43,240 --> 00:24:46,740 We're not going to use that now but it's just for your information. 248 00:24:46,740 --> 00:24:54,400 You can alter the user information like password or email address and you don't need to use a valid email address to do that. 249 00:24:57,400 --> 00:24:59,880 Another one is send invite. 250 00:24:59,880 --> 00:25:01,140 And this is a really cool one. 251 00:25:01,140 --> 00:25:06,220 It's an API function of Godzilla that allows you to send an invite for somebody to view your camera. 252 00:25:13,680 --> 00:25:21,880 The owner will have absolutely no idea that you've done that. 253 00:25:21,940 --> 00:25:24,320 And we're going to try to do that now. 254 00:25:24,420 --> 00:25:27,660 We have the Godzilla app running on my phone. 255 00:25:36,910 --> 00:25:48,890 So I'm inviting that device ID from that client ID, you see? 256 00:25:48,890 --> 00:25:54,650 So device ID, client ID and my email address. 257 00:25:58,220 --> 00:26:01,160 And now, 258 00:26:05,500 --> 00:26:08,380 oh look, I have an invite. 259 00:26:09,260 --> 00:26:10,640 How cool. 260 00:26:10,640 --> 00:26:19,280 So I'm going to accept the invite and yeah, 261 00:26:26,700 --> 00:26:31,800 that's my room and I'm going to send the invite. 262 00:26:31,800 --> 00:26:33,740 This is the camera live right now. 263 00:26:34,480 --> 00:26:38,580 So see, the seconds are rolling. 264 00:26:41,320 --> 00:26:44,060 So this is the camera in my hotel room right now. 265 00:26:44,060 --> 00:26:45,940 Just for your information. 266 00:26:46,300 --> 00:26:47,720 Which is kind of cool. 267 00:26:49,040 --> 00:26:58,880 Just for fun and games we kind of developed a new not so orthodox way of getting into the streams. 268 00:26:59,140 --> 00:27:00,940 Assuming that I'm doing this right. 269 00:27:00,940 --> 00:27:02,300 Hang on, hang on. 270 00:27:06,520 --> 00:27:09,720 One would argue that I was supposed to boot this way earlier. 271 00:27:09,720 --> 00:27:13,000 So I'm going to get back to it after it finishes booting. 272 00:27:15,000 --> 00:27:18,140 So cancel. 273 00:27:19,260 --> 00:27:20,740 Moving on. 274 00:27:24,570 --> 00:27:30,730 Again, the owner of the camera is completely unaware that somebody has been invited. 275 00:27:30,730 --> 00:27:34,180 Not at the moment of the invite and not after that. 276 00:27:34,180 --> 00:27:36,320 So you can send invites to everybody. 277 00:27:36,960 --> 00:27:38,540 What do they call it on Facebook? 278 00:27:38,540 --> 00:27:39,940 Live watch. 279 00:27:39,940 --> 00:27:41,500 Invite your friends. 280 00:27:41,500 --> 00:27:42,660 Stuff like that. 281 00:27:43,160 --> 00:27:46,100 This is how the email looks like. 282 00:27:46,100 --> 00:27:48,120 But you don't really need that. 283 00:27:49,120 --> 00:27:57,040 And yeah, just for the hell of it, we coded this. 284 00:28:00,980 --> 00:28:01,940 Sorry. 285 00:28:05,430 --> 00:28:13,790 You see I have this bad habit of insisting that I do live demos. 286 00:28:15,630 --> 00:28:19,070 And you know what's life without a little adventure? 287 00:28:19,950 --> 00:28:23,190 Live demos tend to break or you miss something. 288 00:28:23,190 --> 00:28:29,050 Anyway, until my Kali boots, I promise you next generation botnets, right? 289 00:28:29,430 --> 00:28:46,570 So we dumped the former, we got the binary and we ran them through EDA and you know, it wasn't very fast until we found a buffer overflow in their cloud agent which is actually a .exe file. 290 00:28:47,010 --> 00:28:50,270 So they have this Kali platform. 291 00:28:50,270 --> 00:29:01,250 Again, much like many other cloud platforms and there's a combination of P2P and relay servers and there's main 514 exe that handles the services device side. 292 00:29:02,290 --> 00:29:06,770 And upon inspection we found that the function was vulnerable to an out of bound rights. 293 00:29:06,770 --> 00:29:09,530 It's the TK set device model handle. 294 00:29:11,130 --> 00:29:13,630 And they specifically crafted buffer. 295 00:29:14,130 --> 00:29:16,270 So this is the code. 296 00:29:16,830 --> 00:29:24,990 And we have in the lower right hand corner, we have those two V28 and V29. 297 00:29:24,990 --> 00:29:35,610 All we have to do is just send a buffer that's large enough to overflow them and get past them and then we get, we have like system right after that. 298 00:29:35,690 --> 00:29:43,030 And we can call system and we have a command execution. 299 00:29:43,910 --> 00:29:47,230 Which hopefully we're going to be able to demonstrate. 300 00:29:50,090 --> 00:29:51,730 So let's see. 301 00:29:51,730 --> 00:29:59,530 So again, fully remote, we have this netcat listening and we're going to try to get a root shell in my room. 302 00:30:00,730 --> 00:30:03,390 And hopefully so. 303 00:30:09,070 --> 00:30:12,110 This is the almighty exploit. 304 00:30:22,600 --> 00:30:25,620 Am I sending it what I'm supposed to send it? 305 00:30:33,000 --> 00:30:33,980 Oh, well. 306 00:30:38,620 --> 00:30:39,400 Shit. 307 00:30:39,400 --> 00:30:40,440 Thank you, man. 308 00:30:44,720 --> 00:30:47,320 Yeah, actually that was exactly the problem. 309 00:30:50,960 --> 00:30:50,960 And 310 00:30:59,050 --> 00:31:03,970 you know I should have run that in Tmux or screen. 311 00:31:20,120 --> 00:31:29,820 Yeah, unfortunately the device tends to crash when you do the buffer overflow, but hopefully not this time. 312 00:31:35,420 --> 00:31:36,520 Yeah. 313 00:31:37,320 --> 00:31:40,800 Well, we have movies, as always. 314 00:31:43,180 --> 00:31:48,700 So the movie 315 00:32:02,550 --> 00:32:08,870 shows we get a UID, we get a device ID and then we just, 316 00:32:12,540 --> 00:32:13,840 and we get a shell. 317 00:32:16,990 --> 00:32:22,090 I'm sorry that my shell crashed, but yeah. 318 00:32:22,090 --> 00:32:22,470 I'm going to try to fix it . 319 00:32:23,010 --> 00:32:24,510 Happens to the best of us. 320 00:32:28,160 --> 00:32:33,720 Yeah, and fun story, probably I'm not going to be able to get the video stream either because the device is kind of down. 321 00:32:33,980 --> 00:32:40,860 But long story short, you can get a shell, a very predictable shell, works every time, root access, full root access on all these devices. 322 00:32:40,880 --> 00:32:45,040 And there is another vulnerability that we found. 323 00:32:49,510 --> 00:32:53,910 A command injection vulnerability which is significantly easier to exploit. 324 00:32:54,850 --> 00:32:58,710 Essentially the camera supports something called remote upgrade. 325 00:32:58,990 --> 00:33:01,130 Again, everything relayed through the cloud. 326 00:33:01,850 --> 00:33:06,830 And the function takes two parameters, the firmware version and the download location. 327 00:33:07,210 --> 00:33:14,190 Now the thing is if you send a bogus download location, it just has to be up so it can initiate a TCP connection to it. 328 00:33:14,190 --> 00:33:15,690 It doesn't have to be valid. 329 00:33:15,690 --> 00:33:21,150 It's going to pass the rest of the output to tar. 330 00:33:22,750 --> 00:33:30,270 So essentially it's going to do an initial connection to the update location and it's going to pass what you call as the file name to tar. 331 00:33:30,730 --> 00:33:36,410 And then that's going to get you a command injection, a very easy command injection actually. 332 00:33:36,890 --> 00:33:41,970 Because tar is going to execute your input and then semicolon and then whatever command that you want. 333 00:33:41,970 --> 00:33:43,910 And you're going to connect back shell to you. 334 00:33:43,910 --> 00:33:46,150 And you can actually on these devices you can do netcat. 335 00:33:46,150 --> 00:33:47,730 They have netcat installed. 336 00:33:47,730 --> 00:33:52,390 So you can netcat minus E BNSH to your machine. 337 00:33:53,170 --> 00:34:01,750 As a bonus and funny story about responsible disclosure, we were stuck with these guys for about four or five months. 338 00:34:01,990 --> 00:34:03,830 They wouldn't answer our e-mails. 339 00:34:04,010 --> 00:34:08,590 So we kind of didn't publish anything because we were like ethical. 340 00:34:09,350 --> 00:34:11,750 Or our legal department is very ethical. 341 00:34:12,930 --> 00:34:19,970 And then somebody published on Reddit the AWS bucket vulnerability that they found. 342 00:34:19,970 --> 00:34:24,050 So they're like, Godzilla AWS bucket vulnerability zero day in Godzilla. 343 00:34:24,350 --> 00:34:28,170 And at that point we were kind of forced to publish our stuff. 344 00:34:28,170 --> 00:34:29,590 And we're like, okay. 345 00:34:29,590 --> 00:34:32,350 And we have all these other things as well. 346 00:34:33,830 --> 00:34:39,830 So we got a call from them saying that they're going to patch their stuff. 347 00:34:40,590 --> 00:34:42,150 And they didn't. 348 00:34:42,150 --> 00:34:46,070 They just patched the bucket. 349 00:34:46,130 --> 00:34:50,530 But it's kind of messed up for them and I understand where they're coming from. 350 00:34:50,530 --> 00:34:54,230 The whole user ID thing is an architecture thing. 351 00:34:54,230 --> 00:34:56,490 And they already have devices in the market. 352 00:34:56,490 --> 00:34:58,510 It's kind of hard to change. 353 00:34:59,030 --> 00:35:06,830 The buffer overflows they could patch but I'm going to bet that I have like this shitty update process unfortunately. 354 00:35:06,950 --> 00:35:09,090 So yeah, it kind of sucks. 355 00:35:09,090 --> 00:35:14,430 And then a colleague of mine tells me that his mother in Puerto Rico has like three of these at home. 356 00:35:16,910 --> 00:35:17,950 So yeah. 357 00:35:18,470 --> 00:35:22,990 Now, I don't know how we are in stake aways. 358 00:35:23,030 --> 00:35:26,690 So IoT is obviously a huge attack surface. 359 00:35:26,690 --> 00:35:32,370 People ask me, how do you know what's a good or bad IoT? 360 00:35:32,370 --> 00:35:33,450 What should I buy? 361 00:35:33,590 --> 00:35:36,950 And I always tell them there's a few things that you can look out for. 362 00:35:36,950 --> 00:35:38,970 One of them is actually the update process. 363 00:35:38,970 --> 00:35:40,590 Inherently everything is vulnerable, right? 364 00:35:40,590 --> 00:35:44,030 We're seeing advisories on a weekly basis and all the big stuff, right? 365 00:35:44,150 --> 00:35:45,770 Including Google, including us. 366 00:35:45,770 --> 00:35:48,810 We get reports about vulnerabilities in our stuff. 367 00:35:49,010 --> 00:35:55,570 Not on a weekly basis but it's very important to look at the way people patch their stuff. 368 00:35:55,570 --> 00:35:56,670 How they update. 369 00:35:56,670 --> 00:35:58,130 If that update is unattended. 370 00:35:58,130 --> 00:36:01,690 If there's any chance that somebody didn't update when an update was available. 371 00:36:01,690 --> 00:36:04,230 So that's kind of one of the first things to look out for. 372 00:36:04,670 --> 00:36:09,810 The second I would say would be the magnitude of the company. 373 00:36:09,950 --> 00:36:15,430 Or how impacted would they be if a vulnerability was found. 374 00:36:15,510 --> 00:36:22,170 Let us not forget, and I hope nobody is going to be upset with me saying this , that the system is broken. 375 00:36:22,170 --> 00:36:26,270 It's still broken right now in terms of legal stuff. 376 00:36:26,570 --> 00:36:30,090 As a researcher , there's still a challenge in going outside. 377 00:36:30,090 --> 00:36:32,070 Remember that hypothetical scenario? 378 00:36:32,070 --> 00:36:44,770 It's hypothetical because you cannot go outside of your own space to see if you can go outside of your S3 bucket or see if you can get outside of your MQTT topic from a legal standpoint. 379 00:36:44,770 --> 00:36:51,350 And at the same time the system is fundamentally broken because D-Link won the lawsuit against FTC. 380 00:36:51,370 --> 00:36:56,650 So for those of you who don't know, FTC sued D-Link in February 2015 for Mirai. 381 00:36:57,870 --> 00:37:00,150 And everybody was like, okay, good. 382 00:37:00,430 --> 00:37:04,970 People should be accountable for their mess, their screw-ups. 383 00:37:05,370 --> 00:37:07,030 But they lost. 384 00:37:07,030 --> 00:37:10,590 In October 2015, FTC lost the lawsuit against D-Link. 385 00:37:10,730 --> 00:37:12,490 And it was so obviously there. 386 00:37:12,490 --> 00:37:15,670 Telnet enabled with 1, 2, 3, 4 on millions of devices. 387 00:37:16,210 --> 00:37:23,090 The cloud implementation in many IoTs is broken. 388 00:37:23,090 --> 00:37:24,890 It's like fundamentally broken. 389 00:37:24,890 --> 00:37:27,890 They are negligent, if not more than negligent. 390 00:37:27,890 --> 00:37:31,250 They are trying to add new functionality and we can get that. 391 00:37:31,890 --> 00:37:35,770 But not knowing, remember, do you know the cloud? 392 00:37:36,010 --> 00:37:37,050 Fuck! 393 00:37:37,410 --> 00:37:39,250 Nobody understands the cloud. 394 00:37:39,850 --> 00:37:44,510 So many companies don't really understand how to do cloud implementations for their stuff, right? 395 00:37:44,610 --> 00:37:47,350 And yeah, look into that. 396 00:37:48,490 --> 00:37:50,730 So vendors need to pentest their products. 397 00:37:50,850 --> 00:37:56,030 These guys told me, the director of product management called me on my cell phone. 398 00:37:56,030 --> 00:37:58,890 I was like in Singapore doing some other event. 399 00:37:59,210 --> 00:38:01,610 And asked me, why didn't you call us? 400 00:38:01,610 --> 00:38:02,630 Well, we tried. 401 00:38:02,630 --> 00:38:03,070 Okay. 402 00:38:03,070 --> 00:38:06,990 Then I asked him, why didn't you pentest your stuff before putting it in the market? 403 00:38:07,270 --> 00:38:08,950 And he said, but we did. 404 00:38:09,990 --> 00:38:10,870 No. 405 00:38:11,330 --> 00:38:12,690 No, we really did. 406 00:38:12,690 --> 00:38:13,850 How much did you pay? 407 00:38:13,850 --> 00:38:14,630 Seriously. 408 00:38:14,750 --> 00:38:21,310 Because seeing that there's a 408-311 client ID takes five minutes with burp. 409 00:38:21,310 --> 00:38:26,890 I mean, how much did you pay that company to do your security audit before pushing your stuff into the market? 410 00:38:27,030 --> 00:38:28,630 Dude, we paid a lot of money. 411 00:38:29,290 --> 00:38:31,430 Get out of here, you know. 412 00:38:32,470 --> 00:38:33,650 So yeah. 413 00:38:33,770 --> 00:38:40,210 Obviously, rock bug bounty programs have very good update mechanisms. 414 00:38:40,510 --> 00:38:44,010 And again, it's trivial to find RCEs in IOTs. 415 00:38:45,010 --> 00:38:49,830 Another more or less honorable mention and this is a call for me to you guys. 416 00:38:49,830 --> 00:38:54,830 How many of you are part of a big company and how many of you are independent researchers? 417 00:38:54,830 --> 00:38:55,930 So big company. 418 00:38:58,010 --> 00:38:59,730 I feel for you, man. 419 00:39:00,830 --> 00:39:02,370 Independent researchers? 420 00:39:04,690 --> 00:39:11,670 So you see, because so far we've been able to publish only a fraction of our research. 421 00:39:13,350 --> 00:39:14,150 Trust me. 422 00:39:14,150 --> 00:39:20,410 And we have like this big space with all the things that we've researched and it's insane. 423 00:39:20,610 --> 00:39:22,710 Unfortunately, I cannot talk about it, you know. 424 00:39:23,110 --> 00:39:24,010 And yeah. 425 00:39:24,650 --> 00:39:34,030 So because it's easier from a legal standpoint if we publish something for companies to go after us and the legal team is like, you know, maybe you shouldn't do that. 426 00:39:34,710 --> 00:39:38,230 Yeah, I mean, we already have a lot of other stuff to do. 427 00:39:38,490 --> 00:39:41,910 And yeah, maybe it would be best if we just stay on the safe side. 428 00:39:41,910 --> 00:39:43,650 You already published some papers, you know. 429 00:39:43,650 --> 00:39:45,150 You talked at a few conferences. 430 00:39:45,150 --> 00:39:46,510 What more do you want, you know? 431 00:39:46,510 --> 00:39:52,670 And I'm like, we need people to know about this stuff and patch it and fix it because that's why we do what we do. 432 00:39:52,790 --> 00:39:55,450 Yeah, but really? 433 00:39:58,170 --> 00:40:05,930 So if you're an independent researcher, if you have the capability, we need more. 434 00:40:06,110 --> 00:40:08,870 We need more research on mass hacking IOTs. 435 00:40:08,870 --> 00:40:11,930 It's so easy and we need more of this stuff published. 436 00:40:11,930 --> 00:40:16,510 So if you want to get into that and if you want help from us, yeah, we can definitely help. 437 00:40:16,690 --> 00:40:18,310 We would be more than happy to help. 438 00:40:18,310 --> 00:40:22,470 I mean, I'm not in Silicon Valley saying that I want to make the world a better place. 439 00:40:23,410 --> 00:40:28,450 But I mean, there's so many stuff that's not published and it's so dangerous. 440 00:40:28,450 --> 00:40:39,490 I mean, the hypothetical scenario of viewing all the recordings of all the people, of all those cameras from the beginning of times up until today, it's still, it may be still happening. 441 00:40:40,490 --> 00:40:44,930 And you know, there's a challenge for somebody like me to talk about it. 442 00:40:44,930 --> 00:40:48,270 So with that in mind, I thank you for your time and for your patience. 443 00:40:48,270 --> 00:40:50,470 I hope it was enjoyable and yeah.