Code Obfuscation. Mayur Kamat Nishant Kumar



Similar documents
Software Protection through Code Obfuscation

Implementation of an Obfuscation Tool for C/C++ Source Code Protection on the XScale Architecture *

Introduction to Program Obfuscation

Code Obfuscation Literature Survey

Software Code Protection Through Software Obfuscation

SOURCE CODE OBFUSCATION BY MEAN OF EVOLUTIONARY ALGORITHMS

Applications of obfuscation to software and hardware systems

Lecture 12: Software protection techniques. Software piracy protection Protection against reverse engineering of software

Obfuscation of Abstract Data-Types

Obfuscating C++ Programs via Control Flow Flattening

OBFUSCATING C++ PROGRAMS VIA CONTROL FLOW FLATTENING

Design of Java Obfuscator MANGINS++ - A novel tool to secure code

Obfuscation: know your enemy

Using Evolutionary Algorithms to obfuscate code

Platform Independent Code Obfuscation

Surreptitious Software

Static Analysis of Virtualization- Obfuscated Binaries

Obfuscation by Partial Evaluation of Distorted Interpreters

Software Reverse Engineering

DATA OBFUSCATION. What is data obfuscation?

Secret Communication through Web Pages Using Special Space Codes in HTML Files

Introduction to Computers and Programming. Testing

An Iteration Obfuscation Based on Instruction Fragment Diversification and Control Flow Randomization

LASTLINE WHITEPAPER. Why Anti-Virus Solutions Based on Static Signatures Are Easy to Evade

C++ INTERVIEW QUESTIONS

Efficient Data Structures for Decision Diagrams

What is Software Watermarking? Software Watermarking Through Register Allocation: Implementation, Analysis, and Attacks

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

Next-Generation Protection Against Reverse Engineering

2) Write in detail the issues in the design of code generator.

Overview. What is software testing? What is unit testing? Why/when to test? What makes a good test? What to test?

Qiong Liu, Reihaneh Safavi Naini and Nicholas Paul Sheppard Australasian Information Security Workshop Presented by An In seok

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

2) trusted network, resilient against large scale Denial of Service attacks

MULTIFACTOR AUTHENTICATION FOR SOFTWARE PROTECTION

You are to simulate the process by making a record of the balls chosen, in the sequence in which they are chosen. Typical output for a run would be:

A Survey of Anti-Tamper Technologies

Pseudo code Tutorial and Exercises Teacher s Version

Test case design techniques I: Whitebox testing CISS

Introduction to Parallel Programming and MapReduce

Higher Computing Science Course Assessment Specification (C716 76)

k-gram Based Software Birthmarks

CHAPTER 5 INTELLIGENT TECHNIQUES TO PREVENT SQL INJECTION ATTACKS

Assessment of Data Obfuscation with Residue Number Coding

Lecture Notes on Linear Search

Man at the end (MATE) attacks are an understudied

Software Assurance Tools: Web Application Security Scanner Functional Specification Version 1.0

AP Computer Science Java Mr. Clausen Program 9A, 9B

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

Object Oriented Design

2 SYSTEM DESCRIPTION TECHNIQUES

Parasitics: The Next Generation. Vitaly Zaytsev Abhishek Karnik Joshua Phillips

1 Description of The Simpletron

Masters programmes in Computer Science and Information Systems. Object-Oriented Design and Programming. Sample module entry test xxth December 2013

Oracle Database Security Services

Software Metrics. Lord Kelvin, a physicist. George Miller, a psychologist

How To Ensure Correctness Of Data In The Cloud

Lab Experience 17. Programming Language Translation

AGENDA. Background. The Attack Surface. Case Studies. Binary Protections. Bypasses. Conclusions

Software Testing Strategies and Techniques

CHASE Survey on 6 Most Important Topics in Hardware Security

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is

Sequential Data Structures

Case studies: Outline. Requirement Engineering. Case Study: Automated Banking System. UML and Case Studies ITNP090 - Object Oriented Software Design

PES Institute of Technology-BSC QUESTION BANK

Lab 4.4 Secret Messages: Indexing, Arrays, and Iteration

An Open Framework for Reverse Engineering Graph Data Visualization. Alexandru C. Telea Eindhoven University of Technology The Netherlands.

Stacks. Linear data structures

1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D.

CSE 880. Advanced Database Systems. Active Database Design Issues

BCS2B02: OOP Concepts and Data Structures Using C++

Intrusion Detection Systems

Cohort: BCA/07B/PT - BCA/06/PT - BCNS/06/FT - BCNS/05/FT - BIS/06/FT - BIS/05/FT - BSE/05/FT - BSE/04/PT-BSE/06/FT

WebSphere Business Monitor

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void

Initial Roadmap: Point-to-Point Encryption Technology and PCI DSS Compliance

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

MongoDB Aggregation and Data Processing Release 3.0.4

RIA SECURITY TECHNOLOGY

Moving from CS 61A Scheme to CS 61B Java

Organization of Programming Languages CS320/520N. Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science

Transcription:

Code Obfuscation Mayur Kamat Nishant Kumar

Agenda Malicious Host Problem Code Obfuscation Watermarking and Tamper Proofing Market solutions

Traditional Network Security Problem Hostile Network

Malicious Host Hostile Network Hostile User

Motivation Intellectual Property Protection Under threat in various forms Reverse engineering Tampering Software Piracy Loss of revenue and finally an overall loss

