Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las...

94
Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition and Extortion

Transcript of Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las...

Page 1: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Marina Krotofil, Jason Larsen

DefCon 23, Las Vegas, USA07.08.2015

Rocking the Pocket Book: Hacking Chemical Plants for Competition and Extortion

Page 2: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Who we are

Hacker(Ex)Academic

Got hooked on cyber-physical hacking

Dragged into academic world against own will

Page 3: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Motivation

Page 4: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Industrial Control Systems

Page 5: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Industrial Control Systems aka SCADA

Physical application

Curtesy: Compass Security Germany GmbH

Page 6: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Industry means big businessBig business == $$$$$$$

Industrial Control Systems

Page 7: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Some horrible physical

consequences010011011011101

Missing piece of knowledge

How do we do it??

Page 8: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Source: simentari.com

Typical understanding of SCADA hacking

Page 9: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

What can be done to the process

Compliance violation

Safety (occupational, environment)

Pollution (environment)

Contractual agreements

Production damage

Product quality and product rate

Operating costs

Maintenance efforts

Equipment damage

Equipment overstress

Violation of safety limits

Page 10: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Attack considerations

Equipment damageo Comes first into anybody’s mind (+)o Irreversible ( )o Unclear collateral damage (-)o May transform into compliance

violation, e.g. if it kills human (-)

Compliance violation

Production damage

Equipment damage

Compliance violation

o Compliance regulations are public knowledge (+)o Unclear collateral damage (-)o Must be reported to the authorities ( )o Will be investigated by the responsible agencies (-)

±

±

Page 11: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Here’s a plant. What is the plan?

Attack goal: persistent economic damage

Page 12: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Process control

Page 13: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Running upstairs to turn on your furnace every time it gets cold gets tiring after a while so you automate it with a thermostat

(Nest because it’s so cute!)

Process control automation

Set point

Page 14: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Control loop

Actuators

Control system

Physical process

Sensors

Measure process state

Computes control commands for

actuators

Adjust themselves to influence

process behavior

Page 15: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Control system

Jacques Smuts „Process Control for Practitioners“

Termostat controller

+

Error in desired temperaturee(t) = SP - PV

Heat loss

(e.g. through windows)

Heat into houseSet point (SP) Furnace fuel valve

House heating system

Temperature sensor

-Desired temp

Measured temp

(Process variable, PV)

Controller output, COSignal to actuator

(valve)Adjusted fuel

flow to furnace

Page 16: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Control equipment

In large –scale operations control logic gets more complex than a thermostat

One would need something bigger than a thermostat to handle it

Most of the time this is a programmable logic controller (PLC)

Page 17: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

1. Copy data from inputs to temporary storage2. Run the logic3. Copy from temporary storage to outputs

Inp

uts

Ou

tpu

ts

PLC internals

Sensors Actuators

Page 18: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

If Input 1 and (Input 4 or Input 11) then Output 6

Control logic

If tank pressure in PLC 1 > 1800 reduce inflow in PLC 3

It is programmed graphically most of the time(We hear you screaming: Noooo!!!!

Just give me a real language!)

Page 19: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

PID: proportional, integral, derivative – most widely used control algorithm on the planet

The sum of 3 components makes the final control signal

PI controllers are most often used

Jacques Smuts „Process Control for Practitioners“

PID control

Page 20: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Wires are run from sensors and actuators into wiring cabinets

Communication mediao 4-20 mAo 0-10 vo Air pressure

Usually process values are scaled into meaningful data in the PLC

Field communication

Page 21: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

PLC cannot do it alone

PLC does not have the complete picture and time trends

Human operators watch the process 7/24

Most important task: resolving of alarms

Page 22: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

IT hacking vs. OT hacking

Page 23: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Example: attack on process data flow

Data integrity: packet injection; replay; data manipulation; …

DoS: DoS; DDoS; flooding; starvation;….

I am not controlling the

process!!

Operator

Net. Admin

PLC Frequency converter

CentrifugeEngineering station

Linkage to cyber assets

HMIDB

