• Aucun résultat trouvé

Hack Like a Movie Star

N/A
N/A
Protected

Academic year: 2022

Partager "Hack Like a Movie Star"

Copied!
81
0
0

Texte intégral

(1)

Marina Krotofil & A. D. or MKAD ;-)

Hack Like a Movie Star

Step-by-step guide to cra7ing SCADA payloads for physical a?acks with

catastrophic consequences

(2)
(3)

Who we are: A. D.

q  PhD candidate in embedded security

q  Likes playing CTF and to reverse engineer

q  Hardware and so>ware

developer

(4)

Who we are: Marina Krotofil

q  Formally trained ex-academician and engineer

q  Interested in cyber-physical exploitaBon

q  Never thought I was a hacker

before my hacker friends told

me I was

(5)

Prehistory

(6)

Prehistory: Hacking chemical plants

Control Access

Discovery Cleanup

Damage

M. Krotofil. Hacking Chemical Plants for CompeBBon and ExtorBon. Black Hat USA (2015) J. Larsen. Breakage. Black Hat Federal (2007)

(7)

At DefCon ICS village

q  Several types of control systems (traffic lights, robots, power

grid) available for hacking q  Many hacking master minds q  Applied techniques they use to

hack IT systems

o Nmap-ing & traffic analysis o Firing vulnerabiliBes scanners

to get shell

o No success & lost interest

(8)

Control Access

Discovery Cleanup

Damage

Stages will help you!

(9)

Control Access

Discovery Cleanup

Damage

Stages will help you!

(10)

CybaKWorks Traffic Light kit

q  Semi-handcra>ed demo tool

o Legally obtained image from the Internet o Own hardware components

o Permission for full disclosure

Thanksgiving: Ma\hew Luallen of CybaB

h\ps://cybaB.org/cybaBworks

Our first testbed

(11)

Project kick-off meeKng :-)

(12)

Control Access

Discovery Cleanup

Damage

Access

(13)

GeSng in

q  Somewhere out there in the world there is a lonely traffic light

system. How do you connect to it?

(14)

GeSng in

q  In our case the system is just in front of us

That was

hard!

(15)

Control Access

Discovery Cleanup

Damage

Discovery

(16)

American traffic-light-controlled

crossroad

(17)

ConfiguraKon

The Bad Guy

176.16.192.10

CybaKWorks-1 pla[orm

176.16.192.30

RPi 2

hard wired GPIO Modbus TCP

Peak HMI Rex

Rex Wireshark

here

(18)

Rex control system

h\ps://www.rexcontrols.com/rex-control-system-raspberry-pi

q REX Control System is a family of so>ware products for automaBon projects

q RexDraw - development tool for creaBon of control programsh von q RexView - diagnosBc tool, allows

watching the runBme core

execuBon of control algorithm q RexCore - run Bme environment

handles Bming and execuBon of control algorithms

(19)

Cyber-physical system

q  IT systems “embedded” in an applicaKon in the physical world

o Cyber-physic al a\acks has

q  The goal of the a\acker

o Bring system into a specific state

o To make system performing desired acBons

(20)

Layers of cyber-physical system

Physical layerControl layerCyber layer

Process behavior Control algorithm

Measured process

state Control

commands Inputs

Controller HMI

DB Engineering station Server

x(t) y(t)

Outputs

(21)

ConfiguraKon DiagnosKc VisualizaKon RexDraw

RexCompiler

RexView Peak HMI

TCP IP Modbus TCP

RexCore

*.mdl

*.rex

HOST, CybaK VM

Physical applicaKon

RPi Drv Mb Drv

Control and monitoring architecture

(22)

Understanding the network and the traffic

q  Rex communicaBon protocol

o Proprietary, reverse engineerable

q  Modbus TCP

o Open source

o No [authenBcaBon, integrity protecBon, encrypBon]

(23)

Understanding the traffic

(24)

Understanding the traffic

(25)

Understanding the traffic

(26)

q  Everything what could be measured (inputs) and set (outputs) is called a point

o Points have tags (variable name)

o You need to reconstruct point-tag nomenclature o Points come in analog, digital, and integer flavors o Points can be read, write, or read/write

q  O>en mulBple conversion based on tables stored somewhere on the servers or Internet

o Go find them

Understanding points and tags

(27)

HMI for traffic light management

q  No authenBcaBon and access control

(28)

Look around HMI

(29)

Alarms

q  Alarm is (min/max) threshold/warning of a point value or process/system condiKon

q  Warns operator about unwanted/dangerous condiBons/events

o They tell you what process creator was worried about

q  Alarm can be generated

o In controller o In data base o On the HMI

q  The a\acker may need to suppress alarms during the

a\ack

(IllustraBve alarms)

(30)

Alarms

Empty alarm log -> no alarms

configured, good for us :-)

