cisco and ecole polytechnique · automatizing vulnerability research to better face new software...

29
Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / [email protected] Innova&on & Research Symposium Cisco and Ecole Polytechnique 8-9 April 2018

Upload: others

Post on 15-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Automatizing vulnerability researchto better face new software security challenges

CEDRICTESSIERINSTRUMENTATIONTEAMLEADER/[email protected]

Innova&on&ResearchSymposiumCiscoandEcolePolytechnique

8-9April2018

Page 2: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Software Security

• Data security depends on secure software

• Software contains bugs

• Some bugs are vulnerabilities

• software intended behaviour can be abused

�2

Page 3: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Vulnerabilities

• Unknown vulnerabilities will be discovered

• so-called 0 days

• A lot of them independently by several peoples

• contrary to popular opinion

• 0 days will be exploited in the wild

• NSA or CIA leaks

• Ransomware (WannaCry ETERNALBLUE)

�3

Page 4: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Vulnerability research

• motive (why)

• attack surface (where)

• knowledge (how)

• first move (when)

�4

Vulnerability research cannot be reserved to the bad guys…… as it will give them the advantage

Page 5: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Offensive Security

�5

• Deep complementarity

• Counterbalance bad guys advantages

• Increase the cost of attacks

• Knowledge is power“Ignorance has taken over Yo, we gotta take the power back!”

Rage Against the Machine

From a defensive only security paradigm…

…to both defensive AND offensive

Page 6: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Auditing Software

�6

Auditing software and finding vulnerabilities is crucial

“Who looks outside, knows nothing; who looks inside,glimpses the incredible waiting to be known.”

Carl Snow

Page 7: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Platforms Diversity

• Huge diversity of platforms

• toward the end of Wintel (Windows + Intel x86) era

• ARM's dominance on mobile markets

• MIPS, PowerPC, [your 90s architecture] still kicking

�7

Page 8: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Software Complexity

• Increasing complexity of the applications

• multi-megabyte software libraries are common

• web browsers are more like small operating systems

• Closed source binaries

• very common in the industry

• require reverse engineering

• but fewer eyes often means more bugs…

�8

Page 9: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Increased Difficulty

• Overall improvements over the past years

• more and more mitigations and compiler enhancements

• better development cycles (continuous bugs hunt)

• Finding exploitable bugs is more difficult

• low-hanging fruits less and less common

• yes, it’s bad news (think as a James Bond villain)

�9

Page 10: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Costs

• Bad guys have resources (sometimes much more than you think)

• criminal organizations

• state-sponsored groups

• military and secret services

• Good guys have limited resources (sometimes even less than you think)

• time (money)

• workforce

�10

Page 11: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Finding vulnerabilities

• Never-ending quest (growing code base)

• Renewed challenge (increasing difficulty)

• Competitive field (inflating investment)

�11

Innovation is mandatory

New tools and strategies are needed

Page 12: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Binary Analysis

• Dedicated tools

• disassembler

• debugger

• Specific techniques

• static analysis

• dynamic instrumentation

�12

Page 13: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

DBI

• Observe any state of a program anytime during runtime

• Automate the data collection and processing

�13

“Transformation of a program into its own measurement tool”

Page 14: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

QBDI

�14

QuarkslaB Dynamic binary Instrumentation

• Open-source

• Cross-platform

• macOS, Windows, Linux, Android and iOS

• Cross-architecture

• x86_64, ARM (more to come)

• Modular design (Unix philosophy)

Give it a try! https://qbdi.quarkslab.com/

Page 15: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Modularity

�15

• Only provides what is essential

• Don’t force users to do thing in your way

• Easy integration everywhere

Page 16: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Integration

�16

Page 17: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Fuzzing

• Fuzz testing software (aka fuzzing)

• injects randomized or mutated inputs

• provides a way to find bugs

• Completely automated

• input generation

• software execution

• crash (pre)analysis (or triage)

�17

Page 18: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

AFL

�18

• State-of-the-art fuzzer

• a reference in industry

• impressive trophies (openssl, openssh, …)

• Open-source© Michał Zalewski

Page 19: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

AFL

Guided Fuzzing

�19

INPUT BINARY PATH

Generate Execute Record

CRASH

Feed back

MUTATED INPUT

Page 20: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Smart Fuzzer

• Hybrid approach

• various brute force strategies (input mutation)

• genetic algorithm (input selection)

• Focus on inputs that produced new path

• Maximise code coverage (better results)

• Minimise search space (less time)

�20

aims at better efficiency

Page 21: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

AFL Limitations

• Pros:

• Fast (scale for thousand executions per second)

• Efficient (find bugs in real-world applications)

• Cons:

• Targets sources are required

• Portability

�21

Page 22: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

AFL/QBDI

• Targets closed source binaries

• Allows runtime optimizations (search space reduction)

• Reverse engineering needed (no sources)

• often minimal but mandatory when targeting internals

�22

AFL with QBDI as the instrumentation engine

Page 23: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Fuzzing Binaries

�23

Page 24: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Symbolic Execution

�24

• Analyzes software without running it

• Uses symbolic values instead of inputs (abstract interpretation)

• Represents computations as expressions

bvadd

bv

1 8

bvxor

bv bv

10 8 20 8

mov al, 1 mov cl, 10 mov dl, 20 xor cl, dl add al, cl

Page 25: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Triton

• Cross-platform (macOS, Windows, Linux)

• Dynamic Symbolic Execution (DSE) engine

• Integrated constraints solver interface

�25

Open-source dynamic binary analysis framework

Page 26: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Constraints Solving

�26

• Taking a path or not depends on conditions

• Conditions create path constraints

• Symbolic expressions can represent constraints

• Constraints can be solved symbolically (SAT solvers)

y = input[0]; z = y - 42; if (z == 0) { crash(); }

z == 0 ? y = 42

Page 27: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Improving AFL

• New kind of hybrid approach

• discovering paths with AFL/QBDI

• solve unsatisfied path constraints with Triton

• Inspired by Shellphish’s Driller

• used in 2016 DARPA's Cyber Grand Challenge

�27

Page 28: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com

Innovation & Research Symposium 2018 - Cisco and Ecole Polytechnique

Scalability

�28

• Scalability is a major challenge

• path explosion (both in AFL and symbolic execution)

• amount of generated data

• Machine learning is essential to vulnerability research

• it is making it more efficient today

• it will make it more scalable tomorrow

Page 29: Cisco and Ecole Polytechnique · Automatizing vulnerability research to better face new software security challenges CEDRIC TESSIER INSTRUMENTATION TEAM LEADER / ctessier@quarkslab.com