start	end	text
0	4940	Welcome everybody. Thanks for being here. I'd like to start by saying that this is my
4940	11420	first time at DEF CON, so I'm really happy to be here. And really happy to be able to
11420	18160	talk to you. I know that the title is a little bit generic, Building the IoT in Smart Buildings,
18160	24240	but that's intentional. That's because I want to take you through a journey of the research
24240	29980	that we did in smart buildings that is culminating in, let's say, consumer-grade IoT devices
29980	35200	in smart buildings. But it started with industrial protocols, with BACnet and all of that. And I'll
35200	41400	take you through all of that by showing you some of the attacks that we developed. And that's the
41400	50840	main focus of the talk today. But first, a little bit about me. So I have a bachelor's and a master's
50840	56720	and PhD in computer science. So I have an academic background. I have more than five years now in
56720	62020	security doing some pen testing and mostly academic research also. Right now I'm a senior
62020	69740	researcher at Forescout and I do vulnerability research for OT and IoT environments and devices.
70040	74460	And I also work with network monitoring and intrusion detection for OT and IoT.
75120	80520	This presentation, of course, is not just my work. It's the result of more or less a couple of years
80520	86340	of research with many collaborators at Forescout and also at the University of Eindhoven, where I
86340	92960	used to work before. So just bear in mind that this is not something that only I did.
94600	101920	So a little bit of motivation. Why are we talking about IoT in smart buildings and IoT in general?
101920	108280	So what are the risks from IoT devices, right? So the number of devices in organizations is rapidly
108280	113260	increasing and I think everybody is aware about that. The IoT has already grown a lot in the past
113260	120220	decades and is expected to reach... the numbers vary there, but people say between 20, 30, up to
120220	127520	50 billion connected devices in the next few years. Those devices are mostly unmanaged. They
127520	132680	come from different vendors. It's not just the usual IT world anymore where we had Windows and
132680	139920	Linux and maybe macOS. So we have non-standard operating systems. We have a diversity of
140480	145860	protocols. Many of them are insecure. There are infamous cases of insecure protocols in
146300	152360	building automation. Some of these devices may dynamically connect to other devices.
152400	158360	It could be inside or outside of the organization's network. And there's also another
158360	165020	statistics there that by 2020, next year, more than 25% of identified attacks in enterprises
165020	170460	will involve the IoT. This is a projection, but it's something that could happen, right? And
171140	177880	there was this report released by Microsoft just last week about nation-state attackers using IoT
177880	186000	devices to infiltrate in corporations, right? They're using printers and voice over IP phones
186000	192960	and stuff like that and IP cameras mostly. But let's talk then about smart buildings. So smart
192960	201380	buildings is one of the places where the IoT is rapidly proliferating. So in a smart building,
201380	206900	we have several functions. We have lifts. We have surveillance systems. We have fire alarm systems.
206900	216480	We have lighting systems, HVAC, so thermostats, fans. We have data centers that have to be cooled.
216480	221460	We have surveillance rooms to control the surveillance systems. And all of these are
221460	229720	connected to a network and connected to building controllers. And why would anybody
229720	233440	attack smart buildings? Well, first of all, smart buildings are not just
234640	239100	shopping malls or residential buildings or something like that. They could be very
239100	244820	critical buildings like airports, data centers, hospitals, public spaces, even factories. We're
244820	251180	talking about we're in the ICS village, right? So the factories that host the ICS devices can
251180	257600	also be critical buildings that are smart buildings. These building automation systems
257600	263240	and smart building networks are many times legacy systems. So some of those systems are
263240	269960	decades old. There's many times no encryption, no authentication. It's the same story as in ICS.
270600	274440	But what's happening nowadays is that connectivity is increasing, right? So there's an increasing
274440	280600	attack surface. There are default protocols and open ports, default passwords, weak passwords
280600	286580	used in these devices. And all of that creates a perfect storm, let's say, for attackers.
289820	295940	So OT, IT, and IoT are all converging in smart buildings. So if you look at a typical smart
295940	301920	building network, you have a management layer where you have workstations, you have IoT platforms,
301920	309260	and you have building management workstations that are connected and used to manage all of
309260	313600	the field devices and the controller devices and all of that. And then you have separate
314160	318540	subsystems, right? You have, for instance, video surveillance with IP cameras and NVRs and
318540	323980	displays. And then you have the access control systems with badge readers and door locks
324980	331640	and access control, physical access control controllers. You have the HVAC system, you have
331640	338540	the smart lighting system. And then you also have, in this whole scenario, the consumer-grade IoT
338540	348100	entry. So you have IoT gateways, you have things like smart plugs, smart TVs, wearables. In hospitals
348100	353020	you have medical devices, which many times are in the same networks as the building
353020	359220	automation devices. You have other kinds of sensors and actuators and smart everything, basically.
360300	365220	And although, we will see that later on, but although ideally these networks would not be
365220	370400	just flat networks and things should be isolated and all of that, in many cases in practice what
370400	374900	we do see is just a flat network where everything is able to communicate to everything else,
374900	382780	which is an ideal scenario for an attack. So what is the focus of our research?
382780	386500	So we wanted to study vulnerabilities and attacks in smart buildings.
388680	395780	And there are many attacks, attack factors in smart buildings. And we were looking first at
395780	401060	building automation systems of the legacy protocols and devices and then later on the
401060	406120	consumer-grade IoT stuff. And then some of the attacks and areas that we imagined and some of
406120	411460	the things that we implemented are, for instance, in HVAC changing the temperature set points to...
411900	417840	I think there was a presentation before talking about BACnet and from the McAfee guys about BACnet
417840	424920	and how you can change temperature set points and hack HVAC devices so that basically data
424920	433180	centers are taken offline or in hospitals biological or medical material can suffer
433180	439360	severe consequences. So you also have in the access control systems you can add or delete
439360	444860	authorized users. In the surveillance system you can for instance delete or replay footage so that
444860	450660	physical intrusions can happen. For the smart lighting systems you can switch lights
451200	457780	on or off or continuously on and off and basically make them unusable. And for other IoT systems you
457780	461660	can do things like denial of service, you can use them for information gathering, for pivoting in
461660	469340	the network and all of that. So on the left-hand side there what you can see is the lab that we
469340	477540	built for this research and you can see that there is a mix of legacy building automation stuff
477540	484640	so workstations and industrial-grade building automation controllers using protocols like
484640	491800	BACnet and Modbus and KNX and Lontoc and others. And you also have IP cameras and
491800	497880	Philips Hue and Wi-Fi access points and stuff that are more consumer-grade IoT.
499240	504840	So now I'll go through a list of attack scenarios and stuff that we implemented
505660	510220	so that we can show some of these scenarios in practice what are their
510220	517860	effects and how to achieve those things. So we started this as almost everybody who
517860	522060	starts looking at smart buildings by looking at the BACnet protocol because it's really
522060	526600	one of the major protocols used for interoperability in these systems.
526600	533200	It's one of the most used protocols in building automation. Nowadays it's infamous
533200	538360	because it's a clear text protocol, there's mostly no authentication. Because of that there are
538360	543960	all the security threats. You can use it for reconnaissance, you can spoof devices,
543960	551540	you can tamper with variables, for instance temperature set points or inputs and outputs
551540	558140	and all that. You can do denial of service easily in many of these devices. So if you
558140	563720	look at the right hand side there, it's one of the parts of the lab that I showed before.
563720	570040	And the house there, the little dollhouse, is simulating a smart building where on the upper
570040	578460	floor you have a motion sensor and a light and on the lower floor you have a thermostat and a fan.
578460	584200	On the right hand side you can see a lot of devices there. There's a network switch
584200	589340	and there's an HMI that's used to program the BACnet devices. And there's another
589880	595580	touchscreen device which is actually a Raspberry Pi simulating an attacker. And then on top you
595580	602160	can see some BACnet controllers. So the idea is that the usual functioning there is you have a
602160	608620	temperature set point and then if the temperature ever goes above the set point the fan starts
608620	614420	working and then if it lowers down the fan stops working and when there's a presence detected in
614420	626680	the house the light goes off. But you can easily DOS the BACnet router which is the blue device in
626680	636040	the middle there on the top and the effect that you have when you run a simple DOS so you're
636040	640320	basically just flooding the device with many packets and you can see that the packets being
640320	646560	sent there by the attacker and you will see that basically the router will stop working and then
646560	653570	the error LED will go on and yeah that means that the device is not active anymore and then it
653570	657870	It could be controlling the light, but it doesn't. So the light doesn't work anymore.
657890	661610	So in this case, it's controlling the lights, but it could be controlling HVAC
661610	666370	or any other of the subsystems that I mentioned before.
666870	670590	So, OK, we can do that with using the BACnet protocol
670590	674830	and with building automation devices,
674830	678610	but then we wanted to look at another attack scenario, which is
678610	683550	basically, OK, if we have many vulnerable devices,
683550	688290	can we create a chain, an attack path,
688290	691030	for instance, where a remote attacker could reach
691350	696030	the devices that are actually controlling, for instance, the access control
697170	699770	function in this case. So another thing we did
699770	703630	in that lab, we did some vulnerability research, we disclosed
703630	707450	some CVs, we found around, if I'm not mistaken,
707450	711690	eight CVs, and most of them were actually related
711690	715810	to the web applications running in these devices. So I think almost all of them had
716750	719630	cross-site scripting and some of them had command
719630	723750	injections. This is very common in this kind of environment.
723750	728110	And we also found a buffer overflow that allowed for remote code execution.
728430	731670	So we basically chained an attack
731670	735070	where the steps are those on the bottom there.
735070	739890	So first we gain access remotely using an IP camera, then we perform
739890	743330	some lateral movement to the management workstation, then from there we
743710	747930	move to the access control PLC using the buffer
747930	751870	overflow. We execute our payload over there, and then the idea is
751870	754810	to persist also in that. And that
755630	758570	was achieved basically by
759470	764730	exploiting mostly the access control PLC,
764730	767790	which has a web application and a
767790	771930	specific building automation framework, Java framework running on that,
771930	775730	and runs on top of the QNX operating system. So once we have that
775730	779710	buffer overflow, we can basically live off the land there
779710	783570	on the device and use some of the devices on
783570	788670	functions to upload our malware and persist.
789030	791650	And then implement our final attack, which is to open
791650	795050	or close doors depending on whether
796510	799090	what we want to achieve. So for instance,
799090	803130	here you can allow unauthorized people
803130	807010	to access sensitive locations. Imagine that in a hospital or
807010	811070	an airport or something like that. Or you could also not
811070	815190	allow somebody to access a specific location.
815190	818910	So for instance, you combine both attacks and you have
820070	823130	an HVAC not working
823130	826230	in the data center and then you lock the door and
826910	829630	nobody can go in and fix the issue.
830970	835070	So then we actually looked at how many of those devices can be found
835070	838670	online. And this is data from last year, so this we did last year.
839030	843250	And we saw around 23,000 devices of the
843250	847250	ones, the same models that we were looking at in our
847250	851450	research. And we saw that around 40% of those, almost 40%
851450	855410	of those were vulnerable to the remote code execution
855410	859630	the buffer overflow and the remote code execution that we found.
859630	863410	So that means that there are more than the 9,000
863410	867290	devices available on the internet that's from Shodan that
867290	871770	could be completely owned from the outside.
873330	875330	So then we saw, okay,
875330	879470	we have problems with the protocols, we have problems with
879470	883110	the devices in the building automation side, right,
883110	887410	in the older stuff, let's say. And we have a lot of those available
888250	891430	online, but what we have, what we really can
891430	895790	easily find online are IoT devices and consumer-grade IoT devices
895790	899390	and smart cameras, for instance, and
900590	902810	other such kind of devices. So
903510	907350	we wanted to look at these IoT devices and what are the
907350	911310	impacts that they have on smart buildings. So in this attack that I
911310	915750	described now, we used the IP camera, for instance, as an entry point,
915750	919290	but what else could we do with the IP camera, right,
919290	922650	or with the lighting system and all the other systems that I described.
922650	927270	So the next three scenarios are about the IoT in smart buildings. So our goal
927270	931990	was to investigate the IoT protocols and devices used in a smart building.
932090	935330	So some of the examples of, sorry, the protocols and
935330	938810	devices that I'll be talking about in the next scenarios are
939090	943290	RTP and RTSP for video surveillance, the Philips Hue smart light
943290	947930	for the lighting system, and MQTT for the IoT system.
948450	951170	And we divided our findings there in
951170	955010	three categories. So things that we found on the field, so basically by
955010	959130	talking to customers and partners and by looking at the networks
959130	963350	of these customers. Things that we found on
963350	967610	the web, mostly on Shodan, and things that we found on our lab.
967610	971150	So the setup of the lab is, this is just a simplified version of the
971770	975090	same figure that we had in the beginning.
975350	980050	So we have the video surveillance system, the IoT system, and the smart lighting system.
981830	983290	So let's talk about the
983290	987550	findings on the field. So when we look at smart building networks
987550	990390	with consumer-grade IoT devices,
990390	994810	how are these networks configured in practice?
995210	998430	First thing we realized is that many times these internal
998430	1002330	networks are not well segmented. So you do have one switch that
1002330	1006570	has IP cameras and IT devices and
1006570	1010290	OT and building automation and everything talking to each other
1010290	1014430	not well segmented at all. So you have unwanted communication
1014430	1018470	links between all these categories, right? IT, OT,
1018470	1021770	IoT caused by, yeah, misconfigurations.
1022370	1026250	There are many unwanted services and insecure protocols enabled
1026250	1030510	so it's easy to find Telnet, FTP, UPnP, and
1030510	1034350	many times the facility managers
1034350	1038630	or the people who are managing those networks are not even aware that those things are
1038630	1041410	activated because they come activated by default.
1041970	1046970	The insecure protocols come activated by default and that's it.
1046970	1051010	There are many times weak passwords to access devices.
1051110	1055110	There are devices with known vulnerabilities and there's a lot of use
1055110	1058950	of unencrypted traffic. So I already mentioned RTP and RTSP for
1058950	1063190	the video streams and I'll talk about this in details. And you also have for instance
1063190	1067070	HTTP and MQTT in clear text for IoT
1067070	1070770	devices. So then what do we find on the web?
1070770	1075070	So we were talking about the unencrypted protocols, right? So if we look at devices with clear text
1075070	1079210	or RTSP on the web, we find more than
1079210	1082590	4.5 million devices and those are mostly IP cameras
1082590	1087070	but there are also other devices that use this kind of protocol. If we look
1087070	1090530	specifically for the Philips Hue, for instance, for the smart lighting system
1090880	1095190	we found almost 10,000 devices online and if you look at
1095190	1098930	clear text MQTT which is used for general IoT
1098930	1102970	you have more than 75,000 devices. And these data are from
1102970	1106950	this year actually, just from last month because this is one of the
1106950	1110190	latest things that we have been looking at.
1110890	1115050	So let's go in details in these three next attack scenarios, right?
1116890	1119110	Just in general, what are the findings
1119110	1123090	of the labs? So again, this is the lab
1123090	1127090	that we had before. Now we have an internal attacker and
1127090	1130590	what we want to achieve there is for the video surveillance we want to do
1130590	1134810	footage replace or Hollywood style, you know, heist movie
1134810	1138690	kind of scenario where you are showing one thing
1138690	1142510	to the security operator but actually the camera is
1142510	1146510	streaming something else so you can steal something from
1146510	1150570	the bank. In the smart lighting system you can just
1150570	1154350	basically cause a denial of service to
1154350	1158550	make the lights go out or go on or
1158550	1162090	on and off continuously.
1162870	1166430	You can also use in the case of the Philips Hue or something that's interesting
1166430	1170590	you can just reconfigure the platform to use that as a pivot point inside of the network
1170590	1173830	and in the case of MQTT and IoT
1175050	1178370	devices, you can use that for instance information gathering and
1178370	1182090	denial of service and these are the attacks that we implemented.
1182090	1187010	So for the attack scenario number three for the video surveillance system
1187010	1190550	again this is just a simplified version of the other picture
1190550	1194910	you have the IP cameras that are using RTP and RTSP to
1194910	1198850	communicate with the network video recorder and the network video recorder is
1198850	1202250	connected to the network switch and then you have a storage server and then local monitoring
1202250	1205750	to look at the video being streamed.
1206470	1210330	So what's the problem with RTSP and RTP? They are
1210820	1214510	streaming protocols. One is usually over TCP
1214510	1218490	the other one over UDP. One is to send the data, the other is to
1218490	1222670	control the session basically. RTSP is very similar to
1222670	1226150	HTTP and it's used to control the stream
1226750	1230370	and it's basically mandatory to establish a session before
1230370	1234570	you start streaming via RTP. And RTP is designed for
1234570	1238530	real-time transfer of usually audio and video data.
1238530	1242570	It's unidirectional from a server which is the camera to a client which is a network video
1242570	1246610	recorder. And there are secure versions and you can
1246610	1250310	use GLS for instance, but this is rarely
1250310	1254490	used in practice. So what is the anatomy
1254490	1258550	of an attack here? So because you are using these unencrypted protocols
1258550	1262550	and you are internally in the network, you can just establish
1262690	1266570	a man in the middle. If you drop the traffic and record the video footage, it's
1266570	1270650	unencrypted, it's clear text. You can replace
1273090	1274630	a heartbeat RTSP command
1274630	1278530	usually it's a get param command with a teardown so you stop
1278530	1282290	the connection between the camera and the NVR. And then you
1282290	1286590	just basically tell the camera to stream somewhere else and then you start
1286590	1290370	streaming your pre-recorded footage to the NVR. So you
1290370	1294350	replay a pre-captured stream to the NVR. So in practice
1294350	1298850	this is how it looks like. So you have the surveillance
1298850	1302830	footage and this is what the camera is normally streaming.
1302970	1307670	And then in the attacker machine you run Ethercap to do a man in the middle.
1308730	1309990	So you select
1310710	1312110	the hosts.
1329900	1333480	And then we have another script which is actually recording
1333480	1337980	the footage and replaying the pre-recorded footage
1337980	1340580	when the session is stopped.
1352770	1354070	Yeah, now basically
1354070	1356730	the session with the camera has stopped.
1359530	1361910	And then now we are
1362930	1366490	replaying something that was captured before. And then on the bigger screen
1366490	1369870	you can see what is actually going on and on the smaller screen you can see
1369870	1373950	what the security operator or the surveillance guard would
1373950	1375670	be looking at.
1375670	1376530	Right?
1378750	1383290	So this is another attack scenario, attacking the Philips Hue.
1383410	1387450	And the Philips Hue is interesting because it's a very common IoT device
1387450	1391370	which until last year didn't support HTTPS at all.
1391370	1395610	It was only supporting HTTP. And a lot of people
1395610	1400450	knew about that and it was very easy to attack a Philips Hue.
1400450	1403530	And they issued a former
1403530	1407290	update last year. But basically what is used to
1408370	1411370	validate your communication with the Hue is
1413090	1415430	a token, an authorization token
1415430	1419630	and that can be just sniffed also from the network because it's in clear text.
1419630	1423990	And then an attacker can just control the camera, right? So you just send a
1423990	1428610	put request there for the state of the camera so you can do on or
1428610	1431650	off. And then the... I just saw
1431650	1435390	that I have like three minutes left so I'll run through the slides. So you can
1436270	1439930	just switch the lights on or off and then as a result
1439930	1443370	you can have something like this, right? So it's basically the light is
1443370	1447630	completely unusable. So the last
1447630	1451130	attack scenario that you have is MQTT which is a publish
1452690	1455990	subscribe protocol used for IoT devices
1455990	1459930	where you have a broker that coordinates
1459930	1463670	the communication between a set of publishers and subscribers. And that's used to
1465730	1468430	exchange sensory information,
1468430	1472690	telemetry information and also to issue commands to some devices.
1472770	1476010	And again, it's usually used in clear text so you can
1476010	1479850	just passively sniff the traffic or you can subscribe to some topics
1479850	1483710	and you can use that for information gathering to understand
1483710	1487990	the devices that are in the network. You can subscribe to wild card topics
1487990	1492450	so you can see basically every topic that a broker is handling.
1493450	1496050	It's very easy to do denial of service also
1496050	1500050	because you have quality of service that can be increased
1500050	1504070	so you amplify the attack with the responses that
1504070	1507930	are required and you can use very heavy payloads.
1509310	1512070	It's a very common protocol in IoT
1512070	1516530	but again if used insecurely it's very easy to attack it.
1517990	1520370	So with all this in mind,
1520370	1523730	with all these scenarios of attacks, let's very quickly talk about
1523730	1526830	defending the IoT. So the things that we
1528110	1531990	should do so that those attacks are mitigated or
1532310	1536170	cannot happen. So the first thing is that we need network visibility so you need to know
1536170	1538730	what devices are on the network so that you can
1540070	1544170	know if they are vulnerable or not or what kinds of protocols they are talking
1544910	1548410	what devices are communicating to what other devices and so on
1549490	1551970	which allows you to do proper asset management
1551970	1555730	so proper configuration and patching of the devices.
1555870	1559590	Network segmentation is extremely important so you can isolate problems
1560170	1564110	and reduce the attack surface. Sometimes there are devices that are
1564110	1567890	difficult to patch so at least they should be segmented.
1568770	1572510	And as a last point, network monitoring and intrusion detection.
1572510	1576330	You should basically know what's going on at the network
1576330	1580090	in real time and be able to spot anomalies and
1580090	1584590	attacks happening. So more details about
1584590	1587230	these attacks and about the defenses and all of that are in
1588170	1592350	four papers that we have over there. The first
1592350	1596070	the top two papers are actually academic publications
1596810	1599450	and they deal mostly with the BACnet stuff
1599450	1603490	and they deal mostly actually with the defensive side
1603490	1607670	so how to do intrusion detection for BACnet but we also describe
1607670	1611710	the attacks. And the two white papers in the bottom
1611710	1615910	are commercial white papers so they describe
1616990	1619770	most of these attacks and areas that I showed here
1619770	1623530	and also a little bit about defense.
1624950	1628050	So what are the key takeaways from this talk?
1628050	1632270	Abusing the IoT in smart buildings, it's easy, it's cheap
1632270	1635950	it can have severe consequences like we've seen with
1635950	1636910	HVAC, with
1639870	1643190	access control where you can let the
1644050	1646870	attacker basically do physical intrusions
1647790	1652110	and defending the IoT in smart buildings is doable and it starts with understanding what's
1652110	1655970	in the network and monitor. And as a last takeaway
1655970	1658530	I just want to say that
1659690	1661090	the building automation
1663810	1668050	the building automation technology is old but we are
1668050	1671930	moving to more connected smart cities and
1671930	1675990	connected everything so we should always keep in mind that more connection means
1675990	1680070	an increased attack surface and the consequences of these attacks also.
1680070	1683210	So sorry if I went over time. Thanks.
1683210	1683830	Applause
