E N D
1. Reverse Engineering Ian Kayne
2. 02/09/09 2 RCE
3. 02/09/09 3 RCE Required knowledge/skills (x86)
Platform knowledge – stack, registers etc
“Some” assembly language
C/C++ & as many other languages as possible
Operating system mechanisms
win32api
Toolset (debugger, disasm, hex editor…)
Mindset (patterns, logic)
4. 02/09/09 4 RCE Imagine a strong protection mechanism
5. 02/09/09 5 RCE Reversing demonstration
6. 02/09/09 6 RCE After the demonstration, recap:
Analysed executable
Set breakpoints on likely API calls
Traced up the call stack
Analysed the code
Found the good boy/bad boy “switch”
Patched the jump “live” to test
Converted RVA to file offset, patched file
1 byte patch
7. 02/09/09 7 Protection Imagine a strong protection mechanism again
License key system
CRC
Anti-debugging techniques
Encryption
8. 02/09/09 8 Protection Encryption for protection
Data must be decrypted before use
Code must be decrypted before execution
UPX (packer), Armadillo, Themida…
Can be made very hard, but not impossible
Remember the jump loop – EB FE
Generics – break one, break all
Homebrew is risky – “learn the principles”
9. 02/09/09 9 Protection Some obfuscation techniques:
Encode obvious “beacon” strings
Avoid win32api/library functions:
bpx MessageboxA
Use alternative functions/mechanisms
E.g.: SetWindowPos instead of ShowWindow
Roll your own api/GUI functions
Can’t break on GetWindowText if you don’t use it!
Hide code within the executable
Self modifying code, PE sections etc
10. 02/09/09 10 Protection Some anti-debugger techniques
Deliberate exceptions (code in SEH)
Self-debugging (can’t “stack” debuggers)
Timers and counters
Alter DR0 – DR7 hardware debug registers
IsDebuggerPresent()
Check for/attack known debugger processes, windows, services, drivers… (Starforce)
http://www.securityfocus.com/infocus/1893
11. 02/09/09 11 RCE Why are these low-level technical techniques important?
“Learn the principles”
Your first job: consultant to betting company about to release online gambling game
The basics:
Internet security
Server security
Data security
But… what about the end-user software?
12. 02/09/09 12 Review Thank you!
Questions
Comments
Items to review
Further study