SlideShare a Scribd company logo
Code Obfuscation Against Symbolic Execution Attacks
Sebastian Banescu1, Christian Collberg2, Vijay Ganesh3,
Zack Newsham3, Alexander Pretschner1
1 Technical University of Munich, Germany
2 University of Arizona, Tucson, AZ, USA
3 University of Waterloo, Ontario, Canada
Research Questions
1. How do we measure obfuscation strength?
2. Which obfuscation transformations are stronger? Why?
3. Are combinations of obfuscation transformations stronger?
4. How many obfuscation transformations should one combine?
5. Can we build stronger obfuscation transformations?
2
Introduction
• Many obfuscation transformations available
• Malware developers combine them to generate millions of malware variants
• Human-assisted analysis of all variants unscalable
• Automated analysis must be employed
3
Automated Analysis Attacks
4
Deobfuscation Attack Goals
• Simplify control-flow graph
• Identify & disable tamper-proofing checks
• Bypass authentication checks / trigger conditions
5
Simplify Control-Flow Graph (Yadegari et al. 2015)
1. Explore paths such that all code is covered
2. Simplify traces using compiler optimization tricks
3. Reconstruct CFG from traces
6
Identify Tamper-Proofing Checks (Qiu et al. 2015)
1. Taint code segment
2. Explore paths until enough self-checks disabled
(cyclic checks → explore all code)
3. Disable self-checking instructions
7
Symbolic / Concolic Execution
8
1. Make variables (inputs) symbolic
2. Collect path constraints during execution
3. Solve path constrains w. SMT solver → concrete values (test cases)
int main(int ac, char* av[]){
int a = atoi(av[1]); // symbolic
int b = atoi(av[2]); // symbolic
int c = atoi(av[3]); // symbolic
if (a > b)
a = a - b;
if (b < 1) {
if (c != a) {
c = a + b;
}
}
b = 1;
return 0;
}
Bypass Authentication Checks (Banescu et al. 2015)
1. Make password symbolic
2. Explore paths until desired instruction (sequence) is found
3. Solve path constraints on paths that lead to desired instruction via SMT solver
4. Find satisfiable path constraints → concrete inputs to bypass check
9
A Common Sub-Problem of Deobfuscation Attacks
• Common sub-problem: path exploration
• How do we explore paths of a given program?
• Generate test cases:
 Black-box test generation: Fuzzing, Random testing
 White-box test generation: Symbolic/Concolic execution
10
VS
Measuring Obfuscation Strength
• Strength of obfuscation: increase in test case generation time
• Observation: Generally, obfuscation does not change input-output behavior
→ No increase in black-box test case generation time
• Example:
• Observation: Could be faster to use black-box test generator than white-box
• Conclusion: Apply obfuscation transformations until white-box slower than
black-box test case generation
11
if (arg[1][0] > 127)
// do this
else
// do that
Obfuscator
Obfuscated
Program
Code Tampering Attacks
• Question: Why do we need code obfuscation? Just use cryptographic hash
• Example:
• Hard for symbolic execution (SMT solver) to break crypto hash functions
• Answer:
 Test case generation is non-invasive attack, i.e. code is read, not changed
 Obfuscation aims to defend against MATE attacker (can tamper with code)
 Easy to find and patch-out crypto hash functions
12
if (SHA256(arg[1]) == 0xa49…3793)
// do this
else
// do that
Experiments
13
Overview of Experiments
• Datasets of programs:
1. Manually crafted 48 small programs (heterogeneous)
2. Randomly generated 5761 larger programs (homogeneous)
• Obfuscation tools:
1. Tigress C Obfuscator / Virtualizer (source code level)
2. Obfuscator-LLVM (LLVM IR level)
• Symbolic execution tools:
1. KLEE (LLVM IR level)
2. Angr (binary level)
3. Triton (binary level)
14
Description of Experiment 1
• Attacker goal: 100% code coverage → CFG recovery, remove all self-checks
• Obfuscated programs in 1st dataset with:
 30 combinations of 5 obfuscation transformations from Tigress
 Opaque predicates
 Encode literals
 Encode arithmetic
 Control flow flattening
 Virtualization
 9 combinations of 3 obfuscation transformations from Obfuscator-LLVM
 Instruction substitution
 Control flow flattening
 Bogus control flow
 48 original programs x 39 obfuscations + 48 original programs = 1920
