iot the gift that keeps on giving - iot village · iot –the gift that ... rented a connected car...

41
IoT The gift that keeps on giving Host: Alex “Jay” Balan – Chief Security Researcher [email protected] | @jaymzu Contributors [email protected] Radu Alexandru Basaraba - [email protected] Alexandru Lazar [email protected] Mihai Moldovan - [email protected]

Upload: others

Post on 16-Oct-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

IoT – The gift that keeps on giving

Host:

Alex “Jay” Balan – Chief Security Researcher

[email protected] | @jaymzu

Contributors – [email protected]

Radu Alexandru Basaraba - [email protected]

Alexandru Lazar – [email protected]

Mihai Moldovan - [email protected]

Page 2: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

2

Page 3: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

3

Page 4: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

4

Page 5: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

5

• Chapter 1 – The crazy state of IoT

• Chapter 2 – From China with love

• First findings

• Quick crash course into IoT hacking

• Demo

• Chapter 3 – The gift that keeps on giving

Page 6: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

6 CHAPTER 1: The crazy state of IoT

Page 7: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

RENTED A CONNECTED CAR ONCE…

7

Page 8: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

SMART EVERYTHING

8

Smart Portable fish finder

Smart lightbulb & WiFi repeater

Smart Lightbulb

Smart ThermostatSmart Yoga Mat

Smart Music Player

Smart Barbie doll

Smart Power Outlet

Smart Coffee Maker

Page 9: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

IT TAKES A SPECIAL KIND OF CRAZY TO TRY THIS

9

Page 10: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

THE MOST COMMON ISSUES

10

• Undocumented hardcoded passwords

• Weak or no encryption

• Command injection

• Very old services

• WiFi configuration hotspots

• Bad UX on Firmware updates

• Port forwarding / UPnP

• Device – cloud – mobile app cloud sync

• poor input validation => command injection

THE MOST DANGEROUS ISSUES

Page 11: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

MOST IOT SECURITY PAPERS ARE FOCUSED ON PROXIMITY BASED ATTACKS

11

• MITM the Bluetooth key exchange

• Get shell on some device in your house

• Etc…

• Attacks that require proximity have their charm

Page 12: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

MASS HACKS NEED MORE LOVE

12

Page 13: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

IOT IS JUST HARDWARE + OS + APP (+ CLOUD)

13

wu-ftpd IIS5.0 RDPJoomla

app

Page 14: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

WHY IS THAT A PROBLEM ?

14

• No standards or security reviews for 90% of what’s out there

• Each company builds their own app with almost no

experience with how security works

Page 15: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

15

CHAPTER 2

FROM CHINA WITH LOVE

Page 16: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

IDOORBELL & NEO COOLCAM

16

Page 17: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

SETTING IT UP – STANDARD LINKSYS ROUTER

Page 18: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

SETTING IT UP – SETUP FLOW

18

flow is identical for both the doorbell and webcam

Page 19: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

FROM A PERFECTLY GOOD ROUTER

Page 20: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

TO SWISS CHEESE

Page 21: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

SHODAN SAYS THIS HAS GREAT POTENTIAL

Page 22: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

AT THIS POINT WE WENT THROUGH THE USUAL FIRST STEPS

22

• Wireshark

• Mobile app unpacking

• Check for weak encryption

• Check webapp for various vectors

• Etc…

• We realized that we’ve become used to a number of stupid things

• …and cheered when we found things that should be common sense

• Encryption in cloud communication (yey!)

• No encryption on direct connections (boo!)

Page 23: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

SO…

Page 24: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

YOU SEE AN INPUT FIELD… YOU FUZZ IT

Sadly, the good folks at Neo Shenzhen decided not to let us have too much fun.

Crash on the first try…

The RTSP server didn’t crash with the same method, though (yet)

Page 25: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

25

I’M A SIMPLE MAN. I SEE A CRASH, I GET AROUSED

Page 26: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

HOOK-UP TO SERIAL

Page 27: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

GREAT SUCCESS! NO CREDENTIALS THOUGH

Page 28: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

GOT ROOT ?

Pause boot loader: pass init=/bin/bash to kernel

Use dumb shell to add telnetd to startup

Page 29: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

FIRST FINDS – UNDOCUMENTED USERS

29

Page 30: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

FIRST FINDS – AND THIS - ONE BINARY TO RULE THEM ALL(BECAUSE WHY NOT ?)

30

• Webserver

• RTSP server

• Authentication for webserver

• Authentication for RTSP

Page 31: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

DEBUG TIME!

31

cp -r / /path/to/sdcard

Page 32: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

HTTP AUTH

32

When checking auth at http://<ip>/?usr=<user>&pwd=<password>

libs_parsedata will copy the content of those two arguments onto the

stack without checking if they fit, resulting in an out of bound write

0x460 allocated on stack

Page 33: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

HTTP AUTH

33

ASLR is enabled

However….

No PIE = it will always load at the same address

We’ll use ROP gadget at 0x0007EDD8

To put the address of the stack pointer

(which now contains our command) into R0

Then call the system function to execute our command

GET /?usr=<204bytes><command>&pwd=<328bytes><0xD8ED07> HTTP/1.1

* checksec.sh - http://www.trapkit.de/tools/checksec.html

Page 34: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

THE “ALMIGHTY” EXPLOIT

34

Page 35: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

RTSP

35

• Tried to fuzz user/pass again – didn’t get so lucky this time

• Back to basics…

The RTSP server uses digest authentication and it seems they

implemented it themselves… .poorly

field & value implied to have 256bytes (0x100) each

Unlimited sized strings scanned into field & value

Page 36: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

RTSP EXPLOIT

36

Same binary – we’ll use the same gadget from http. The request

looks like this:

DESCRIBE rtsp://<IP>:554/ RTSP/1.0Authorization: Digest <296 bytes><command>=”<548 bytes><0xD8ED07>”

Page 37: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

DEMO

37

Page 38: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

20 YEARS AGO CALLED. ROOT SHELL BY PASSING 200 CHARS TO LOGIN RING A BELL TO ANYONE ?

38

Page 39: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

FROM CHINA WITH LOVE - KEY TAKEAWAYS

39

• Setup flow requests a password change but there are 2

undocumented users that device owners don’t know exist

• A really lame overflow leads to RCE. Base system provides ASLR

but the app “architecture” decided it’d be a good idea to not use it

• Seriously, check & disable UPnP on your routers

• It’s hard to tell how many affected devices are in the wild since we

don’t know how many (other) vendors use this firmware but at this

point we’re looking at more than 200k

• RCE for other models will require adding other targets to the

exploit

Page 40: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

THE GIFT THAT KEEPS ON GIVING

40

• We need a “security certification” system of sorts for IoT that looks

at more than “military grade encryption”

• We need to educate or otherwise “stimulate” the vendors to have a

proper incident response process and unattended update

mechanisms

• We need to educate the users to get to get tools that can handle the

security of their non-traditional devices. At the very least

vulnerability checkers

• There are vulnerabilities discovered in apps every day but at the

rate IoT is developing we’ll have stuff to talk about for ages

• IoT security papers is a low hanging fruit. Almost everything is not

only broken but also, sometimes, unfixable

• Focus on remote exploits and mass hacks since that’s what the bad

guys are going to focus on

Page 41: IoT The gift that keeps on giving - IoT Village · IoT –The gift that ... RENTED A CONNECTED CAR ONCE ... • We realized that we’ve become used to a number of stupid things •

41

Ask me anything.

[email protected] | @jaymzu