WEBVTT

00:00.000 --> 00:01.220
Welcome everybody.

00:01.220 --> 00:02.620
Thanks for being here.

00:03.220 --> 00:08.300
I'd like to start by saying that this is my first time at DEF CON, so I'm really happy to be here.

00:09.560 --> 00:12.680
And really happy to be able to talk to you.

00:13.840 --> 00:19.340
I know that the title is a little bit generic, Building the IoT in Smart Buildings, but that's intentional.

00:19.340 --> 00:31.900
That's because I want to take you through a journey of the research that we did in smart buildings that is culminating in, let's say, consumer-grade IoT devices in smart buildings.

00:31.900 --> 00:34.880
But it started with industrial protocols, with BACnet and all of that.

00:34.880 --> 00:40.620
And I'll take you through all of that by showing you some of the attacks that we developed.

00:40.620 --> 00:44.140
And that's the main focus of the talk today.

00:44.960 --> 00:47.540
But first, a little bit about me.

00:47.540 --> 00:52.120
So I have a bachelor's and a master's and PhD in computer science.

00:52.120 --> 00:54.040
So I have an academic background.

00:54.040 --> 01:01.360
I have more than five years now in security doing some pen testing and mostly academic research also.

01:01.360 --> 01:09.740
Right now I'm a senior researcher at Forescout and I do vulnerability research for OT and IoT environments and devices.

01:10.040 --> 01:14.460
And I also work with network monitoring and intrusion detection for OT and IoT.

01:15.120 --> 01:17.580
This presentation, of course, is not just my work.

01:17.580 --> 01:27.720
It's the result of more or less a couple of years of research with many collaborators at Forescout and also at the University of Eindhoven, where I used to work before.

01:28.180 --> 01:32.960
So just bear in mind that this is not something that only I did.

01:34.600 --> 01:37.660
So a little bit of motivation.

01:37.860 --> 01:41.920
Why are we talking about IoT in smart buildings and IoT in general?

01:41.920 --> 01:44.560
So what are the risks from IoT devices, right?

01:44.560 --> 01:51.000
So the number of devices in organizations is rapidly increasing and I think everybody is aware about that.

01:51.000 --> 02:03.780
The IoT has already grown a lot in the past decades and is expected to reach... the numbers vary there, but people say between 20, 30, up to 50 billion connected devices in the next few years.

02:04.740 --> 02:07.440
Those devices are mostly unmanaged.

02:07.440 --> 02:09.260
They come from different vendors.

02:09.260 --> 02:14.740
It's not just the usual IT world anymore where we had Windows and Linux and maybe macOS.

02:15.160 --> 02:17.740
So we have non-standard operating systems.

02:17.740 --> 02:21.220
We have a diversity of protocols.

02:21.220 --> 02:23.040
Many of them are insecure.

02:23.360 --> 02:27.960
There are infamous cases of insecure protocols in building automation.

02:28.500 --> 02:32.360
Some of these devices may dynamically connect to other devices.

02:32.400 --> 02:35.900
It could be inside or outside of the organization's network.

02:36.380 --> 02:46.200
And there's also another statistics there that by 2020, next year, more than 25% of identified attacks in enterprises will involve the IoT.

02:46.200 --> 02:50.460
This is a projection, but it's something that could happen, right?

02:50.460 --> 03:01.360
And there was this report released by Microsoft just last week about nation-state attackers using IoT devices to infiltrate in corporations, right?

03:01.360 --> 03:09.180
They're using printers and voice over IP phones and stuff like that and IP cameras mostly.

03:09.560 --> 03:12.440
But let's talk then about smart buildings.

03:12.440 --> 03:19.720
So smart buildings is one of the places where the IoT is rapidly proliferating.

03:20.420 --> 03:22.580
So in a smart building, we have several functions.

03:22.580 --> 03:23.900
We have lifts.

03:23.900 --> 03:25.140
We have surveillance systems.

03:25.140 --> 03:26.900
We have fire alarm systems.

03:26.900 --> 03:32.960
We have lighting systems, HVAC, so thermostats, fans.

03:32.960 --> 03:36.480
We have data centers that have to be cooled.

03:36.480 --> 03:40.400
We have surveillance rooms to control the surveillance systems.

