00:00:00.000-->00:00:05.239 >>Next and last today we have Daniel, we have Mauro and we have Jen who are going to talk 00:00:05.239-->00:00:11.311 to us about smart city stuff. And taking over smart city stuff and generally causing all kinds 00:00:11.311-->00:00:16.283 of chaos and havoc. Why don’t we give these guys a big round of applause? [applause] >>Hi 00:00:19.052-->00:00:24.057 everybody. Woo! So, some quick introductions. My name is Daniel Crowley, I’m the Research Baron 00:00:32.599-->00:00:37.404 for X-Force Red. Uh you might be wondering why I have such a silly title. Well uh, I wanted 00:00:37.404-->00:00:43.010 to be a director of research uh cause I do direct the research program but d-director’s 00:00:43.010-->00:00:47.147 apparently a reserved word at IBM so I had to sort of work around that. I pitched them a 00:00:47.147-->00:00:52.953 couple things like Tyrannical Research Dictator. They didn’t like that. Um, I s- I pitched a 00:00:52.953-->00:00:56.290 research sultan but there was some suggestion that nah maybe there was some cultural 00:00:56.290-->00:01:01.695 insensitivity there so we passed on that one. But I do hold uh and I’m getting ahead of myself 00:01:01.695-->00:01:06.099 here but I do hold the noble title of baron in the micronation of Sealand so as 00:01:06.099-->00:01:12.105 long as you respect it’s sovereignty well emeri-libertas to you buddy. Um, but uh I’m a 00:01:12.105-->00:01:18.078 baron as long as you don’t mind me having paid 40 dollars to get that title. Um best 40 dollars 00:01:18.078-->00:01:22.716 I’ve ever spent by the way. Um I’ve been doing pen testing uh since 2004 and I’ve been a 00:01:22.716-->00:01:27.821 hobbyist before that and I also happen to have an interest in, in physical security and uh I’m 00:01:27.821-->00:01:32.826 a bit of a walks board enthusiast. Oh I didn’t advance the slides quick enough did I? 00:01:41.702-->00:01:46.673 >>Hi, I’m Jennifer Savage, I’m a security researcher at Threatcare. I’m also a member of 00:01:46.673-->00:01:52.846 the Black Hat review board. I’ve had a couple decades experience in tech. Including uh software 00:01:52.846-->00:01:58.352 development, management, um vulnerability management, vulnerability assessment, 00:01:58.352-->00:02:03.290 penetration testing, security research, etcetera. >>I’m Mauro, I’ve been doing pen testing for 00:02:08.195-->00:02:13.133 many years. I’ve been fuzzing through differing areas, like security architecture, 00:02:13.133-->00:02:18.138 developing, uh system administrator, uh I love to find flaws, and correct them. >>So 00:02:22.876-->00:02:29.216 you might be kind of curious about the term smart city. What exactly makes a technology smart 00:02:29.216-->00:02:35.889 city technology? Well it’s a pretty broad blanket term kind of like internet of things. Um, 00:02:35.889-->00:02:40.494 it’s sl- it’s more specific of that but it’s still in the venn diagram, it’s a pretty large 00:02:40.494-->00:02:45.632 bubble and there’s lots of little circles within that. So for instance there’s the 00:02:45.632-->00:02:51.505 industrial internet of things. Um cities have to have uh, utilities. Ya know you have to 00:02:51.505-->00:02:56.543 have water infrastructure and power and all that sort of thing. So when you have 00:02:56.543-->00:03:02.115 technology running that, that’s s- part of smart city tech. Um something that fits more 00:03:02.115-->00:03:07.120 squarely into that is uh urban automation. SO an example being automated waste trucks. That uh 00:03:09.556-->00:03:14.895 drive around and pick up people’s trash cans and read RFID tags in the trash cans so 00:03:14.895-->00:03:19.900 they have an exact log of when each trash can was picked up and which trash can uh, belonged to 00:03:22.369-->00:03:28.241 whom and how heavy it was and all that sort of thing. And then you have uh public safety things 00:03:28.241-->00:03:33.246 like police body cams. You have things like emergency management systems. Um, so you have uh 00:03:36.116-->00:03:41.121 systems that uh, uh detect impending disasters and allow people to respond quicker. Um, 00:03:44.591-->00:03:49.596 you have intelligent transportation systems, uh, um, uh, uh devices and software, 00:03:51.765-->00:03:56.770 that try to reduce traffic congestion. Um things that will detect how much traffic is on a 00:03:58.772-->00:04:03.710 stretch of road and then communicate with the traffic light down the road to say okay 00:04:05.779-->00:04:10.784 you h- you’re gonna wanna open it up a little bit. Um, and then you have uh, metropolitan area 00:04:13.120-->00:04:18.125 networks which are just sort of city sized, uh they’re like LANs but uh city sized. Um, so you 00:04:20.794-->00:04:26.833 might have public internet kiosks or you might have city wide wife uh provided just for 00:04:26.833-->00:04:32.572 all the citizens to use. Um and there’s more smart city tech than just this. There’s lots and 00:04:32.572-->00:04:37.577 lots and lots of different tech. But these are different just example areas. >>So when it 00:04:40.013-->00:04:44.951 comes to privacy there are a lot of concerns with smart city technologies. Um it’s a very 00:04:44.951-->00:04:49.422 different thing when you can choose what you have in your home. You can choose not to have 00:04:49.422-->00:04:54.427 IOT devices. You can choose not to have a smart TV in your home. Um but you can’t really get much 00:04:57.197-->00:05:03.870 control over the fact that outside your home, right outside your door every street lamp on 00:05:03.870-->00:05:09.743 your street might have a camera in it. And that’s what we’re talking about when we talk about 00:05:09.743-->00:05:15.482 smart cities. Everything’s monitored. There’s a billion sensors everywhere. Um it could 00:05:15.482-->00:05:22.155 become the case that there are legitimate purposes that are subverted by malicious actors. 00:05:22.155-->00:05:27.160 And so i-if ya know a legitimate person could use a connected vehicle infrastructure like a 00:05:30.063-->00:05:37.037 vehicles infrastructure hub to monitor the location of a car or use cameras to monitor the 00:05:37.037-->00:05:42.442 location of a person walking down a street, then a, um ya know a malicious actor could use 00:05:42.442-->00:05:48.582 it for the same purposes as well. >>So speaking of intelligent transportation 00:05:48.582-->00:05:51.451 systems this is 1 of the biggest pushes in smart city systems this is one of the biggest 00:05:51.451-->00:05:56.056 pushes in smart city tech. There is a lot of advancement, a lot of adoption of smart city 00:05:56.056-->00:06:00.126 technologies. Uh I was lucky enough to speak with the gentlemen of the Federal Highway 00:06:00.126-->00:06:05.131 Administration who corrected me a little bit on this slide. And so uh, there was h- as far as we 00:06:08.168-->00:06:13.874 can find a proposed OBD 3 standard at one point which is basically OBD 2 plus a little 00:06:13.874-->00:06:18.979 transceiver. But the more we looked into it we weren’t sure if it was a thing that was 00:06:18.979-->00:06:24.751 pitched a long time ago around uh circa 2000 and then died because it was obviously a 00:06:24.751-->00:06:29.756 terrible idea or it might have actually been a hoax. Um because w-we chased it down and it was, 00:06:31.925-->00:06:38.832 some of these things looked pretty odd. So uh thank you to Ed for the FHWA uh for steering 00:06:38.832-->00:06:43.837 us in, in the right direction on that. Um, so uh something that exists in uh Hangzhou, China is 00:06:47.073-->00:06:51.211 what’s called the city brain or Traffic Brain. Which is a gigantic intelligent 00:06:51.211-->00:06:56.216 transportation systems project that aims to reduce the traffic problems in Hangzhou. And um, as 00:07:00.020-->00:07:05.759 a western th-this particular quote kind of horrified me that uh in China people have less 00:07:05.759-->00:07:12.232 concern with privacy which allows us to move faster. Uh and that uh for context is being 00:07:12.232-->00:07:17.237 spoken by uh, the, uh, the manager of AI at Alibaba who created, Alibaba created the 00:07:19.506-->00:07:24.511 Traffic Brain and he’s speaking about it at, the World Summit AI uh in a talk about the Traffic 00:07:27.047-->00:07:33.887 Brain. But it’s not just in China. Um, there’s also street lights with uh, cameras built 00:07:33.887-->00:07:39.326 into them and uh it took me awhile of staring at this picture before I could actually 00:07:39.326-->00:07:44.331 see the cameras in these street lights but sure enough they are there. Now, in addition to that 00:07:47.867-->00:07:53.206 lots of cities are either talking about or have already deployed facial recognition 00:07:53.206-->00:08:00.113 software to their surveillance cameras. So, in 2017 uh, a former uh former governor e- 00:08:00.113-->00:08:06.986 for- red leather, yellow leather, unique New York. Um a former government official for 00:08:06.986-->00:08:13.126 Singapore said they want to deploy cameras to every single 1 of their lamp posts, all 100 and 00:08:13.126-->00:08:18.131 10,100 and put facial recognition uh software to work on those cameras. And if you 00:08:20.266-->00:08:25.271 think that’s crazy Dubai 1 upped them. They want to make the first police station manned 00:08:27.540-->00:08:32.545 entirely by robot police by 2030. There was a movie about this, it didn’t end well. 00:08:40.153-->00:08:45.158 [laughter] >>So let’s talk about reconnaissance. How do you discover what’s in a city? So 00:08:47.761-->00:08:53.533 you just start with search engines, that’s the most obvious place. In fact, everything that 00:08:53.533-->00:08:58.671 you need in order to discover what’s in a city can be done entirely through passive 00:08:58.671-->00:09:03.610 reconnaissance methods. So, um we started with case studies made by manufactures who talked 00:09:06.946-->00:09:11.651 about what their devices were being used for around the world. And you can get some really 00:09:11.651-->00:09:15.722 interesting information about the deployment of those devices just by looking at the case 00:09:15.722-->00:09:22.429 studies. There’s also news reports. So local news will quite often cover smart city 00:09:22.429-->00:09:27.434 developments. It’s all new, it’s n-all, all fascinating and it’s all recorded by the news. And 00:09:30.103-->00:09:36.209 then um, oh the open data initiatives. So some of you may have seen a lot of open data 00:09:36.209-->00:09:41.314 initiatives offered by uh various government agencies and cities will quite often have 00:09:41.314-->00:09:46.753 their own open data initiatives. Where they public data quite often taken from those smart 00:09:46.753-->00:09:51.758 city sensors. And then some city contracts um, are public, ha- I’m looking at this upside down, 00:09:57.130-->00:10:02.669 it's’ kind of hard. So some city contracts are public. So in the US everything is FOIA-able so 00:10:02.669-->00:10:07.941 you can look up purchase order online if you just google for it properly. You can check bidnet, 00:10:07.941-->00:10:12.946 etcetera and then you can see what your city has. So, also public systems are, already 00:10:25.692-->00:10:32.165 mapped. So there’s some really great search engines out there that are used for um mapping out 00:10:32.165-->00:10:37.937 internet infrastructure. Um so if you first identify the IANA ranges for the city you are 00:10:37.937-->00:10:43.676 doing recon on, then you can just check SHODAN and Censys by searching literally for that 00:10:43.676-->00:10:48.681 IANA range. There will be an ID for it. And then lastly physical recon. So just going outside 00:10:52.385-->00:10:58.825 basically and looking with your eyes. Um you can do traditional methods like war driving, 00:10:58.825-->00:11:04.163 looking for WIFI, there’s all kinds of different war driving methods out there. There’s even 00:11:04.163-->00:11:10.336 wardriving for LoRaWAN. You can find I think Travis Goodspeed has some really great stuff on 00:11:10.336-->00:11:15.808 other uh types of wardriving out there. And um, but all this requires that you actually log 00:11:15.808-->00:11:20.813 off and walk outside your homes, so. A bit of a challenge for some of us. And then source code 00:11:23.416-->00:11:30.223 repositories, so a lot of this stuff is open source. Um you can check Github, Bitbucket, Gitlab 00:11:30.223-->00:11:35.728 and then lastly we found this thing called OS ADP run by the Federal Highway Administration 00:11:35.728-->00:11:42.235 and I was recently informed that they actually are requiring that a lot of these manufacturers 00:11:42.235-->00:11:46.839 open source their software so that independent security researchers can do this kind of 00:11:46.839-->00:11:52.979 work. And it really enables us to try to find these kinds of flaws [applause]. So I’m really 00:11:52.979-->00:11:57.984 happy with that. [applause] So let’s apply these mesag- methods real quick to a city. So Austin, 00:12:00.086-->00:12:05.825 Texas which is the city I live in. Um here is a round up of some news reports that were down 00:12:05.825-->00:12:10.830 about smart city tech that was being deployed. So autonomous transit shuttles, um a smart 00:12:13.233-->00:12:17.103 street. So 6th street which is a real big party street there. They were going to turn into a 00:12:17.103-->00:12:22.108 smart street. Um, this is CityUP. It’s basically a website all about Austin’s smart city 00:12:24.744-->00:12:31.117 initiatives. And you can find lots of details there. Uh here’s the Censys results for the 00:12:31.117-->00:12:36.222 city’s IANA ranges. This actually covers a lot more than just the smart city tech that 00:12:36.222-->00:12:42.362 they have. It’s a list of like all of the systems that are running on their range. Um and 00:12:42.362-->00:12:49.035 this is kind of neat, at all of the low water crossings in Austin they have flood sensors 00:12:49.035-->00:12:54.173 and these boxes are on the side of the road and you can just walk right by and see them. Um 00:12:54.173-->00:13:00.079 and here’s how they transmit here. Interestingly after we started doing our research and I 00:13:00.079-->00:13:05.585 became concerned about um whether or not flood sensors might be messed with and nobody 00:13:05.585-->00:13:10.623 would n- know to go check to make sure it’s, it’s a legitimate reading, somebody 00:13:10.623-->00:13:15.595 went ahead and installed cameras without us even reaching out or talking to them. They installed 00:13:15.595-->00:13:19.365 cameras at every low water crossing so now when you check the ATXfloods website that 00:13:19.365-->00:13:24.370 reports the results of, of the flood sensor, you can verify it visually to see whether or not 00:13:27.006-->00:13:33.312 the low water crossing actually is flooded and um ATXfloods by the way is a website you can use 00:13:33.312-->00:13:38.251 to sh- to um plan your route around the city during times of flooding, because it floods 00:13:38.251-->00:13:44.991 quite frequently in Austin. And then uh, this is actually just a purchase order we found by 00:13:44.991-->00:13:49.562 googling for purchase orders like we said beforehand this ones for police body cams which 00:13:49.562-->00:13:54.567 falls under the safety uh subset of things. >>Alright so I imagine some of you are here 00:14:00.173-->00:14:05.178 just for the bugs. So here’s the bugs. So the first uh device th- or r-rather devices that we 00:14:07.480-->00:14:12.485 looked at were um, were a uh, in- in a device family called the i.Lon devices from Echelon 00:14:16.355-->00:14:22.495 corporation. Um we looked at the smart server which was previously called uh, previously 00:14:22.495-->00:14:29.302 branded as the i.LON 100 and it’s successor the i.LON 600. Um now both of these things have 00:14:29.302-->00:14:35.241 the same functions but different feature sets. Um, so basically um, you might know something 00:14:35.241-->00:14:40.780 around ICS security. But if you know anything about ICS security the general recommendation is 00:14:40.780-->00:14:46.652 never ever attach these things to the internet. N-ever, just like put them in an air gap 00:14:46.652-->00:14:52.325 network and never let anybody touch them unless they are already authorized to touch 00:14:52.325-->00:14:57.530 them. So, um, we found that this was a pretty interesting device because what it does is it hooks 00:14:57.530-->00:15:02.468 up ICS devices to IP networks like the internet. Um, and actually we found about 450 00:15:04.771-->00:15:09.776 smart server devices exposed to the internet via Censys. So that’s great. Um, so uh these 00:15:12.078-->00:15:17.517 things talk to a variety of different devices over various protocols. Like it speaks to the 00:15:17.517-->00:15:23.189 very popular Modbus, us including uh the uh Modbus over TCP IP variant, it speaks BACnet 00:15:23.189-->00:15:29.829 over IP and it can also speak to any sort of web services that uh, uh, uh take SOAP 00:15:29.829-->00:15:34.267 communications. Um hooking this up was kind of a harrowing experience for me because it 00:15:34.267-->00:15:40.706 doesn’t take, it, it, it has these screw terminals to receive power and uh, I couldn’t just 00:15:40.706-->00:15:47.346 cannibalize a power c- like and ATEX power cable and plug in uh, I had to get like a little power 00:15:47.346-->00:15:51.851 adapter and I, m- I did a terrible wiring job. I actually when I hooked this up I plugged 00:15:51.851-->00:15:58.057 it in on 1 of my outside ports on my concrete patio. I was wearing like, uh, uh a safety 00:15:58.057-->00:16:02.395 goggles and oven mitts cause I was like, is this gonna blow up is there going to be fire? I’m 00:16:02.395-->00:16:07.400 not an electrician. Uh if there is anybody from OSHA in the room, I’m sorry. I probably did 00:16:09.635-->00:16:14.640 bad things there although uh it wasn’t at my work place, but anyway. Um, s- h- um, so we 00:16:18.311-->00:16:22.548 found a bunch of things here. Um we found first of all that there were default credentials. Um 1 00:16:22.548-->00:16:27.687 interesting thing is that there is a webserver and an ftp server and there’s separate credentials 00:16:27.687-->00:16:34.160 for both. So you might have 1 of these things and change the web server password but not the FTP 00:16:34.160-->00:16:40.099 password. In fact we sourced 1 of these devices from eBay and found while the web application 00:16:40.099-->00:16:45.104 password had been changed the FTP server password had not. Um, so we uh, we were able to uh 00:16:48.875-->00:16:53.312 because of the fact that the credentials are in a configuration file in plain text 00:16:53.312-->00:16:58.251 on the FTP route, uh we were actually able to get the original credentials for this 00:16:58.251-->00:17:03.155 decide which is scary in and of itself. But that’s ya know, that’s neither here nor there. 00:17:03.155-->00:17:08.728 Um 1 interesting thing about this is even if the default passwords have been changed the 00:17:08.728-->00:17:13.165 default configuration for what to authenticate on the web application does not include the 00:17:13.165-->00:17:18.771 API. Which does most of the heavy lifting. The user interface which calls the API is 00:17:18.771-->00:17:24.010 authenticated but if you know the right way to make the calls you can just invoke uh, all 00:17:24.010-->00:17:29.882 sorts of fun API functions like hey change the ftp credentials to blah, blah, blah. Um, so 00:17:29.882-->00:17:34.887 that’s good and as this is of course over uh plain text http and s- it’s not FTPS or SFTP, 00:17:38.157-->00:17:44.130 it’s just s e- uh just FTP. Um and on top of all that there’s another authentication bypass 00:17:44.130-->00:17:49.335 bug so even if you change the default configuration and both passwords you still have an 00:17:49.335-->00:17:55.508 authentication bypass bug. So uh, I talked about retrieving the clear text password via ftp 00:17:55.508-->00:18:01.681 but um, you can also replace the binaries on the device over ftp. Uh you can fiddle with the ICS 00:18:01.681-->00:18:06.919 gear that’s connected to it in the way that the legitimate administrator would. Or could. 00:18:06.919-->00:18:13.926 H- um, and uh if you want you can also just uh change the IP address and prevent anybody from 00:18:13.926-->00:18:18.931 being able to connect to it. Um, so here’s how the authentication bypass works. Um, w-what the, 00:18:21.200-->00:18:26.205 the i.LON devices do or did um, before patches were, were, were made available they looked at 00:18:30.042-->00:18:35.781 the path to see does it match any uh, does it match any of the items that I have in the 00:18:35.781-->00:18:42.421 configuration file for the authentication section? So, in this case we’re hitting an end 00:18:42.421-->00:18:49.028 point that is authenticated by default. So forms uh slash forms slash echelon slash start is uh, 00:18:49.028-->00:18:54.600 a default item. So this falls under that, that pattern. But it’s just string based matching 00:18:54.600-->00:18:59.939 it doesn’t do any sort of canonicalization on the name. So, if we instead request slash 00:18:59.939-->00:19:04.944 form slash, slash echelon uh slash anything it says okay this isn’t slash form slash echelon, 00:19:07.880-->00:19:12.151 there’s another slash here, I don’t need to authenticate this. Uh and then it hits the 00:19:12.151-->00:19:16.655 operating system, the extra slash is thrown away and well you know the story from there. 00:19:16.655-->00:19:21.661 An interesting note, the i.LON 600 units, uh have this weird thing called security access 00:19:23.963-->00:19:28.868 mode. Which basically means you have to stick a paperclip into this thing and hold it in there 00:19:28.868-->00:19:34.040 as you reset it, so you know like either 2 paperclips or just pull the power and put it back 00:19:34.040-->00:19:41.013 in. Um, so y- you um, you have to go through this process in order to put it into a mode 00:19:41.013-->00:19:47.787 where you can change credentials. So uh, you can’t r-really uh get the plain text 00:19:47.787-->00:19:52.191 um i-if you’re just using the authentication bypass, uh and by the way the default 00:19:52.191-->00:19:56.829 configuration is secure on or at least we didn’t find any problems with the default 00:19:56.829-->00:20:02.702 configuration on the i.LON 600. But this authentication bypass works on it. Um, so you can 00:20:02.702-->00:20:07.706 still use all of the uh, the ICS stuff that they’ve configured into their i.LON 600 when you 00:20:09.909-->00:20:15.414 use this authentication bypass bug but y-you can’t really change the FTP credentials and 00:20:15.414-->00:20:19.752 backdoor the device or anything like that. But what you can do if you really just wanna be a 00:20:19.752-->00:20:26.258 jerk is change the IP address since that’s outside the purview of the security access mode. Now 00:20:26.258-->00:20:30.029 something interesting that we stumbled across that we weren’t looking for as we were doing 00:20:30.029-->00:20:35.034 this research is that the, there was an exploit for the uh, the default configuration bug that 00:20:37.203-->00:20:44.076 affects the API. Um, and this, this way uh, this was interesting to discover. Um this 00:20:44.076-->00:20:49.081 was posted to Git a GitHub gist. Uh back in August of 2015. The comments in the code shown here 00:20:51.484-->00:20:56.489 uh suggest that this is older than 3 years. Uh, so that’s interesting. We contacted 00:20:58.858-->00:21:02.161 echelon, when we contacted Echelon to disclose the vulnerabilities that we 00:21:02.161-->00:21:08.234 discovered we also let them know about this. They were unaware of this exploit and they were under 00:21:08.234-->00:21:14.573 the ware, aware of the bug that it exploits until we spoke to them. So that’s interesting and 00:21:14.573-->00:21:19.311 it tells us something that uh, we normally don’t get to know, which is that, yes there are 00:21:19.311-->00:21:24.316 people looking for these things and finding them and not reporting them. So. >>Ok this is 00:21:26.752-->00:21:31.757 another 1. Can you hear? >>Yeah >>These Battell V2I, what are those? Battelle V2I hub manages 00:21:42.134-->00:21:47.139 communication between connected vehicles and infra- transportation infrastructure. 00:21:50.075-->00:21:55.080 It translate data from multiple sources and protocols using uh they’re using transportation. It 00:21:57.149-->00:22:02.087 has a modular infrastructure. The system can help deliver messages that are useful for 00:22:04.690-->00:22:09.695 transportation application like read light violation, speed, warnings, over high warnings. 00:22:13.799-->00:22:18.804 With V2I hub, it was possible to g- gain access because it has uh how you call it, password. It 00:22:25.044-->00:22:30.049 has uh, various differing API keys that you can access with authentication or you can 00:22:32.284-->00:22:37.289 bypass. You can perform process quitting a task, attacks. Uh executing S call injections in 00:22:41.060-->00:22:46.065 the API it also possible. And you can gain access without authentication. With all these 00:22:49.535-->00:22:54.540 flaws an attacker adversary can do many things. He can track vehicles, he can send f- say 00:22:58.677-->00:23:03.616 false messages, or can change the messages, he can create traffic or modify the ways to 00:23:06.885-->00:23:13.792 change something and say in a way that might create some different behaviors. Or just 00:23:13.792-->00:23:18.797 shut down the hub. So nobody can send or receive messages from the hub. These show why it is 00:23:24.003-->00:23:30.976 possible to shutdown a device that’s running between a hub because uh you can see doesn’t 00:23:30.976-->00:23:35.981 require any authentication, it doesn’t need any API key. V2I hub has an API and this API 00:23:42.554-->00:23:49.361 requires a key. Even if a key has been changed it is possible to access the key through the 00:23:49.361-->00:23:54.366 webserver without authentication. As you can see using a string compare function 00:23:56.568-->00:24:01.507 comparing to a string. That we see pretty soon what it is. Even if the key file was restricted 00:24:09.081-->00:24:16.021 the input key file, uh the input key and the compare key or the write key or compare using the 00:24:16.021-->00:24:21.026 string compare function which has a odd set of return values. And different conditions as you 00:24:23.962-->00:24:28.967 can see there is a list of return values th- that we can use that for. They mostly make 00:24:35.441-->00:24:40.446 sense but something interesting tries to happen when comparing a strings and arrays. The string 00:24:47.820-->00:24:52.825 compare function return null without warning. If this warning is ignored something can happen 00:24:56.328-->00:25:01.266 here. When zero wrote the value return by the function when 2 string are identical it’s 00:25:05.070-->00:25:12.010 compared to null. Okay remember that we saw the compare function trying to compare the correct 00:25:12.010-->00:25:17.015 key with an input key using that function. The comparison returns true as long as you’re not 00:25:21.019-->00:25:26.024 checking types too carefully. This mean you have left score bracket and right square bracket 00:25:31.397-->00:25:36.402 and the angle key and the URL, any key would be the write key so that means you have access to 00:25:38.704-->00:25:43.709 the API always. In that case you can call all the future that V2I hub is using. And lastly the 00:25:49.581-->00:25:54.586 size colon injection in version 3 as well in the login page. So you can extract all the certain 00:25:58.524-->00:26:03.462 names and passwords without any authentication. >>So, the final device that we looked at was 00:26:11.837-->00:26:18.744 called the Libelium Meshlium. So the meshlium is a part of an echo system that works on 00:26:18.744-->00:26:23.916 sensors. Uh the sensors can detect all sorts of things and the meshlium is actually 00:26:23.916-->00:26:28.353 designed to be able to communicate with even sensors that are not produced by 00:26:28.353-->00:26:34.126 Libelium themselves. They have their own sensor ecosystem called Wasp Mode, um and they, 00:26:34.126-->00:26:39.498 are their own set of sensors that they sell that plug into wasp mode pretty easily. Um some 00:26:39.498-->00:26:45.904 examples of these are uh radiation level sensors. And uh, water level s- or distance 00:26:45.904-->00:26:52.644 sensors which are used for example in uh flood prevention by detecting water levels. Um we 00:26:52.644-->00:26:57.649 have sensors that detect um, uh rainfall and wind speed. Um so depending on what this is used 00:27:00.786-->00:27:05.057 for and we do have some limited information, you provided through customer case studies 00:27:05.057-->00:27:10.229 about what this is being used for. Uh for instance we know the Spanish government is using 00:27:10.229-->00:27:15.234 these devices to detect uh, radiation levels around nuclear power plants. Um, we know that 00:27:17.970-->00:27:22.975 uh there is a dam in somewhere in Europe where the meshlium or the, the Wasp Mode ecosystem is 00:27:25.177-->00:27:30.182 being used to detect water quality. So um, if you’re using a meshlium, there’s some 00:27:32.518-->00:27:38.190 interesting problems there, um but the, the meshlium it essentially just acts as a hub. 00:27:38.190-->00:27:43.195 And a centralized location for storage or to be cav- like sort of collected and passed on um so 00:27:45.764-->00:27:52.271 it takes in data from all these sensors and then passes them to either a database or t- pushed 00:27:52.271-->00:27:57.276 them up to some cloud platform. Um, what we found is that there were a number of endpoints on 00:27:59.311-->00:28:03.749 the application that were just missing authentication entirely. So they could be invoked 00:28:03.749-->00:28:09.588 directly uh and didn’t’ require any user name or password. And some of them could actually 00:28:09.588-->00:28:14.593 function c- a, as a whole with like correctly. Uh some of them couldn’t. Uh a number of them 00:28:17.029-->00:28:22.834 actually took user input directly and fed it into a shell command. Um, without any 00:28:22.834-->00:28:27.839 sanitation. So, uh if you take a look at the last line here, uh you can see and this is, this is 00:28:31.710-->00:28:36.114 pretty much uh, there’s this, I don’t remember if this is the start of the file or not. But 00:28:36.114-->00:28:41.119 this is 1 of the uh exploitable cases of this. Uh so if you just put uh something like lets say, 00:28:44.256-->00:28:50.896 semicolon, R, M, R, F slash in as your link variable and you have your type variable set to 00:28:50.896-->00:28:55.400 download update. Well interesting things happen. Um now you might be saying, well 00:28:55.400-->00:29:01.440 Daniel. Um, first of all no pres- no preserve root is in that example. Okay, okay 00:29:01.440-->00:29:05.877 pedantic, sure let’s add that. But you’re still the web application user so you’re not 00:29:05.877-->00:29:10.716 going to be able to uh do much. Well I have a solution which involves the fact that the web 00:29:10.716-->00:29:15.721 application has the uh, the ability to do a sudu without any password. So uh if you just do 00:29:18.390-->00:29:25.263 semi colon sudu R, M, R, F slash, no preserve root, well um, a funny or terrible things 00:29:25.263-->00:29:31.303 happen. Depending on ya know, what side your on. Um, so uh we want to do a little 00:29:31.303-->00:29:36.308 demonstration. Um we have uh, a whole dam simulator built into an aquarium based on a meshlium 00:29:39.144-->00:29:44.149 system. Um we were not able to use that so we instead have a backup video. Which >>I guess 00:29:51.556-->00:29:56.561 there were AV issues with bringing the dam here, so. >>So, this is a simulated dam 00:30:01.366-->00:30:06.371 [laughter] with a simulated river, simulated riverbanks, cars, rock wall, even scenic 00:30:08.640-->00:30:13.645 view and a road and dam. And it’s all inside a network. Now while this a simulated dam the 00:30:21.186-->00:30:26.191 vulnerabilities that we use are very real. What we’ve got set up here is a dam with being 00:30:31.730-->00:30:36.735 controlled by a raspberry pi. And that raspberry pi is controlling the water level 00:30:42.007-->00:30:47.012 based on data sent by this ultrasound sensor attached to a Libelium place. Now this telling 00:30:53.785-->00:30:58.790 us the water level and in centimeters distance from the sensor, now because the 00:31:04.029-->00:31:09.034 vulnerabilities eventually and the fact that the data is being read from the meshlium we’re 00:31:15.040-->00:31:20.045 going to watch a proof of concept exploit loaded with code to the meshlium and corrupt that 00:31:27.552-->00:31:32.557 making it think that the water level is in fact very low. The dam is going to open all the way 00:31:43.001-->00:31:48.006 and it’s going to stay open no matter how high the water level gets. We can see it beginning to 00:31:57.716-->00:32:02.654 top over the riverbanks, and starting to spill over onto the edge of the riverbank. And now 00:32:10.162-->00:32:15.167 on the other side starting to flood the road. So now that we’ve [applause]. >>Please 00:32:21.206-->00:32:26.678 don’t’ dismay, we worked with the vendors, reported all the vulnerabilities. They were all 00:32:26.678-->00:32:31.683 patched. Cities have had weeks to roll out these patches, everybody has been notified. Um, 00:32:33.919-->00:32:38.924 so that’s that’s the, the positive side of all of this. And additionally you know, i- I 00:32:41.159-->00:32:46.598 think when it comes to the implications of seeing things ya know as hackers we have to ask 00:32:46.598-->00:32:52.537 ourselves, to what lengths do we independent of the companies who are selling these devices, 00:32:52.537-->00:32:58.009 independent of the cities or the governments that run them, um want to go to try to find these 00:32:58.009-->00:33:04.482 vulnerabilities with the V2I hub, it’s fairly simple because the code is open source. With 00:33:04.482-->00:33:09.487 the meshlium we had to pay 3-->000 euros for a meshlium setup in order to test it. Um with the 00:33:12.457-->00:33:19.030 i.LONs we got some off eBay used so it was a bit less expensive. But the point is these devices 00:33:19.030-->00:33:25.036 are very, very, very expensive and it can be very difficult for us to get the ability to do the 00:33:25.036-->00:33:30.175 independent security testing that’s really required. Um but as far as the vulnerabilities 00:33:30.175-->00:33:37.115 that we found, here are the implications. Surveillance of connected vehicles. So following 00:33:37.115-->00:33:43.121 a governor around or a celebrity or God forbid even the president. Um, traffic 00:33:43.121-->00:33:48.126 manipulation. Causing traffic to slow down industry in the city that you live in. And sabotage 00:33:50.929-->00:33:56.701 of disaster warning systems similar to the dam demo that we showed you but for something 00:33:56.701-->00:34:02.607 like radiation monitoring where you cause a false panic because you set off the sensors and 00:34:02.607-->00:34:06.111 everybody thinks there’s radiation and they start to evacuate. That could be quite 00:34:06.111-->00:34:11.116 bad right? Um, but after you’ve finished setting up your city it’s a fully sc- ya know a smart 00:34:13.418-->00:34:20.258 city place. Um I hope that you are also going to setup your IOT paper clip. So that you can 00:34:20.258-->00:34:25.263 reset the device when something goes horribly wrong. I hope also that cities will take into 00:34:27.799-->00:34:33.571 consideration whether or not the devices they purchase have been tested by independent third 00:34:33.571-->00:34:39.311 parties on a regular basis. That cities will have their implementation of these devices 00:34:39.311-->00:34:45.116 tested and that the information about the remediation plan for any vulnerabilities found will 00:34:45.116-->00:34:49.220 be made available to the public so the public can feel safe about what’s in their cities. 00:34:49.220-->00:34:54.225 Thank you so much for coming to our talk. [applause]