ken munro pentest partners iot forum 2016

40
[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP Vulnerabilities in the Internet of Things or How weak mobile app code led us to a bunch of IoT bugs

Upload: iot-forum

Post on 23-Jan-2018

970 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Vulnerabilities in the Internet of Things

or

How weak mobile app code led us to a bunch of IoT bugs

Page 2: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Warning:

This presentation may containhot liquids

(and swearing)

Page 3: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Basic mobile app security principle:

Write it securelyObfuscate the code to make reverse

engineering really tough

Page 4: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

What’s the problem?

Huge increase in attack surface:

Mobile app security

Web app security

API security

Mobile device security

IoT device hardware/firmware security

RF security

For a manufacturer of ‘things’…

Page 5: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

My Wi-Fi Kettle

Er yeah. Why?

Nice idea, if pointless

Future potential quite interesting

Coffee machine ships mid October

Security-fail central

Page 6: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Attacking a kettle

#1 port scan

#2 disassembly

#3 locate chipset manuals

#4 review source code

#5 find code fails

#6 0wnage

Page 7: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

How to reverse Android apps

First, get the APK, can use ADB to extract it from phone

Then decompile using Dex2Jar or Jadexhttps://github.com/pxb1988/dex2jar

Figure out how the app works

Edit Dalvik bytecode using APKTool (smali)https://ibotpeaches.github.io/Apktool/

Or simply edit resources it uses

Recompile, sign with any key, distribute

Page 8: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Page 9: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Attacking a kettle

Other crazy consequences:

Write your own client software – kudos to Mark J Cox

Geo-locate unconfigured wireless kettles

Geo-locate configured wireless kettles

‘Steamy windows’ attack, run up victim’s power bill

WIP: exploding kettle

Page 10: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Page 11: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Their latest releases

iKettle 2.0

Wi-Fi coffee machine

New app

New fun

More caffeine fueled

reverse engineering

Page 12: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Page 13: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

My Friend Cayla

Remember our swearytalking doll?

A year is a long time in security…

Page 14: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Attacking a kids doll

#1 hardware issues

#2 disassembly

#3 root phone

#4 locate local database

#5 modify content

#6 redeploy

Page 15: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Hacking Cayla

Wikipedia API

Evil API

Bluetooth

Voice recognition

Local Q database + ‘badwords’

MITM

Modify unencrypted

data in transit

Evil phone, modified app

Modify SQLite DB contents

Tamper with anti-swearing process

API call broken when Wikipedia enforced SSL!

Page 16: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Putting it right

Manufacturer clearly doesn’t ‘get’ security

“We will be issuing an update to the mobile app to fix the issues raised” – except they didn’t

Implementing SSL will help, so long as certificate pinning is enforced

Otherwise, MITM again

But, Bluetooth promiscuity cannot be fixed, as there is no security of pairing process

Page 17: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Vendor updates the app

Our attack stopped working a while back, after the application was finally updated

They ‘fixed’ it by encrypting the database contents with SQLcipher

Er – ignoring the issues that actually mattered

Page 18: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

My Friend Freddy Bear

Nothing changes…

Whilst reverse engineering the iOS version of Cayla’s app, a researcher found a ‘machine gun’ sound file in her code

Action Cayla?

Freddy Bear shipped this Xmas, equally vulnerable

Slightly more annoying

Page 19: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

The media don’t help

CSI Cyber contacted us about My Friend Cayla

A talking doll involved in a murder. So we wrote a technically plausible ‘hack’ for them

In the end they just dubbed a Barbie-alike!

Page 20: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Hello Barbie

Totally different security model

BUT

Wi-Fi PSK stored on board

Potential to intercept mike

Some other data cached on board

…and parents can create accounts to view child’s activity

Page 21: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Samsung Smart Fridge

Samsung RF28HMELBSR Smart Fridge

View Google calendars, weather, recipes, TV etc

Did I say ‘utterly pointless’?

Spectacularly fails to properly encrypt your Gmail password

Drive past your house, attack fridge, steal your email

Page 22: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Samsung Washing machine

Samsung WW10H9600EW ‘smart’ washer

Work in progress, but allows remote control of your washing machine

Similar control to smart fridge

Wi-Fi network primary attack vector

Amusing conversation with installer:“Can I plumb it in for you?”

“No thanks, I’m not using it for washing”

-> very confused look

At least SSL certs are validated

Page 23: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Hoover Wizard

Page 24: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Hoover Wizard

Ready for a train wreck?

Time to look at the mobile app code

Static oauth tokens for API

Plain text control on local network

with ‘encription’

Can we set fire to it?

Page 25: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Ring Wi-Fi doorbell

Remove doorbellUnscrew two T6 Torx screws,

Push setup button on rear of bell

Connect to embedded web server running on Gainspan Wi-Fi module

Users Wi-Fi PSK displayed in plain text…

Page 26: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Ring Wi-Fi doorbell

For once, a vendor that actually responded quickly and effectively

Acknowledged bug within about 20 minutes of Twitter DM

Fix pushed within 2 weeks

But, still trackable:

Page 27: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Internet scales

FitBit Aria internet scalesConnects to your network over Wi-Fi

Shares weight & fatness through Fitbit online services

Set up guest-only IDs the user by weightDon’t eat too many pies overnight

Sends your home SSID to FitBit servers at registration, potential to identify user

Fitbit could therefore geolocate you with wigle.net

Nothing on the board appears to be encrypted

Limited processing power & storage

Page 28: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Setup mode PSK disclosure

Put kettle in to setup mode –either push reset button, or take out batteries

Navigate to URL here

PSK disclosed in plain text

Found & reported, fixed in firmware 38

How we found it:

Page 29: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Page 30: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

UART

SPI

Page 31: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

JTAG

Page 32: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Star Wars

Remember this guy?

Surely BB-8 can’t have vulnerabilities?

Page 33: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Wearables

Wi-Fi eminently more trackable than other RF technologies

Mostly due to war driving and wigle.net

Though still potential with BlueTooth, BT LE, Zigbee, Z-Wave

802.11ah HaLow concerning

What do you sync your device with?

Page 34: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Wearables – smart bra

Innovative approach to heart rate monitoring

Some discussion about being able to assess other stats, such as body temperature

Not quite shipping yetwww.omsignal.com

Can’t wait…

Page 35: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Wearables – tracking

The HRM in the smart clothing syncs with a smart phone and fitness app

StravaMapMyRunNike+Runkeeper

And Runtastic, which had a lovely vulnerability that allowed unauthenticated live tracking…

Page 36: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

Tracking by fitness apps

Privacy for various activity tracking apps is dreadful

Runkeeper, MapMyRun, Strava, RuntasticAll had privacy settings off by defaultGenerally hard to find and configure privacyStrava in fairness mailed users on day2 to show how

Most had sequential session IDs

Runtastic had the shocking real-time tracking bug, even when profile set to private

Only Nike+ seemed to get security & privacy ‘right’

Page 37: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

iSpy Tank

Wi-Fi access point with tracks

Static creds to web interface

Take control from outside the victim’s house

Go spy!

Thermostats, LightwaveRF etc etc all being investigated

Page 38: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

In summary

IoT product vendors have a lot to learn about security

So do some mobile app coders

Finding these bugs would have been really tough if the code was properly obfuscated

Check out your mobile app code; look for the basics:

Is it obfuscated / encrypted?

Static credentials / static keys

Plain text communications / SSL pinning

Page 39: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

IoT Security Foundation

There’s hope yet!

Various bodies attempting to bring good practice to IoT manufacturers

Some progress by US FDA towards medical device security standards

IoT SF shortly to deliver initial self-cert for IoT security, followed by more robust compliance

Page 40: Ken Munro Pentest Partners IoT Forum 2016

[email protected] | +44 (0)20 3095 0500 | @PenTestPartners | www.youtube.com/PenTestPartnersLLP

The Internet of Things isa scary place

Be cynical, don’t adopt technologies that aren’t proven secure

@thekenmunroshow@pentestpartners

Blog:www.pentestpartners.com