a guided protection system for java applications

63
A Guided Protection System for Java Applications Wolfgang Völker| Product Management [email protected] Günther Fischer| Professional Services [email protected] 1

Upload: team-wibu

Post on 13-Apr-2017

702 views

Category:

Software


3 download

TRANSCRIPT

Page 1: A guided protection system for Java applications

1

A Guided Protection System for Java Applications

Wolfgang Völker| Product [email protected]

Günther Fischer| Professional [email protected]

Page 2: A guided protection system for Java applications

2

Agenda

Java dissection Brief overview of protection technologies for Java applications

AxProtector Java fundamentals

Additional options for AxProtetcor Java

Protection at class and method level

Short introduction to licensing of Java applications

Page 3: A guided protection system for Java applications

3

Java Dissection

Page 4: A guided protection system for Java applications

4

Java and the JVM/JRE

Java: programming language developed by Sun in 1995.

The JVM defines an abstract machine.

The instruction set of the VM is the Java byte code.

Compiled Java programs consist of class files that contain byte code. JAR files are ZIP files including a manifest.

The byte code is interpreted and executed by the Java Virtual Machine (JVM).

The byte code is easy to reverse engineer.

The OpenJDK is an open source implementation of a JVM.

Page 5: A guided protection system for Java applications

5

JAVA – Write Once, Run Anywhere (WORA)

Java Program (.java)

Interpreter (JVM)

Java CompilerJAVAC

Java Byte Code (.class /.jar)

Windows

Interpreter (JVM)

Linux

Interpreter (JVM)

MacOS

Page 6: A guided protection system for Java applications

6

The Java architecture

ClassloaderJava Program *.class Files

Byte code Verifier

Interpreter (JVM)

Host Operating System(Windows, Linux, MacOS,..)

Java API *.class Files

Page 7: A guided protection system for Java applications

Java and security

Java classes are Easy to extract

Easy to replace (including system classes!)

Easy to modify

The Java byte code is no "secret “ Conclusion

Everything that is written in Java is inherently insecure!

Seite 7

Page 8: A guided protection system for Java applications

Java byte code and native code

8

Java Runtime(Java)

Java Virtual Machine

(Native Code)

JNI(Native Code)

C/C++ code can be invoked through the JNI (Java Native Interface)

Page 9: A guided protection system for Java applications

9

Protection goals

Protection against piracy (licensing) Protection of intellectual property (reverse engineering)

Protection against analysis by competitors

Protection against unauthorized use of code

Integrity protection of data and code Protection of data as integral part of the product (competitive advantage,

trade secret)

Page 10: A guided protection system for Java applications

10

Arms of the attacker (Java Decompiler .jar/.class -> .java)

Page 11: A guided protection system for Java applications

11

Protection Technologies for Java Applications

Page 12: A guided protection system for Java applications

12

Options considered

Obfuscation Basic Obfuscation

Heavy Duty Protection (Klassmaster)

Java2Exe (JET Engine) Compiling Java byte code into native code

Encrypting native code

Encrypting Java byte code AxProtector

Additional methods CodeMeter Core API

Page 13: A guided protection system for Java applications

13

Java obfuscation tools (KlassMasterAltaori/ProGuard….)

Page 14: A guided protection system for Java applications

14

Basic Obfuscation

Page 15: A guided protection system for Java applications

15

Basic obfuscation (name obfuscation)

Quelle: Zelix Webseite

Page 16: A guided protection system for Java applications

16

Reverse engineering basic obfuscation

Quelle: Zelix Webseite

Decompile

Page 17: A guided protection system for Java applications

17

Heavy Duty Protection

Page 18: A guided protection system for Java applications

18

Zelix KlassMaster

Page 19: A guided protection system for Java applications

19

Heavy duty protection (flow, exception, string obfuscation …)

Quelle: Zelix Webseite

Page 20: A guided protection system for Java applications

20

JDO: Java de-obfuscator / JMD: Java byte code de-obfuscation tool

Page 21: A guided protection system for Java applications

21

JAVA2EXEExcelsior JET Engine

Page 22: A guided protection system for Java applications

22

Java2Exe – The main principleJa

va s

ourc

e co

de

Java

byt

e co

de

Nativ

e co

deJAVACCompiler

Excelsior JIT

Compiler

Page 23: A guided protection system for Java applications

23

Additional protection through native code encryptionJa

va s

ourc

e co

de

Java

