Presentation is loading. Please wait.

Presentation is loading. Please wait.

Seminar in Cryptographic Protocols: Program Obfuscation Omer Singer June 8, 2009.

Similar presentations


Presentation on theme: "Seminar in Cryptographic Protocols: Program Obfuscation Omer Singer June 8, 2009."— Presentation transcript:

1 Seminar in Cryptographic Protocols: Program Obfuscation Omer Singer June 8, 2009

2 Practical Background

3 What is program obfuscation? Obfuscation is deliberately making software code so confusing that even those with access to the code can’t figure out what a program is going to do. “The art of making things appear more complicated”

4 Source: What does this function do?

5 Three main values: – Potency – Resilience – Cost Many methods in use: – Modify variable names and layout – Replace integer values with complex equations – Change program flow – Modify data structures – Anti-disassembly (“armored” viruses) – Anti-debugging

6 And now for some seriously obfuscated programs…

7 Winner of the international C obfuscation contest in 1996 Shows the time on a clock with a configurable face and style

8 Winner of the international C obfuscation contest in 2001 Network-based Pong game #include #include #include #include #include #include #define o0(M,W) mvprintw(W,M?M-1:M,"%s%s ",M?" ":"",_) #define O0(M,W) M##M=(M+=W##M)-W##M #define l1(M,W) M.tv_##W##sec #define L1(m,M,l,L,o,O) for(L=l;L--;)((char*)(m))[o]=((char*)(M))[O] #define I1 lL,(struct sockaddr*)&il #define i1 COLS #define j LINES #define L_ ((j%2)?j:j-1) fd_set I;struct socka\ ddr_in il;struct host\ ent*LI; struct timeval IL,l;char L[9],_[1 h_length,iI, iI,iI);(*(&il)). sin_family=(&(*\ LI))- >h_addrtype ;connect(I1,II); }ii=Ii=(o=i1*0.5 )-lI/2;iI=L_-1;O =li=L_*0.5;while (_){mvaddch(+OO, oo,' ');o0(ii,iI );o0(Ii,Il-=Il); mvprintw(li-1,Il,"%d\n\n%d",i,LL );mvhline(li,+0, '-',i1);mvaddch( O,o,'*');move(li,Il);refresh();\ timeout(+SPEED); gettimeofday(&IL,+0);Ll=getch(); timeout(0);while (getch()!=ERR);\ if(Ll=='q'&&iL)\ write(lL,_+1,1); if(ii>(ll=0)&&Ll ==','){write(lL, _,-(--Il));}else if(Ll=='.'&&ii+\ lI i1){o=i1+i1-o ;Oo*=-1;}if(o>=( Ii+=ll)&&O = (ii+=Il)&&O>iI-1 &&oO>0&&o +iI){O-=O;i++; }}endwin();return(0);}

9 No more fun and games…

10 Actual web code blocked by an Intrusion Prevention System at a client:

11 When unobfuscated…

12 Source:

13

14 Obfuscation helps to bypass antivirus, delay security research response Obfuscated web code is often the first step in a “drive-by download” attack When the web code is executed by the browser it calls programs to target local software Result is infection of the user’s computer

15

16 Source:

17 Google Search Results Containing a Harmful URL

18 Attempt to calculate impact of obfuscated online attacks: 1 aspects-of-malware-and-spam.pdf % of malware spread via compromised websites 2 80% of browser-based attacks are now obfuscated 3 = $7.8 billion $13.2 billion direct damages of malware 1

19 Knowing is half the battle… A few tips to stop obfuscated “drive-by download” attacks Use NoScript to block active content on Firefox Don’t click on web ads Keep client-side software updated: Adobe Reader, Flash Player, Apple Quicktime, etc.

20 Program obfuscation has some positive uses as well!

21 Preventing source code theft – Disrupt reverse engineering – Block code copying – Especially important with the increased use of Java and.NET languages such as C# and Visual Basic which do not compile to machine code – Microsoft recommends obfuscating ASP files in case of server compromise Watermarking and Digital Rights Management (DRM)

22 “If obfuscation technology was ever perfected we would have perfect DRM and perfect malware. Yet, that outcome is unlikely. The computer ultimately has to decipher and follow a software program’s true instructions. Each new obfuscation technique has to abide by this requirement and, thus, will be able to be reverse engineered.” - Chris Wysopal Good Obfuscation, Bad Code

23 Definitions

24 Oracle Access Used by [B+] to facilitate adversary model The oracle is some function Adversary makes query q to the oracle, receives answer f(q) Useful when studying obfuscation: oracle serves as an interface to the program without exposing contents

25 qq f(q) Adversary Oracle Program Adversary with Oracle Access

26 Virtual Black Box Anything one can efficiently compute from a virtual black box, one should be able to efficiently compute given just oracle access to the program. In other words, for any adversary A there exists a simulator S such that whatever A can learn given an obfuscated program, S can learn from oracle access to that program.

27 Speaks Spanish Answers in the form of a question q f(q) Tell me about yourself ¿Que quieres saber?

28 Adversary with access to the virtual black box Simulator with oracle access to the function

29 Circuit In the [B+] paper on obfuscation, a circuit represents a finite length Turing machine.

30 Circuits are easier to put in a virtual black box. Therefore obfuscating circuits is easier than obfuscating TMs. Proofs in the [B+] paper first prove theorems for TM then can easily extend to circuits.