Data flow

Page 24: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Controllability

Observability

OT security

Page 25: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

OT hacking

An attacker with an objective beyond simple mayhem will want to reliably manipulate the process

This is achieved by obtaining and remaining in control of the process

To remain in control you need to apply control theory fu.

(not sql-injections, no XSS or ROP)

Process operator and hacker rival for control over the process

Page 26: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Process-related security properties

HOLY TRINITY

IT domain Process control

Observability

Controllability

Operability

Page 27: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Process-related security properties

HOLY TRINITY

Observability

Controllability

Operability

Information security Process control security

CIA CO2

Page 28: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Haters gonna hate…

Page 29: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Approaches to attacker control

Reliably control the process throughout the attack

Control the process until failure is guaranteed and then let it run out of control

Make the process unusable by messing with the controls

1

2

3

Page 30: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Consider a car and a driver

Attacker has control of the brakes

Attacker applies the left front brake

Diver steers right eventually coming back into a straight line

Attacker applies the left brake

Driver responds by steering to the right until the car is straight again

Page 31: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Consider a car and a driver

The attacker responds by swapping brakes whenever the driver starts to compensate

Eventually the attacker will win since a computer is faster than a human

Page 32: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Multi-adaptive

In the example above, the human is the “hidden actor” in the process that can’t be modeled or predicted

Any subset of a process can be modeled as a “hidden actor” and potentially destabilized

We call the algorithms that counter the feedback loops in the process “multi-adaptive” algorithms

Page 33: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Multi-Adaptive algorithms work just like process control automatic tuning programs except they try to maximize the error instead of minimizing it

The algorithm learns the behavior of the hidden actor and then compensates for it

Controlled uncontrollability

A single algorithm can be used as a payload to disrupt many types of processeso Crash a car or overpressure a loop

Everything the control loop does makes things worse

Page 34: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Get the party started!

Page 35: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Plants for sale

From LinkedIn

More plants offers:http://www.usedplants.com/

Page 36: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Car vs. plant hacking

It is not about the size

It is about MONEY

Plants are ouch! how expensive

Page 37: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Vinyl Acetate Monomer plant (model)

Page 38: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Stages of cyber-physical attacks

Page 39: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Attack payload

Attack objective

Cyber-physical payload

Page 40: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Stages of SCADA attack

Control

Access

DiscoveryCleanup

Damage

Page 41: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Control

Access

DiscoveryCleanup

Damage

Stages of SCADA attack

Page 42: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Control

Access

DiscoveryCleanup

Damage

Stages of SCADA attack

Page 43: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Access

Page 44: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Traditional IT hacking

• 1 0day• 1 Clueless user• Repeat until done

• AntiVirus and patch management• Database links• Backup systems

• No security• Move freely

Exploit kit

Page 45: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Modern IT hacking

Select a vulnerability from the list of ICS-CERT advisories

Scan Internet to locate vulnerable devices

Exploit

• E. Leverett, R. Wightman. Vulnerability Inheritance in Programmable Logic Controllers (GreHack‘13)• D. Beresford. Exploiting Siemens Simatic S7 PLCs . Black Hat USA (2011)

Page 46: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Converts analog signal into digital

Sensors pre-process the measurements

IP-enabled (part of the “Internet-of-Things”)

Computational element

Sensor

Smart instrumentation

Old generation temperature sensor

Page 47: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Invading field devices

Jason Larsen at Black Hat’15 “Miniaturization”

o Inserting rootkit into firmware

Water flow

Shock wave

Valve PhysicalReflected shock wave

Valve closes Shockwave Reflected wave

Pipe

movement

Attack scenario: pipe damage with water hammer

Page 48: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Discovery

Stripper is...

Page 49: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Know the equipment

Stripping column

Page 50: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Process discovery

What and how the process is producing

How it is build and wired

How it is controlled

Espionage, reconnaissanceTarget plant and third parties

Operating and safety constraints

Page 51: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Espionage

Industrial espionage has started LONG time ago (malware samples dated as early as 2003)