03:40.760 --> 03:44.920
And all of these are connected to a network and connected to building controllers.

03:47.040 --> 03:51.120
And why would anybody attack smart buildings?

03:51.120 --> 03:58.380
Well, first of all, smart buildings are not just shopping malls or residential buildings or something like that.

03:58.380 --> 04:04.660
They could be very critical buildings like airports, data centers, hospitals, public spaces, even factories.

04:04.660 --> 04:07.840
We're talking about we're in the ICS village, right?

04:07.840 --> 04:15.000
So the factories that host the ICS devices can also be critical buildings that are smart buildings.

04:15.920 --> 04:21.880
These building automation systems and smart building networks are many times legacy systems.

04:21.880 --> 04:24.620
So some of those systems are decades old.

04:24.820 --> 04:26.940
There's many times no encryption, no authentication.

04:26.940 --> 04:29.960
It's the same story as in ICS.

04:30.600 --> 04:33.540
But what's happening nowadays is that connectivity is increasing, right?

04:33.540 --> 04:35.840
So there's an increasing attack surface.

04:35.840 --> 04:42.100
There are default protocols and open ports, default passwords, weak passwords used in these devices.

04:42.100 --> 04:46.580
And all of that creates a perfect storm, let's say, for attackers.

04:49.820 --> 04:54.220
So OT, IT, and IoT are all converging in smart buildings.

04:54.220 --> 05:12.360
So if you look at a typical smart building network, you have a management layer where you have workstations, you have IoT platforms, and you have building management workstations that are connected and used to manage all of the field devices and the controller devices and all of that.

05:12.360 --> 05:14.920
And then you have separate subsystems, right?

05:14.920 --> 05:19.720
You have, for instance, video surveillance with IP cameras and NVRs and displays.

05:19.720 --> 05:28.780
And then you have the access control systems with badge readers and door locks and access control, physical access control controllers.

05:29.200 --> 05:33.440
You have the HVAC system, you have the smart lighting system.

05:33.980 --> 05:39.080
And then you also have, in this whole scenario, the consumer-grade IoT entry.

05:39.080 --> 05:47.520
So you have IoT gateways, you have things like smart plugs, smart TVs, wearables.

05:47.520 --> 05:54.380
In hospitals you have medical devices, which many times are in the same networks as the building automation devices.

05:54.380 --> 05:59.220
You have other kinds of sensors and actuators and smart everything, basically.

06:00.300 --> 06:14.900
And although, we will see that later on, but although ideally these networks would not be just flat networks and things should be isolated and all of that, in many cases in practice what we do see is just a flat network where everything is able to communicate to everything else,

06:14.900 --> 06:18.180
which is an ideal scenario for an attack.

06:19.340 --> 06:22.780
So what is the focus of our research?

06:22.780 --> 06:26.500
So we wanted to study vulnerabilities and attacks in smart buildings.

06:28.680 --> 06:33.920
And there are many attacks, attack factors in smart buildings.

06:33.920 --> 06:43.020
And we were looking first at building automation systems of the legacy protocols and devices and then later on the consumer-grade IoT stuff.

06:43.380 --> 06:51.460
And then some of the attacks and areas that we imagined and some of the things that we implemented are, for instance, in HVAC changing the temperature set points to...

06:51.900 --> 07:15.160
I think there was a presentation before talking about BACnet and from the McAfee guys about BACnet and how you can change temperature set points and hack HVAC devices so that basically data centers are taken offline or in hospitals biological or medical material can suffer severe consequences.

07:15.760 --> 07:20.780
So you also have in the access control systems you can add or delete authorized users.

07:20.780 --> 07:27.900
In the surveillance system you can for instance delete or replay footage so that physical intrusions can happen.

07:28.280 --> 07:36.200
For the smart lighting systems you can switch lights on or off or continuously on and off and basically make them unusable.

07:36.520 --> 07:42.980
And for other IoT systems you can do things like denial of service, you can use them for information gathering, for pivoting in the network and all of that.

07:43.860 --> 08:09.600
So on the left-hand side there what you can see is the lab that we built for this research and you can see that there is a mix of legacy building automation stuff so workstations and industrial-grade building automation controllers using protocols like BACnet and Modbus and KNX and Lontoc and others.