(31)

SorKng out your discoveries

(32)

Control logic

(33)

Control logic

q  Defines what should/should not happen

o Under which condiBons o At what Bme

o YES or NO proposiBon

q  If-then statements and Boolean logic

o [if input 1 true] AND [input 2 not true] -> [do something]

(34)

Where/how to get it?

q  Engineering/programming staBon

o Some engineer has programmed it o Some human has uploaded it

o O>en stored on some server

q  Go grab it from the controller

o Reverse engineer the compiler

- E.g. see talk of Felix ‘FX’ Lindner talk on building custom disassemblers

h\p://data.proidea.org.pl/confidence/9edycja/materialy/prezentacje/FX.pdf

(35)

Control algorithm

(36)

Control logic (schemaKcs)

[0 0 1;1 5 6;1 1 2; 2 2 3……..7 7 8; 8 8 1]

STT – State TransiBon Table

touts – Bmeouts, Bme limit for current state

Current state

State the system will transit CondiBon to move to the next state

Q2 U1 Y U2 NY TOUT2

AND_TOUT2

C2

(37)

State machine

(38)

Physical outputs of the states

Tags, pins,

Modbus labels

(39)

Mapping tags and pins

(40)

Outcome of the discovery stage

q  Understanding how the systems is built and funcKons

o StaBc discovery of the system

(41)

Control Access

Discovery Cleanup

Damage

Control

(42)

Things which we can change

q  There are two major things the a?acker can control

o The state of the traffic light (red-yellow-green & blinking) o The Bmeout of each state

q  The state of the traffic light can be controlled

o Directly

o Indirectly (by manipulaBng the inputs to control logic)

q  We brainstormed a list of 30 approaches

o Implemented half of it (at the end it is just a hacking exercise for fun & more fun)

(43)

DEMO 1

q  Forcing the point

q  SeSng point value from the debagger (RexView)

o “Set that on green because I am your engineer and I said so!”

q  SeSng point from the microcontroller (RPi)

o Using suid binary

o Does not require root privileges (enjoy!)

gpio write 3 1

(44)

DEMO 2

q  Stale Data a?ack

o Stopping CPU on command

o Traffic lights will remains in their last state

1.  ssh pi@172.16.192.30 2. sudo su

3. ps -ax|grep Rex

find out the pid of RexCore 4.  kill -STOP [pid]

5. kill -CONT [pid]

(repeat 4 and 5 at will)

P.S. We achieved the same effect by clumsily uploading modified firmware – unintended fuzzing J

(45)

DEMO 3

q  Speeding up the clock

o Modifying Bmer Bck

o Making things happening faster

1.  ssh pi@172.16.192.30 2.  sudo su

3.  ps -ax|grep RexCore find out the pid of RexCore 4.  gdb -[pid]

5.  info files

find address ranges for .data in /usr/lib/

libRex_T-2.10.6.so

use start address XXX in the following formula 6.  x/x XXX - 0x98bc8 + 0x9a1d4

you should get a new offset with locaBon of the Bmer Bck 0xXXX: 0x02af080

use XXX in the following formula 7.  set *(int)0xXXX=1000

(50000 speed factor) modify touts as needed

8. [ 1 1 300 1 1 1 1 1 1 1 1 1]

(46)

Reverse engineering RexCore

P.S. Thanks to Ole André Vadla Ravnås for

Frida (www.frida.re)

(47)

DEMO 4

q  ModificaKon of control logic

o Rewire/redesign the logic in a way you want

o E.g.

No-REDs-Allowed!

removed

constant ON

removed

(48)

Outcome of the control stage

