Introduction To Reverse Engineering: Inbar Raz Malware Research Lab Manager
Introduction To Reverse Engineering: Inbar Raz Malware Research Lab Manager
Reverse Engineering
Inbar Raz
Malware Research Lab Manager
December 2011
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved.
What is Reverse Engineering?
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 2
2
Why do it?
Find Academic
Discover Vulnerabilities Research
Trade (Yeah, right…)
Secrets
Circumvent
[Copy]
Protection
Analyse
Patch Binary Pure Protocols
and Curiosity
Alter Behavior
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 3
3
Sounds
awesome,
right?
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 4
4
So where’s the catch?
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 6
6
So where’s the catch?
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 7
7
So where’s the catch?
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 8
8
A Battle of Wits
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 9
9
A Battle of Wits
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 10
10
So what do you need
in order to be
a good reverser?
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 11
11
We’ll come back
to this…
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 12
12
Tools of the Trade
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 13
13
Debuggers
באג בדיזיין – זין בדיבאג
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 14
14
First, there was DEBUG…
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 15
15
GUI and much more: Turbo Debugger
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 16
16
GUI and much more: Turbo Debugger
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 17
17
GUI and much more: Turbo Debugger
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 18
18
Next major step: Soft-ICE
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 19
19
And finally: OllyDbg
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 20
20
Disassemblers
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 21
21
The old world: Sourcer
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 22
22
The old world: Sourcer
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 23
23
Old ages: Sourcer
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 24
24
Old ages: Sourcer
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 25
25
Welcome to Windows: W32DASM
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 26
26
The Holy Grail: IDA-Pro
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 27
27
Hex-Editor
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 28
28
PE Analyzer
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 29
29
Resource Editor
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 30
30
Let’s play
with them tools…
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 31
31
60 seconds on x86 registers
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 32
32
Exercise 1:
Static Reversing
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 33
33
Exercise 1: Static Reversing
Tools: IDA-Pro
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 34
34
Exercise 2:
Dynamic Reversing
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 35
35
Exercise 2: Dynamic Reversing
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 36
36
Exercise 3:
Simple Anti-Debugging
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 37
37
Exercise 3: Simple Anti Debugging
Tools: OllyDbg
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 38
38
Reversing Malware
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 39
39
Introducing: Spy Eye
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 40
40
Act 1:
Encryption
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 41
41
Act 2:
Configuration Download
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 42
42
Act 3:
Another Encryption
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 43
43
So what do you need
in order to be
a good reverser?
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 44
44
What makes a good reverser?
Qualities Knowledge
• Patient • Assembly Language
• Curious • Some High-Level programming
• Best: origin of binary
• Persistent
• Outside-the-Box Thinking • Operating System Internals
• API
• Data Structures
• File Structures
• Good scripting skills
• Anti-Debugging Tricks
• Optional: Good lookin’
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 45
45
Outside-the-Box Thinking
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 46
46
And remember, kids:
+ =?
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 47
47
Which means…
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 48
48
Questions?
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 49
49
Thank you!
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 50
50
Credits
All images and videos have their origin URL in the “Alt Text” property.
All rights belong to their respective owner.
©2011 Check Point Software Technologies Ltd. [PROTECTED] — All rights reserved. 51
51