08:09.600 --> 08:17.880
And you also have IP cameras and Philips Hue and Wi-Fi access points and stuff that are more consumer-grade IoT.

08:19.240 --> 08:34.020
So now I'll go through a list of attack scenarios and stuff that we implemented so that we can show some of these scenarios in practice what are their effects and how to achieve those things.

08:34.140 --> 08:46.600
So we started this as almost everybody who starts looking at smart buildings by looking at the BACnet protocol because it's really one of the major protocols used for interoperability in these systems.

08:46.600 --> 08:51.020
It's one of the most used protocols in building automation.

08:51.900 --> 08:56.900
Nowadays it's infamous because it's a clear text protocol, there's mostly no authentication.

08:57.620 --> 08:59.680
Because of that there are all the security threats.

08:59.680 --> 09:12.600
You can use it for reconnaissance, you can spoof devices, you can tamper with variables, for instance temperature set points or inputs and outputs and all that.

09:12.760 --> 09:17.560
You can do denial of service easily in many of these devices.

09:17.840 --> 09:23.720
So if you look at the right hand side there, it's one of the parts of the lab that I showed before.

09:23.720 --> 09:38.460
And the house there, the little dollhouse, is simulating a smart building where on the upper floor you have a motion sensor and a light and on the lower floor you have a thermostat and a fan.

09:38.460 --> 09:43.160
On the right hand side you can see a lot of devices there.

09:43.160 --> 09:48.480
There's a network switch and there's an HMI that's used to program the BACnet devices.

09:48.480 --> 09:54.240
And there's another touchscreen device which is actually a Raspberry Pi simulating an attacker.

09:54.380 --> 09:57.740
And then on top you can see some BACnet controllers.

09:57.740 --> 10:17.520
So the idea is that the usual functioning there is you have a temperature set point and then if the temperature ever goes above the set point the fan starts working and then if it lowers down the fan stops working and when there's a presence detected in the house the light goes off.

10:17.520 --> 10:54.650
But you can easily DOS the BACnet router which is the blue device in the middle there on the top and the effect that you have when you run a simple DOS so you're basically just flooding the device with many packets and you can see that the packets being sent there by the attacker and you will see that basically the router will stop working and then the error LED will go on and yeah that means that the device is not active anymore and then it It could be controlling the light,

10:54.650 --> 10:56.110
but it doesn't.

10:56.110 --> 10:57.870
So the light doesn't work anymore.

10:57.890 --> 11:06.370
So in this case, it's controlling the lights, but it could be controlling HVAC or any other of the subsystems that I mentioned before.

11:06.870 --> 11:29.090
So, OK, we can do that with using the BACnet protocol and with building automation devices, but then we wanted to look at another attack scenario, which is basically, OK, if we have many vulnerable devices, can we create a chain, an attack path, for instance,

11:29.090 --> 11:38.750
where a remote attacker could reach the devices that are actually controlling, for instance, the access control function in this case.

11:38.750 --> 11:53.810
So another thing we did in that lab, we did some vulnerability research, we disclosed some CVs, we found around, if I'm not mistaken, eight CVs, and most of them were actually related to the web applications running in these devices.

11:53.810 --> 12:00.250
So I think almost all of them had cross-site scripting and some of them had command injections.

12:00.250 --> 12:03.750
This is very common in this kind of environment.

12:03.750 --> 12:08.110
And we also found a buffer overflow that allowed for remote code execution.

12:08.430 --> 12:15.070
So we basically chained an attack where the steps are those on the bottom there.

12:15.070 --> 12:28.810
So first we gain access remotely using an IP camera, then we perform some lateral movement to the management workstation, then from there we move to the access control PLC using the buffer overflow.

12:28.810 --> 12:34.170
We execute our payload over there, and then the idea is to persist also in that.

12:34.450 --> 12:54.730
And that was achieved basically by exploiting mostly the access control PLC, which has a web application and a specific building automation framework, Java framework running on that, and runs on top of the QNX operating system.

12:54.730 --> 13:08.670
So once we have that buffer overflow, we can basically live off the land there on the device and use some of the devices on functions to upload our malware and persist.

