66
Stefano Zanero Associate Professor, Politecnico di Milano Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta, Marcello Pogliani, Mario Polino, Federico Maggi, Andrea M. Zanchettin

Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Stefano ZaneroAssociate Professor, Politecnico di Milano

Hacking RobotsLessons learned, current research and

new perspectives

Joint work with: Davide Quarta, Marcello Pogliani, Mario Polino, Federico Maggi, Andrea M. Zanchettin

Page 2: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Industrial robots?

Page 3: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Industrial Robot Architecture (Standards)

Controller

Page 4: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,
Page 5: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Flexibly programmable

Page 6: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Screenshot of teach pendant + formatted code snippet on the side

Page 7: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

“Implicit” parameters

Page 8: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

“Implicit” parameters

Page 9: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Connected(Part 1)

Page 10: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

They are already meant to be connected

Page 11: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Attack surface

USB port

LAN

Radio

Services:Well-known (FTP) +

custom (RobAPI)

Page 12: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Connected Robots: Why?

● Now: monitoring & maintenance ISO 10218-2:2011

● Near future: active production planning and control○ some vendors expose REST-like APIs○ … up to the use of mobile devices for commands

● Future: app/library stores○ “Industrial” version of robotappstore.com?

Page 13: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

We assess

attack impact byreasoning on

requirements

Page 14: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Requirements: "Laws of Robotics"

Safety

Accuracy

Integrity

Page 15: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Requirements: "Laws of Robotics"

Safety

Accuracy

IntegrityAcknowledgements T.U. Munich, YouTube -- Dart Throwing with a Robotic Manipulator

Page 16: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Requirements: "Laws of Robotics"

Safety

Accuracy

Integrity

Page 17: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

violating any of these requirements

via a digital vector

Robot-Specific Attack

Safety

Accuracy

Integrity

Page 18: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Control Loop Alteration

Safety

Integrity

Attack 1

Accuracy

Page 19: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Control Loop Alteration

Safety

Integrity

Attack 1

Accuracy

Page 20: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Control Loop Alteration

Safety

Integrity

Attack 1

Accuracy

Page 22: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

dr0wned - Cyber-Physical Attack with Additive ManufacturingSofia Belikovetsky, Mark Yampolskiy, Jinghui Toh, Yuval Elovici

Micro-defects in additive manufacturing

Page 23: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Calibration Tampering

SafetyAccuracyIntegrity

Attack 2

Page 24: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Calibration Tampering

SafetyAccuracyIntegrity

Attack 2

Page 25: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Production Logic Tampering

SafetyAccuracyIntegrity

Attack 3

Page 26: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Production Logic Tampering

SafetyAccuracyIntegrity

Attack 3

Page 27: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Displayed or Actual State Alteration

SafetyAccuracyIntegrity

Attacks 4+5

Page 28: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Displayed or Actual State Alteration

SafetyAccuracyIntegrity

Attacks 4+5

Page 29: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Malicious DLL

Displayed State Alteration PoC

Teach Pendant

Page 30: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Displayed State Alteration PoC

Teach Pendant

Malicious DLL

Page 31: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Standards & Regulations vs. Real World

Page 32: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Collaborative Robotics

Page 33: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

let’s compromisethe controller

Page 34: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

USB port

LAN

Radio

Services:Well-known (FTP) +

custom (RobAPI)

Page 35: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

VxWorks 5.x RTOS (x86)

VxWorks 5.x RTOS (PPC)

Windows CE (ARM) .NET >=3.5

FTP, RobAPI, ...

Page 36: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Update problems

FlexPendant

Axis Computer

Microcontrollers

Page 37: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Update problems

FlexPendant

Axis Computer

Microcontrollers

How? FTP at boot

.... plus, no code signing, nothing

Page 38: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Update problems

FlexPendant

Axis Computer

Microcontrollers

FTP? Credentials? Any credential is OK during boot!

ABBVU-DMRO-124644

Page 39: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Autoconfiguration is magic!