Page 52: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Process discovery

Page 53: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

RefinementReaction

Max economic damage?

Final product

Requires input of subject matter experts

Page 54: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Understanding points and logic

Piping and instrumentation diagram

Ladder logicProgrammable Logic Controller

Pump in the plant

Page 55: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Understanding points and logic

Piping and instrumentation diagram

Ladder logicProgrammable Logic Controller

Pump in the plant

HAVEX: Using OPC, the malware component gathers any details about connected devices and sends them back to the C&C.

Page 56: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

CC

1

PC

TC

LC

2

3

LC4

PC

5

6

TC

7

LC

8

TC

9

TC

11

LC

12

TC

14

TC

16

CC

CC 17

18

TC

19

CC

LC25

20

TC21

TC LC

LC

24

2223

26

15

1310

Understanding control structure

Control loop

Page 57: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Control loop configuration

Page 58: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Watch the flows!

fixed

HAc flows into two sections. Not good :(

Page 59: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Obtaining control != being in control

Obtained controls might not be useful for attack goal

Attacker might not necessary be able to control obtained controls

WTF ???

Control Loop XMV{1}

XMV{2}

XMV{3}

Page 60: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Control

Every action has a reaction

Page 61: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Physics of process control

Once hooked up together, physical components become related to each other by the physics of the process

If we adjust a valve what happens to everything else?

o Adjusting temperature also increases pressure and flow

o All the downstream effects need to be taken into account

How much does the process can be changed before releasing alarms or it shutting down?

Page 62: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Process interdependencies

Page 63: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Process interdependencies

Page 64: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Understanding process response

Controller Process

Transmitter

Final control element

Set point

Disturbance

• Operating practice • Control strategy

• Sizing• Dead band• Flow properties

• Type• Duration

• Sampling frequency• Noise profile• Filtering

• Control algorithm• Controller tuning

• Equipment design• Process design• Control loops coupling

Page 65: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Understanding process response

Controller Process

Transmitter

Final control element

Set point

Disturbance

• Operating practice • Control strategy

• Sizing• Dead band• Flow properties

• Type• Duration

• Sampling frequency• Noise profile• Filtering

• Control algorithm• Controller tuning

• Equipment design• Process design• Control loops coupling

Have extensively studied

Page 66: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Process control challenges

Process dynamic is highly non-linear (???)

Behavior of the process is known to the extent of its modelling

o So to controllers. They cannot control the process beyond their control model

UNCERTAINTY!

This triggers alarms Non-liner response

Page 67: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Control loop ringing

Caused by a negative real controller poles

Makes process unstable and uncontrollable

Amount of chemical entering the reactor

Ringing impact ratio 1: 150

Page 68: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Types of attacks

Step attack

Periodic attack

Magnitude of manipulation

Recovery time

Page 69: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

We should automate this process

(work in progress)

Outcome of the control stage

I am 5’3’’ tall

Page 70: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Sensitivity Magnitude of manipulation Recovery time

High XMV {1;5;7} XMV {4;7}

Medium XMV {2;4;6} XMV {5}

Low XMV{3} XMV {1;2;3;6}

Reliably useful controls

Outcome of the control stage

Page 71: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Alarm propagation

Alarm Steady state attacks Periodic attacks

Gas loop 02 XMV {1} XMV {1}

Reactor feed T XMV {6} XMV {6}

Rector T XMV{7} XMV{7}

FEHE effluent XMV{7} XMV{7}

Gas loop P XMV{2;3;6} XMV{2;3;6}

HAc in decanter XMV{2;3;7} XMV{3}

To persist we shall not bring about alarms

The attacker needs to figure out the marginal attack parameters which (do not) trigger alarms

Page 72: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Damage

Page 73: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

How to break things?

Attacker needs one or more attack scenarios to deploy in final payload

The least familiar stage to IT hackers

o In most cases requires input of subject matter experts

Accident data is a good starting point

o Governmental agencies

o Plants’ own data bases

Page 74: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

How to break things?

Page 75: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Hacker unfriendly process

Target plant may not have been designed in a hacker friendly way

o There may no sensors measuring exact values needed for the attack execution

o The information about the process may be spread across several subsystems making hacker invading greater number of devices

o Control loops may be designed to control different parameters that the attacker needs to control for her goal

Page 76: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Measuring the process

• Reactor exit flowrate• Reactor exit temperature• No analyzer

FTTT

Chemical composition

FT

Measuring here is too late

An

alyz

er

An

alyz

er

An

alyz

er

An

alyz

er

Page 77: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

“It will eventually drain with the lowest holes loosing pressure last”

“It will be fully drained in 20.4 seconds and the pressure curve looks like this”

Technician Engineer

Technician vs. engineer

Page 78: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Technician answer

Reactor with cooling tubes

Usage of proxy sensor

Only tells us whether reaction rate increases or decreases

Is not precise enough to compare effectiveness of different attacks

Page 79: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Quest for engineering answer

0,00073; 0,00016; 0,0007…

Code in the controller

Optimization applications

Test process/plant

Page 80: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Engineering answer

Vinyl Acetate production

Page 81: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Product loss

Product per day: 96.000$

Product loss per day: 11.469,70$

Page 82: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Outcome of the damage stage

Product loss, 24 hours Steady-state attacks Periodic attacks

High, ≥ 10.000$ XMV {2} XMV {4;6}

Medium, 5.000$ - 10.000$ XMV {6;7} XMV {5;7}

Low, 2.000$ - 5.000$ - XMV {2}

Negligible, ≤ 2.000$ XMV {1;3} XMV {1;2}

Product per day: 96.000$

Still might be useful

Page 83: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Clean-up

Page 84: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Socio-technical system

• Maintenance stuff• Plant engineers• Process engineers• ….

Cyber-physical system

Controller

Operator

Page 85: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Creating forensics footprint

Process operators may get concerned after noticing persistent decrease in production and may try to fix the problem

If attacks are timed to a particular employee shift or maintenance work, plant employee will be investigated rather than the process

Page 86: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Creating forensics footprint

1. Pick several ways that the temperature can be increased

2. Wait for the scheduled instruments calibration

3. Perform the first attack

4. Wait for the maintenance guy being yelled at and recalibration to be repeated

5. Play next attack

6. Go to 4

Page 87: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Creating forensics footprint

Four different attacks

Page 88: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Defeating chemical forensics

If reactor doubted, chemical forensics guys will be asked to assist

Know metrics and methods of chemical investigators

Change attack patterns according to debugging efforts of plant personnel

Page 89: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Operator’s screens

Regulatoryfilings

Point database

Safety briefs

HistorianSmall

changes to the process

Realtime data from

sensors

Safety systems

SEC filingsProcess experts

Custom research

Final Payload

Custom operator

spoofs

Waiting for unusual events

Log tampering

Minimalprocess model

Accidentdata

Forensicfootprint

Discovery

Control

Damage

Cleanup

AccessICCP

Regulatory reporting

Just-in-time manufacturing

Wireless links

Page 90: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Afterword

Page 91: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

State-of-the-art of ICS security

TCP/IP

Page 92: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Food for thought

Cost of attack can quickly exceed cost of damageo Hacking into large number of deviceso Suppression of alarms and process data spoofingo Badly behaved control loops , synchronization of actions

Each process is unique, but…o There are instances of attacks applicable to wide range of scenarioso SCADA payloads for Metasploit is just a matter of time

Page 93: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

Dream BIG

Evil villains from James Bond movies unite! Go forth and start building your evil lairs.

Page 94: Marina Krotofil, Jason Larsen CON 23/DEF CON 23...Marina Krotofil, Jason Larsen DefCon 23, Las Vegas, USA 07.08.2015 Rocking the Pocket Book: Hacking Chemical Plants for Competition

TE: http://github.com/satejnik/DVCP-TEVAM: http://github.com/satejnik/DVCP-VAM

Damn Vulnerable Chemical Process

Thank [email protected]

[email protected]