13:09.030 --> 13:18.210
And then implement our final attack, which is to open or close doors depending on whether what we want to achieve.

13:18.210 --> 13:25.730
So for instance, here you can allow unauthorized people to access sensitive locations.

13:25.730 --> 13:28.650
Imagine that in a hospital or an airport or something like that.

13:28.650 --> 13:35.190
Or you could also not allow somebody to access a specific location.

13:35.190 --> 13:49.630
So for instance, you combine both attacks and you have an HVAC not working in the data center and then you lock the door and nobody can go in and fix the issue.

13:50.970 --> 13:55.490
So then we actually looked at how many of those devices can be found online.

13:55.490 --> 13:58.670
And this is data from last year, so this we did last year.

13:59.030 --> 14:08.210
And we saw around 23,000 devices of the ones, the same models that we were looking at in our research.

14:08.290 --> 14:19.630
And we saw that around 40% of those, almost 40% of those were vulnerable to the remote code execution the buffer overflow and the remote code execution that we found.

14:19.630 --> 14:31.770
So that means that there are more than the 9,000 devices available on the internet that's from Shodan that could be completely owned from the outside.

14:33.330 --> 14:45.590
So then we saw, okay, we have problems with the protocols, we have problems with the devices in the building automation side, right, in the older stuff, let's say.

14:45.690 --> 15:02.810
And we have a lot of those available online, but what we have, what we really can easily find online are IoT devices and consumer-grade IoT devices and smart cameras, for instance, and other such kind of devices.

15:02.810 --> 15:09.870
So we wanted to look at these IoT devices and what are the impacts that they have on smart buildings.

15:09.870 --> 15:22.650
So in this attack that I described now, we used the IP camera, for instance, as an entry point, but what else could we do with the IP camera, right, or with the lighting system and all the other systems that I described.

15:22.650 --> 15:26.750
So the next three scenarios are about the IoT in smart buildings.

15:26.750 --> 15:31.990
So our goal was to investigate the IoT protocols and devices used in a smart building.

15:32.090 --> 15:47.930
So some of the examples of, sorry, the protocols and devices that I'll be talking about in the next scenarios are RTP and RTSP for video surveillance, the Philips Hue smart light for the lighting system, and MQTT for the IoT system.

15:48.450 --> 15:52.310
And we divided our findings there in three categories.

15:52.310 --> 16:01.210
So things that we found on the field, so basically by talking to customers and partners and by looking at the networks of these customers.

16:02.090 --> 16:07.610
Things that we found on the web, mostly on Shodan, and things that we found on our lab.

16:07.610 --> 16:15.090
So the setup of the lab is, this is just a simplified version of the same figure that we had in the beginning.

16:15.350 --> 16:20.050
So we have the video surveillance system, the IoT system, and the smart lighting system.

16:21.830 --> 16:24.570
So let's talk about the findings on the field.

16:24.570 --> 16:34.810
So when we look at smart building networks with consumer-grade IoT devices, how are these networks configured in practice?

16:35.210 --> 16:40.150
First thing we realized is that many times these internal networks are not well segmented.

16:40.150 --> 16:52.590
So you do have one switch that has IP cameras and IT devices and OT and building automation and everything talking to each other not well segmented at all.

16:52.870 --> 16:57.530
So you have unwanted communication links between all these categories, right?

16:57.530 --> 17:01.770
IT, OT, IoT caused by, yeah, misconfigurations.

17:02.370 --> 17:21.410
There are many unwanted services and insecure protocols enabled so it's easy to find Telnet, FTP, UPnP, and many times the facility managers or the people who are managing those networks are not even aware that those things are activated because they come activated by default.

17:21.970 --> 17:26.970
The insecure protocols come activated by default and that's it.

17:26.970 --> 17:31.010
There are many times weak passwords to access devices.

17:31.110 --> 17:36.350
There are devices with known vulnerabilities and there's a lot of use of unencrypted traffic.

17:36.350 --> 17:41.750
So I already mentioned RTP and RTSP for the video streams and I'll talk about this in details.

17:41.870 --> 17:48.050
And you also have for instance HTTP and MQTT in clear text for IoT devices.