• Ran KLEE 10x on each of the 1920 programs → recorded time, mem. size …
15
Results of Experiment 1
• Opaque predicates and virtualization have highest increase in program size
• Opaque predicates and encode literals have smallest impact on symbolic execution time
• Flattening and virtualization (also combined w. other transformations) increase time
• % time waiting for solver increased by flattening and encode arithmetic, decreased by virt.
• Flattening increases number of queries sent to SMT solver
• Encode arithmetic increases size of queries sent to SMT solver
16
Tigress Obfuscator-LLVM
Description of Experiment 2
• Attacker goal: find test for “winning” path → bypass license check
• Obfuscated programs in 2nd dataset with:
 5 obfuscation transformations from Tigress
 Opaque predicates
 Encode literals
 Encode arithmetic
 Control flow flattening
 Virtualization
 5761 programs x 5 obfuscations + 5761 programs = 34 566 programs
• Ran symbolic execution tools:
1. KLEE (LLVM IR level)
2. Angr (binary level)
3. Triton (binary level)
17
Results of Experiment 2
• Triton ran out of memory when given larger obfuscated programs
• KLEE and angr only successfully analyzed 12.713 obfuscated programs
• Data types of variables and type of operators influence symbolic execution time
• KLEE incurs overall lower slowdown than angr (also requires less memory)
• Slowdown for finding “winning” path is lower than slowdown for 100% code coverage
18
Key Observation from Experiments
Observation: Number of path constraints are the same for all obfuscated and
original programs
Reason: Obfuscation transformations do not introduce new paths dependent on
symbolic values
Idea: Introduce new paths dependent on symbolic values!
19
Conclusions
• Test case generation is a common sub-goal of 3 deobfuscation attacks
• Used 2 datasets of small programs to compare obfuscation and attack impl.:
 Opaque predicates, instruction substitution and encode literals not good
 Virtualization, flattening and encode arithmetic better
 KLEE slightly faster than Angr
• Remark: Obfuscation transformations don’t introduce input dependent paths
• Proposed obfuscation transformations to raise the bar for sym-exec
• Future work:
 Use real-world programs
 Binary obfuscators (e.g. Themida)
 Other automated attacks (e.g. active / tampering attacks)
20
21
Thank you for your attention!
Questions?
21

More Related Content

What's hot

Compiler for Zero-Knowledge Proof-of-Knowledge Protocols
Compiler for Zero-Knowledge Proof-of-Knowledge ProtocolsCompiler for Zero-Knowledge Proof-of-Knowledge Protocols
Compiler for Zero-Knowledge Proof-of-Knowledge Protocols
Thomas Briner
 
Calculation of Cyclomatic complexity
Calculation of Cyclomatic complexityCalculation of Cyclomatic complexity
Calculation of Cyclomatic complexity
nikshaikh786
 
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
Stefano Dalla Palma
 
Benchmarking with JMH (riviera dev 2017)
Benchmarking with JMH (riviera dev 2017)Benchmarking with JMH (riviera dev 2017)
Benchmarking with JMH (riviera dev 2017)
Nenad Bogojevic
 
Comparing Reuse Mechanisms for Model Transformation Languages: Design for an ...
Comparing Reuse Mechanisms for Model Transformation Languages: Design for an ...Comparing Reuse Mechanisms for Model Transformation Languages: Design for an ...
Comparing Reuse Mechanisms for Model Transformation Languages: Design for an ...
Daniel G. Strüber
 
Triantafyllia Voulibasi
Triantafyllia VoulibasiTriantafyllia Voulibasi
Triantafyllia Voulibasi
ISSEL
 
Programming using MPI and OpenMP
Programming using MPI and OpenMPProgramming using MPI and OpenMP
Programming using MPI and OpenMP
Divya Tiwari
 
Scalable concurrency control in a dynamic membership
Scalable concurrency control  in a dynamic membershipScalable concurrency control  in a dynamic membership
Scalable concurrency control in a dynamic membershipAugusto Ciuffoletti
 
Protecting JavaScript source code using obfuscation - OWASP Europe Tour 2013 ...
Protecting JavaScript source code using obfuscation - OWASP Europe Tour 2013 ...Protecting JavaScript source code using obfuscation - OWASP Europe Tour 2013 ...
Protecting JavaScript source code using obfuscation - OWASP Europe Tour 2013 ...
AuditMark
 
A simple tool for debug (tap>)
A simple tool for debug (tap>)A simple tool for debug (tap>)
A simple tool for debug (tap>)
Laurence Chen
 