byt

e co

de

Nativ

e co

de

Encr

ypte

d na

tive

codeJAVAC

Compiler

Excelsior JIT

Compiler AxProtector

Page 24: A guided protection system for Java applications

24

Encrypting Java Byte Code

Page 25: A guided protection system for Java applications

Encrypting the code

25

Encrypting the byte code before shipping:

Decrypting classes/methods at run time

EncryptionUnprotected Application

Decryption

AxEngine

AxEngine

Page 26: A guided protection system for Java applications

26

AxProtector Suite

AxProtector native Windows 32-/64-bit Mac OS X Linux

AxProtector .NET .Net 2.0, 3.0, 3.5, 4.0, 4.5

AxProtector Java Java 1.6

Java 1.7

Java 1.8

Java Applications

Java Applets

Java Servlets

Page 27: A guided protection system for Java applications

27

AxProtector – The main principle

UnprotectedapplicationWin32 ExecutableWin32 Dynamic Link LibraryWin64 ExecutableWin64 Dynamic Link LibraryMac OS X 32-BitMac OS X 64-BitMac OS X Universal Binary.NET 2.0 Assembly (Exe).NET 2.0 Assembly (Dll).NET 3.0 Assembly (Exe).NET 3.0 Assembly (Dll).NET 3.5 Assembly (Exe).NET 3.5 Assembly (Dll).NET 4.0 Assembly (Exe).NET 4.0 Assembly (Dll).NET 4.5 Assembly (Exe).NET 4.5 Assembly (Dll)Java 1.6 ApplicationJava 1.7 ApplicationJava 1.8 Application

protected

application

AxEngine

Protection

Licenses

Encryption

AxProtector

Page 28: A guided protection system for Java applications

28

AxProtector Java – fundamentals

AxProtector Java automatically encrypts the byte code at class level and method level and protects your application.

Each class/method is automatically decrypted when loaded. The AxProtector Runtime must be initialized. There are several ways to achieve this: Java applications with Main-Class => wrapper

manual loading through EntryPoint

manual loading through ProtectionManager

Manual instantiation might be necessary (e.g. Application Server) Build extended protection measures (IxProtector) Specific license queries (CoreAPI)

Page 29: A guided protection system for Java applications

29

Supported Applications Types

What types of applications can AxProtector Java protect? Console and desktop applications

Applets, Web Start applications

Servlets

Eclipse RCP, Eclipse Plugins

OSGi

Page 30: A guided protection system for Java applications

30

AxProtector – The main principle

Encrypted Class on the hard drive

Class in Memory

AxProtector RuntimeJVMloadClass

Page 31: A guided protection system for Java applications

31

AxProtector Classes

Automatic protection (integrated into the JAR or as WibuXpm4JRuntime.jar) Adjustments in your code Automatic code protection during runtime execution:

Integrated into the protected application (included in the JAR file)

Separate WibuXpm4JRuntime.jar in classpath

Page 32: A guided protection system for Java applications

32

AxProtector Java 9.1 – What‘s new?

IxProtector– Method Protection Annotations

EntryPoint

Protected

Unprotected

Trap

Parsable class files (support of annotation parser) Command line file in XML-format (license list)

Page 33: A guided protection system for Java applications

33

Example

Page 34: A guided protection system for Java applications

34

Decompiling Encrypted Code

Page 35: A guided protection system for Java applications

35

Java class file structure

Magic Number Version

Constant Pool

Access Flag

this Class

super Class

Interfaces

Fields

Methods

Attributes

Page 36: A guided protection system for Java applications

36

Unencrypted code (CAFEBABE)

Page 37: A guided protection system for Java applications

37

AxProtector protected Java byte code

Page 38: A guided protection system for Java applications

38

Enigma

Page 39: A guided protection system for Java applications

39

D4J

Page 40: A guided protection system for Java applications

40

Lython

Page 41: A guided protection system for Java applications

41

JD-GUI

Page 42: A guided protection system for Java applications

42

Additional levels of protection

Java VM signature check Verifies the authenticity of the JVM being executed

WibuXPM4J32/64.dll integrity check Callback check

Checks that no JNI functions have been changed

JVMPI/JVMTI detection Checks whether a JVMPI/JVMTI agent is present

Page 43: A guided protection system for Java applications

Detecting JVM manipulations (changes to the JVM source code)

43

OpenJDK is an open source implementation of the JVM Available since version 6