17:48.630 --> 17:50.770
So then what do we find on the web?

17:50.770 --> 17:53.030
So we were talking about the unencrypted protocols, right?

17:53.030 --> 18:06.590
So if we look at devices with clear text or RTSP on the web, we find more than 4.5 million devices and those are mostly IP cameras but there are also other devices that use this kind of protocol.

18:06.590 --> 18:21.370
If we look specifically for the Philips Hue, for instance, for the smart lighting system we found almost 10,000 devices online and if you look at clear text MQTT which is used for general IoT you have more than 75,000 devices.

18:21.370 --> 18:30.190
And these data are from this year actually, just from last month because this is one of the latest things that we have been looking at.

18:30.890 --> 18:35.050
So let's go in details in these three next attack scenarios, right?

18:36.890 --> 18:40.250
Just in general, what are the findings of the labs?

18:40.770 --> 18:44.350
So again, this is the lab that we had before.

18:44.350 --> 19:07.890
Now we have an internal attacker and what we want to achieve there is for the video surveillance we want to do footage replace or Hollywood style, you know, heist movie kind of scenario where you are showing one thing to the security operator but actually the camera is streaming something else so you can steal something from the bank.

19:08.470 --> 19:22.090
In the smart lighting system you can just basically cause a denial of service to make the lights go out or go on or on and off continuously.

19:22.870 --> 19:42.090
You can also use in the case of the Philips Hue or something that's interesting you can just reconfigure the platform to use that as a pivot point inside of the network and in the case of MQTT and IoT devices, you can use that for instance information gathering and denial of service and these are the attacks that we implemented.

19:42.090 --> 20:05.750
So for the attack scenario number three for the video surveillance system again this is just a simplified version of the other picture you have the IP cameras that are using RTP and RTSP to communicate with the network video recorder and the network video recorder is connected to the network switch and then you have a storage server and then local monitoring to look at the video being streamed.

20:06.470 --> 20:09.170
So what's the problem with RTSP and RTP?

20:09.290 --> 20:11.870
They are streaming protocols.

20:11.870 --> 20:16.470
One is usually over TCP the other one over UDP.

20:16.470 --> 20:20.750
One is to send the data, the other is to control the session basically.

20:20.750 --> 20:33.150
RTSP is very similar to HTTP and it's used to control the stream and it's basically mandatory to establish a session before you start streaming via RTP.

20:33.150 --> 20:38.530
And RTP is designed for real-time transfer of usually audio and video data.

20:38.530 --> 20:43.530
It's unidirectional from a server which is the camera to a client which is a network video recorder.

20:43.690 --> 20:51.910
And there are secure versions and you can use GLS for instance, but this is rarely used in practice.

20:52.590 --> 20:55.890
So what is the anatomy of an attack here?

20:55.890 --> 21:03.710
So because you are using these unencrypted protocols and you are internally in the network, you can just establish a man in the middle.

21:03.710 --> 21:09.230
If you drop the traffic and record the video footage, it's unencrypted, it's clear text.

21:09.230 --> 21:21.270
You can replace a heartbeat RTSP command usually it's a get param command with a teardown so you stop the connection between the camera and the NVR.

21:21.490 --> 21:29.990
And then you just basically tell the camera to stream somewhere else and then you start streaming your pre-recorded footage to the NVR.

21:29.990 --> 21:33.710
So you replay a pre-captured stream to the NVR.

21:33.710 --> 21:36.570
So in practice this is how it looks like.

21:36.570 --> 21:42.830
So you have the surveillance footage and this is what the camera is normally streaming.

21:42.970 --> 21:47.670
And then in the attacker machine you run Ethercap to do a man in the middle.

21:48.730 --> 21:52.110
So you select the hosts.

22:09.900 --> 22:20.580
And then we have another script which is actually recording the footage and replaying the pre-recorded footage when the session is stopped.

22:32.770 --> 22:36.730
Yeah, now basically the session with the camera has stopped.

22:39.530 --> 22:45.270
And then now we are replaying something that was captured before.

22:45.270 --> 22:55.670
And then on the bigger screen you can see what is actually going on and on the smaller screen you can see what the security operator or the surveillance guard would be looking at.

22:55.670 --> 22:56.530
Right?

