breaking the laws of robotics - paper.seebug.org conf/blackhat/2017_us/us... · breaking the laws...

72
Breaking the Laws of Robotics Attacking Industrial Robots Davide Quarta , Marcello Pogliani , Mario Polino, Federico Maggi , Andrea M. Zanchettin, Stefano Zanero

Upload: vohanh

Post on 27-Jul-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Breaking the Laws of RoboticsAttacking Industrial Robots

Davide Quarta, Marcello Pogliani, Mario Polino, Federico Maggi,Andrea M. Zanchettin, Stefano Zanero

Page 2: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Industrial robots?

Page 3: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Industrial Robot Architecture (Standards)

Controller

Page 4: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital
Page 5: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Flexibly programmable&

Connected

Page 6: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Screenshot of teach pendant + formatted code snippet on the side

Page 7: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

“Implicit” parameters

Page 8: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Flexibly programmable&

Connected(Part 1)

Page 9: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Connected Robots

● 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 10: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Attack surface

USB port

LAN

Radio

Services:Well-known (FTP) +

custom (RobAPI)

Page 11: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

They are already meant to be connected

Page 12: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Do you considercyber attacks

against robots arealistic threat?

Connected?

Page 13: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Do you considercyber attacks

against robots arealistic threat?

Page 14: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

What are the mostvaluable assets

at risk?

Page 15: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Whatconsequences

do you foresee?

Page 16: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

impact is much more important than the

vulnerabilities alone.

Page 17: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

How do we assess the impactof an attack against

industrial robots?

Page 18: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

We assess impact byreasoning on

requirements

Page 19: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Requirements: "Laws of Robotics"

Safety

Accuracy

Integrity

Page 20: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Requirements: "Laws of Robotics"

Safety

Accuracy

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

Page 21: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Requirements: "Laws of Robotics"

Safety

Accuracy

Integrity

Page 22: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

violating any of these requirements

via a digital vector

Robot-Specific Attack

Safety

Accuracy

Integrity

Page 23: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

5 robot-specific attacks

Page 24: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Control Loop Alteration

Safety

Integrity

Attack 1

Accuracy

Page 25: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

DEMO

Page 27: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Calibration Tampering

Safety

Accuracy

Integrity

Attack 2

Page 28: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Production Logic Tampering

Safety

Accuracy

Integrity

Attack 3

Page 29: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

(Perceived) State Alteration

Safety

Accuracy

Integrity

Attack 4+5

Page 30: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Perceived State Alteration PoC

Teach Pendant

Malicious DLL

Page 31: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Perceived State Alteration PoC

Teach Pendant

Malicious DLL

Page 32: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Is the Teach Pendant part of the safety system?

Page 33: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Is the Teach Pendant part of the safety system?

NO

Page 34: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Are thestandard safety

measurestoo limiting?

Page 35: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Are thestandard safety

measurestoo limiting?

Page 36: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Do youcustomize

the safety measuresin your deployment

Page 37: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Do youcustomize

the safety measuresin your deployment

Page 38: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Standards & Regulations vs. Real World

Page 39: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

...so far, we assumed the attacker has already

compromised the controller...

Page 40: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

… let’s compromise the controller!

Page 41: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

VxWorks 5.x RTOS (x86)

VxWorks 5.x RTOS (PPC)

Windows CE (ARM) .NET >=3.5

FTP, RobAPI, ...

Page 42: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

● Statically-linked RTOS● Custom peripherals

○ No fuzzing :(● Firmware online or MMC

○ yay, with symbols!● Simulator for Windows

○ “Virtual controller”○ Not an exact replica

Wearing the pentester’s hat

Page 43: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

User Authorization System

User ∈ roles → grantsAuthentication: username + password

Used for FTP, RobAPI, …

By the way, documentation seems to advise against changing the default user’s permissions

Page 44: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

● How do you update such a complex system?○ Just update the main computer’s MMC!○ Other components (teach pendant, axis computer)

fetch their software via FTP at boot.

● FTP? Credentials? Any credential is OK during boot!

● No integrity check on firmware, no signatures, nothing

Let’s boot!

ABBVU-DMRO-124644

Page 45: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Autoconfiguration is magic!

Service box auto-configures itself via FTP

Hard-coded FTP credentials (again…)

They’re restricted to /command

ABBVU-DMRO-124642

Page 46: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

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

Enter /command

ABBVU-DMRO-124642

Page 47: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

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

shell reboot

shell uas_disable

Pair this with the default, hard-coded credentials for WAN access → remote command execution.

Enter /command

ABBVU-DMRO-124642

Page 48: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

There’s more! Let’s look at cmddev_execute_command:

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

tl;dr; whatever the command is, we overflow buf, who is on the stack → remote code execution

Enter /command

ABBVU-DMRO-128238

Page 49: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

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 50: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Takeaways

Mostly logical vulnerabilities

Some memory corruption

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

Page 51: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Complete attack chain (1)

Page 52: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Complete attack chain (2)

Page 53: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Complete attack chain (3)

Page 54: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

“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 55: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

That’s how we implemented the attacks

Page 56: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Attack Surface

?

Page 57: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Flexibly programmable&

Connected(Part 2)

Page 58: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital
Page 59: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Ethernet Wireless

Page 60: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

WAN

Page 61: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Not so many...

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 62: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Remote Exposure of Industrial Routers

...way many more!

Unknown which routers are actually robot-connected

Page 63: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Typical Issues

Information Disclosure and "Fingerprintability"● Verbose banners (beyond brand or model’s name)● Detailed technical material on vendor’s website

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

Page 64: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Typical Issues (1)

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

Page 65: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Typical Issues (2)

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

Page 66: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Bottom lineConnect your robots with care

Page 67: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Conclusions

Page 68: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Robots are increasingly being connected

Robot-specific class of attacks

Barrier to entry: quite high, budget-wise

Black Hat Sound Bytes

Page 69: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Vendors are very responsive

As a community we really needto push hard for countermeasures

What should we do now?

Page 70: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Hints on Countermeasures

Short termAttack detection and deployment hardening

Medium termSystem hardening

Long termNew standards, beyond safety issues

Page 71: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Davide [email protected]

@_ocean

Federico [email protected]

@phretor

Marcello [email protected]

@mapogli

Papers, slides, and FAQ @ robosec.org

Questions?

Page 72: Breaking the Laws of Robotics - paper.seebug.org Conf/Blackhat/2017_us/us... · Breaking the Laws of Robotics Attacking Industrial Robots ... USB port LAN Radio ... via a digital

Breaking the Laws of RoboticsAttacking Industrial Robots

Davide Quarta, Marcello Pogliani, Mario Polino, Federico Maggi,Andrea M. Zanchettin, Stefano Zanero