Www.SecurityXploded.com. Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.

Slides:



Advertisements
Similar presentations
Pokas x86 Emulator for Generic Unpacking By Amr Thabet
Advertisements

Sample chapter from Reverse Engineering Course.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
RIVERSIDE RESEARCH INSTITUTE Helikaon Linux Debugger: A Stealthy Custom Debugger For Linux Jason Raber, Team Lead - Reverse Engineer.
Dean Carlson and Beth Anne Byrd CpSc 420.  What is reverse engineering?  Brief History  Usefulness  The process  Bagle Virus example.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Reverse Engineering Ian Kayne For School of Computer Science, University of Birmingham 2 nd February 2009.
OllyDbg Debuger.
SRE  Introduction 1 Software Reverse Engineering (SRE)
Code Injection and Software Cracking’s Effect on Network Security Group 5 Jason Fritts Utsav Kanani Zener Bayudan ECE 4112 Fall 2007.
CAS: A FRAMEWORK OF ONLINE DETECTING ADVANCE MALWARE FAMILIES FOR CLOUD-BASED SECURITY From: First IEEE International Conference on Communications in China:
Defeating public exploit protections (EMET v5.2 and more)
Software Analysis & Deobfuscation Engine. Page  2  Project Name: SADE  Project Members: Faiza Khalid, Komal Babar and Abdul Wahab  Project Supervisor.
Part 5: Anti-Reverse-Engineering Chapter 15: Anti-Disassembly Chapter 16: Anti-Debugging Chapter 17: Anti-Virtual Machine Techniques Chapter 18: Packing.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Introduction to Android Swapnil Pathak Advanced Malware Analysis Training Series.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Trying to like a boss… REVERSE ENGINEERING. WHAT EVEN IS… REVERSE ENGINEERING?? Reverse engineering is the process of disassembling and analyzing a particular.
Application Security Tom Chothia Computer Security, Lecture 14.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Part 3: Advanced Dynamic Analysis Chapter 8: Debugging.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Part 5: Anti-Reverse-Engineering
Ether: Malware Analysis via Hardware Virtualization Extensions Author: Artem Dinaburg, Paul Royal, Monirul Sharif, Wenke Lee Presenter: Yi Yang Presenter:
Monnappa KA  Info Security Cisco  Member of SecurityXploded  Reverse Engineering, Malware Analysis, Memory Forensics 
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
EECS 354 Network Security Reverse Engineering. Introduction Preventing Reverse Engineering Reversing High Level Languages Reversing an ELF Executable.
Malware Analysis Jaimin Shah & Krunal Patel Vishal Patel & Shreyas Patel Georgia Institute of Technology School of Electrical and Computer Engineering.
Executable Unpacking using Dynamic Binary Instrumentation Shubham Bansal (iN3O) Feb 2015 UndoPack 1.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
1 OmniUmpack: Fast, Generic, and Safe Unpacking of Malware Authors: Lerenzo Martignoni, Mihai Christodorescu and Somesh Jha Computer Security Applications.
1 CHAPTER 5 DIFFING. 2 What is Diffing? Practice of comparing two sets of data, before and after a changed has occurred Practice of comparing two sets.
Analyzing Malicious Code Nicolas Brulez Ryan Russell Disassembly with a time constraint Recon 2005.
Amit Malik SecurityXploded Research Group FireEye Labs.
Static Shared Library. Non-shared v.s. Shared Library A library is a collection of pre-written function calls. Using existing libraries can save a programmer.
LOGOPolyUnpack: Automating the Hidden-Code Extraction of Unpack-Executing Malware Royal, P.; Halpin, M.; Dagon, D.; Edmonds, R.; Wenke Lee; Computer Security.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Stealing Passwords Remotely & Malware Analysis PacITPros May 8, 2012.
Homework tar file Download your course tarball from web page – Named using your PSU ID – Chapter labeled for each binary.
1 Software. 2 What is software ► Software is the term that we use for all the programs and data on a computer system. ► Two types of software ► Program.
Copyright Security-Assessment.com 2006 Unpacking Malware, Trojans and Worms PE Packers Used in Malicious Software Presented by Paul Craig Ruxcon 2006.
Software mechanism of Genesis --- a cheating software for Warcraft3 Yang Chen Wen Sun.
Lecture 11 Example Rootkit. Intel internship Intel CTG (Corporate Technology Group) –Advanced research & development –System integrity services using.
Lecture 10 Anti-debugger techniques. Anti-debuggers Making reverse-engineering and disassembly painful –Polymorphism –Encryption –Interrupt disabling.
PGP Desktop (Client only) By: Courtney Wirtz & Vincent Verner.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Reverse Engineering Contemporary Countermeasures By: Joshua Schwartz.
Semi-Automatic Unpacking on IA-32 Using OllyBonE Joe Stewart.
Polymorphic Virus Analysis Nicolas BRULEZ Senior Virus Researcher Websense Security Labs IMPROVISED TALK MMMKAY?!
Lab assignments Follow each lab walkthrough in textbook
Live Phishing Attack Authentication Activity from a Foreign Address.
Chapter 1. Basic Static Techniques
Techniques, Tools, and Research Issues
Malware Incident Response  Dynamic Analysis - 2
This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational.
Attacking Obfuscated Code with IDA Pro
Lab assignments Follow each lab walkthrough in textbook
Part 5: Anti-Reverse-Engineering
CMSC 491/691 Malware Analysis
CSC 497/583 Advanced Topics in Computer Security
CSC 497/583 Advanced Topics in Computer Security
Setup a VM to use for analyzing malware
This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational.
Presentation transcript:

Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions of any kind. Also the views/ideas/knowledge expressed here are solely of the trainer’s only and nothing to do with the company or the organization in which the trainer is currently working. However in no circumstances neither the trainer nor SecurityXploded is responsible for any damage or loss caused due to use or misuse of the information presented here.

