+ All Categories
Home > Documents > BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart...

BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart...

Date post: 27-Jan-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
73
BMS is destroyed by "smart button"
Transcript
Page 1: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button"

Page 2: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

2

About me

• Specialize in ICS security of embedded devices • Dedicate a lot of time to programming industrial controllers for ICS • Took part in smart home development projects

I am working at

Page 3: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 3

Content

• What is BMS

• Introduction to KNX

• Ideal world

• Real world

Page 4: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 4

News about cyber attack on BMS

Page 5: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 5

What is BMS

Page 6: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 6

What is BMS

Automation level

Management level

Field level

Building Management System - BMS

sensors actuators

PLC / HMI

Page 7: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 7

Main objectives of BMS

Reduce power consumption

Control operation of different systems

Ensure visitors’ comfort

Page 8: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 8

Environment is BMS

Page 9: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 9

Environment of KNX

Al Maktoum International Airport

Asia Square

Welt Museum Wien

Page 10: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 10

Heating, Ventilation and Air

Conditioning

Environment of KNX

Room Thermostat

Transponder reader ….

Indoor presence detection

Page 11: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 11

Environment of KNX

ABB KNX solutions for hotel applications

Page 12: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

12

Introduction to KNX

Page 13: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 13

KNXnet/IP KNX - TP (Twisted pair)

9600 bit/s

KNX - RF

KNX - PL Power Line (PL110)

Physical communication media

16384 bit/s 868 MHz

1200 bit/s

Page 14: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 14

KNX address space

max 15 areas

1 area – max 15 lines

1 line – max 255 nodes

Page 15: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 15

KNX-TP frame

Page 16: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 16

KNX-TP frame

Control byte

Page 17: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 17

Source address

area

line

node

KNX-TP frame

Page 18: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 18

Receiver address

It depends on Group Address Style

KNX-TP frame

Page 19: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 19

Receiver address

It depends on Group Address Style

KNX-TP frame

Page 20: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 20

NPCI

KNX-TP frame

Page 21: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 21

TPCI / APCI

KNX-TP frame

Page 22: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 22

KNX-TP frame

Page 23: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 23

Multicast @ 224.0.23.12:3671

1 byte 1 byte 2 bytes 2 bytes

KNXnet/IP frame

Page 24: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 24

Second Control Byte In KNXnet/IP

KNXnet/IP frame

Page 25: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

25

Ideal world

Page 26: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 26

KNX Position Paper on Data Security and Privacy

Page 27: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 27

KNX Position Paper on Data Security and Privacy

Page 28: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 28

KNX Position Paper on Data Security and Privacy

1

2 ETS5 provides security connection HOWEVER …

Page 29: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

29

Real world

Page 30: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 30

Expectations and reality

ETS5 provides security connection

Page 31: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 31

Shodan, Censys, …

Page 32: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 32

stand-alone device

“smart” transceiver (NCN5120 or E981.03)

How to connect to KNX TP

Design self-transceiver

Page 33: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 33

ETS software

Tools to work with KNX

Press button to switch “Program mode”

Commit/configure node

Page 34: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 34

Tools to work with KNX

https://github.com/Xarlan/pwnknx

pwnknx

connection

Ethernet (via IP gateway)

Ethernet/Wi-Fi (based on esp32)

KNX-TP (based on esp32)

Page 35: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 35

Tools to work with KNX

To get information about number line, address format, which used • sniff

• scan To find all nodes in a line, because ETS5 sometimes can’t display all of them

• read Read configuration from node (APCI “memory read”)

• write Write configuration to node (APCI “memory write”)

• set_key Set the authorization key (APCI “Escape” + extended APCI bits )

pwnknx

Page 36: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 36

1 floor

Attack to field level

2 floor

3 floor

Connect anywhere to KNX TP

• Listen the traffic and slightly understand the type of devices

• Replay attack

Ethernet KNX-TP

Page 37: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 37

1 floor

Attack to field level

2 floor

3 floor

• Discover KNX-TP segment

• Manage nodes in current KNX-TP segment

Lock

Ethernet KNX-TP

Page 38: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 38

1 floor

Attack to field level

2 floor

3 floor

• Use APCI “Read memory” to get info

Lock

IP 192.168.1.222 Mask 255.255.255.255

Gateway 192.168.1.1

Status router Lock or Unlock …

Ethernet KNX-TP

Page 39: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 39

1 floor

Attack to field level

2 floor

3 floor

• Use APCI “Write memory” to change the configuration node or IP router

Lock

Ethernet KNX-TP

Page 40: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 40

Unlock

1 floor

Attack to field level

2 floor

3 floor

• Use APCI “Write memory” to change the configuration node or IP router

Ethernet KNX-TP

Page 41: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 41

Unlock

Ethernet KNX-TP

1 floor

Attack to field level

2 floor

3 floor

• Discover and manage all nodes in KNX-TP & KNXnet/IP

Page 42: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 42

Attack to field level

• APCI “User Message” we can to send up to 69 bytes, not 15 bytes, some router can transfer 69 bytes form knx-tp to KNXnetIP

for some KNX IP router don’t forget about

• Padding for Ethernet frame

Page 43: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 43

Attack to field level

• No needed to switch to “program mode” in ETS5 you need switch to “program mode” to change configuration of node in real life – use APCI “memory read/write” without “key authorization”