q  A por[olio of a?acks instances to include into final payload

o All various ways you can influence the state of the physical applicaBon o Choose which few you want to use in final payload

- Those which are more reliable and most effecBve

(49)

Control Access

Discovery Cleanup

Damage

Damage

(50)

q  Safety related (very catastrophic)

o Damage to the vehicles

o Killing road users (drivers, pedestrians, cyclists…) o Both

q  Economy related (very inconvenient)

o Denial of traffic light service o Maintenance efforts

o Traffic impairment

q  Force amplifier (very unfortunate)

o Making a way for bad guys

o Denying a way for good guys (ambulance, police)

A?ack goal

(51)

Traffic jams and gridlocks

Paris amore…..

(52)

Designing a?ack scenario

q  Final payload is tailored to the system you are a?acking

o Requires knowledge of traffic light system soluBon,

(cross)road layout, traffic pa\erns, driving culture, etc.

o E.g. in India nobody follows traffic lights, traffic lights in many U.S. ciBes are desynchronized anyway and

“Germans don’t need traffic lights”

q  Traffic light hack in Los Angeles in 2006

o Disgruntled city traffic engineers reprogrammed lights to stay red longer o Used their comprehensive knowledge of the city's traffic pa\erns and

chose few key intersecBons

o Caused a massive traffic bo\leneck and several days of gridlock

h\ps://www.youtube.com/watch?v=zv9FQZ7kgqU

(53)

Control Access

Discovery Cleanup

Damage

Cleanup

(54)

Cyber-physical a?acks

q  Cyber-physical a?acks change things in the physical world

o The impact of such a\acks cannot be made

invisible

by smart

“stealth techniques” or by modifying logs

q  Because it is NOT INVISIBLE, somebody responsible will try to intervene if things are not going right

q  Make those people unaware of true system’s state

(s om e u nr e la te d H MI )

(55)

Traffic light HMI

(56)

DEMO 5

q  Blinding operator about real state of the traffic lights

o Requires some form of MITM

o Can be implemented at the network layer, on the HMI host, DB, etc.

h\p://www.nrl.navy.mil/itd/ncs/products/core

[1 (0)]: /opt/ZN/hmi_on.ef [2 (0)]: /opt/ZN/hmi_blank.ef [3 (0)]: /opt/ZN/hmi_yellow.ef [4 (0)]: /opt/ZN/hmi_red.ef

[5 (0)]: /opt/ZN/hmi_main_yellow.ef [6 (0)]: /opt/ZN/hmi_side_yellow.ef [7 (1)]: /opt/ZN/hmi_main.ef

[8 (0)]: /opt/ZN/hmi_side.ef

q  IntercepBng traffic to the operator

o E\ercap filters for traffic manipulaBon

o We used Common Open Research Emulator (CORE) installed on CybaB pla•orm

o Tool for emulaBng networks on one or more machines

(57)

Public

tenders Regulatory standards

Operator

screens Visit locaKons

VLog Changing point value

RealKme data from

sensors

Bypass Supervisor

Reports on traffic jam

costs

Traffic

experts Custom research

Final Payload Custom

operator spoofs

WaiKng for rare events

tampering Log Minimal

traffic system model

Accidents in newspapers

Forensic footprint

Discovery

Control

Damage Cleanup

Access

Traffic flow

Management Regulatory

logging Dig up cables Wireless links

(58)

What is in the real world?

(59)

Modern traffic light systems are complex

q  All traffic light systems are built and configured differently!

o Even from the same vendor o To the customer specificaBon

q  Complex interacKve system

o Traffic IS a part of the system

q  Seems like no security requirements or regulaKons YET

(60)

Traffic Management Traffic

InformaKon Historical Data bank

Roadworks

Status lanes Point speeds

& Travel Kme

Traffic intensity and vehicle categories

Traffic reports

Apps, radio, tv, Websites, navigaKon

Status bridges

BiiiiiiG DATA

(61)
(62)

Road traffic

management center

(63)

Modern traffic light systems ensure safety

h\p://theconversaBon.com/traffic-light-hacking-shows-the-internet-of- things-must-come-with-be\er-security-30803 Physical layerControl layerCyber layer

Process behavior Control algorithm

Measured process

state Control

commands Inputs

Controller HMI

DB Engineering station Server

Safety

x(t) y(t)

Outputs

(64)

FuncKonal safety requirements

q  European and local direcKves

o EN 12675 - T

raffic signal controllers. FuncBonal safety requirements. First published in 2000.

o NaBonal normaBves based on EN 12675 q  DetecKon of failure

o Minimal Bme to detect the occurrence of fault and take acBon is 100-850 ms depending on class of fault

o DiagnosBc checks of controller logic system and acBon to be taken shall not be greater than 10 sec

h\p://www.ganino.com/games/BriBsh%20standard/BS%20EN/BS%20EN%2012675-2001.pdf

(65)

q  MMU can be implemented as stand alone supervisor or as safety processor on the main CPU board (the la\er is more common)

o At this point we cannot judge on the security of implementaBon

q  Failure modes

o Typical safety state of operaBon is blinking yellow

o Major fault

– irreversible, requires (manual) controller reset

o Minor fault – reversible, controller may return to full funcBonality

FuncKonal safety

(66)

Typical safety checks

ü All color and green/green conflicts ü Signal sequences

ü  Min. and max. Bmes for all signal states

ü Min. and max. cycle Bme for coordinated signals ü  Min. and max. lamp load for red, amber and green ü Min. and max. main supply voltage for safe

operaBon

ü  Min. and max. main supply frequency ü and others

h\ps://www.swarco.com/en/Products-Services/Traffic-Management/Urban-Traffic- Management/ITC-Traffic-Controllers/ITC-3-Traffic-Controller#tab-7642

(67)

Access

(68)

In the mass media

(69)

Previous works

q  Cesar Cerrudo of IOAcKve

o Sent fake data to vehicle detecBon sensors’ Access Point o Could influence behavior of the traffic lights

http://blog.ioactive.com/2014/04/hacking-us-and-uk-australia-france-etc.html

http://web.eecs.umich.edu/~brghena/projects/green_lights/ghena14green_lights.pdf

q  Research group of University of Michigan

o Hacked into wireless traffic light control communicaBon and into controller o Could influence behavior of the traffic lights

q  BasKan Bloessl

o Reversed engineered local wireless traffic light communicaBon o Reversed and decoded live bus stops telemetry

http://www.bastibl.net/traffic-lights/

(70)

Shodan old friend…..

q  According to vendors’ specificaKons, traffic light systems are Internet-friendly

o Remote accessible diagnosBc tools o Internet accessible control panel o ApplicaBon updates

o Logs are accessible over internet

o (Internet connecBvity is used with care by traffic lights operators in EU (?)) -> at least with ones we spoke to

q  We did not find a traffic light online YET

o But several Traffic Management Systems (with weak protecBon) o Not allowed to disclose

(71)

KAR - Korte Afstands Radio

<=> Short Distance Radio

q  System for requesKng green for emergency vehicles

o Based on open standards

h\p://bison.connekt.nl/standaarden/

h\ps://en.wikipedia.org/wiki/OpenAIR

q  Request packet contains among others:

o ID of intersecBon, vehicle speed, direcBon

o Type of car and its ID (e.q. police, fire brigade, ambulance, public transport)

q  CALL FOR ZERO DAY EXPLOIT ;-)

