Lecture 11 Example Rootkit. Intel internship Intel CTG (Corporate Technology Group) –Advanced research & development –System integrity services using.

Slides:



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

Sample chapter from Reverse Engineering Course.
Using VMX within Linux We explore the feasibility of executing ROM-BIOS code within the Linux x86_64 kernel.
Lecture 10: Linking and loading. Lecture 10 / Page 2AE4B33OSS 2011 Contents Linker vs. loader Linking the executable Libraries Loading executable ELF.
Operating System Security : David Phillips A Study of Windows Rootkits.
RIVERSIDE RESEARCH INSTITUTE Helikaon Linux Debugger: A Stealthy Custom Debugger For Linux Jason Raber, Team Lead - Reverse Engineer.
® IBM Software Group © 2010 IBM Corporation What’s New in Profiling & Code Coverage RAD V8 April 21, 2011 Kathy Chan
GROUP 2 WINDOWS INTERNALS TOOLS & WINDOWS SDK DEBUGGING TOOLS David Denhollander Kevin Finkler Corey Sarnia Ailun Shen.
Module 4.2 File management 1. Contents Introduction The file manager Files – the basic unit of storage The need to organise Glossary 2.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Memory Management (II)
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
Memory & Storage Architecture Seoul National University Computer Architecture “ Bomb Lab Hints” 2nd semester, 2014 Modified version : The original.
OllyDbg Debuger.
SRE  Introduction 1 Software Reverse Engineering (SRE)
F13 Forensic tool analysis Dr. John P. Abraham Professor UTPA.
Jackson Behling Robert Barclay GROUP ‘I’
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
OBJECT MODULE FORMATS. The object module format we have employed as an educational device is called OMF (relocatable object format). It’s one of the earliest.
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.
Practical Malware Analysis Ch 8: Debugging Rev
Hands-On Virtual Computing
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 14 Managing and Troubleshooting Windows 2000.
Part 3: Advanced Dynamic Analysis Chapter 8: Debugging.
Rootkits in Windows XP  What they are and how they work.
Analysis of the Fimbel Keylogger and Pace University Converter Christopher Funk, Sheryl Hanchar, and Ned Bakelman.
EECS 354 Network Security Reverse Engineering. Introduction Preventing Reverse Engineering Reversing High Level Languages Reversing an ELF Executable.
14 Step-by-Step Instructions for an Upgrade Installation n Prepare for the installation Verify that all devices and applications are Windows 2000 compatible.
Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16.
Incell Phonium Processor Design Specifications Dale Mansholt Aaron Drake Jonathan Scruggs Travis Svehla Incell Phonium Processor.
Executable Unpacking using Dynamic Binary Instrumentation Shubham Bansal (iN3O) Feb 2015 UndoPack 1.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Eclipse debugger.
MICHALIS POLYCHRONAKIS(COLUMBIA UNIVERSITY,USA), KOSTAS G. ANAGNOSTAKIS(NIOMETRICS, SINGAPORE), EVANGELOS P. MARKATOS(FORTH-ICS, GREECE) ACSAC,2010 Comprehensive.
Module 6: Debugging a Windows CE Image.  Overview Debug Zones IDE Debug Setup IDE Debug Commands Platform Builder Integrated Kernel Debugger Other Debugging.
CSE451 Linking and Loading Autumn 2002 Gary Kimura Lecture #21 December 9, 2002.
RIVERSIDE RESEARCH INSTITUTE Deobfuscator: An Automated Approach to the Identification and Removal of Code Obfuscation Eric Laspe, Reverse Engineer Jason.
Analyzing Malicious Code Nicolas Brulez Ryan Russell Disassembly with a time constraint Recon 2005.
CSCI Rational Purify 1 Rational Purify Overview Michel Izygon - Jim Helm.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Homework tar file Download your course tarball from web page – Named using your PSU ID – Chapter labeled for each binary.
Virtual techdays INDIA │ august 2010 virtual techdays INDIA │ august 2010 Consolidate and Virtualize your Linux Environment M.S.Anand │ Technology.
HPC F ORUM S EPTEMBER 8-10, 2009 Steve Rowan srowan at conveycomputer.com.
Windows ® 2000 Debugging André Vachon Development Lead Windows Debuggers Microsoft Corporation.
Software mechanism of Genesis --- a cheating software for Warcraft3 Yang Chen Wen Sun.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
Lecture 8 Rootkits Hoglund/Butler (Chapter 7-8). Avoiding detection Two ways rootkits can avoid detection –Modify execution path of operating system to.
Lecture 10 Anti-debugger techniques. Anti-debuggers Making reverse-engineering and disassembly painful –Polymorphism –Encryption –Interrupt disabling.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
PV204 Security technologies Reverse engineering of binary applications Petr Švenda Faculty of Informatics, Masaryk University.
Reverse Engineering Contemporary Countermeasures By: Joshua Schwartz.
Lab assignments Follow each lab walkthrough in textbook
Operating System Debugging Support and How Win32 Debuggers Work
Operating System & Application Software
Live Phishing Attack Authentication Activity from a Foreign Address.
Techniques, Tools, and Research Issues
Chapter 1. Basic Static Techniques
Dynamic Analysis ddaa.
Malware Incident Response  Dynamic Analysis - 2
Computer Architecture “Bomb Lab Hints”
Chapter 9: Virtual-Memory Management
Lab assignments Follow each lab walkthrough in textbook
Reverse engineering through full system simulations
Module 6: Debugging a Windows CE Image
CMSC 491/691 Malware Analysis
Code Composer Essentials 3.0
CSC 497/583 Advanced Topics in Computer Security
CSC 497/583 Advanced Topics in Computer Security
Presentation transcript:

Lecture 11 Example Rootkit

Intel internship Intel CTG (Corporate Technology Group) –Advanced research & development –System integrity services using AMT Detecting rootkits C programming experience Low-level OS knowledge Embedded programming Who can I send?

Rustock.B rootkit Frank Boldewin, “A Journey to the Center of the Rustock.B Rootkit”, Jan. 20, 2007 – Combines a number of obfuscation techniques found in other malware

Stage 1: Ollydbg Drop from Mother Ship –Gives you rustock.exe, a Windows PE Step 1 –In Ollydbg, search for all referenced text strings Not much shown due to obfuscation/packing –Use PEID or Protection-ID tools to determine packer/compiler/protector Not much shown, perhaps a proprietary packer used –Check for unrecognized data in code Code loaded at virtual address of 0x Entry point of Rustock.B at 0x401000

Stage 1: Ollydbg Looks like obfuscated code at 0x401B82 –Find references to this address

Stage 1: Ollydbg At 0x040198D –PUSH of 0x401B82 followed by RETN –Same as a CALL –Set breakpoint and run –Obfuscated code should be unobfuscated now

Stage 1: Ollydbg Not quite, have Ollydbg analyze code –Step through API importing code to obtain API names for subsequent call instructions

Stage 1: Ollydbg Find call to kernel32._lcreat –Creates a file called lzx32.sys (kernel mode driver) –Set breakpoint and run again –Select EDI in Registers window and follow it

Stage 1: Ollydbg EDI points to C:\windows\system32:lzx32.sys –Use of : instead of \ –Alternative Data Stream (ADS) Hides the driver from easy detection Windows Explorer and cmd.exe do not show ADS Change memory to replace “:” (0x3a) to a “\” (0x5c) Attach ADS to directory since ADS viewers do not show this –Rerun code and step through driver creation –Stop code at lclose at address 0x401cc7 Driver has been deobfuscated and unpacked now

Stage 2: PE-Tools Driver now detached –Analyze it in IDA to find obfuscated code –Detached driver code and.idb file in “stage1” directory –Attempt to load in Ollydbg Launch using LOADDLL.EXE fails

Stage 2: PE-Tools Change driver –Currently a DLL, a native executable, and contains imports from kernel libraries (NTOSKRNL.EXE and HAL.DLL) –Change to no DLL, a Windows GUI application, and no imports –Fix PE-files using PE-Tools Unmark DLL bit in PE-Tools

Stage 2: PE-Tools Change driver –In Optional Header of PE-Tools, change Subsystem value from 1 to 2 (Windows GUI)

Stage 2: PE-Tools Change driver –Set RVA and size to 0 –Will be reset later

Stage 2: Ollydbg Driver loads now –Same as Stage 1: obfuscated code at 0x116a4

Stage 2: Ollydbg Find references to this address 0x116a4

Stage 2: Ollydbg Two places with PUSH 0x116a4/ RETN –Set breakpoint and run

Stage 2: Ollydbg Analyze code now…

Stage 2: Ollydbg

Dump debugged process

Stage 2: Ollydbg Dump debugged process –Unmark “Rebuild Import”

Stage 2 After dump, restore PE-File settings –DLL bit –Subsystem native –RVA and Size of Import directory field

Stage 3: IDA Load dumped file into IDA

Stage 3: IDA Obfuscated data –Can not use the previous approach

Stage 3 Read code at 0x116a4 –Import APIs from NTOSKRNL –Query system modules running –Allocate kernel memory –Unpack routine (0x11788) Unpacks code to kernel memory –Move unpacked code over packed code area –Grab imports from NTOSKRNL and HAL.DLL, destroy PE-Header, rebase API calls –Free unused kernel memory –JMP EAX at address 0x117c8 Real driver created dynamically –Must rip the unpacking code at 0x117d3 and dump whole data as file before PE-Header destroyed and driver code rebased

Stage 3 Program included

Stage 3: Reversing Rustock.B door.rustock.b.html#technicaldetails

Doing it faster with a kernel debugger SoftICE+ICEEXT –Special function in NTOSKRNL.EXE to load driver IopLoadDriver Is not exported by default –Need proper.pdb file of NTOSKRNL.EXE from Microsoft server –Need to convert it to SoftICE format.nms –Problem: SoftICE symbol retriever unreliable –Read Frank Boldewin’s SoftICE howto Alternative –Leech Windows Debugging Tools from MSFT –Read paper for recipe

Cleanup Run RkUnhooker