Easy to implement backdoors in the JVM

Inserting code that logs loaded classes is pretty easy

Solution: JVM verification

Page 44: A guided protection system for Java applications

44

Updating the signature

Page 45: A guided protection system for Java applications

Attacks through tool interfaces

In Java there are some " Tool" interfaces Intended to analyze/modify byte code

Debugger, Profiler

JVMPI: Java Virtual Machine Profiling Interface Up to and including Java 6

JVMTI: Java Virtual Machine Tools Interface Since Java 7, successor of JVMPI

Seite 45

Page 46: A guided protection system for Java applications

46

Additional Techniques

Page 47: A guided protection system for Java applications

47

Protecting data files

Assumption Data is the intellectual property e.g. vehicle data for licensed garages

Protection goal Secure the data against unauthorized use (licensing)

Protect the data against "extraction" and reproduction by competitors

Solution: Data encryption

Page 48: A guided protection system for Java applications

48

Protecting data files

Only secure when the keys are stored in a trusted storage.

Page 49: A guided protection system for Java applications

49

CodeMeter Core API

com.wibu.CodeMeter Foundation of all protection mechanisms Communication interface for CodeMeter Advanced protection options

Unified interface throughCodeMeter License Server

License in a dongle or in an encrypted license file

Unified license options

Transparent interchangeable use within an application

Dongle

Your Software

Activation

Java Native Interface

CodeMeter License Server

Page 50: A guided protection system for Java applications

50

Protection of data – encryption

Protection through encryption/decryption within the application

cmCrypt2 ()

Page 51: A guided protection system for Java applications

51

Integrity protection – signatures

Integrity protection of data/libraries

cmCalculateDigest()

cmCalculateSignature()

cmValidateSignature()

Page 52: A guided protection system for Java applications

52

Core API – Documentation and Examples

CodeMeter Java API Help (HTML Format) Servlet Sample CmCalculator CmDemo

License access

Reading of licenses

Encryption

Page 53: A guided protection system for Java applications

53

A Few Words About CodeMeter

Page 54: A guided protection system for Java applications

54

At the core of the CmDongle

Smart card Chip Protection against side channel attacks

Differential Power Analysis (DPA)

Firmware Update Enhanced security features

Enhanced features

Secure update channel

64 kByte | 384 kByte | 512 kByte license storage

Page 55: A guided protection system for Java applications

55

Software integration

Automatic encryption (AxProtector Java) Encrypting classes/methods before release

Wrapped in JAR file

Wrapper for automatic decryption when loading classes/methods

Integration with CodeMeter Core API Encryption API

Activation of specific modules

Counting concurrent sessions

Page 56: A guided protection system for Java applications

56

Flexible licensing models for licensor

Single User

Network

Feature On Demand

Perpetual

Trial version

Rent / Leasing / Subscription

Pay-Per-Use

Maintenance period

Downgrade

Grace Period

Volume

Version

Standby

High Availability

Overflow

Borrowing

Name/PC

Time zone

Page 57: A guided protection system for Java applications

57

Centralized automatic license management

Ticket

Id

License

Ticket

Lice

nsor

Lice

nsee

Ticket

Page 58: A guided protection system for Java applications

58

Summary

Page 59: A guided protection system for Java applications

59

Protection through Obfuscation

Protection against piracy (licensing) Protection of intellectual property (reverse engineering)

Protection against analysis by competitors

Protection against unauthorized use of code

Integrity protection of data and code Protection of data as integral part of the product (competitive advantage,

trade secret)

Page 60: A guided protection system for Java applications

60

Protection through Java2EXE

Protection against piracy (licensing) Protection of intellectual property (reverse engineering)

Protection against analysis by competitors

Protection against unauthorized use of code

Integrity protection of data and code Protection of data as integral part of the product (competitive advantage,

trade secret)

Page 61: A guided protection system for Java applications

61

Protection through Encryption

Protection against piracy (licensing) Protection of intellectual property (reverse engineering)

Protection against analysis by competitors

Protection against unauthorized use of code

Integrity protection of data and code Protection of data as integral part of the product (competitive advantage,

trade secret)

Page 62: A guided protection system for Java applications

62

We are prepared!

Page 63: A guided protection system for Java applications

63

Thank you for your attention!

WIBU-SYSTEMSGermany +49-721-93172-0

USA +1-425-775-6900

China +86-21-55661790

www.wibu.com | [email protected]