Why UPnP is awesome and terrifying

35
© 2012 Presented by: Why UPnP is Awesome …and Terrifying Daniel Crowley

description

An explanation of how UPnP works, and why it is an inherently dangerous protocol.

Transcript of Why UPnP is awesome and terrifying

Page 1: Why UPnP is awesome and terrifying

© 2012

Presented by:

Why UPnP is Awesome…and Terrifying

Daniel Crowley

Page 2: Why UPnP is awesome and terrifying

© 2012

Who am I?

• Daniel Crowley• Managing Consultant• Trustwave – SpiderLabs - AppSec• [email protected]• @dan_crowley

Page 3: Why UPnP is awesome and terrifying

© 2012© 2012

How UPnP works

Page 4: Why UPnP is awesome and terrifying

© 2012

Phases of UPnP Protocol

• Addressing• Discovery• Description• Control• Eventing• Presentation

Page 5: Why UPnP is awesome and terrifying

© 2012© 2012

Addressing

Page 6: Why UPnP is awesome and terrifying

© 2012

Addressing

• Acquire network address–DHCP

• Associate with multicast group

Page 7: Why UPnP is awesome and terrifying

© 2012© 2012

Discovery

Page 8: Why UPnP is awesome and terrifying

© 2012

Discovery

• M-SEARCH (request)–HTTPMU•Multicast•UDP

–Port 1900

Page 9: Why UPnP is awesome and terrifying

© 2012

Discovery – M-SEARCH

Page 10: Why UPnP is awesome and terrifying

© 2012

Discovery – M-SEARCH

Page 11: Why UPnP is awesome and terrifying

© 2012

Discovery

• NOTIFY–HTTPMU•Multicast•UDP

–Port 1900

Page 12: Why UPnP is awesome and terrifying

© 2012

Discovery - NOTIFY

Page 13: Why UPnP is awesome and terrifying

© 2012© 2012

Description

Page 14: Why UPnP is awesome and terrifying

© 2012

Description

• Unicast HTTP• Grab/parse UPnP description xml files

Page 15: Why UPnP is awesome and terrifying

© 2012© 2012

Control

Page 16: Why UPnP is awesome and terrifying

© 2012

Control

• Unicast HTTP• SOAP

Page 17: Why UPnP is awesome and terrifying

© 2012© 2012

Eventing

Page 18: Why UPnP is awesome and terrifying

© 2012

Eventing

• GENA– HTTP based

• SUBSCRIBE, POLL and NOTIFY• May be implemented by UPnP device

Page 19: Why UPnP is awesome and terrifying

© 2012© 2012

Presentation

Page 20: Why UPnP is awesome and terrifying

© 2012

Presentation

• Description phase provides root XML file• Root XML file can contain presentation URI• URI is HTTP resource for alternate control or

view

Page 21: Why UPnP is awesome and terrifying

© 2012© 2012

Awesome

Page 22: Why UPnP is awesome and terrifying

© 2012

Awesome

• Kittens• Missiles

Page 23: Why UPnP is awesome and terrifying

© 2012

Why it’s awesome

• Universal control protocol–Traditional network devices–Network-attached devices–AV Gear

• Ease of device deployment–Self-configuring devices

Page 24: Why UPnP is awesome and terrifying

© 2012© 2012

Terrifying

Page 25: Why UPnP is awesome and terrifying

© 2012

Terrifying

• No authentication built in– DeviceProtection– UPnP security

• Some actions exposed are awful– RunLua– SetDNSServer– UpdateFirmware

Page 26: Why UPnP is awesome and terrifying

© 2012

Remote Keystrokes?

Page 27: Why UPnP is awesome and terrifying

© 2012

Arm/Disarm Alarm System?

Page 28: Why UPnP is awesome and terrifying

© 2012

Add entry PINs to door lock?

Page 29: Why UPnP is awesome and terrifying

© 2012

Terrifying

• Being used for:– Door Locks– Security Cameras– Motion Sensors– Alarm Systems– Electrical Outlets

Page 30: Why UPnP is awesome and terrifying

© 2012

Terrifying

• Control is built on Unicast HTTP–CSRF• Javascript• Flash• Silverlight

Page 31: Why UPnP is awesome and terrifying

© 2012

UPnP Daemons

• Full

•Of

•Holes

Page 32: Why UPnP is awesome and terrifying

© 2012

Flaws in UPnP actions

• Traditional application security flaws–Shell injection–Memory corruption

Page 33: Why UPnP is awesome and terrifying

© 2012© 2012

DemoBelkin WeMo

Page 34: Why UPnP is awesome and terrifying

© 2012© 2012

DemoBubbleUPnP