The Psychology of C# Analysis
The Psychology of C# AnalysisThe Psychology of C# Analysis
The Psychology of C# Analysis
Coverity
 
Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage" Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage"
Rapita Systems Ltd
 
Qat09 presentations dxw07u
Qat09 presentations dxw07uQat09 presentations dxw07u
Qat09 presentations dxw07uShubham Sharma
 
Decision Making & Loops
Decision Making & LoopsDecision Making & Loops
Decision Making & Loops
Akhil Kaushik
 
Data Generation with PROSPECT: a Probability Specification Tool
Data Generation with PROSPECT: a Probability Specification ToolData Generation with PROSPECT: a Probability Specification Tool
Data Generation with PROSPECT: a Probability Specification Tool
Ivan Ruchkin
 
On component interface
On component interfaceOn component interface
On component interface
Laurence Chen
 
Magic behind the numbers - software metrics in practice
Magic behind the numbers - software metrics in practiceMagic behind the numbers - software metrics in practice
Magic behind the numbers - software metrics in practice
Sebastian Marek
 
Information and data security pseudorandom number generation and stream cipher
Information and data security pseudorandom number generation and stream cipherInformation and data security pseudorandom number generation and stream cipher
Information and data security pseudorandom number generation and stream cipher
Mazin Alwaaly
 
Tools and techniques of code coverage testing
Tools and techniques of code coverage testingTools and techniques of code coverage testing
Tools and techniques of code coverage testing
IAEME Publication
 
Sequence to Sequence Pattern Learning Algorithm for Real-time Anomaly Detecti...
Sequence to Sequence Pattern Learning Algorithm for Real-time Anomaly Detecti...Sequence to Sequence Pattern Learning Algorithm for Real-time Anomaly Detecti...
Sequence to Sequence Pattern Learning Algorithm for Real-time Anomaly Detecti...
Gobinath Loganathan
 

What's hot (20)

Compiler for Zero-Knowledge Proof-of-Knowledge Protocols
Compiler for Zero-Knowledge Proof-of-Knowledge ProtocolsCompiler for Zero-Knowledge Proof-of-Knowledge Protocols
Compiler for Zero-Knowledge Proof-of-Knowledge Protocols
 
Calculation of Cyclomatic complexity
Calculation of Cyclomatic complexityCalculation of Cyclomatic complexity
Calculation of Cyclomatic complexity
 
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
 
Benchmarking with JMH (riviera dev 2017)
Benchmarking with JMH (riviera dev 2017)Benchmarking with JMH (riviera dev 2017)
Benchmarking with JMH (riviera dev 2017)
 
Comparing Reuse Mechanisms for Model Transformation Languages: Design for an ...
Comparing Reuse Mechanisms for Model Transformation Languages: Design for an ...Comparing Reuse Mechanisms for Model Transformation Languages: Design for an ...
Comparing Reuse Mechanisms for Model Transformation Languages: Design for an ...
 
Triantafyllia Voulibasi
Triantafyllia VoulibasiTriantafyllia Voulibasi
Triantafyllia Voulibasi
 
Programming using MPI and OpenMP
Programming using MPI and OpenMPProgramming using MPI and OpenMP
Programming using MPI and OpenMP
 
Scalable concurrency control in a dynamic membership
Scalable concurrency control  in a dynamic membershipScalable concurrency control  in a dynamic membership
Scalable concurrency control in a dynamic membership
 
Protecting JavaScript source code using obfuscation - OWASP Europe Tour 2013 ...
Protecting JavaScript source code using obfuscation - OWASP Europe Tour 2013 ...Protecting JavaScript source code using obfuscation - OWASP Europe Tour 2013 ...
Protecting JavaScript source code using obfuscation - OWASP Europe Tour 2013 ...
 
A simple tool for debug (tap>)
A simple tool for debug (tap>)A simple tool for debug (tap>)
A simple tool for debug (tap>)
 
The Psychology of C# Analysis
The Psychology of C# AnalysisThe Psychology of C# Analysis
The Psychology of C# Analysis
 
Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage" Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage"
 
Qat09 presentations dxw07u
Qat09 presentations dxw07uQat09 presentations dxw07u
Qat09 presentations dxw07u
 
Decision Making & Loops
Decision Making & LoopsDecision Making & Loops
Decision Making & Loops
 
Data Generation with PROSPECT: a Probability Specification Tool
Data Generation with PROSPECT: a Probability Specification ToolData Generation with PROSPECT: a Probability Specification Tool
Data Generation with PROSPECT: a Probability Specification Tool
 
