Software Reverse Engineering Software Cracking

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Dynamic Self-Checking Techniques for Improved Tamper Resistance Bill Horne, Lesley Matheson, Casey Sheehan, Robert E. Tarjan STAR Lab, InterTrust Technologies.
White-Box Cryptography
Systems Software.
DR. MIGUEL ÁNGEL OROS HERNÁNDEZ 8. Cracking. Cracking Magnitude of piracy  All kinds of digital content (music, software, movies)  Huge economic repercussions.
K. Salah1 Buffer Overflow The crown jewel of attacks.
CS266 Software Reverse Engineering (SRE) Applying Anti-Reversing Techniques to Java Bytecode Teodoro (Ted) Cipresso,
DR. MIGUEL ÁNGEL OROS HERNÁNDEZ 9. Técnicas anti-ingeniería inversa.
.NET IL Obfuscation Presented by: Sarath Chandra Dorbala.
Binary Obfuscation Using Signals Igor V. Popov ( University of Arizona)‏ Saumya K. Debray (University of Arizona)‏ Gregory R. Andrews (University of Arizona)
CMSC 414 Computer (and Network) Security Lecture 2 Jonathan Katz.
Achieving Trusted Systems by Providing Security and Reliability Ravishankar K. Iyer, Zbigniew Kalbarczyk, Jun Xu, Shuo Chen, Nithin Nakka and Karthik Pattabiraman.
Software Testing and Reliability Testing Real-Time Systems Aditya P. Mathur Purdue University May 19-23, Corporation Minneapolis/St Paul,
Chapter 10 Application Development. Chapter Goals Describe the application development process and the role of methodologies, models and tools Compare.
SRE  Introduction 1 Software Reverse Engineering (SRE)
Compiled by Benjamin Muganzi 3.2 Functions and Purposes of Translators Computing 9691 Paper 3 1.
Page 1 Sandboxing & Signed Software Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Code Injection and Software Cracking’s Effect on Network Security Group 5 Jason Fritts Utsav Kanani Zener Bayudan ECE 4112 Fall 2007.
Jarhead Analysis and Detection of Malicious Java Applets Johannes Schlumberger, Christopher Kruegel, Giovanni Vigna University of California Annual Computer.
Secure Embedded Processing through Hardware-assisted Run-time Monitoring Zubin Kumar.
Trying to like a boss… REVERSE ENGINEERING. WHAT EVEN IS… REVERSE ENGINEERING?? Reverse engineering is the process of disassembling and analyzing a particular.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
© SERG Reverse Engineering (Introduction to Binary Reversing) Software Reversing Engineering (a.k.a. Reversing) Spiros Mancoridis.
Software Construction and Evolution - CSSE 375 Reverse Engineering Tools and Techniques Shawn & Steve Left – Reengineering from the competition can be.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Paradyn Project Dyninst/MRNet Users’ Meeting Madison, Wisconsin August 7, 2014 The Evolution of Dyninst in Support of Cyber Security Emily Gember-Jacobson.
Kenichi Kourai (Kyushu Institute of Technology) Takuya Nagata (Kyushu Institute of Technology) A Secure Framework for Monitoring Operating Systems Using.
1 Architectural Support for Copy and Tamper Resistant Software David Lie, Chandu Thekkath, Mark Mitchell, Patrick Lincoln, Dan Boneh, John Mitchell and.
Windows PE files Infections and Heuristic Detection Nicolas BRULEZ / Digital River PACSEC '04.
Binary Auditing Geller Bedoya Michael Wozniak. Background  Binary auditing is a technique used to test the security and discover the inner workings of.
Ether: Malware Analysis via Hardware Virtualization Extensions Author: Artem Dinaburg, Paul Royal, Monirul Sharif, Wenke Lee Presenter: Yi Yang Presenter:
CS266 Software Reverse Engineering (SRE) Reversing and Patching Java Bytecode Teodoro (Ted) Cipresso,
EECS 354 Network Security Reverse Engineering. Introduction Preventing Reverse Engineering Reversing High Level Languages Reversing an ELF Executable.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Title of Selected Paper: IMPRES: Integrated Monitoring for Processor Reliability and Security Authors: Roshan G. Ragel and Sri Parameswaran Presented by:
Protecting Software Code By Guards The George Washington University Cs297 YU-HAO HU.
Lecture 5 Page 1 CS 111 Online Processes CS 111 On-Line MS Program Operating Systems Peter Reiher.
Security Vulnerabilities in A Virtual Environment
Introduction Program File Authorization Security Theorem Active Code Authorization Authorization Logic Implementation considerations Conclusion.
Protecting The Kernel Data through Virtualization Technology BY VENKATA SAI PUNDAMALLI id :
Exploiting Instruction Streams To Prevent Intrusion Milena Milenkovic.
“Software reverse engineering involves taking an existing system for which source code or proper documentation is not available and attempting to recover.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 31 Memory Management.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
1 Software Reverse Engineering Dr. Khaled Salah Associate Professor of Computer Science October.
Lecture 11 Example Rootkit. Intel internship Intel CTG (Corporate Technology Group) –Advanced research & development –System integrity services using.
1 Xen and the Art of Binary Modification Lies, Damn Lies, and Page Frame Addresses Greg Cooksey and Nate Rosenblum, March 2007.
Friday, 23 August 2013 Session Work out Presented By: Abhijit Pal.
DR. MIGUEL ÁNGEL OROS HERNÁNDEZ 4. Herramientas. Contexto Computers understand binary code Binary code can be written in hexadecimal Hexadecimal code.
Lecture 10 Anti-debugger techniques. Anti-debuggers Making reverse-engineering and disassembly painful –Polymorphism –Encryption –Interrupt disabling.
Software Reverse Engineering Binary analysis: concepts, methods and tools. Catalin Patulea Mar 5, 2008.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Reverse Engineering Contemporary Countermeasures By: Joshua Schwartz.
Reversing Karthik S 1BM05CS029. What is Reverse Engineering? Reverse engineering (RE) is the process of extracting the knowledge or design blueprints.
Chapter Goals Describe the application development process and the role of methodologies, models, and tools Compare and contrast programming language generations.
Computer System Structures
Topic 2: Hardware and Software
Advanced Computer Systems
Visit for more Learning Resources
Chapter 1. Basic Static Techniques
CSCI-235 Micro-Computer Applications
CompSci 725 Presentation by Siu Cho Jun, William.
Malware Incident Response  Dynamic Analysis - 2
Java programming lecture one
COEN 252 Computer Forensics
Memory Management Tasks
Obfuscation in .NET Atchyutuni Shilpa CS-795.
Reverse engineering through full system simulations
Plug-In Architecture Pattern
Presentation transcript:

Software Reverse Engineering Software Cracking Sometimes, the best way to advance is in reverse K. Salah

What is Reverse Engineering? The process of extracting the knowledge or design blueprints from anything man-made. It is different than conventional scientific research (e.g, coming up with blueprints of the atom) With reverse engineering, the artifact being investigated is man-made With Scientific research, the artifact is a natural phenomenon Software Reverse Engineering About opening up a program’s “box” and looking inside No screwdrivers needed, but integrates several arts of Code breaking Puzzle solving Programming Logical analysis K. Salah

Why Reverse Engineering? Application development Why reinvent the wheel Undocumented API Interoperability with proprietary software Used enormously for all MS products Software quality and robustness Security-Related Malicious Software Black-Hat Hackers To find vulnerabilities and exploit them White-Hat Hackers To identify, dissect and analyze malware Reversing ciphers Defeating copy right protection Must-do when it comes to propriety software Really unknown what the code does and how secure K. Salah

Is reversing legal? Jury is still out Bottom line What is “reverse engineering” used for? K. Salah

“Software Cracking is a scientific process as much as it is an art,” Greg Hoglund Taking measurements Analysis to draw proper conclusions K. Salah

Reversing 101 Books Web sites Elad Eilam, “Reversing: Secretes of Reverse Engineering,” Wiley, 2005 Greg Hoglund, “Exploiting Software: How to Break Code,” Addison-Wesley, 2004 Kris Kaspersky, “Hacker Disassebmling Uncovered,” A-List Publishing, 2003 Web sites Learn to crack http://www.learn2crack.com/ http://woodmann.net/krobar/ Crack Find http://www.crackfind.com/ http://www.cracksearchengine.net/ http://astalavista.box.sk http://ttdown.com/ K. Salah

Approaches to reverse engineering White Box Analysis Analyzing and understanding source code Code coverage – walking down dark allies Black Box Analysis Analyzing a running program by probing it with various inputs Gray Box Analysis A combination K. Salah

Program Structure Static libraries Dynamic libraries Third party library external to program Added to program while being built Become integral part of the final executable Dynamic libraries Idea is to utilize memory Multiple processes can use the same DLL Remains separate from the executable Update to DLL requires no update to program Simplify the reversing process and give many hints on program behavior. K. Salah