Acknowledgement  Special thanks to null & Garage4Hackers community for their extended support and cooperation.  Thanks to all the trainers who have devoted their precious time and countless hours to make it happen.

Reversing & Malware Analysis Training This presentation is part of our Reverse Engineering & Malware Analysis Training program. Currently it is delivered only during our local meet for FREE of cost. For complete details of this course, visit our Security Training page.Security Training page

Who am I Nagareshwar Talekar  Founder of SecurityXploded  Reverse Engineering, Malware Analysis, Cryptography, Password Forensics, Secure Coding etc.  tnagareshwar at gmail.com

Contents  What is EXE Packing?  Purpose of Packing EXE  What is Unpacking?  Detection of Packer  Execution of Packed EXE Program  Standard Process of Unpacking EXE  Unpacking UPX using OllyDbg  DEMO - Unpacking UPX  Anti Anti-Debugging Plugins  References

What is EXE Packing/Protecting?  EXE Packing: Compressing the Executable to a smaller Size  EXE Protecting: Encrypting with Anti-Debugging Techniques to prevent Reversing In Reversing world, both Packer & Protector is commonly referred as Packer. Examples of Packers: UPX, AsProtect, Armadillo etc.

EXE - Before Packing

EXE - After Packing

Purpose of Packing EXE  Prevent Reverse Engineering [Crack License, Secret Code etc.] Defeat Static Disassembling Make Dynamic Debugging Difficult  Reduce the size of Executable file  Bypass Anti-virus Detections with multi-level Packing It is used by Software Vendors to prevent Serial Cracking and Malware Authors to prevent analysis by AV Researchers.

What is Unpacking?  Extracting the Original Binary from the Packed Executable File.  Automatic Unpackers available for popular Packers. May not work with different versions Not available for Complex packers  Involves Live Debugging by Defeating Anti-Debugging techniques

Detection of Packer  Packer Detectors like PEiD, RDG, ExeScan etc Detect the popular Packers Show the version of Packer also  PE Viewer Tools like PEditor, PEview Look at Section Table Look at Import Table

Packer Detectors

Structure of Packed EXE Before PackingAfter Packing

Execution of Packed EXE Program  Execution starts from new OEP  Saves the Register status using PUSHAD instruction  All the Packed Sections are Unpacked in memory  Resolve the import table of original executable file.  Restore the original Register Status using POPAD instruction  Finally Jumps to Original Entry point to begin the actual execution

Standard Process of Unpacking EXE  Debug the EXE to find the real OEP (Original Entry Point)  At OEP, Dump the fully Unpacked Program to Disk  [?] Fix the Import Table using ImpRec Tool  [?] Fix the PE Header

Unpacking UPX using OllyDbg  Load the UPX packed EXE file into the OllyDbg  Start tracing the EXE, until you encounter a PUSHAD instruction.  At this stage, put the Hardware Breakpoint (type 'hr esp-4' at command bar) so as to stop at POPAD instruction.  Other way is to manually search for POPAD (Opcode 61) instruction and then set Breakpoint on it.

Unpacking UPX using OllyDbg (contd)  Next press F9 to continue the Execution.  You will break on the instruction which is immediately after POPAD or on POPAD instruction [based on the method you have chosen]  Now start tracing with F7 and soon you will encounter a JMP instruction which will Jump to OEP in the original program.  At OEP, dump the whole program using OllyDmp plugin.

DEMO - Unpacking UPX

Anti Anti-Debugging Plugins Here are useful OllyDbg Plugins for Anti Anti-Debugging  Olly Advanced  Hide Debugger  NtGlobalFlag  Anti Anti BPM

Useful Tips  Always use simple EXE for Unpacking exercises  Use same EXE for all – You will know the OEP & other magic numbers  Use Windows XP for better (less annoying) debugging experience.  Have Patience, Its an Art and takes time.  For best results, do it in the Moon Light

What's Next?  Try Unpacking AsPack, AsProtect, PESpin, YodaP etc  Try Unpacking Packed DLL ( Google - Neolite DLL Unpacking )  Try Advanced Packers: Armadillo

Reference  Complete Reference Guide for Reversing & Malware Analysis Training Complete Reference Guide for Reversing & Malware Analysis Training

Thank You !