22:58.750 --> 23:03.290
So this is another attack scenario, attacking the Philips Hue.

23:03.410 --> 23:11.370
And the Philips Hue is interesting because it's a very common IoT device which until last year didn't support HTTPS at all.

23:11.370 --> 23:13.790
It was only supporting HTTP.

23:13.950 --> 23:20.450
And a lot of people knew about that and it was very easy to attack a Philips Hue.

23:20.450 --> 23:25.070
And they issued a former update last year.

23:25.110 --> 23:39.630
But basically what is used to validate your communication with the Hue is a token, an authorization token and that can be just sniffed also from the network because it's in clear text.

23:39.630 --> 23:42.450
And then an attacker can just control the camera, right?

23:42.450 --> 23:49.110
So you just send a put request there for the state of the camera so you can do on or off .

23:50.070 --> 23:54.730
And then the... I just saw that I have like three minutes left so I'll run through the slides.

23:54.770 --> 24:01.730
So you can just switch the lights on or off and then as a result you can have something like this, right?

24:01.730 --> 24:04.930
So it's basically the light is completely unusable.

24:06.210 --> 24:22.890
So the last attack scenario that you have is MQTT which is a publish subscribe protocol used for IoT devices where you have a broker that coordinates the communication between a set of publishers and subscribers.

24:22.890 --> 24:32.690
And that's used to exchange sensory information, telemetry information and also to issue commands to some devices.

24:32.770 --> 24:46.270
And again, it's usually used in clear text so you can just passively sniff the traffic or you can subscribe to some topics and you can use that for information gathering to understand the devices that are in the network.

24:46.270 --> 24:52.450
You can subscribe to wild card topics so you can see basically every topic that a broker is handling.

24:53.450 --> 25:07.930
It's very easy to do denial of service also because you have quality of service that can be increased so you amplify the attack with the responses that are required and you can use very heavy payloads.

25:09.310 --> 25:16.530
It's a very common protocol in IoT but again if used insecurely it's very easy to attack it.

25:17.990 --> 25:25.290
So with all this in mind, with all these scenarios of attacks, let's very quickly talk about defending the IoT.

25:25.290 --> 25:33.270
So the things that we should do so that those attacks are mitigated or cannot happen.

25:33.270 --> 25:55.730
So the first thing is that we need network visibility so you need to know what devices are on the network so that you can know if they are vulnerable or not or what kinds of protocols they are talking what devices are communicating to what other devices and so on which allows you to do proper asset management so proper configuration and patching of the devices.

25:55.870 --> 26:01.670
Network segmentation is extremely important so you can isolate problems and reduce the attack surface.

26:01.670 --> 26:07.890
Sometimes there are devices that are difficult to patch so at least they should be segmented.

26:08.770 --> 26:12.510
And as a last point, network monitoring and intrusion detection.

26:12.510 --> 26:21.690
You should basically know what's going on at the network in real time and be able to spot anomalies and attacks happening.

26:23.250 --> 26:31.830
So more details about these attacks and about the defenses and all of that are in four papers that we have over there.

26:31.890 --> 26:48.990
The first the top two papers are actually academic publications and they deal mostly with the BACnet stuff and they deal mostly actually with the defensive side so how to do intrusion detection for BACnet but we also describe the attacks.

26:49.690 --> 27:03.530
And the two white papers in the bottom are commercial white papers so they describe most of these attacks and areas that I showed here and also a little bit about defense.

27:04.950 --> 27:08.050
So what are the key takeaways from this talk?

27:08.050 --> 27:34.370
Abusing the IoT in smart buildings, it's easy, it's cheap it can have severe consequences like we've seen with HVAC, with access control where you can let the attacker basically do physical intrusions and defending the IoT in smart buildings is doable and it starts with understanding what's in the network and monitor.

27:34.410 --> 28:00.070
And as a last takeaway I just want to say that the building automation the building automation technology is old but we are moving to more connected smart cities and connected everything so we should always keep in mind that more connection means an increased attack surface and the consequences of these attacks also.

28:00.070 --> 28:02.210
So sorry if I went over time.

28:02.210 --> 28:03.210
Thanks.

28:03.210 --> 28:03.830
Applause