On component interface
On component interfaceOn component interface
On component interface
 
Magic behind the numbers - software metrics in practice
Magic behind the numbers - software metrics in practiceMagic behind the numbers - software metrics in practice
Magic behind the numbers - software metrics in practice
 
Information and data security pseudorandom number generation and stream cipher
Information and data security pseudorandom number generation and stream cipherInformation and data security pseudorandom number generation and stream cipher
Information and data security pseudorandom number generation and stream cipher
 
Tools and techniques of code coverage testing
Tools and techniques of code coverage testingTools and techniques of code coverage testing
Tools and techniques of code coverage testing
 
Sequence to Sequence Pattern Learning Algorithm for Real-time Anomaly Detecti...
Sequence to Sequence Pattern Learning Algorithm for Real-time Anomaly Detecti...Sequence to Sequence Pattern Learning Algorithm for Real-time Anomaly Detecti...
Sequence to Sequence Pattern Learning Algorithm for Real-time Anomaly Detecti...
 

Similar to ACSAC2016: Code Obfuscation Against Symbolic Execution Attacks

How to hack cryptographic protocols with Formal Methods
How to hack cryptographic protocols with Formal MethodsHow to hack cryptographic protocols with Formal Methods
How to hack cryptographic protocols with Formal Methods
Ofer Rivlin, CISSP
 
Effective and Efficient API Misuse Detection via Exception Propagation and Se...
Effective and Efficient API Misuse Detection via Exception Propagation and Se...Effective and Efficient API Misuse Detection via Exception Propagation and Se...
Effective and Efficient API Misuse Detection via Exception Propagation and Se...
XavierDevroey
 
Vulnerability Detection Based on Git History
Vulnerability Detection Based on Git HistoryVulnerability Detection Based on Git History
Vulnerability Detection Based on Git History
Kenta Yamamoto
 
CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019
Olivera Milenkovic
 
The Future of Automated Malware Generation
The Future of Automated Malware GenerationThe Future of Automated Malware Generation
The Future of Automated Malware GenerationStephan Chenette
 
B-Sides Seattle 2012 Offensive Defense
B-Sides Seattle 2012 Offensive DefenseB-Sides Seattle 2012 Offensive Defense
B-Sides Seattle 2012 Offensive Defense
Stephan Chenette
 
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
TEST Huddle
 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
asifusman1998
 
Improving the accuracy and reliability of data analysis code
Improving the accuracy and reliability of data analysis codeImproving the accuracy and reliability of data analysis code
Improving the accuracy and reliability of data analysis code
Johan Carlin
 
Unit 2 Unit level testing.ppt
Unit 2 Unit level testing.pptUnit 2 Unit level testing.ppt
Unit 2 Unit level testing.ppt
PerfectMe2
 
Foundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose ApplicationsFoundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose ApplicationsChing-Hwa Yu
 
Software testing: an introduction - 2017
Software testing: an introduction - 2017Software testing: an introduction - 2017
Software testing: an introduction - 2017
XavierDevroey
 
Instrumentation & the Pitfalls of Abstraction
Instrumentation & the Pitfalls of AbstractionInstrumentation & the Pitfalls of Abstraction
Instrumentation & the Pitfalls of Abstraction
ESUG
 
Compeition-Level Code Generation with AlphaCode.pptx
Compeition-Level Code Generation with AlphaCode.pptxCompeition-Level Code Generation with AlphaCode.pptx
Compeition-Level Code Generation with AlphaCode.pptx
San Kim
 
SSBSE 2020 keynote
SSBSE 2020 keynoteSSBSE 2020 keynote
SSBSE 2020 keynote
Shiva Nejati
 
Mutation Testing and MuJava
Mutation Testing and MuJavaMutation Testing and MuJava
Mutation Testing and MuJava
Krunal Parmar
 
Assessing Unit Test Quality
Assessing Unit Test QualityAssessing Unit Test Quality
Assessing Unit Test Qualityguest268ee8
 

Similar to ACSAC2016: Code Obfuscation Against Symbolic Execution Attacks (20)

How to hack cryptographic protocols with Formal Methods
How to hack cryptographic protocols with Formal MethodsHow to hack cryptographic protocols with Formal Methods
How to hack cryptographic protocols with Formal Methods
 
Effective and Efficient API Misuse Detection via Exception Propagation and Se...
Effective and Efficient API Misuse Detection via Exception Propagation and Se...Effective and Efficient API Misuse Detection via Exception Propagation and Se...
Effective and Efficient API Misuse Detection via Exception Propagation and Se...
 