31 Obfuscators An obfuscator is an algorithm О that will restrict what an adversary can learn about P given O(P).

32 What is the adversary trying to achieve? – A program that produces the same output as P – A program that produces output with some relation to the output of P – A function that computes some function of P – Decide some property of P The last achievement is the weakest, we want to prove that it is impossible.

33 General Impossibility Proof

34 TM Obfuscator A probabilistic algorithm O is a TM obfuscator if the following conditions hold…

35 Functionality: For every Turing machine M, the string O(M) describes a Turing machine that computes the same function as M.

36 Polynomial slowdown: The description length and running time of O(M) are at most polynomially larger than those of M

37 “Virtual black box” property: For any PPT A, there is a PPT S and a negligible function α such that for all TMs M

38 Circuit Obfuscator Same idea as TM Obfuscator but intuitively easier since a circuit computes a function with inputs of particular length Hence the proposition: If a TM obfuscator exists, then a circuit obfuscator exists Thus if we prove impossibility for circuit obfuscators, impossibility of TM obfuscators follows

39 Unobfuscatable Circuit Ensemble A family of circuits such that: – Every circuit c in the family is efficient – There exists a predicate π(c) such that π(c) is hard to compute with oracle access to the function that c computes π(c) is easy to compute with access to any circuit c’ that computes the same function as c

40 Main Proof Structure [B+] structure their Proof the Main Impossibility Result as follows: 1.Define obfuscators that are secure when applied to two programs 2.Show that such obfuscators do not exist 3.Modify the construction to prove that TM/circuit obfuscators do not exist 4.Show how this proof yields an unobfuscatable function ensemble

41

42 2-TM Obfuscator A 2-TM obfuscator is defined the same as a TM obfuscator but with a strengthened “virtual black box property”: the adversary has access to two obfuscated Turing machines.

43 Formal definition of the strengthened “virtual black box” property: Adversary with access to two obfuscated TMs Simulator with oracle access to the two TMs

44 Proposition: According to [B+], “the essence of this proof is that there is a fundamental difference between getting oracle access to a function and getting the program that computes it, no matter how obfuscated”.

45 Proof by contradiction… Suppose that there exists a 2-TM obfuscator O. Consider a function that cannot be learned by oracle queries, for example the following Turing machine:

46 Define another Turing machine such that: Consider an adversary A such that: A (C,D) = D(C)

47 Then for any α,β:

48 Therefore S with oracle access to and must output 1 and with oracle access to and must output 0… but S cannot differentiate between the two so we have a contradiction.

49 The combination of the these equations contradict the fact that O is a 2-TM obfuscator: Recall that a 2-TM obfuscator O is defined with the “virtual black box” property that:

50 In the [B+] paper, the proof that 2-TM obfuscators do not exist is extended to show that 2-circuit obfuscators also do not exist.

51 TM Obfuscator [B+] extend the two-program obfuscation impossibility result to single program obfuscation. The extension is based on the ability to combine functions/TMs

52 In [B+] the combination of two functions is defined as. A program C is decomposed into by setting. By this definition, having oracle access to a combined function is the same as having oracle access to and individually.

53 Theorem: TM obfuscators do not exist. The adversary A is the same as before only modified to decompose the program that it receives.

54 Suppose for the sake of contradiction that exists TM obfuscator O. These equations contradict the virtual black-box property required for O being a TM obfuscator.

55 In [B+] this proof is extended to circuit obfuscators. The challenge with extending to circuit obfuscators is greater than expected – Size of the circuit is greater than the input length – Adapt the proof using homomorphic encryption properties

56 Unobfuscatable Circuit Ensembles The case against obfuscators is further strengthened by proving the existence of unobfuscatable circuit ensembles.

57 The unobfuscatable circuit ensemble is defined as Reminder:

58 We can now show that given any circuit that computes the same function as, we can reconstruct the latter. Since D’ computes the same function as D and, we have We can now reconstruct

59 Indistinguishability Obfuscator Obfuscation models weaker than the “virtual black box” may still be useful for software protection Indistinguishability obfuscator: Obfuscations of equivalent circuits of the same size should be computationally indistinguishable. Later works have shown this model to be impossible to achieve as well

60 Software Watermarking We would like to be able to “watermark” a program such that the code will always have a certain identifier that cannot be removed.

61 A good software watermarking scheme should have the following properties: – Functionality: The marked program computes the same function as the original program. – Meaningfulness: Most other programs don’t have this marking. – Fragility: It is infeasible to remove the mark from the program without (substantially) changing its behavior. [B+] sought to formalize the watermarking problem as it relates to obfuscation.

62

63 [B+] sketch a proof showing that no such watermarking scheme exists. For any unobfuscatable program, we know that an adversary will be able to take the obfuscated (marked) program and reconstruct the (unmarked) source code.

64 Conclusion [B+] have made progress in formalizing the concept of program obfuscation. They have shown that the “virtual black box” paradigm is impossible to satisfy. Somewhat strong obfuscation of some programs remains a possibility

65 Program obfuscation has an increasingly important role in the race between hackers and the information security community. Additional research must be made in order to increase the effectiveness of malware detection. Significant progress in obfuscation techniques may break the current signature-based detection model. Final Thoughts

66 Thanks for listening!


Download ppt "Seminar in Cryptographic Protocols: Program Obfuscation Omer Singer June 8, 2009."

Similar presentations


Ads by Google