o No authenBcaBon, authorizaBon or encrypBon

Other protocols: Transit Signal Priority(TSP) h\p://www.g\.com/file/ transit-signal-priority/79-1000-0444-0_B%20TSP%20Sell%20Sheet.pdf

(72)

A7erword

(73)

And Oscar goes to……

Nope, not to Marina

(74)

And Oscar goes to those….

Who can design meaningful a?ack scenario OR

Who can overcome safety protecKons

(75)

And it’s feeling goooood……

(76)

It’s green, so keep good speed!

Bad day :-(

(77)

(ouch!) Also under traffic light controllers

supervision

(78)

q  Anybody can mimic the sound signal and play when NOT GREEN

o Is real current concern

o Please don’t kill pedestrians!

Sight challenged pedestrians

(79)

Who can design meaningful a?ack scenario OR

Who can overcome safety protecKons

And Oscar goes to those….

(80)

Possible A?ack on Safety

Confirmed by a traffic engineer as “maybe possible”

q  Central traffic managements receives status of Safety Unit

q  CAN Bus interface between ApplicaBon and Safety CPU is found in current soluBons

q  Steps to take:

o  Acquire the hardware (like Cesar Cerrudo/IOAcBve) o  Fuzz the connecBon between ApplicaBon and Safety o  Reverse engineer safety implementaBon

o  Discover remote vulnerability

o  Exploit vulnerability to bypass safety

(81)

Marina Krotofil

marina.krotofil@tuhh.de

@marmusha

THANK YOU

A. D.

Thanksgiving: Cesar Cerrudo for patiently answering many questions

Références

Documents relatifs

For the boundary element methods discussed here, the acoustic and Dirichlet boundary problems are reformulated as time–dependent inte- gral equations on R + × Γ. The integral

grunt gallery gratefully acknowledges the support of the Canada Council for the Arts, the Province of BC through the British Columbia Arts Council and BC Gaming, the City

Marie Leoz, Florence Damond, Jude Kfutwah, Jean-Christophe Plantier, French Res-O Network. New Insights into HIV-1 Group O Diversity.. Y181C mutation in the RT). • Need for a

and derived blockchains Biryukov, Tikhomirov Introduction Network privacy Our transaction clustering method Parallel connections Weighting timestamp vectors Clustering the

This allows the correlation between gender in language and labor market participation to have a different intercept across languages that pertain to a different

dumping memory takes time ( &gt;10 seconds for 4 GB) multiple connections occur one after the other or interspersed space quickly fills up.. Problem 2: we don’t even know how

It has recently been shown in [4] (see also [5]) that coupled equations of Fokker-Planck type with a degenerate nonlinear diffusion term and braking/ acceleration forces in-

Plots 4a-4c show the effect of the virtual nodes pricing on the overall cost (Fig. 4a), the fraction of traffic served by the physical infrastructure (Fig. 4b) and the number