Introduction to White box testing
Introduction to White box testingIntroduction to White box testing
Introduction to White box testing
 
Vulnerability Detection Based on Git History
Vulnerability Detection Based on Git HistoryVulnerability Detection Based on Git History
Vulnerability Detection Based on Git History
 
CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019
 
The Future of Automated Malware Generation
The Future of Automated Malware GenerationThe Future of Automated Malware Generation
The Future of Automated Malware Generation
 
Fault tolerance
Fault toleranceFault tolerance
Fault tolerance
 
B-Sides Seattle 2012 Offensive Defense
B-Sides Seattle 2012 Offensive DefenseB-Sides Seattle 2012 Offensive Defense
B-Sides Seattle 2012 Offensive Defense
 
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
 
Improving the accuracy and reliability of data analysis code
Improving the accuracy and reliability of data analysis codeImproving the accuracy and reliability of data analysis code
Improving the accuracy and reliability of data analysis code
 
Unit 2 Unit level testing.ppt
Unit 2 Unit level testing.pptUnit 2 Unit level testing.ppt
Unit 2 Unit level testing.ppt
 
Unit 6
Unit 6Unit 6
Unit 6
 
Foundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose ApplicationsFoundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose Applications
 
Software testing: an introduction - 2017
Software testing: an introduction - 2017Software testing: an introduction - 2017
Software testing: an introduction - 2017
 
Instrumentation & the Pitfalls of Abstraction
Instrumentation & the Pitfalls of AbstractionInstrumentation & the Pitfalls of Abstraction
Instrumentation & the Pitfalls of Abstraction
 
Compeition-Level Code Generation with AlphaCode.pptx
Compeition-Level Code Generation with AlphaCode.pptxCompeition-Level Code Generation with AlphaCode.pptx
Compeition-Level Code Generation with AlphaCode.pptx
 
SSBSE 2020 keynote
SSBSE 2020 keynoteSSBSE 2020 keynote
SSBSE 2020 keynote
 
Mutation Testing and MuJava
Mutation Testing and MuJavaMutation Testing and MuJava
Mutation Testing and MuJava
 
Assessing Unit Test Quality
Assessing Unit Test QualityAssessing Unit Test Quality
Assessing Unit Test Quality
 

Recently uploaded

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 

Recently uploaded (20)

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 

