FunCap RAPID REVERSING WITH IDA PRO DEBUGGER ANDRZEJ DERESZOWSKI

Similar documents
Monitoring, Tracing, Debugging (Under Construction)

Automating Linux Malware Analysis Using Limon Sandbox Monnappa K A monnappa22@gmail.com

Mobile Application Hacking for Android and iphone. 4-Day Hands-On Course. Syllabus

Attacking Obfuscated Code with IDA Pro. Chris Eagle

Mobile Application Hacking for ios. 3-Day Hands-On Course. Syllabus

Advanced ANDROID & ios Hands-on Exploitation

Linux. Reverse Debugging. Target Communication Framework. Nexus. Intel Trace Hub GDB. PIL Simulation CONTENTS

Real-time Debugging using GDB Tracepoints and other Eclipse features

Fine-grained covert debugging using hypervisors and analysis via visualization

RTOS Debugger for ecos

What s Cool in the SAP JVM (CON3243)

Android Packer. facing the challenges, building solutions. Rowland YU. Senior Threat Researcher Virus Bulletin 2014

Adi Hayon Tomer Teller

Dongwoo Kim : Hyeon-jeong Lee s Husband

ios Testing Tools David Lindner Director of Mobile and IoT Security

C Programming Review & Productivity Tools

Storm Worm & Botnet Analysis

Melde- und Analysestelle Informationssicherung MELANI Torpig/Mebroot Reverse Code Engineering (RCE)

Bug hunting. Vulnerability finding methods in Windows 32 environments compared. FX of Phenoelit

Chapter 14 Analyzing Network Traffic. Ed Crowley

Java Troubleshooting and Performance

Hotpatching and the Rise of Third-Party Patches

STLinux Software development environment

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

When Security Gets in the Way. PenTesting Mobile Apps That Use Certificate Pinning

Debugging with TotalView

Security Intelligence Services. Cybersecurity training.

AGENDA. Background. The Attack Surface. Case Studies. Binary Protections. Bypasses. Conclusions

GPU Profiling with AMD CodeXL

Application-Level Debugging and Profiling: Gaps in the Tool Ecosystem. Dr Rosemary Francis, Ellexus

Hands-on CUDA exercises

Debugging Windows Applications with IDA WinDbg Plugin Copyright 2011 Hex-Rays SA

Running a Program on an AVD

Lecture 26: Obfuscation

ios applications reverse engineering Julien Bachmann

Detecting Malware With Memory Forensics. Hal Pomeranz SANS Institute

ANDROID DEVELOPER TOOLS TRAINING GTC Sébastien Dominé, NVIDIA

How to test and debug an ASP.NET application

Mobile Application Security and Penetration Testing Syllabus

Testing for Security

This is DEEPerent: Tracking App behaviors with (Nothing changed) phone for Evasive android malware

So You Want To Analyze Malware? Tools, Techniques, and Mindset

Introduction. Figure 1 Schema of DarunGrim2

How To Develop For A Powergen 2.2 (Tegra) With Nsight) And Gbd (Gbd) On A Quadriplegic (Powergen) Powergen Powergen 3

Mobile Performance Management Tools Prasanna Gawade, Infosys April 2014

The Value of Physical Memory for Incident Response

Reverse Engineering by Crayon: Game Changing Hypervisor and Visualization Analysis

GlassFish v3. Building an ex tensible modular Java EE application server. Jerome Dochez and Ludovic Champenois Sun Microsystems, Inc.

Compilers and Tools for Software Stack Optimisation

APPLICATION SECURITY: FROM WEB TO MOBILE. DIFFERENT VECTORS AND NEW ATTACK

for Malware Analysis Daniel Quist Lorie Liebrock New Mexico Tech Los Alamos National Laboratory

Microsoft Patch Analysis

Prof. Christos Xenakis, Dr. Christoforos Ntantogian Department of Digital Systems University of Piraeus, Greece

TOOL EVALUATION REPORT: FORTIFY

CHAD TILBURY.

Using Microsoft Visual Studio API Reference

Review and Exploit Neglected Attack Surface in ios 8. Tielei Wang, Hao Xu, Xiaobo Chen of TEAM PANGU

Mobile Application Security Testing ASSESSMENT & CODE REVIEW

Introduction. Application Security. Reasons For Reverse Engineering. This lecture. Java Byte Code

Department of Veterans Affairs. Open Source Electronic Health Record Services

SYLLABUS MOBILE APPLICATION SECURITY AND PENETRATION TESTING. MASPT at a glance: v1.0 (28/01/2014) 10 highly practical modules

Developing, Deploying, and Debugging Applications on Windows Embedded Standard 7

<Insert Picture Here> Oracle Database Support for Server Virtualization Updated December 7, 2009

The Intel VTune Performance Analyzer

Pentesting iphone & ipad Apps Hack In Paris 2011 June 17

Virtualization System Vulnerability Discovery Framework. Speaker: Qinghao Tang Title:360 Marvel Team Leader

Full System Emulation:

Advanced Scripting Techniques for Automating Regression Tests and Measurements with the Code Composer Studio Scripting Utility

Performance Counter. Non-Uniform Memory Access Seminar Karsten Tausche

Implementation and Implications of a Stealth Hard-Drive Backdoor

SCADA/HMI MOVICON TRAINING COURSE PROGRAM

Inside a killer IMBot. Wei Ming Khoo University of Cambridge 19 Nov 2010