• APCI “Escape” + Key authorization use to “memory access-protection” However, some nodes can confirm that the authorization key was changed, but in reality nothing happened!!!

Page 44: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 44

KNX-TP KNXnet/IP

Update firmware via KNX-TP

Page 45: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 45

KNX-TP KNXnet/IP

Update firmware via KNX-TP

Page 46: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 46

KNX-TP KNXnet/IP

Update firmware via KNX-TP

Page 47: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 47

KNX-TP KNXnet/IP

Update firmware via KNX-TP

Page 48: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 48

Use APCI “User Message”

• to read firmware: APCI = 0x2C0 (User Message) Data = [0xXX, …, 0xXX] where 0xXX – the part of firmware

• to write firmware: APCI = 0x2C2 (User Memory Write) Data = [0xXX, …, 0xXX] where 0xXX – the part of firmware

Update firmware via KNX-TP

How to update firmware on IP router from field side ?

Page 49: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 49

Update firmware

How to get control over the device Connect to the Ethernet

Run “vendor name”

Update Tool

Update

Page 50: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 50

Inside the IP router

Possible MCU: • ATmega128 • AT91SAM9G20 • NXP LPC2366

Possible OS: • Nut/OS • Linux • Custom firmware

Possible transceiver: • FZE1066 • EIB-TP-UART-IC • E981.03

Page 51: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 51

Linx 150 programmable automation stations

Attack to Automation level

program connectivity functions to concurrently integrate: • CEA‐709 (LonMark Systems); • BACnet; • KNX; • Modbus; • M‐Bus

Page 52: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 52

Manual control

External interfaces

USB Ethernet

microSD Linx 150

Page 53: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 53

Serial 38,400 bps / 8 data bits / no parity / 1 stop bit / no handshake

Connecting to the Linx 150

Manual

Ethernet • http web server • ftp • ssh • …

Linx 150

Page 54: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 54

Manual connection

You can do anything!!!

Page 55: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 55

HTTP web

A lot of information for guest

Linx 150

Page 56: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 56

HTTP web

Account: admin Password: loytec4u

Linx 150

Don’t forget, that the communication happens via HTTP, FTP

Page 57: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 57

Linx 150

min: 1 symbol

max: 15 symbols

HTTP web

Page 58: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 58

Analyze /etc/init.d/S35firewall and other network settings

Bruteforce

rules in iptables

fail2ban

sshguard

NOT

if you miss - engage in brute force

Page 59: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 59

Step aside

Page 60: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 60

Inside firmware image

linx_at91_6_4_6_20190213_1030.dl

https://www.loytec.com/de/support/download/linx-150

Download from official web site

Linx 150

Page 61: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 61

Inside firmware image

linx_at91_6_4_6_20190213_1030.dl

A lot of Debian package +

Loytec package

Linx 150

Page 62: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 62

CVE-2019-xxxx

Inside firmware image

CVE-2018-15599 dropbear_2018.76-1

CVE-2017-1000368 CVE-2017-1000367

sudo_1.8.19p2-1

CVE-2017-7418 proftpd_1.3.5d-1

Linux Kernel 3.18.45 CVE-2018-xxxx

Page 63: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 63

Inside firmware image

File doesn’t stripped

Stack may be executable

Page 64: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 64

Inside firmware image

Hardcoded password and user

/usr/bin/linx_at91_primary.exe

Page 65: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 65

Inside firmware image

Function “firmware_update_from_file”

no checking of integrity and authenticity

Page 66: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 66

Inside firmware image

/var/lib/opcua/certificatestore/server/private /etc/lighttpd/ssl/

Private key

The same “Private Key” for different version of firmware

Perhaps the same “Private Key” for different devices

Page 67: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 67

Inside firmware image

What is it Linx 153 firmware ???

Linx 153 firmware

Some new specific package for Linx 153

Old packages from Linx 150 with older version

for example “proftpd”

Page 68: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 68

Additional info

• “Learn how to control every room at a luxury hotel remotely: the dangers of insecure home automation deployment.” by Jesus Molina

• “Security for KNXnet/IP” by Daniel Lechner, Wolfgang Granzer,

Wolfgang Kastner • Hacking Intelligent Buildings: Pwning KNX & ZigBee Networks https://conference.hitb.org/hitbsecconf2018ams/sessions/hacking-intelligent-buildings-pwning-knx-zigbee-networks/

Page 69: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

69

Conclusion

Page 70: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 70

• DoS for any node in KNX network

• Opportunity to manage any device in KNX

• Change router configuration

• Update firmware for some node via knx-tp

• No checks are present in during update

• Using not secure protocols (http, ftp) to communicate with Linx 150

• Using old packages in Linx 150

Page 71: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 71

• KNX Position Paper on Data Security and Privacy

Page 72: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

BMS is destroyed by "smart button" 72

Gratitude • Dimitrii Viktorov, CTO, SENSORMATICA LLC

@KanIkFFdoen

https://sensormatica.ru

• Kees Jongenburger

Page 73: BMS is destroyed by smart button - Hack In Paris · 2019-07-04 · BMS is destroyed by "smart button" 35 Tools to work with KNX • sniff To get information about number line, address

[email protected]

73

@Xarlan


Recommended