The .exe format and DLLs Before loading DLLs, addresses of functions in DLL are pointing to dummy addresses in an import table When process is loaded, the OS loader loads every module listed in the imported table, and resolves the addresses of each of the functions listed in each modules. The addresses are found in the exported table of the module. K. Salah

Important Flags K. Salah

Reversing Tools No all-in-one Disassemblers and low-level debuggers IDA Pro ILDasm OllyDbg Win32Dasm WinDbg Numega SoftICE Decompilers Dream to come true In development: Andromeda and Boomerang For Java and C#, the dream has come true System monitors FileMon, TCPView, TDIMon, RegMon, PortMon, WinObj, Process Exporer Hex Editors Hex Workshop Hiew WinHex K. Salah

IDA-generated function flowchart K. Salah

IDA-generated function interactions at high level K. Salah

Copyright Protection Open Architecture CPU can not check “authorized” or “legal” code Only execution mode and process memory protection by OS– useless When program runs, its data and code has to be exposed or decrypted Decryption key or decrypted data are impossible to hide – It is the CPU that does the decryption operation Make no mistake: It is virtually impossible to create a totally uncrackable copy protection scheme One crack is not the issue, “class breaks” is K. Salah

Design Considerations Resistance to attack End-user transparency The annoyance factor K. Salah

Types of Protection Media-Based Protections Watermarking Deliberately writing bad sectors on floppy Easy to break Watermarking Check for watermark on media before running Can be broken Serial Numbers Program has “secret validation algorithm” to check for good serial numbers Checksum Check for valid checksum before or during running Challenge Response and Online Activations A step up Hardware-Based Protections Program runs or keeps running if a dongle is attached Software as a Service Highly secure Vendor is in control Advanced Protection Concepts -- Crypto-Processors Violates Open Architecture K. Salah

Crypto Processors Originated by Robert M. Best in his patent, “Executing Enciphered Programs.” Decrypt code then Execute Each Crypto-mP has (assigned by CA) Two pair of keys A serial number The Steps Software is shipped by the vendor with binary executable encrypted mP decrypts with private key Machine code is placed in a special memory not software-accessable Similar to macrocode for each machine instruction Only accessed by the process itself. Any other access by OS or IDT or any software is a violation. Code is executed from this (theoretically) inaccessable memory K. Salah

Is this unbreakable? Power usage analysis attacks Differential power analysis by Paul Kocher, Joshu Jaffe, and Benjamin Jun Watch the power consumption to ascertain the value of the key being used  K. Salah

Antireversing Techniques Lets get one thing out of the way It is never possible to entirely prevent reversing What is possible is to hinder and obstruct reversers by wearing them out and making it so slow and painful. drown the reverser into a sea of irrelevant information Outcome: they give up K. Salah

Basic Approaches to Antireversing Eliminate Symbolic Antireversing Non-byte-code Imported and exported and internal Function names. String names. Byte-code (Java and .NET) Intermediate code of a compiler Uses internal cross-references than addresses Make it so easy to decompile to source code! More: class names, class member names, names of instantiated global objects Use inlining & addresses for function names Obfuscating the program Functionally identical yet far less readable E.g. rename all symbolic links into meaningless symbols Code Encryption Part of the binary executable is encrypted and is decrypted at runtime Only hinders static analysis Embedding Antidebuggers Code Check for debugger existence. If so, terminate or better yet confuse it! Workaround is using static analysis Powerful combination: use encryption with antidebugging. Why? K. Salah

Detecting Debugger TF set in EFLAGS Check handlers in IDT Enable TF and see if exception is swallowed by debugger Code checksum Slowdown runtime Use only for sensitive functions Use a special thread to see if program was stopped for long time Inserting junk bytes into code Use opcode: db or ds Disassemblers get confused Linear sweep vs. recursive traversal K. Salah

Example of Obfuscation – Code Interleaving  K. Salah

Keygenning Definition: The process of creating programs that mimic the key-generation algorithm for everyone to use Software can be blacklisted if it always works with same pair of (serialnumber or username.) Better yet: Key depends on pair of username plus computer-specific info (disk driver serial number) Ripping Keygen Algorithms The process is somewhat easy Locate/copy/paste/modify K. Salah

JAVA, C#, and .NET Reversing is incredibly trivial task Bytecode and MSIL is highly detailed Full definition of every data structure Name of every symbol Every object, data member, and member function Decompile and modify Countermeasures Renaming symbols Control flow obfuscation Breaking decompilation and disassembley Corrupting the metadata with bogus references, strings, methods, etc. K. Salah

Decompiling C# function K. Salah