Testing Mobile Apps CS 4720 Web & Mobile Systems

ERIKA Enterprise pre-built Virtual Machine

The Hacker Strategy. Dave Aitel Security Research

Exploring the impact of a hard drive backdoor. Jonas Zaddach

Pro ASP.NET 4 CMS. Using the JET 4 Framework. Advanced Techniques for C# Developers. Apress. Alan Harris

ICC. NetLink Version Info INDUSTRIAL CONTROL COMMUNICATIONS, INC.

Integrating SNiFF+ with the Data Display Debugger (DDD)

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

Reversing in OS X - what s different

DS-5 ARM. Using the Debugger. Version 5.7. Copyright 2010, 2011 ARM. All rights reserved. ARM DUI 0446G (ID092311)

Run-Time Deep Virtual Machine Introspection & Its Applications

Basics of VTune Performance Analyzer. Intel Software College. Objectives. VTune Performance Analyzer. Agenda

Using jvmstat and visualgc to Solve Memory Management Problems

Performance Analysis and Visualization of SystemC Models. Adam Donlin and Thomas Lenart Xilinx Research

Android Developer Fundamental 1

Using the Intel Inspector XE

Fahim Uddin 1. Java SDK

OWASP Mobile Top Ten 2014 Meet the New Addition

Sequential Performance Analysis with Callgrind and KCachegrind

DS-5 ARM. Using the Debugger. Version Copyright ARM. All rights reserved. ARM DUI 0446M (ID120712)

Understand and Build Android Programming Environment. Presented by: Che-Wei Chang

Using Process Monitor

ELEC 377. Operating Systems. Week 1 Class 3

GDB Tutorial. A Walkthrough with Examples. CMSC Spring Last modified March 22, GDB Tutorial

Jonathan Worthington Scarborough Linux User Group

Targeted attacks: From being a victim to counter attacking

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Transcription:

FunCap RAPID REVERSING WITH IDA PRO DEBUGGER ANDRZEJ DERESZOWSKI

Who am I? Security consultant with focus on incident handling, forensics and malware analysis Not a dedicated reverser RE is just part of my job => I avoid RE as much as possible as it is just too time consuming

Tools we use IDA Pro for static analysis OllyDbg for debugging (other tools used by real reversing gurus like PIN, metasm etc. are out of scope here)

Problem => Olly gives a lot of good info during debugging but this won t be visible in IDA => Unpacked code needs rebuilding to load in IDA, not always easy IN SHORT: No automatic connection between the two tools

Idea Why not connect both worlds and provide automated solution? First I wanted to use IDA Pro tracer but realized it is too slow and generating not easily-readable data with too much noise The inspiration: PaiMei Stalker by Pedram Amini - old and not developed any more, with only win32 userland support (uses PyDbg) Places breakpoints at each function start based on imported IDB from IDA Exports a script to load comments from the debugger to IDA s listing Let s implement a solution by using IDA debugger!

Introducing FunCap IDApython script/plugin Aims to combine runtime info and feeds it into the static listing IN SHORT: you can run some code in the sandbox VM and it will add useful comments to your IDA listing based on the recorded code execution RESULT: you understand some functions without even looking at them SAVES TIME!

Funcap how it works Places breakpoints on function call instructions (alternatively breakpoints can be places on function start and end) Runs IDA debugger When a breakpoint is hit it captures the arguments and function address and tries to dereference them and guess their type (currently only string, int and pointers) Places a breakpoint directly after the call instruction When the call returns they are dereferenced again to see how the memory was changed This information is dumped to a text file and inserted into the IDA listing

Funcap features (1) Supports ia-32, ia-64 and ARM more can easily be added Supports Win32, Win64, Linux32, Linux64, Android. No MacOS or ios yet. Supports almost any IDA debugger connector, even PIN tracer connector

Funcap features (2) Builds a runtime call graph code_discovery mode to automatically deal with packers Python> code_discovery = True 0x9c299a: new code section detected: [0x9c1000, 0x9c3000] hooking function: sub_9c299a() Function call: sub_1000156e+147 to sub_9c299a (0x9c299a)

Funcap features (3) Resolves indirect calls API calls can be captured as well Full context is dumped to the file, subset of the context is pasted into IDAs listing annotations Hexdump or ASCII capture format Python> hexdump = True

Funcap features (4) Recursive argument dereferencing idea taken from PEDA for GDB Capture scope easily configurable (which registers etc.) Recursive function hooking mode for large binaries Python> d.recursive = True Easy command line interface in Python Functions that were executed are marked by a different color

Funcap DEMO 1. Taidoor basic example 2. ZEUS/Citadel usage of the call graph 3. Unknown APT code_discovery mode 4. Snake/Uroburos Funcap in kernel mode (just results) 5. Android Funcap for ARM/Thumb (just results)

Funcap limitations No threads following (recursive mode) Code injected to another process is not going to be followed Call graph a bit unfriendly to the user Only basic types are dereferenced (no structures) Argument count determination not very accurate on ia64 and ARM

Funcap future directions Threads following Breakpoint on thread creation? Remote process code injection following Cuckoo plugin? Switching to kernel mode debugger? Better graph solution Visualize outside IDA (Gephi perhaps?) Better argcount determination and complex types support Using decompiler plugin? Automation and database storage

Questions? deresz@gmail.com http://github.com/deresz/funcap