ACSAC2016: Code Obfuscation Against Symbolic Execution Attacks

  • 1. Code Obfuscation Against Symbolic Execution Attacks Sebastian Banescu1, Christian Collberg2, Vijay Ganesh3, Zack Newsham3, Alexander Pretschner1 1 Technical University of Munich, Germany 2 University of Arizona, Tucson, AZ, USA 3 University of Waterloo, Ontario, Canada
  • 2. Research Questions 1. How do we measure obfuscation strength? 2. Which obfuscation transformations are stronger? Why? 3. Are combinations of obfuscation transformations stronger? 4. How many obfuscation transformations should one combine? 5. Can we build stronger obfuscation transformations? 2
  • 3. Introduction • Many obfuscation transformations available • Malware developers combine them to generate millions of malware variants • Human-assisted analysis of all variants unscalable • Automated analysis must be employed 3
  • 5. Deobfuscation Attack Goals • Simplify control-flow graph • Identify & disable tamper-proofing checks • Bypass authentication checks / trigger conditions 5
  • 6. Simplify Control-Flow Graph (Yadegari et al. 2015) 1. Explore paths such that all code is covered 2. Simplify traces using compiler optimization tricks 3. Reconstruct CFG from traces 6
  • 7. Identify Tamper-Proofing Checks (Qiu et al. 2015) 1. Taint code segment 2. Explore paths until enough self-checks disabled (cyclic checks → explore all code) 3. Disable self-checking instructions 7
  • 8. Symbolic / Concolic Execution 8 1. Make variables (inputs) symbolic 2. Collect path constraints during execution 3. Solve path constrains w. SMT solver → concrete values (test cases) int main(int ac, char* av[]){ int a = atoi(av[1]); // symbolic int b = atoi(av[2]); // symbolic int c = atoi(av[3]); // symbolic if (a > b) a = a - b; if (b < 1) { if (c != a) { c = a + b; } } b = 1; return 0; }
  • 9. Bypass Authentication Checks (Banescu et al. 2015) 1. Make password symbolic 2. Explore paths until desired instruction (sequence) is found 3. Solve path constraints on paths that lead to desired instruction via SMT solver 4. Find satisfiable path constraints → concrete inputs to bypass check 9
  • 10. A Common Sub-Problem of Deobfuscation Attacks • Common sub-problem: path exploration • How do we explore paths of a given program? • Generate test cases:  Black-box test generation: Fuzzing, Random testing  White-box test generation: Symbolic/Concolic execution 10 VS
  • 11. Measuring Obfuscation Strength • Strength of obfuscation: increase in test case generation time • Observation: Generally, obfuscation does not change input-output behavior → No increase in black-box test case generation time • Example: • Observation: Could be faster to use black-box test generator than white-box • Conclusion: Apply obfuscation transformations until white-box slower than black-box test case generation 11 if (arg[1][0] > 127) // do this else // do that Obfuscator Obfuscated Program
  • 12. Code Tampering Attacks • Question: Why do we need code obfuscation? Just use cryptographic hash • Example: • Hard for symbolic execution (SMT solver) to break crypto hash functions • Answer:  Test case generation is non-invasive attack, i.e. code is read, not changed  Obfuscation aims to defend against MATE attacker (can tamper with code)  Easy to find and patch-out crypto hash functions 12 if (SHA256(arg[1]) == 0xa49…3793) // do this else // do that
  • 14. Overview of Experiments • Datasets of programs: 1. Manually crafted 48 small programs (heterogeneous) 2. Randomly generated 5761 larger programs (homogeneous) • Obfuscation tools: 1. Tigress C Obfuscator / Virtualizer (source code level) 2. Obfuscator-LLVM (LLVM IR level) • Symbolic execution tools: 1. KLEE (LLVM IR level) 2. Angr (binary level) 3. Triton (binary level) 14
  • 15. Description of Experiment 1 • Attacker goal: 100% code coverage → CFG recovery, remove all self-checks • Obfuscated programs in 1st dataset with:  30 combinations of 5 obfuscation transformations from Tigress  Opaque predicates  Encode literals  Encode arithmetic  Control flow flattening  Virtualization  9 combinations of 3 obfuscation transformations from Obfuscator-LLVM  Instruction substitution  Control flow flattening  Bogus control flow  48 original programs x 39 obfuscations + 48 original programs = 1920 • Ran KLEE 10x on each of the 1920 programs → recorded time, mem. size … 15
  • 16. Results of Experiment 1 • Opaque predicates and virtualization have highest increase in program size • Opaque predicates and encode literals have smallest impact on symbolic execution time • Flattening and virtualization (also combined w. other transformations) increase time • % time waiting for solver increased by flattening and encode arithmetic, decreased by virt. • Flattening increases number of queries sent to SMT solver • Encode arithmetic increases size of queries sent to SMT solver 16 Tigress Obfuscator-LLVM
  • 17. Description of Experiment 2 • Attacker goal: find test for “winning” path → bypass license check • Obfuscated programs in 2nd dataset with:  5 obfuscation transformations from Tigress  Opaque predicates  Encode literals  Encode arithmetic  Control flow flattening  Virtualization  5761 programs x 5 obfuscations + 5761 programs = 34 566 programs • Ran symbolic execution tools: 1. KLEE (LLVM IR level) 2. Angr (binary level) 3. Triton (binary level) 17
  • 18. Results of Experiment 2 • Triton ran out of memory when given larger obfuscated programs • KLEE and angr only successfully analyzed 12.713 obfuscated programs • Data types of variables and type of operators influence symbolic execution time • KLEE incurs overall lower slowdown than angr (also requires less memory) • Slowdown for finding “winning” path is lower than slowdown for 100% code coverage 18
  • 19. Key Observation from Experiments Observation: Number of path constraints are the same for all obfuscated and original programs Reason: Obfuscation transformations do not introduce new paths dependent on symbolic values Idea: Introduce new paths dependent on symbolic values! 19
  • 20. Conclusions • Test case generation is a common sub-goal of 3 deobfuscation attacks • Used 2 datasets of small programs to compare obfuscation and attack impl.:  Opaque predicates, instruction substitution and encode literals not good  Virtualization, flattening and encode arithmetic better  KLEE slightly faster than Angr • Remark: Obfuscation transformations don’t introduce input dependent paths • Proposed obfuscation transformations to raise the bar for sym-exec • Future work:  Use real-world programs  Binary obfuscators (e.g. Themida)  Other automated attacks (e.g. active / tampering attacks) 20
  • 21. 21 Thank you for your attention! Questions? 21