Page 40: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Autoconfiguration is magic!

ABBVU-DMRO-124642

Page 41: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

FTP RETR /command/whatever read system infoFTP STOR /command/command execute “commands”

Enter /command

ABBVU-DMRO-124642

Page 42: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

FTP RETR /command/whatever read system infoFTP STOR /command/command execute “commands”

Enter /command

ABBVU-DMRO-124642

Page 43: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

FTP GET /command/whatever read, e.g., env. varsFTP PUT /command/command execute “commands”

shell reboot

shell uas_disable

+ hard-coded credentials? → remote command execution

Enter /command

ABBVU-DMRO-124642

Page 44: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Let’s look at cmddev_execute_command:

shell → sprintf(buf, "%s", param)other commands → sprintf(buf, "cmddev_%s", arg)

overflow buf (on the stack) → remote code execution

Enter /command

ABBVU-DMRO-128238

Page 45: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Ex. 1: RobAPI● Unauthenticated API endpoint● Unsanitized strcpy()→ remote code executionEx. 2: Flex Pendant (TpsStart.exe)● FTP write /command/timestampAAAAAAA…..AAAAAAA● file name > 512 bytes ~> Flex Pendant DoS

Other buffer overflows

ABBVU-DMRO-124641, ABBVU-DMRO-124645

Page 46: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Takeaways

Some memory corruption

Mostly logical vulnerabilities

All the components blindly trust themain computer (lack of isolation)

Page 47: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Complete attack chain (1)

Page 48: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Complete attack chain (2)

Page 49: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Complete attack chain (3)

Page 50: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

“Sensitive” files:● Users’ credentials and permissions● Sensitive configuration parameters (e.g., PID)● Industry secrets (e.g., workpiece parameters)

Obfuscation: bitwise XOR with a “random” key.Key is derived from the file name. Or from the content. Or …

File protection

Page 51: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

That’s how we implemented the attacks

Page 52: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Attack Surface

?

Page 53: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Network

Physical (but digital)

Programming Languages

Attack Surface

Page 54: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Network

Page 55: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Not so many...(yesterday I've just found 10 more)

Remote Exposure of Industrial Robots

Search Entries Country

ABB Robotics 5 DK, SE

FANUC FTP 9 US, KR, FR, TW

Yaskawa 9 CA, JP

Kawasaki E Controller 4 DE

Mitsubishi FTP 1 ID

Overall 28 10

Page 56: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Remote Exposure of Industrial Routers

...way many more!

Unknown which routers are actually robot-connected

Page 57: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Typical Issues

Trivially "Fingerprintable"● Verbose banners (beyond brand or model name)● Detailed technical material on vendor’s website

○ Technical manual: All vendors inspected○ Firmware: 7/12 vendors

Page 58: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Typical Issues (1)

Outdated Software Components● Application software (e.g., DropBear SSH, BusyBox)● Libraries (including crypto libraries)● Compiler & kernel● Baseband firmware

Page 59: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Typical Issues (2)

Insecure Web Interface● Poor input sanitization● E.g., code coming straight from a "beginners" blog

Cut & paste

Page 60: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Physical Attack Surface

Page 61: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Programming Languages Attack Surface

UNTRUSTED INPUT

ROBOT MOVEMENT

Page 62: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Conclusions

Page 63: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Robots are increasingly being connected

Industrial robot-specific class of attacks

Barrier to entry: quite high, budget-wise

Conclusions

Page 64: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Some vendors are very responsive

As a community we really needto push hard for countermeasures

What should we do now?

Page 65: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Hints on Countermeasures

Short termAttack detection and deployment hardening

Medium termSystem hardening

Long termNew standards, beyond safety issues

Page 66: Hacking Robots Lessons learned, current research and new … · 2018. 11. 2. · Hacking Robots Lessons learned, current research and new perspectives Joint work with: Davide Quarta,

Please reach out!

[email protected]@raistolo

Papers, slides, and FAQhttp://robosec.org

Questions?