Code under Attack Tampering Reverse Engineering Software Piracy

Legal battles No Electronic Theft (NET) Protection Digital Millennium Copyright Act (DMCA) Technical Protection Server-Side Protection Encryption Native Code Obfuscation

Server-Side Protection

Encryption

Native Code

Obfuscation

Definition T P P is an obfuscating transformation if If P fails to terminate or terminates with error, then P may or may not terminate Otherwise, P must terminate and produce same output as P

Measuring Obfuscation Obfuscation can be measured as sum of the following: Potency ( E(P )/E(P) 1) Resilience ( trivial, weak, strong, full, 1-way) Cost ( free, cheap, costly, dear ) Stealth

Forget about good software engineering principles

Software metrics Complexity of software increases: Program length No. of operators and operands. Data flow complexity Number of inter-block variable references. Cyclomatic complexity Number of predicates in a function. Nesting complexity Number of nesting level of conditionals in a program.

Software metrics Data structure complexity Complexity of the static data structures in the program like variables, vectors, records. OO Metrics Level of inheritance Coupling Number of methods triggered by another method Non-cohesiveness

Obfuscation Categories Layout Obfuscation Data Obfuscation Control Obfuscation Preventive Obfuscation

Layout Obfuscation Aimed at making the code unreadable Formatting Change (low, one-way, free) Layout Remove Comments (high, one-way, free) Scramble Identifiers (high, one-way, free)

Data Obfuscation Aimed at obscuring data and data structures Storage Data Obfuscation Aggregation Ordering Encoding

Storage & Encoding - 1 Split variables Transform single variable : v = [(v1, v2.. vk)] Increases Potency Required to provide extra functions for variable mapping ( higher cost) Original Bool a, b, c a = true, b = false, c = true Obfuscated Short a1, a2, a3, b1, b2, c1, c2 a1 = a2=a3 = true,.. c = a & b c1 = ( (a1 ^ a2 ) ^ a3) & ( b1 ^ b2) c2 = c1

Storage and Encoding- 2 Convert Static into Procedural Lots of information conveyed through static variables Convert into function call High potency and resilience ( depends on function) Actual String t = Net Obfuscated String retstr(int i) { string s; s[1] = N ; s[2] = e ; s[3] = t ;}

Storage and Encoding- 3 Other important methods are Scalers to Objects Changing encoding Changing Variable Lifetimes.

Array Transformation Modifying Inheritance Merging scalar variables Aggregation & Reordering - 1 Reordering execution sequence

Array Transformation Aggregation & Reordering - 2 Splitting & folding ( increases potency) Merging & flattening ( decreases potency) Actual 1 2 7 8 9 Obfuscated 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 7 8 9

Aggregation & Reordering - 3 Inheritance Split a class

Aggregation & Reordering - 4 Inheritance Insert a class

Control Obfuscation Aimed at obfuscating the flow of execution Aggregation Control Ordering Computation

Opaque Construct Obfuscator knows the outcome but very hard for de-obfuscator to predict. Makes it resilient Makes it costly adding additional code. { } int v, a= 5, b= 6; v =11 = a + b; if ( b > 5 ) T if ( random ( 1, 5) < 0 ) F.

Redundant Code Introducing opaque predicates Introducing multiple obfuscated loops Introducing buggy loops

Inline and Outline Inline: removes procedural abstraction. Outline: creates bogus procedural abstraction. High resilience

Cloning Other Control Obfuscation methods Interleaving Methods Non-reducible Flow Graphs

Preventive Obfuscation Works by trying to break the known deobfuscation techniques. Preventive Targeted Inherent

In the example Added bogus data Inherent Prevented de-obfuscator from automatic analysis Actual Code For ( i = 1; i<= 10; i++) A[i] = I; Obfuscated Code Int B[50] For (i=10; i>= 1; i--) { A[i] = I; B[i] += B[i*i/2];}

Target It targets specific de-obfuscating programs E.g. HoseMocha example Crashes if we add any code after return statement

Cost of obfuscation Execution time Why don t we use obfuscation High program complexity Effort More $$$ Ignorance

Solutions to Malicious Host Code Obfuscation Digital Rights Management Tamper -Proofing Watermarking

Watermarking Seed = 1923456 Software Seed = 5467894 Seed = 1675856 Seed = 5467894

Tamper - Proofing Key component of client-side security User is assumed to have sufficient time, resources and inclination to subvert protection www.cracks.am Demonstrates need for stronger protection against reverse engineering

Tamper-Proofing Reverse Engineering Attack P S P S T P Software Auth Module (SAM) Tamper-Proof SAM

Commercial Applications Code Obfuscators Zelix Klassmaster Semantic Design Digital Rights Management Windows RMS Lockbox Apple s itunes Tamper Proofing Cloakware Watermarking Digimarc

Conclusion Malicious host presents new security threats Code obfuscation makes reverse engineering difficult Watermarking and tamper-proofing address issues of software piracy and tampering respectively Still an inchoative field

References [1] Collberg, C., Thomberson, C., Low, D., A Taxonomy of Obfuscating Transformation, Technical Report # 148, 1997 [2] Wang, C., A Security Architecture of Survivability Mechanisms, PhD thesis, University of Virginia, October 2000 [3] Wroblewski, G., General Method of Program Code Obfuscation, Wrowclaw, 2002 [4] Collberg, C., Thomberson, C., Watermarking, Tamperproofing, and Obfuscation Tools for Software protection, 2002