1 00:00:00,000 --> 00:00:00,840 Hi, folks. 2 00:00:00,840 --> 00:00:06,880 My name is Rik Ramgadi, and I originally had submitted a talk called Shining a Light on a Black Box. 3 00:00:06,880 --> 00:00:16,520 However, things changed, and then after, Ian and I changed our slides to be So Hopelessly Broken 2.0, Circumventing Security Controls and Network Accessible Services. 4 00:00:17,900 --> 00:00:19,760 So like I said, my name is Rik Ramgadi. 5 00:00:19,760 --> 00:00:21,140 I'm the one on the right here. 6 00:00:21,140 --> 00:00:31,060 I am a senior security analyst at ISE, and I like to hack things like web apps, mobile apps, binaries, and IOT devices, which is why I do a lot of work with the IOT village. 7 00:00:31,200 --> 00:00:33,620 I like to read a lot, and I'm always confused. 8 00:00:33,620 --> 00:00:35,080 Then we also have Ian Sinderman. 9 00:00:36,340 --> 00:00:38,020 Well, that would be me. 10 00:00:38,020 --> 00:00:40,160 I'm a security analyst at ISE as well. 11 00:00:40,240 --> 00:00:42,480 I may have been a low-key carny as a child. 12 00:00:42,520 --> 00:00:48,240 I also like to hack things, web apps, IOT garbage, some hardware, tech obscura, that sort of stuff. 13 00:00:48,240 --> 00:00:50,660 I always like to try and learn new things. 14 00:00:50,660 --> 00:00:52,860 I always like to teach them as well, whether that works. 15 00:00:52,920 --> 00:00:54,480 Maybe not. 16 00:00:54,560 --> 00:00:57,160 But I'm also always confused, like Rik. 17 00:00:57,160 --> 00:00:58,400 I really like that one. 18 00:00:58,800 --> 00:01:00,340 I guess it's an easy one to like. 19 00:01:00,340 --> 00:01:01,860 It's very realistic. 20 00:01:02,580 --> 00:01:05,920 So the things, here's the agenda. 21 00:01:05,920 --> 00:01:10,900 This talk is about our research project that we concluded in 2018. 22 00:01:10,960 --> 00:01:18,300 During our research project, we hacked a bunch of embedded devices, 13, we had 13 targets. 23 00:01:18,300 --> 00:01:26,620 We got a remotely exploitable shell in 12 of them, and these are the three best stories that I could fit in half an hour, that we could fit in half an hour. 24 00:01:26,880 --> 00:01:36,440 And the idea behind it was that we were trying to find remotely exploitable bugs in embedded devices, which is kind of what you do when you play the So Hopelessly Broken CTF. 25 00:01:36,860 --> 00:01:46,900 And throughout the whole presentation, we're going to cover three devices, the Buffalo Terror Station, the Drobo 5N2, and the Netgear R9000. 26 00:01:46,900 --> 00:01:51,540 These are all devices that we bought, I think, early last year, so I would say March-ish. 27 00:01:51,620 --> 00:01:55,960 And then we hacked in between then, and we ended everything in about October, November. 28 00:01:56,020 --> 00:02:00,700 But, as we'll find out throughout the presentation, just because we concluded testing does not mean that our job was over. 29 00:02:01,480 --> 00:02:08,580 With the Buffalo Terror Station, we're going to be looking at how sometimes developers may be confused with how some functionality may work. 30 00:02:08,580 --> 00:02:11,340 We're going to be looking at a couple interesting HTTP headers. 31 00:02:11,520 --> 00:02:24,480 And then we're going to be talking about an interesting situation where responsible disclosure, where we responsibly disclosed these issues to this manufacturer, and then they didn't respond to us, and some stuff happened where they tweeted some information and then deleted it. 32 00:02:24,580 --> 00:02:27,380 And it's all very humorous, yet concerning. 33 00:02:27,380 --> 00:02:29,380 Then we have the Drobo 5N2. 34 00:02:29,380 --> 00:02:33,800 We're going to be talking about how we reverse engineered the protocol, which is what this talk was originally about. 35 00:02:33,820 --> 00:02:39,640 And then after that, we're going to be talking about how we found the keys to get into the Drobo under the device's doormat. 36 00:02:39,800 --> 00:02:50,260 And then last, we have the R9000, which we'll be talking about an interesting authentication mechanism and how we were able to fake a call from inside of the house. 37 00:02:50,420 --> 00:02:55,720 And then after, a tale of bug bounties and bug bounty companies that we ended up in. 38 00:02:56,160 --> 00:03:06,660 And then after that, we're going to have a conclusion where we talk about responsible disclosure, the stuff that we found, how we found it, and comparing our study from last year with our original study from 2013. 39 00:03:07,260 --> 00:03:10,740 So without further ado, I'll kick it off with the first one. 40 00:03:11,100 --> 00:03:12,440 The Buffalo Terrace Station. 41 00:03:12,440 --> 00:03:14,980 This is one of the devices that's actually in the CTF right now. 42 00:03:14,980 --> 00:03:18,440 And after you figure out how easy this is, you'll score some easy points. 43 00:03:18,860 --> 00:03:25,340 The Terrace Station, with this very easy name, is a Soho enterprise business grade NAS. 44 00:03:25,420 --> 00:03:27,800 And it runs between $2,000 to $4,000. 45 00:03:27,800 --> 00:03:29,100 It's made in Japan. 46 00:03:29,100 --> 00:03:31,720 And it has an administrative web application. 47 00:03:31,840 --> 00:03:34,200 And I'll pass it over now to Ian to explain everything else. 48 00:03:34,200 --> 00:03:34,780 Okay. 49 00:03:34,860 --> 00:03:40,060 So this web app has, it has this wonderful JSON API. 50 00:03:40,780 --> 00:03:47,600 So one thing that I really dislike about JSON, at least in the context of, I guess, everything, is application JSON. 51 00:03:48,040 --> 00:03:57,700 So application JSON really sucks when you're trying to do CSRF, assuming they're actually checking the content type, because you generally need to preflight your requests if you want to set this content type. 52 00:03:58,140 --> 00:04:03,720 But further, we see that there is a authentication cookie, so they're probably using cookies for some of this. 53 00:04:04,000 --> 00:04:08,740 But there's also an authentication, like, value within the post body. 54 00:04:08,820 --> 00:04:19,440 Back to CSRF, that's probably not going to be something that we can do if that authentication token is there, because we would have to know their authentication token in order to send a malicious post body. 55 00:04:20,180 --> 00:04:23,860 However, we decided to kind of change that. 56 00:04:24,280 --> 00:04:29,460 So first thing we did is, you know, find the source code for this, or at least the code for the web app. 57 00:04:29,780 --> 00:04:34,480 In this case, we found that they were all precompiled Python binaries, which kind of sucks. 58 00:04:34,480 --> 00:04:38,880 Like, it's Python, you should be able to read it nice and easy, but this is not super readable. 59 00:04:39,460 --> 00:04:44,420 However, you just use uncompile 6 and then it's just ready to go in a matter of, like, one or two minutes. 60 00:04:45,200 --> 00:04:46,080 So that was nice. 61 00:04:46,080 --> 00:04:51,240 So now we have very nice readable data, and it's in Python, nice and easy to parse, even if you don't know what you're doing. 62 00:04:51,980 --> 00:04:55,560 And then we see some rather concerning stuff here. 63 00:04:56,100 --> 00:04:57,240 Like skip off. 64 00:04:58,360 --> 00:05:00,560 Yes, please, I'd very much like to do that. 65 00:05:00,740 --> 00:05:02,020 How do I do this? 66 00:05:03,460 --> 00:05:05,720 What do you guys think skip off does? 67 00:05:09,040 --> 00:05:11,680 So somebody thinks it's a security mechanism. 68 00:05:12,120 --> 00:05:13,080 We'll talk later. 69 00:05:14,200 --> 00:05:16,060 Let's figure out where this is going now. 70 00:05:18,880 --> 00:05:24,480 So the next thing I did after seeing this was just see where else is skip off referenced, like, within this file. 71 00:05:24,480 --> 00:05:28,100 So I just do a search and then we find this chunk of code. 72 00:05:28,800 --> 00:05:40,420 Highlight the important parts, and it looks like if we just set our HTTP host, like, our host header to local host, we skip authentication. 73 00:05:40,820 --> 00:05:45,680 I can kind of see why someone would implement this, so let's talk about that. 74 00:05:46,100 --> 00:05:50,660 So let's say that we have an API that it needs to talk to itself. 75 00:05:51,120 --> 00:06:04,560 We could, you know, implement some sort of authentication, like understanding what the authentication to grant yourself an auth token for yourself and then use it with yourself, or we could just say, hey, when I talk to myself, I know it's me, so we're good to go. 76 00:06:05,300 --> 00:06:07,600 So I'm pretty sure that's what they were trying to do. 77 00:06:08,080 --> 00:06:19,360 So, you know, if the host header is always a local host and a local request, and it's never a local host and a client request, then the host header being local host means it's a local request. 78 00:06:19,400 --> 00:06:21,000 You know, good to go, job done. 79 00:06:21,720 --> 00:06:28,080 Except there's a problem with this, and I think many of you have already realized this problem, and it's that the host header is client controlled . 80 00:06:28,920 --> 00:06:31,120 So that's not good. 81 00:06:31,780 --> 00:06:38,460 So the host header is usually local host and a local request, and it's rarely local host and a client request. 82 00:06:38,680 --> 00:06:43,560 So the host header being local host just means it's a request with a weird host header. 83 00:06:44,540 --> 00:06:55,220 So one of the reasons that I think this becomes an issue with a lot of people is that the host header is application layer while routing decisions are done at the network layer. 84 00:06:55,760 --> 00:07:07,100 So although in a lot of our large web applications, we can expect some routing decisions to be made based on the host header, this is a tiny little NAS on your LAN. 85 00:07:07,100 --> 00:07:09,540 You're not going through a load balancer to talk to your NAS. 86 00:07:09,540 --> 00:07:12,100 If you are, like, that's a hell of a NAS. 87 00:07:12,640 --> 00:07:18,120 So since there's no load balancer and since we're talking to it directly, what can we do? 88 00:07:18,400 --> 00:07:20,060 Well, let's find out. 89 00:07:20,060 --> 00:07:21,600 So we have a base request here. 90 00:07:21,760 --> 00:07:27,340 We have a junk SID, and it responds with, hey, this is an invalid session ID. 91 00:07:27,580 --> 00:07:29,000 That makes sense. 92 00:07:29,460 --> 00:07:32,220 So what if we set our host header to local host? 93 00:07:32,740 --> 00:07:36,380 And we still have a junk SID, and we still get an error, but it's a slightly different error. 94 00:07:36,380 --> 00:07:38,820 It's still invalid, but it's invalid params. 95 00:07:38,840 --> 00:07:43,720 And it's saying that, you know, the reboot function doesn't take any arguments, but we did give it one. 96 00:07:44,300 --> 00:07:49,060 As far as I can tell, the only argument that we may have given it was the SID parameter. 97 00:07:49,760 --> 00:07:51,360 So what if we just delete it? 98 00:07:51,920 --> 00:07:59,800 Well, if we delete it, we get result null, and then the device makes some sad beeps and reboots because suddenly we're an admin. 99 00:08:00,860 --> 00:08:02,280 That's probably not good. 100 00:08:02,680 --> 00:08:04,140 So I just got a shell. 101 00:08:04,720 --> 00:08:07,920 And now I can get a root shell without authentication. 102 00:08:10,140 --> 00:08:11,640 Also probably not good. 103 00:08:12,220 --> 00:08:17,480 Yeah , so I guess if, for those of you keeping track, the authentication is the host header kind of. 104 00:08:17,500 --> 00:08:25,240 So the fact that you could just send, say, your IP address is 127.0.0.1, and then have to say, this is all you need to know from here on out. 105 00:08:25,280 --> 00:08:31,200 We were able to access all the functionality in the NAS, also the ability to make the device beep. 106 00:08:31,420 --> 00:08:33,040 And that was really interesting as well. 107 00:08:33,040 --> 00:08:35,540 So we brought this device to another CTF. 108 00:08:35,540 --> 00:08:37,460 I think no one's figured it out here so far. 109 00:08:37,560 --> 00:08:39,780 There's actually a request to make the device play music. 110 00:08:40,660 --> 00:08:42,740 And that's one of the most annoying things that we found out. 111 00:08:42,740 --> 00:08:45,480 So remotely we're able to play music in other people's houses. 112 00:08:45,480 --> 00:08:49,440 And on top of the fact that we're able to get a shell, which I'm not sure which one's more concerning. 113 00:08:54,500 --> 00:08:59,740 So, I don't know, it seems like after all the shells that we got on these devices, getting a shell kind of got boring. 114 00:08:59,880 --> 00:09:01,820 So then it became, hey, we can play music. 115 00:09:01,820 --> 00:09:02,740 This is fun. 116 00:09:02,960 --> 00:09:04,300 This shell's boring. 117 00:09:05,460 --> 00:09:07,800 So yeah, how about that tweet and delete? 118 00:09:08,380 --> 00:09:10,120 So we decided to disclose. 119 00:09:10,120 --> 00:09:15,720 As normal, we disclosed all of the issues that we found to the manufacturer. 120 00:09:15,720 --> 00:09:19,520 Gave them at least a month or two to fix them before doing public disclosure. 121 00:09:19,860 --> 00:09:25,740 In this case, you know, we sent an email to their security contact on 0622 and heard nothing. 122 00:09:26,180 --> 00:09:29,800 So we sent another on 0702 and heard nothing. 123 00:09:30,300 --> 00:09:35,840 So then we sent the Volns to the security contact on 07, on the next day, and we heard nothing. 124 00:09:36,200 --> 00:09:40,740 So we sent the CVEs on 0822 and we heard nothing. 125 00:09:41,160 --> 00:09:46,280 So we announced our public release because it had been many months and we tried our best. 126 00:09:46,840 --> 00:09:53,660 And then two days later, we did our public release with a demo live stream showing off the exploits and how to do this. 127 00:09:54,540 --> 00:09:57,360 And then something happened the next day that none of us were anticipating. 128 00:09:58,660 --> 00:10:02,520 An official Buffalo Twitter account retweeted the link to our live stream. 129 00:10:04,740 --> 00:10:06,980 What did that link contain? 130 00:10:07,460 --> 00:10:14,960 That link contained a very nice URL to our live stream on YouTube about how to hack all Buffalo devices. 131 00:10:16,900 --> 00:10:18,460 What happened to that tweet Ian? 132 00:10:18,920 --> 00:10:24,100 Well, at some point, they must have realized that something was terribly wrong because they deleted it. 133 00:10:24,420 --> 00:10:27,040 However, we do have a screenshot, so that's nice. 134 00:10:27,260 --> 00:10:28,400 So we're not crazy. 135 00:10:28,400 --> 00:10:29,680 This actually did happen. 136 00:10:30,160 --> 00:10:32,140 Hopefully your folks in the back can see it. 137 00:10:32,180 --> 00:10:36,060 You're laughing, so you can see it in the back and hopefully you're enjoying it as much as we did. 138 00:10:36,580 --> 00:10:38,740 So what ended up happening with the device in the end? 139 00:10:38,740 --> 00:10:39,560 Did we get patches? 140 00:10:39,560 --> 00:10:40,720 Well, we'll find out. 141 00:10:40,900 --> 00:10:43,520 So clearly they realized that something was wrong. 142 00:10:43,520 --> 00:10:48,420 So at least someone at that company is aware that there's a lot of vulnerabilities that should be fixed. 143 00:10:48,560 --> 00:10:52,120 So clearly, as far as patchability goes, there are patches. 144 00:10:53,100 --> 00:10:54,520 There are no patches. 145 00:10:55,400 --> 00:10:57,740 It's been like a year, I think. 146 00:10:58,480 --> 00:11:10,000 And for a talk that I did at CypherCon, I did some more research and found that all TerraStations are vulnerable to the same exploit, including the ones with the brand new completely redone UI. 147 00:11:10,000 --> 00:11:11,580 How much were those devices again? 148 00:11:11,680 --> 00:11:17,180 The devices, I think some of them were upped into 20K, something like that. 149 00:11:17,180 --> 00:11:20,660 Like professional grade network attached storage for businesses. 150 00:11:21,260 --> 00:11:25,240 20K for your own, I guess, C2C server in the end, pretty much. 151 00:11:28,000 --> 00:11:31,240 But yeah, I guess in summary, the host header is client controlled. 152 00:11:31,240 --> 00:11:37,160 Unless you have something that's parsing it and making sure that it's not client controlled, maybe don't rely on it for authentication. 153 00:11:37,660 --> 00:11:41,240 And if you have a security address, please pay attention to it. 154 00:11:41,240 --> 00:11:42,580 We're trying to help you. 155 00:11:42,840 --> 00:11:44,800 And if you screw up, oh no. 156 00:11:44,840 --> 00:11:51,020 Clearly whoever had deleted that tweet knew that something was wrong, but they didn't own up to it. 157 00:11:51,300 --> 00:11:53,480 Or if they did, someone didn't listen to them. 158 00:11:53,480 --> 00:11:57,720 And all of these devices are still vulnerable, including the one in the CTF. 159 00:11:57,720 --> 00:11:59,400 Like it's running the newest firmware. 160 00:11:59,620 --> 00:12:01,680 And you can go over and get a shell in it if you like. 161 00:12:02,820 --> 00:12:05,780 Oh, you want to talk about Maryland Democratic Party real quick? 162 00:12:05,780 --> 00:12:10,200 You get more, you're way more enthusiastic about this issue than I am, so I'm going to let you take care of this one. 163 00:12:11,200 --> 00:12:21,940 So after all of this, we found out that the Maryland Democratic Party had a Buffalo NAS on the internet with no password. 164 00:12:22,580 --> 00:12:30,000 And while we were doing all this research, another research company found it and contacted them and then like did a release about it. 165 00:12:30,180 --> 00:12:35,280 Apparently like every nation state and their grandmother was in this NAS pulling off all their data. 166 00:12:35,960 --> 00:12:38,320 But the Maryland Democratic Party did take care of it. 167 00:12:38,320 --> 00:12:39,520 They put a password on it. 168 00:12:39,520 --> 00:12:41,780 So it was still on the internet, but they put a password on it. 169 00:12:42,080 --> 00:12:43,300 And then we released this. 170 00:12:44,160 --> 00:12:49,160 So I guess, I'm pretty sure every nation state and their grandmother can Google. 171 00:12:49,560 --> 00:12:52,700 So sorry Maryland Democratic Party, we tried. 172 00:12:54,640 --> 00:12:58,000 Just to be clear on that one, we didn't hack them at all. 173 00:12:58,000 --> 00:12:59,160 That never happened. 174 00:12:59,200 --> 00:13:03,140 Let's make sure, I don't want to hear about that later on from anybody. 175 00:13:03,780 --> 00:13:13,060 But it's kind of funny because we give a lot of these presentations where we tell people about like, hey, there are vulnerabilities that you're seeing are, it's in the system. 176 00:13:13,060 --> 00:13:15,540 It's like you can have the like up-to-date firmware. 177 00:13:15,540 --> 00:13:16,760 You can have a good password. 178 00:13:16,760 --> 00:13:21,760 It's like if there are authentication bypasses, it's like false sense of security that you're leading yourself into. 179 00:13:21,960 --> 00:13:25,520 Don't get me wrong, it's important to have good passwords and important to keep your stuff up to date. 180 00:13:25,520 --> 00:13:31,260 But if there's no update and people can just change the host header to localhost and get in, you're just lying to yourself. 181 00:13:31,840 --> 00:13:35,960 Talking about lying to yourself is our next device, the Drobo 5N2. 182 00:13:36,280 --> 00:13:44,460 The Drobo 5N2 is a Soho Enterprise grade NAS, and it is between $400 and $500, way cheaper than a Buffalo, but just as vulnerable. 183 00:13:44,540 --> 00:13:45,560 This one's made in the great... 184 00:13:45,560 --> 00:13:46,980 I'd say a lot more vulnerable. 185 00:13:46,980 --> 00:13:48,840 This one's probably way more vulnerable. 186 00:13:48,840 --> 00:13:52,280 I'll tell you guys how many unauthenticated shells we got on this thing at the end of this. 187 00:13:52,440 --> 00:13:54,380 But this one's made in America. 188 00:13:55,320 --> 00:14:05,120 The reason why we wanted to do research into this device was because you can't manage it through a web app by default. 189 00:14:05,120 --> 00:14:08,720 Almost all these devices, you hook it up, there's a web app, you connect to it. 190 00:14:08,720 --> 00:14:14,320 The Drobo, the only way that you can connect to it by default is by installing this thing called a Drobo dashboard. 191 00:14:15,020 --> 00:14:21,320 And people on Reddit were losing their minds over it because they thought it was really cool, because it has all these pretty lights and the kids really like LEDs. 192 00:14:21,880 --> 00:14:28,180 And the other reason why is because it's pretty robust and it's also like a pretty fair price point, I guess. 193 00:14:29,180 --> 00:14:40,140 I wanted to get it because it has this custom protocol that it uses to connect to the device with this only macOS and Windows binary that you need to install. 194 00:14:40,140 --> 00:14:44,220 So we installed it, and this is what the Drobo dashboard looks like. 195 00:14:44,460 --> 00:14:46,440 I think this was the macOS version. 196 00:14:46,440 --> 00:14:51,720 You install it, and then it gives you other information about the device, like the serial number. 197 00:14:51,720 --> 00:15:00,080 It tells you how many drives you have installed, when was the last time you set up RAID and all that, and the life expectancy of all those drives. 198 00:15:00,080 --> 00:15:01,540 I'm not sure how it does that. 199 00:15:01,680 --> 00:15:07,680 And you can also install other apps and remotely access the device through other means as well. 200 00:15:09,000 --> 00:15:17,240 The first thing that we did is that I was really worried that the only way that we'd be able to assess this device is by doing a lot of hardcore reverse engineering. 201 00:15:17,240 --> 00:15:21,060 It's like, oh, they probably have certificate pinning, they probably encrypted everything with TLS. 202 00:15:21,200 --> 00:15:21,760 Ha! 203 00:15:22,080 --> 00:15:23,680 It was just plain text. 204 00:15:25,140 --> 00:15:33,520 Everything, and I know it's a little bit hard to see that, but that's just, we opened up Wireshark and started clicking on a bunch of stuff, and we found out that everything was in plain text, and I was like, well, cool. 205 00:15:34,280 --> 00:15:39,760 But, so it's like, this customer proprietary API was just XML. 206 00:15:40,060 --> 00:15:51,180 And what you had to do is that you sent the, like, that, like, dry net, TM stuff at the beginning, those dots are just hex characters, I put dots in so it's a little bit more easy on the eyes, and then some XML data. 207 00:15:51,800 --> 00:15:54,000 Well, we still need to reverse engineer the protocol here. 208 00:15:54,000 --> 00:16:01,740 We need to figure out, like, how it all works, what does the 61 here mean, what is that DRA number, and how does this all work? 209 00:16:01,740 --> 00:16:10,860 So, the first step that I said is like, well, cool, maybe I can just send this message with echo, and then pipe it into Netcat, connect to the device on port 5001. 210 00:16:11,000 --> 00:16:18,860 We saw that whenever we were interfacing with the device, it was over port 5001, and that it was always listening on that port as soon as the device turned on. 211 00:16:19,260 --> 00:16:23,900 So, maybe we can just send this and figure out if it just gives us a message back. 212 00:16:23,900 --> 00:16:25,420 Maybe there's no authentication. 213 00:16:26,420 --> 00:16:28,380 We sent it, we didn't get anything back. 214 00:16:28,380 --> 00:16:29,240 It just froze. 215 00:16:29,240 --> 00:16:30,860 We needed to figure out why at that point. 216 00:16:30,860 --> 00:16:34,440 So, we need to do some more protocol reverse engineering and see where that goes. 217 00:16:34,740 --> 00:16:48,060 So, I also found out while we were looking at it, that if you kill the instance of your Drobo dashboard, it'll restart, and when it restarts, it'll have something listening on port 5000. 218 00:16:48,180 --> 00:16:51,880 It's like, cool, well, I can probably just connect to the device on port 5000. 219 00:16:52,600 --> 00:16:57,700 If you connect to the device on port 5000, it spits out all this XML, and that's really interesting. 220 00:16:57,700 --> 00:17:03,820 Notice there's no trickery there, no authentication, I'm not sending anything, connect to the device on port 5000, and that's it. 221 00:17:04,360 --> 00:17:10,940 So, I was like, alright, maybe it is that it needs to be connected to the device on port 5000 and also send a message. 222 00:17:11,420 --> 00:17:12,780 Well, let's try that out. 223 00:17:12,780 --> 00:17:19,600 If we send that and we echo this information, pipe it into Netcat, maybe there's no authentication. 224 00:17:19,940 --> 00:17:21,760 It's like, well, that's not working either. 225 00:17:21,760 --> 00:17:23,040 Maybe there's something else. 226 00:17:23,200 --> 00:17:31,060 So, at this point, we're going through the process of reverse engineering and figuring out how is it that the whole, like, handshake part is happening between these things. 227 00:17:31,400 --> 00:17:39,520 So, we killed the Drobo dashboard, and I think the other thing that was very important about this is that every time you kill it, it just automatically restarts. 228 00:17:39,520 --> 00:17:45,380 So, we needed to set a script to automatically kill it every time until we were ready, start Wireshark, and then start back there from nothing. 229 00:17:45,600 --> 00:17:47,980 And we found out that there is authentication. 230 00:17:48,580 --> 00:17:54,800 When the Drobo dashboard starts, so the application that connects to your device, it sends this message. 231 00:17:55,440 --> 00:18:00,020 And this message is only, it only happens once at the beginning. 232 00:18:00,020 --> 00:18:02,620 Kind of sounds like what happens when you log into an application, right? 233 00:18:02,620 --> 00:18:10,880 You log in, you send your username and password once, it sets a session token, it gives it back to you, and then you have all that information and you can just keep on doing the do. 234 00:18:11,200 --> 00:18:13,980 So, we needed to reverse engineer the front part here. 235 00:18:13,980 --> 00:18:17,560 So, you can see that the DRAINATM part is still the same. 236 00:18:17,760 --> 00:18:20,320 There's a bunch of dots and a number there. 237 00:18:20,660 --> 00:18:26,920 That number looks pretty long, and it looks, I would say, it looks complex enough that I don't think I'd be able to brute force it. 238 00:18:27,440 --> 00:18:30,880 So, we started looking into what it is that this number meant. 239 00:18:32,000 --> 00:18:35,920 The first part, the DRAINATM part, was just those hex characters. 240 00:18:36,420 --> 00:18:45,320 Ian found out that, after that, it would say if it's coming from the server or if it's being sent to the server with the other bytes, and then the rest of it was the size of the packet. 241 00:18:45,660 --> 00:18:50,740 And now that we know all that information, there's something else here that we still need to figure out. 242 00:18:50,840 --> 00:18:51,940 What's that? 243 00:18:51,980 --> 00:19:01,920 So, the part that's, I guess, kind of highlighted in red, but definitely bolded, that looks like something that's still complex enough that we can't just randomly guess where it belongs to. 244 00:19:02,340 --> 00:19:08,700 But, we found out that when we connect to the device on port 5000, it gives us back that number. 245 00:19:09,020 --> 00:19:12,420 That here, folks, is the serial number. 246 00:19:12,760 --> 00:19:17,060 So, it looks like the thing that you need to authenticate to the device is its serial number. 247 00:19:17,060 --> 00:19:22,600 It's like, oh, this is complex enough, serial numbers are pretty long, but you can just do the following. 248 00:19:22,660 --> 00:19:35,200 Connect to the target on port 5000, extract the serial number from the XML that's returned to you, send the login request on port 5001, send whatever command you want on port 5001, and then install whatever you want. 249 00:19:35,600 --> 00:19:37,580 We found out that you can install pretty much anything. 250 00:19:37,580 --> 00:19:47,000 You can install MySQL, you can install Apache, you can install OpenSSH, you can install other malware that you find anywhere, but it pretty much allows you to do anything. 251 00:19:47,360 --> 00:19:51,200 And then after, we found out that Drupal also provides this thing called Drupal Access. 252 00:19:51,280 --> 00:19:57,160 It's a web application that they provide so that you can connect to the device through something that's not the Drupal dashboard. 253 00:19:57,540 --> 00:20:00,500 And we were still wondering, well, we don't really have a shell yet. 254 00:20:00,640 --> 00:20:02,180 How are we going to do this? 255 00:20:02,420 --> 00:20:13,400 The first application that we installed gave us CVE-2018-14-699, and I think that's a little bit hard to see for everyone in the back, so let's look at this a little bit more closely. 256 00:20:13,540 --> 00:20:17,680 Here's the device's IP address, 192.168.1.26. 257 00:20:17,980 --> 00:20:19,740 It's on port 8080. 258 00:20:19,860 --> 00:20:21,400 It listens on Drupal Access. 259 00:20:21,400 --> 00:20:26,500 You send an enable user request, and you say your username to your command injection payload. 260 00:20:26,500 --> 00:20:30,560 That goes straight into a shell, and that's the easiest shell I've ever gotten throughout my whole career. 261 00:20:31,320 --> 00:20:32,380 And that's pretty much it. 262 00:20:32,380 --> 00:20:33,700 There's no authentication or anything. 263 00:20:33,700 --> 00:20:40,980 You send this individual request to any Drupal Access, I guess, Drupal, Drupal with Drupal Access, and you automatically get a shell. 264 00:20:42,320 --> 00:20:44,860 So let's talk about now the disclosure timeline. 265 00:20:46,500 --> 00:20:49,100 We sent everything to them on 07.06. 266 00:20:49,200 --> 00:20:52,160 In an email we said like, hey, we want to send you these vulnerabilities over. 267 00:20:52,200 --> 00:20:53,400 How do you want to receive them? 268 00:20:53,400 --> 00:20:54,580 Do you want us to encrypt them or not? 269 00:20:54,580 --> 00:20:56,240 Do you want us to PGP sign it? 270 00:20:56,240 --> 00:20:58,000 Ha, they didn't care. 271 00:20:58,000 --> 00:21:00,580 We send them back again to a security contact. 272 00:21:00,580 --> 00:21:02,160 Ha, they didn't care. 273 00:21:02,780 --> 00:21:09,020 We send the CVs over anyways, hopefully stirring something up for them to respond back to us. 274 00:21:09,040 --> 00:21:10,160 We got nothing. 275 00:21:10,760 --> 00:21:17,960 And then after I did a public release and a live demo of me exploiting this vulnerability, I'm also going to be doing this in other conferences. 276 00:21:17,960 --> 00:21:19,800 I'm going to be at BSides Puerto Rico in October. 277 00:21:19,800 --> 00:21:21,160 I'm going to be doing the same thing again. 278 00:21:21,160 --> 00:21:23,940 And the reason why is because they don't fix anything. 279 00:21:24,280 --> 00:21:27,800 So, send a DM to the Drobo CTO. 280 00:21:27,800 --> 00:21:28,780 Ian, what happened there? 281 00:21:28,780 --> 00:21:31,140 How do we DM the Drobo CTO? 282 00:21:31,940 --> 00:21:39,180 So, for that handy dandy protocol that they gave us, I decided to write a little Python utility that makes it very easy to run your own commands. 283 00:21:39,480 --> 00:21:41,480 And I accidentally got command injection. 284 00:21:42,740 --> 00:21:44,660 Just while writing a script. 285 00:21:44,860 --> 00:21:49,880 So, we kind of figured we should probably tell them about that because it's depressingly trivial. 286 00:21:49,880 --> 00:21:51,580 So I sent them a DM. 287 00:21:51,980 --> 00:21:58,920 Or I sent the CTO of the company that acquired Drobo a DM. 288 00:21:59,160 --> 00:22:00,260 We'll get to that. 289 00:22:01,360 --> 00:22:08,020 So then after that, we sent all the vulnerabilities that we found to Drobo and to CTO email. 290 00:22:08,020 --> 00:22:11,380 Or sent all the vulnerabilities that we found in Drobo to the CTO's email. 291 00:22:11,400 --> 00:22:12,340 We didn't hear back from him. 292 00:22:12,340 --> 00:22:14,000 I'm pretty sure he doesn't like us. 293 00:22:14,140 --> 00:22:17,440 Besides the point, Ian mentioned something interesting. 294 00:22:18,320 --> 00:22:22,400 While we were sending all this stuff over, something was happening in the background. 295 00:22:22,880 --> 00:22:24,300 Drobo was getting acquired. 296 00:22:25,140 --> 00:22:30,880 While Drobo was getting acquired, we found a bunch, we found nine unauthenticated shells, folks. 297 00:22:30,920 --> 00:22:31,880 Nine. 298 00:22:32,120 --> 00:22:33,760 That's embarrassing to me. 299 00:22:33,980 --> 00:22:34,420 Well, not for me. 300 00:22:34,420 --> 00:22:35,300 I found them. 301 00:22:35,340 --> 00:22:37,540 But they're like, this company is store centric. 302 00:22:37,540 --> 00:22:42,320 They were acquiring two companies, Drobo and Nexen, throughout that whole process. 303 00:22:42,640 --> 00:22:46,360 Now I'm here in red, which I'm hoping all of you can see. 304 00:22:46,360 --> 00:22:51,260 In August 21st, 2018, they released this on the Nexen website. 305 00:22:51,700 --> 00:22:53,520 Let's look at that timeline again. 306 00:22:53,520 --> 00:22:55,840 We submitted everything on 07-06. 307 00:22:56,520 --> 00:22:58,280 So that would be July? 308 00:22:59,120 --> 00:23:00,320 Yeah, July. 309 00:23:00,320 --> 00:23:01,080 He's shaking his head. 310 00:23:01,080 --> 00:23:01,860 July. 311 00:23:01,980 --> 00:23:06,940 And then after, on August 22nd, we send them all the CVEs. 312 00:23:06,940 --> 00:23:11,800 Throughout that whole process, they could have addressed these issues or just got them back to us. 313 00:23:12,180 --> 00:23:18,540 I'll be honest, they could have been just busy with their acquisition and not really in the mood to deal with nine unauthenticated shells. 314 00:23:19,080 --> 00:23:20,560 Sounds like their problem, not mine. 315 00:23:21,080 --> 00:23:24,160 But let's go to the summary of this issue. 316 00:23:24,520 --> 00:23:26,840 Having a proprietary protocol does not make you safe. 317 00:23:26,840 --> 00:23:34,200 Just because you're prescribing to the idea behind, like, if it's mine and nobody else knows about it, nobody can find any exploits, that's not true. 318 00:23:34,200 --> 00:23:36,020 There are many good reverse engineers out there. 319 00:23:36,020 --> 00:23:37,180 They will figure it out. 320 00:23:37,500 --> 00:23:40,560 It's a bad idea to authenticate with a thing that you're providing users. 321 00:23:41,000 --> 00:23:44,420 They probably shouldn't be authenticating users with a serial name or their serial number. 322 00:23:44,420 --> 00:23:46,840 I probably wouldn't be authenticating people with their name. 323 00:23:47,540 --> 00:23:49,800 And pay attention to your support tickets. 324 00:23:49,800 --> 00:23:53,620 We sent a couple support tickets in hope that they would address these issues. 325 00:23:53,620 --> 00:23:54,800 Never got addressed. 326 00:23:55,060 --> 00:24:00,740 And then last up, it's like, if you end up screwing up, like Ian said, it's probably just to own up to it. 327 00:24:00,740 --> 00:24:04,640 It's like, if somebody submitted these things, maybe it's time to address them. 328 00:24:04,700 --> 00:24:09,460 There was also something other, some other thing that happened that was interesting throughout this whole process. 329 00:24:09,840 --> 00:24:15,280 When I was sending them these emails, I got, or I guess we got, we got blacklisted. 330 00:24:15,280 --> 00:24:16,720 RPA just got blacklisted. 331 00:24:16,720 --> 00:24:18,920 Now, that makes no sense. 332 00:24:19,060 --> 00:24:24,120 Why would you blacklist somebody who's sending you an email and I'm hacking a device that I have in my house? 333 00:24:24,400 --> 00:24:25,360 Those things don't add up. 334 00:24:25,360 --> 00:24:27,260 Those are very separate things. 335 00:24:27,460 --> 00:24:30,960 But that was, whatever, I could have also, I give them the benefit of the doubt. 336 00:24:30,960 --> 00:24:37,760 I actually give all these companies, despite all the headaches, the benefit of the doubt, may have just been that we downloaded the firmware too many times. 337 00:24:38,040 --> 00:24:41,840 May have just been that, like, we're a security company and it looked like fishy traffic. 338 00:24:42,400 --> 00:24:45,800 It's all, I, they, I, I understand if those things happen. 339 00:24:45,800 --> 00:24:48,420 I don't understand not addressing the issues that we reported. 340 00:24:49,020 --> 00:24:55,360 So now, I'm passing it over to Ian for the Netgear R9000, which is the last device we're gonna be looking at today. 341 00:24:55,420 --> 00:24:56,920 And this one's really a doozy. 342 00:24:56,920 --> 00:24:57,760 Have fun, Ian. 343 00:24:59,460 --> 00:25:00,520 No idea. 344 00:25:00,520 --> 00:25:06,640 So, the R9000 holds a special place in my heart, for good reasons and bad reasons. 345 00:25:07,040 --> 00:25:08,000 We'll get to that. 346 00:25:08,100 --> 00:25:10,000 So it's a flagship router by Netgear. 347 00:25:10,080 --> 00:25:14,240 At the time that we did our research, I think it was like the most expensive one they offered. 348 00:25:14,260 --> 00:25:17,500 Something like $350 to $500. 349 00:25:17,980 --> 00:25:20,460 It's aimed at like power users, that sort of thing. 350 00:25:20,740 --> 00:25:26,720 It has a rich feature set with all sorts of fun applications you can run on your router because you need to run applications on your router. 351 00:25:27,280 --> 00:25:31,680 And it's administered via a web app, a mobile app, and Telnet if you cheat. 352 00:25:31,680 --> 00:25:32,820 Of course, I cheat. 353 00:25:33,600 --> 00:25:38,260 But it also has a bug bounty for vulnerability disclosure. 354 00:25:38,260 --> 00:25:40,960 And only a bug bounty for vulnerability disclosure. 355 00:25:41,020 --> 00:25:44,460 We'll get to how that kind of broke things in a minute. 356 00:25:45,080 --> 00:25:48,000 So, the web app, you know, it was kind of boring. 357 00:25:48,000 --> 00:25:49,320 It's what we've seen a lot. 358 00:25:49,320 --> 00:25:53,750 It's just basic authorization or like, yeah, basic authentication. 359 00:25:53,950 --> 00:25:55,470 No clear bypasses. 360 00:25:55,470 --> 00:25:57,730 It's a forum post, but it has C-serve protection. 361 00:25:57,890 --> 00:25:59,510 It's very crappy C-serve protection. 362 00:25:59,510 --> 00:26:01,570 So if you want to break that, you probably can. 363 00:26:01,570 --> 00:26:02,810 I highly recommend trying. 364 00:26:03,790 --> 00:26:05,630 So I started poking at other things. 365 00:26:05,830 --> 00:26:07,870 Like the mobile API. 366 00:26:07,870 --> 00:26:11,590 So it's a SOAP API, which, yeah, ew, it's not fun to work with those. 367 00:26:11,890 --> 00:26:13,170 But it's different. 368 00:26:13,170 --> 00:26:16,730 It has JWT-based authentication, which, eh, it's okay. 369 00:26:17,330 --> 00:26:21,050 But static analysis showed it was a total minefield of command injection. 370 00:26:21,050 --> 00:26:23,790 And command injection is one of my favorite things to do. 371 00:26:23,810 --> 00:26:25,970 So that instantly got me interested. 372 00:26:27,090 --> 00:26:32,010 But, sadly, the API is terribly broken and unreliable. 373 00:26:32,010 --> 00:26:35,430 And half of the endpoints just did not work at all. 374 00:26:35,790 --> 00:26:40,390 So it kind of ended up being an uphill battle to do anything with this API. 375 00:26:40,690 --> 00:26:43,790 But I still got off-bypassing friends, so we'll figure out how. 376 00:26:44,450 --> 00:26:45,310 Hey, Rick. 377 00:26:45,330 --> 00:26:48,930 Have you ever, like, seen people using the X-Forwarded Foreheader much? 378 00:26:48,930 --> 00:26:51,030 I've seen a lot of people use the X-Forwarded Foreheader. 379 00:26:51,030 --> 00:26:52,990 I've never seen somebody use it properly. 380 00:26:54,070 --> 00:26:58,650 So the X-Forwarded Foreheader, it's a de facto standard. 381 00:26:59,010 --> 00:27:03,910 So it's something that a lot of people have agreed on, that it does X thing. 382 00:27:03,970 --> 00:27:06,170 But it's not properly standardized. 383 00:27:06,510 --> 00:27:12,830 But it's usually used by load balancers to convey a client's actual IP address to some sort of upstream service. 384 00:27:13,810 --> 00:27:14,690 Usually. 385 00:27:15,350 --> 00:27:18,670 So it's also not as simple as a lot of people think it is. 386 00:27:18,730 --> 00:27:21,570 So the X-Forwarded Foreheader is actually a list of IP addresses. 387 00:27:21,650 --> 00:27:34,890 Normally we only see it as a single IP address, but it's designed so that when a load balancer or whatever that's working with this header receives a request, it should prepend the IP address that it received that header from to the beginning of the list. 388 00:27:35,510 --> 00:27:37,890 And also, it doesn't have to be an IP address. 389 00:27:37,890 --> 00:27:43,910 You can put whatever you like in this header and your load balancer is probably just going to stick an IP address on the front of it. 390 00:27:44,250 --> 00:27:47,330 So a lot of people don't seem to realize this. 391 00:27:47,330 --> 00:27:48,730 And it causes problems. 392 00:27:48,950 --> 00:27:53,590 Like what happens if they're just expecting an IP address and dumping that into a database? 393 00:27:53,890 --> 00:27:55,930 And I put a little semicolon boy in there. 394 00:27:56,310 --> 00:27:57,290 Breaks things. 395 00:27:58,130 --> 00:28:00,370 So how does this relate to our router? 396 00:28:00,810 --> 00:28:04,250 Well, our SOAP API interprets the X-Forwarded Foreheader. 397 00:28:04,390 --> 00:28:05,190 Why? 398 00:28:05,190 --> 00:28:07,050 I honestly have no idea. 399 00:28:07,050 --> 00:28:10,710 There's no reason that you should need the X-Forwarded Foreheader on your LAN. 400 00:28:10,790 --> 00:28:14,530 Again, you're not talking to your router on your LAN through a load balancer. 401 00:28:14,970 --> 00:28:16,450 That would be a hell of a router. 402 00:28:17,350 --> 00:28:24,790 But static analysis also showed that the R9000 is probably the only Netgear router or device that interprets the X-Forwarded Foreheader. 403 00:28:24,810 --> 00:28:33,510 I downloaded all the firmware that I could find, unpacked it, searched through it, and the R9000 was the only one with an instance of the X-Forwarded Foreheader. 404 00:28:33,570 --> 00:28:35,410 So that's also weird. 405 00:28:35,950 --> 00:28:37,950 But what can we do with it? 406 00:28:38,570 --> 00:28:40,190 Well, here's a problem. 407 00:28:40,530 --> 00:28:43,610 So HTTP requests are handled by a CGI server. 408 00:28:43,610 --> 00:28:45,430 And this is U-H-T-T-P-D. 409 00:28:45,510 --> 00:28:51,870 That CGI server sends those requests down to a downstream process. 410 00:28:51,910 --> 00:28:55,850 In this case, Net CGI is what handles all of our SOAP API requests. 411 00:28:56,310 --> 00:29:03,890 So U-H-T-T-P-D will take something in, take the request, turn all of the headers into environment variables, and then toss that down to a different process. 412 00:29:04,890 --> 00:29:10,190 So, Net CGI uses the remote address environment variable to determine if a request is local. 413 00:29:10,250 --> 00:29:16,130 And much like the Buffalo, it will whitelist itself so it can talk to itself without having to deal with authentication. 414 00:29:16,490 --> 00:29:21,250 Now normally, the remote address environment variable is what you would want to use for this. 415 00:29:21,250 --> 00:29:26,130 Because it will be the actual IP address that that request came from in normal circumstances. 416 00:29:26,350 --> 00:29:30,870 And even if you try to change it, chances are you're not going to be able to mess with it. 417 00:29:31,250 --> 00:29:37,570 However, U-H-T-T-P-D just replaces the remote address environment variable with the contents of the exported for header. 418 00:29:39,210 --> 00:29:40,510 For some reason. 419 00:29:40,990 --> 00:29:43,410 Like, I'm a complete RE scrub. 420 00:29:43,410 --> 00:29:45,450 I graph scrub and everything. 421 00:29:45,690 --> 00:29:49,010 But even looking at the assembly, I could tell that that's exactly what that did. 422 00:29:49,010 --> 00:29:51,570 Because it was like ten lines of assembly and that was it. 423 00:29:52,570 --> 00:29:55,030 So, yeah, that's not good. 424 00:29:55,030 --> 00:30:05,250 Because if we can say that we're whatever IP address we want and it uses an IP address to determine if you should bypass authentication, why can't we bypass authentication? 425 00:30:05,810 --> 00:30:07,310 Well, we can. 426 00:30:07,630 --> 00:30:15,610 We just set exported for colon 192.168.1.1 and suddenly we're an admin on the SOAP API. 427 00:30:15,670 --> 00:30:17,370 And we can do whatever we like. 428 00:30:17,870 --> 00:30:22,170 So thus, CVE 2019.12.51.0 was born. 429 00:30:23,230 --> 00:30:25,710 So, I wasn't thinking satisfied. 430 00:30:26,290 --> 00:30:30,210 Because, you know, off bypass isn't fun if you don't get a shell, right? 431 00:30:30,790 --> 00:30:32,010 So, I got a shell . 432 00:30:32,110 --> 00:30:35,690 CVE 2019.12.51.1. 433 00:30:36,750 --> 00:30:37,910 It's kind of big. 434 00:30:38,130 --> 00:30:44,470 So, I don't think we're going to focus on this shell because it's got a lot of fun challenges. 435 00:30:44,470 --> 00:30:46,070 Like, it can only be 17 characters. 436 00:30:46,070 --> 00:30:48,230 It has to be all capitalized , all capitals. 437 00:30:48,230 --> 00:30:49,250 It has to have a colon. 438 00:30:49,250 --> 00:30:53,150 It has to have a single quote and then a semicolon and you have to comment out everything. 439 00:30:53,830 --> 00:30:56,710 But if you want to talk about that, talk to us later. 440 00:30:56,830 --> 00:30:57,970 Because we don't have time. 441 00:30:58,130 --> 00:31:04,490 Before we get away from this one, the interesting part was Ian found the range header, which is definitely an unexpected header. 442 00:31:04,490 --> 00:31:07,890 So, we're able to use the range header to say, like, all right, cool. 443 00:31:07,890 --> 00:31:15,310 Let's put the whole thing that we need in that header and then we'll reference that header in the XML body of that SOAP request. 444 00:31:15,430 --> 00:31:18,590 And I guess we were just lucky that all those things happened to jive together. 445 00:31:19,830 --> 00:31:20,650 Yep. 446 00:31:20,650 --> 00:31:27,150 When you're poking at CGI and you're trying to get weird command injection payloads through, the environment variables are very much your friend. 447 00:31:27,910 --> 00:31:30,070 But I wasn't quite done yet. 448 00:31:30,130 --> 00:31:32,990 Because Netgear has a very fun clause in their bug bounty. 449 00:31:33,050 --> 00:31:40,270 If you can get remote unauthorized access to administer a Netgear device via the internet, not LAN, they'll give you 15 grand. 450 00:31:40,430 --> 00:31:42,170 I can buy a lot of ice cream with 15 grand. 451 00:31:42,170 --> 00:31:46,230 So, I started looking into that. 452 00:31:46,690 --> 00:31:49,570 So, the SOAP API requires extra headers. 453 00:31:49,830 --> 00:31:52,650 Like, for the SOAP requests and all that good stuff. 454 00:31:52,650 --> 00:32:01,250 So, XHR can set these, but it's cross-origin, so it'll have to preflight the requests and chances are the router's just going to slap that right out of the air. 455 00:32:01,450 --> 00:32:03,370 So, CSURF isn't going to happen. 456 00:32:03,790 --> 00:32:09,290 So, the device isn't exposed to any, it doesn't expose itself over the LAN at all. 457 00:32:09,290 --> 00:32:11,650 So, I was kind of out of luck at this point. 458 00:32:11,770 --> 00:32:13,750 So, I just kind of decided, well, I guess I'll die. 459 00:32:13,750 --> 00:32:15,230 I guess I'm not getting the 15K. 460 00:32:15,570 --> 00:32:16,970 Until two weeks later. 461 00:32:17,130 --> 00:32:20,850 And I was taking a shower and my brain started just shouting DNS rebinding. 462 00:32:21,570 --> 00:32:24,490 And say, two minutes later, I figured out why. 463 00:32:24,890 --> 00:32:31,430 The thing with DNS rebinding is that it functions a lot like CSURF, except it's seen as being the same origin. 464 00:32:31,470 --> 00:32:37,230 So, you can send whatever request you like without having to deal with these preflighting annoyances. 465 00:32:38,110 --> 00:32:39,650 So, yeah, no more preflighting. 466 00:32:39,650 --> 00:32:43,610 However, it differs from CSURF in that we cannot send authentication. 467 00:32:44,350 --> 00:32:48,550 In our case, well, DEX 4.4 is a de facto standard. 468 00:32:48,610 --> 00:32:51,810 So, can we just set that header and make ourself an admin? 469 00:32:52,230 --> 00:32:53,530 Well, yes. 470 00:32:53,850 --> 00:32:55,130 So, that's what I did. 471 00:32:55,870 --> 00:32:57,350 So, it's not a restricted header. 472 00:32:57,350 --> 00:32:58,670 So, let's just build a payload. 473 00:32:59,090 --> 00:33:00,870 So, this is the workflow that I went with. 474 00:33:01,470 --> 00:33:03,210 The victim is anyone on the LAN. 475 00:33:03,210 --> 00:33:05,630 They can be authenticated, unauthenticated , does not matter. 476 00:33:05,630 --> 00:33:07,770 Mobile devices, does not matter. 477 00:33:08,230 --> 00:33:10,610 They just wait for the DNS TTL to wear out. 478 00:33:10,830 --> 00:33:17,170 And then once it does, I start issuing post requests via XHR with our off-bypass header to do the following. 479 00:33:17,230 --> 00:33:18,570 We start a config change. 480 00:33:18,750 --> 00:33:19,890 We enable QOS. 481 00:33:19,970 --> 00:33:21,450 We enable advanced QOS. 482 00:33:21,610 --> 00:33:24,430 Then we finish the config change and we pop a shell. 483 00:33:24,450 --> 00:33:29,050 So, we have to fire off five requests to enable a bunch of services and do configs and stuff. 484 00:33:29,250 --> 00:33:32,530 But it actually only takes like 20 seconds to do all of that and then get a shell. 485 00:33:33,190 --> 00:33:37,050 So, just threw that into, I guess, a shell and then it was off to the races. 486 00:33:37,650 --> 00:33:40,470 So, we started disclosure. 487 00:33:41,850 --> 00:33:43,650 So, we got the 15K bounty. 488 00:33:43,650 --> 00:33:44,510 Didn't we, Rick? 489 00:33:48,230 --> 00:33:48,950 Right? 490 00:33:49,250 --> 00:33:53,070 Although I appreciate the applause, something we didn't get the bounty. 491 00:33:53,230 --> 00:33:54,170 What was that, Ian? 492 00:33:55,550 --> 00:34:00,750 So, you know how our disclosure timelines have been pretty small up until now and we tabbed through them all? 493 00:34:01,110 --> 00:34:03,150 This is half of our disclosure timeline. 494 00:34:03,550 --> 00:34:05,430 We just put the important bits in here. 495 00:34:06,430 --> 00:34:09,750 So, let's go through some of the more important ones. 496 00:34:10,330 --> 00:34:19,090 On 10.03, or 18.10.03, we submitted all of our vulnerabilities through bug crowd because that was the only disclosure avenue that we had. 497 00:34:19,570 --> 00:34:25,330 So, we got an award for crosshead scripting via the X-Ordered Foreheader, a completely different issue that was rather low severity. 498 00:34:25,330 --> 00:34:26,530 So, that was nice. 499 00:34:26,670 --> 00:34:40,130 But we didn't hear anything else for two months until Netgear stated that they can't reproduce the command injection issue and they had, in the meantime, released new firmware and asked us to test again and record the proof of concept so they could figure out what they were doing. 500 00:34:41,850 --> 00:34:43,230 So, we did that. 501 00:34:43,230 --> 00:34:48,490 We verified that, yes, I can still get root remotely and I gave them a nice video. 502 00:34:48,710 --> 00:34:52,970 So, they marked the command injection exploit as triaged, which was nice. 503 00:34:53,350 --> 00:34:56,250 That was a little over two months after the initial release. 504 00:34:56,770 --> 00:35:03,630 And then about a month after that, they released the firmware 1.0.4.26. 505 00:35:03,930 --> 00:35:05,270 They didn't tell us about that. 506 00:35:05,270 --> 00:35:06,430 They just released it. 507 00:35:07,430 --> 00:35:15,230 And then about a month after that, or half a month or so, I got a hunch that, you know, I think they fixed everything without telling us or giving us rewards. 508 00:35:15,710 --> 00:35:17,010 So, I checked. 509 00:35:17,690 --> 00:35:19,290 And they had. 510 00:35:19,750 --> 00:35:21,330 So, we confronted them. 511 00:35:21,650 --> 00:35:25,410 And they marked everything as unresolved and gave us degraded rewards. 512 00:35:25,690 --> 00:35:29,330 Like, you know that command injection and off bypass that lets you do admin and everything? 513 00:35:29,490 --> 00:35:31,110 Totally not critical. 514 00:35:32,270 --> 00:35:33,210 Totally. 515 00:35:33,990 --> 00:35:35,450 So, whatever. 516 00:35:35,450 --> 00:35:36,110 That's fine. 517 00:35:36,110 --> 00:35:37,550 We just wanted to disclose the issues. 518 00:35:37,550 --> 00:35:40,170 We're not actually going for the money, although it would be nice. 519 00:35:40,390 --> 00:35:42,290 So, we asked for CVEs. 520 00:35:42,290 --> 00:35:47,670 Because Netgear is a, or it was, a CVE numbering authority. 521 00:35:47,670 --> 00:35:50,230 So, they should be giving us CVEs for their products. 522 00:35:50,430 --> 00:35:52,370 And they just didn't respond. 523 00:35:52,510 --> 00:35:55,410 And then something like a month later, we asked for CVEs again. 524 00:35:55,410 --> 00:35:57,510 And they said, we're not doing CVEs anymore. 525 00:35:58,730 --> 00:36:00,230 Okay, then why are you with CNA? 526 00:36:00,490 --> 00:36:02,830 So, we contact MITRE to get CVEs. 527 00:36:02,830 --> 00:36:07,070 And they say, we'll give you CVEs once we know that Netgear is not a CNA. 528 00:36:07,590 --> 00:36:10,990 Two months later, almost like, what, half a year over? 529 00:36:10,990 --> 00:36:15,330 Eight months since we started the disclosure timeline, we got our CVEs from MITRE . 530 00:36:16,030 --> 00:36:20,450 And unsurprisingly, Netgear was no longer on the list of CNAs. 531 00:36:22,050 --> 00:36:23,270 So, that was fun. 532 00:36:23,270 --> 00:36:24,650 Anything to add, Rick? 533 00:36:25,170 --> 00:36:26,670 Well, I got plenty to add. 534 00:36:26,670 --> 00:36:38,370 So, one of the things that I guess was really problematic about all this was that when we reported all these vulnerabilities through BugCrowd to Netgear, all that time went by and they were just not fixing the issues. 535 00:36:38,370 --> 00:36:41,110 They weren't admiring that we had sent them the issues over. 536 00:36:41,170 --> 00:36:45,010 I can't, I blame both Netgear and BugCrowd for this situation. 537 00:36:45,170 --> 00:36:49,130 Because we had responsibly disclosed all these vulnerabilities through them. 538 00:36:49,130 --> 00:36:58,930 And this was the first time ever, I think both of us have ever seen BugCrowd put a blocker, not on the researcher, but on the company for not addressing the issues that we had sent over. 539 00:36:59,350 --> 00:37:07,030 Netgear had also put us in a position that we thought that, alright, cool, we could have easily sent them these issues separately and they could have been addressed. 540 00:37:07,110 --> 00:37:20,410 And the DNS rebinding was just kind of a nice feature that we knew or, I guess, a nice way to chain all the things together to get unauthenticated command injection on this device with, I guess, 20 seconds of user interaction. 541 00:37:20,490 --> 00:37:35,150 The thing about it is that we, I feel, I can't help but feel that I ended up being lied to as a researcher, especially from the fact that we met all the requirements of their program and we didn't get what they promised that they were going to give us. 542 00:37:35,390 --> 00:37:36,370 That's beside the points. 543 00:37:36,370 --> 00:37:38,550 I guess it's kind of water under the bridge at this point. 544 00:37:38,670 --> 00:37:39,610 Ian, the summary? 545 00:37:40,930 --> 00:37:47,350 So, in general, like, I highly recommend if you're doing anything with web applications, use the X-Forwarded Foreheader. 546 00:37:47,350 --> 00:37:49,730 It is a very fun header to mess with. 547 00:37:49,730 --> 00:37:58,090 You can get command injection, SQL injection, a lot of SQL injection, tainting logs, all sorts of good stuff like that. 548 00:37:58,570 --> 00:38:01,510 And CMDI, like, yeah, it'll find a way. 549 00:38:01,510 --> 00:38:07,110 Even if it's, you know, 17 characters and mangled to all hell, you're still going to get command injection. 550 00:38:07,110 --> 00:38:08,850 You just have to try hard enough. 551 00:38:09,530 --> 00:38:12,250 So, again, environment variables are your friend. 552 00:38:12,390 --> 00:38:14,490 DNS rebinding is remarkably powerful. 553 00:38:14,490 --> 00:38:30,350 This was the first time that I had used it and it kind of blew my mind because suddenly all of these attacks that require, you know, authentication tokens or require bypassing CSRF protection become extremely easy to do as long as you don't have to worry about authentication. 554 00:38:31,230 --> 00:38:33,950 And, like, yeah, if you have a bug bounty, please communicate with us. 555 00:38:33,950 --> 00:38:36,970 Don't just leave us sitting there for two months, five times. 556 00:38:37,450 --> 00:38:40,270 And if you stop providing service, communicate. 557 00:38:40,270 --> 00:38:43,350 You can, like, say, hey, we're not a CNA anymore. 558 00:38:43,610 --> 00:38:45,390 And also, like, communicate in general. 559 00:38:45,390 --> 00:38:46,250 It's nice. 560 00:38:46,910 --> 00:38:58,490 And for bug bounties, we found out a few times now that bug bounty programs, like, the companies don't have much of an incentive to treat researchers fairly. 561 00:38:58,490 --> 00:39:02,790 They can just say, no, and you can't really do much. 562 00:39:02,790 --> 00:39:07,430 There's no incentive for them to not really do that aside from just people getting angry. 563 00:39:08,690 --> 00:39:12,310 And bug bounties probably shouldn't replace your security contacts. 564 00:39:12,370 --> 00:39:15,230 We would not have gone through the bug bounty if we didn't have to. 565 00:39:15,830 --> 00:39:17,970 But that was their only security contact. 566 00:39:17,970 --> 00:39:19,990 That was the only way that we had. 567 00:39:20,830 --> 00:39:23,450 So, that's just how it ended. 568 00:39:24,310 --> 00:39:26,270 I guess, anything to add, Rick? 569 00:39:26,990 --> 00:39:27,990 No, that's kind of it. 570 00:39:27,990 --> 00:39:32,250 I know we're definitely over time, so we're just going to run through these conclusions and answer some questions at the end. 571 00:39:32,510 --> 00:39:39,150 For the quick conclusions, these were the things that were different from when we conducted our research project in 2013. 572 00:39:39,150 --> 00:39:43,630 In 2013, most of the shells that we ended up getting were through CSRF. 573 00:39:43,790 --> 00:39:56,070 We found out now, I think it's more that our security research in general has gotten to a spot where it's more, it's easier to get a hand of different ways to bypass checks, especially authentication checks. 574 00:39:56,070 --> 00:39:58,350 So, in this case, we didn't need to use CSRF for any of these. 575 00:39:58,350 --> 00:40:00,890 We just used a lot of authentication bypasses. 576 00:40:01,370 --> 00:40:09,970 One of the things that was nice now that we didn't see in 2013 is that, in 2013, a lot of the devices had executable stacks. 577 00:40:10,190 --> 00:40:16,030 We found, I think, two buffer workflows in one of the ASUS routers that we hacked. 578 00:40:16,130 --> 00:40:21,910 Those did not have an executable stack, so we had to do ROP and a bunch of other really fancy stuff to eventually get a shell. 579 00:40:22,310 --> 00:40:27,870 That was not the case in 2013 , where just pretty much it was the bottom of the barrel with regards to security. 580 00:40:28,570 --> 00:40:32,190 And software packages were really out of date in 2013. 581 00:40:32,190 --> 00:40:33,390 They're really not that much anymore. 582 00:40:33,390 --> 00:40:41,190 One of the bugs that we found a lot in that study was that SMB was horribly out of date, so you could do symlink traversal. 583 00:40:41,270 --> 00:40:43,270 That's really not the case anymore for a lot of these. 584 00:40:43,370 --> 00:40:44,890 It's much more up to date. 585 00:40:45,150 --> 00:40:52,210 And I guess nicer from both the security's perspective, because you get to try to find new, interesting security vulnerabilities instead of these old ones. 586 00:40:52,590 --> 00:40:59,110 And before we didn't see any publicly documented security contacts, a lot of the times we were just emailing people that we found on LinkedIn. 587 00:40:59,410 --> 00:41:05,630 Now we did see some manufacturers, for example, Asus, TerraMaster, Synology, QNAP. 588 00:41:05,690 --> 00:41:12,290 A lot of these companies actually tried their best to ensure that the vulnerabilities that we were disclosing were getting addressed. 589 00:41:12,790 --> 00:41:20,770 And publicly documented disclosure outlets, the two that I mentioned that I think were the ones that made me the happiest were QNAP and Synology. 590 00:41:21,870 --> 00:41:25,290 QNAP and Synology were very good about all the issues that were reported to them. 591 00:41:25,290 --> 00:41:32,390 As soon as we reported to them, they responded within a day or two and they addressed the issues and they had us check to make sure that everything was good. 592 00:41:33,330 --> 00:41:34,930 Let's find out what stayed the same. 593 00:41:35,570 --> 00:41:41,850 Devices that are still remotely exploitable, given the 125 CVEs that we found, I think that's pretty easy to understand. 594 00:41:42,450 --> 00:41:50,090 There's still plenty of CSERF, like I said in the previous slide, before we were using that for the exploit chain for a lot of the stuff. 595 00:41:50,230 --> 00:41:54,790 Now we don't need to use it as much because we found out about a lot of authentication bypasses. 596 00:41:55,090 --> 00:41:57,210 OS command injection is still a problem. 597 00:41:57,210 --> 00:42:01,030 That's probably one of the vulnerabilities that we focused on this time around. 598 00:42:01,570 --> 00:42:03,750 And security through obscurity is still alive and well. 599 00:42:03,750 --> 00:42:15,590 We looked at a lot of manufacturers that the way that they would do stuff, it's like they would try to do their own type of encryption or their own type of file hosting so that it would become kind of problematic but it wasn't in the end. 600 00:42:15,590 --> 00:42:23,630 And here's some of the stuff that stayed the same for, or I guess like what changed, but stayed the same in manufacturers. 601 00:42:23,990 --> 00:42:25,690 Some manufacturers actually really care. 602 00:42:25,810 --> 00:42:33,050 I've been talking about Synology and QNAP a lot, not because I know anybody there, but it's because I was really happy with the disclosure process. 603 00:42:33,850 --> 00:42:36,650 Oh yeah, Xiaomi was another one that was very good. 604 00:42:36,650 --> 00:42:38,430 I think that's how you say it, right? 605 00:42:39,590 --> 00:42:43,150 Xiaomi did a very good job of addressing the issues that we disclosed. 606 00:42:43,170 --> 00:42:45,410 They have an interesting bug bounty program. 607 00:42:45,550 --> 00:42:52,550 They paid us in toys, never had that happen before, even as a child. 608 00:42:52,750 --> 00:42:55,570 And a lot of the companies have bug bounty programs. 609 00:42:55,690 --> 00:43:05,870 Needless to say, I'm not very happy with companies like Netgear who were partnering with Bug Crowd and they ended up in this situation where we feel cheated, but a lot of other companies did actually pay out their bug bounties and I'm happy for that. 610 00:43:06,470 --> 00:43:11,190 And some companies are really interested in working with researchers to get things addressed. 611 00:43:11,450 --> 00:43:14,390 A lot of the stuff that we reported, they were very much happy. 612 00:43:14,650 --> 00:43:16,450 They wanted to know, how did you guys find it? 613 00:43:16,450 --> 00:43:17,370 What did you do? 614 00:43:17,370 --> 00:43:18,830 Do you think that we have more instances? 615 00:43:18,830 --> 00:43:19,590 Can you check? 616 00:43:19,590 --> 00:43:21,050 Also, it's free work, so why not? 617 00:43:21,070 --> 00:43:25,950 But it's a really nice situation where they care about the security and they're trying their best to improve it. 618 00:43:26,850 --> 00:43:28,270 And that's kind of it, folks. 619 00:43:28,690 --> 00:43:31,830 These are me and Ian's Twitters. 620 00:43:32,230 --> 00:43:34,510 And we also love talking shop. 621 00:43:34,510 --> 00:43:38,570 We're going to be at the Village for the rest of the day until Sunday we'll be here. 622 00:43:38,850 --> 00:43:42,670 We'll leave eventually, but this was a very good experience. 623 00:43:42,710 --> 00:43:46,550 And this was the results of our three of the best results from our research project. 624 00:43:46,550 --> 00:43:49,190 There are two other people that weren't able to present with us today. 625 00:43:49,190 --> 00:43:50,850 That's Josh Meyer and Sean Marani. 626 00:43:50,970 --> 00:43:54,650 Those guys found a lot of other vulnerabilities and it was great to work with them. 627 00:43:54,650 --> 00:43:59,870 Thanks for your time and I'll open the floor up to questions if any of you have anything to say or ask.