Detecting Malware With Memory Forensics. Hal Pomeranz SANS Institute



Similar documents
CHAD TILBURY.

The Value of Physical Memory for Incident Response

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

Memory Forensics: Collecting & Analyzing Malware Artifacts from RAM

Digital Forensic analysis of malware infected machine Case study ***

FATKit: A Framework for the Extraction and Analysis of Digital Forensic Data from Volatile System Memory p.1/11

Redline Users Guide. Version 1.12


Storm Worm & Botnet Analysis

An Introduction to Incident Detection and Response Memory Forensic Analysis

VISA SECURITY ALERT December 2015 KUHOOK POINT OF SALE MALWARE. Summary. Distribution and Installation

Online Payments Threats

Redline User Guide. Release 1.14

TZWorks Windows Event Log Viewer (evtx_view) Users Guide

Detecting the One Percent: Advanced Targeted Malware Detection

Physical Memory Standard Operating Procedures

This report is a detailed analysis of the dropper and the payload of the HIMAN malware.

Advanced Malware Cleaning Techniques for the IT Professional

finding malware on compromised Windows machines

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 2 Introducing Operating Systems

Detecting Unknown Malware: Security Analytics & Memory Forensics. Fahad Ehsan. Cyber Security #RSAC

Y R O. Memory Forensics: A Volatility Primer M E M. Mariano Graziano. Security Day - Lille1 University January Lille, France

Fall. Forensic Examination of Encrypted Systems Matthew Postinger COSC 374

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Cloud Backup Express

Persist It Using and Abusing Microsoft s Fix It Patches

GRC & Cyber Security Conference - Bringing the Silos Together ISACA Ireland 3 Oct 2014 Fahad Ehsan

Chapter 14 Analyzing Network Traffic. Ed Crowley

Memory Forensics & Security Analytics: Detecting Unknown Malware

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

5 Steps to Advanced Threat Protection

Workflow Templates Library

Inside Windows Rootkits

Redline Users Guide. Please visit our forums:

Comprehensive Malware Detection with SecurityCenter Continuous View and Nessus. February 3, 2015 (Revision 4)

Bypassing Local Windows Authentication to Defeat Full Disk Encryption. Ian Haken

Q-CERT Workshop. Matthew Geiger 2007 Carnegie Mellon University

ITA Mail Archive Setup Guide

Stop the Maelstrom: Using Endpoint Sensor Data in a SIEM to Isolate Threats

Incident Response. Six Best Practices for Managing Cyber Breaches.

Web-Based Data Backup Solutions

One-byte Modification for Breaking Memory Forensic Analysis

Run-Time Deep Virtual Machine Introspection & Its Applications

cubesql ReadMe SQLabs, All rights reserved.

Malware Analysis Report

Windows Operating Systems. Basic Security

USB 2.0 Flash Drive User Manual

Deploying EFS: Part 2

PARALLELS SERVER BARE METAL 5.0 README

DigitalPersona Pro Enterprise

Endpoint protection for physical and virtual desktops

Securing Secure Browsers

EVTXtract. Recovering EVTX Records from Unallocated Space PRESENTED BY: Willi Ballenthin OCT 6, Mandiant Corporation. All rights reserved.

Quick Start Guide for Parallels Virtuozzo

Quick Start Guide for VMware and Windows 7

Search and Destroy the Unknown FROM MALWARE ANALYSIS TO INDICATIONS OF COMPROMISE

Pcounter Web Report 3.x Installation Guide - v Pcounter Web Report Installation Guide Version 3.4

Application Whitelisting - Extend your Security Arsenal? Mike Baldi Cyber Security Architect Honeywell Process Solutions

MSc Computer Security and Forensics. Examinations for / Semester 1

IceWarp to IceWarp Server Migration

Welcome! Windows Security at SANS Recommended Reading

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Network Licensing. White Paper 0-15Apr014ks(WP02_Network) Network Licensing with the CRYPTO-BOX. White Paper

13.1 Backup virtual machines running on VMware ESXi / ESX Server

FORENSIC ARTIFACTS FROM A PASS THE HASH (PTH) ATTACK BY: GERARD LAYGUI

Recon and Mapping Tools and Exploitation Tools in SamuraiWTF Report section Nick Robbins

Using Remote Desktop Clients

Virtual Appliance for VMware Server. Getting Started Guide. Revision Warning and Disclaimer

Is the Scanning of Computer Networks Dangerous?

IBM Tivoli Monitoring V6.2.3, how to debug issues with Windows performance objects issues - overview and tools.

Oracle post exploitation techniques. László Tóth

System Requirements - Table of Contents

Preparing a SQL Server for EmpowerID installation

Cyber Security in Taiwan's Government Institutions: From APT To. Investigation Policies

Getting Ahead of Malware

Endpoint protection for physical and virtual desktops

Spyware Analysis. Security Event - April 28, 2004 Page 1

Host-based Intrusion Prevention on Windows and UNIX. Dr. Rich Murphey White Oak Labs

CAS : A FRAMEWORK OF ONLINE DETECTING ADVANCE MALWARE FAMILIES FOR CLOUD-BASED SECURITY

Uroburos Highly complex espionage software with Russian roots

Windows security for n00bs part 1 Security architecture & Access Control

BlackBerry Enterprise Service 10. Secure Work Space for ios and Android Version: Security Note

CLC Server Command Line Tools USER MANUAL

Techniques and Tools for Recovering and Analyzing Data from Volatile Memory

Windows Rootkit Overview

Adi Hayon Tomer Teller

Security Intelligence Services. Cybersecurity training.

4.1 Introduction 4.2 Explain the purpose of an operating system Describe characteristics of modern operating systems Control Hardware Access

Setup and Analysis of ZeuS Banking Trojan V w/ Volatility and LibVMI in a Virtualized Lab

How To Install An Aneka Cloud On A Windows 7 Computer (For Free)

SecureDoc Disk Encryption Cryptographic Engine

Automation of Post-Exploitation

Retrieving Internet chat history with the same ease as a squirrel cracks nuts

Evolving Threat Landscape

Transcription:

Detecting Malware With Memory Forensics Hal Pomeranz SANS Institute

Why Memory Forensics? Everything in the OS traverses RAM Processes and threads Malware (including rootkit technologies) Network sockets, URLs, IP addresses Open files User generated content Passwords, caches, clipboards Encryption keys Hardware and software configuration Windows registry keys and event logs

Memory Analysis Advantages Best place to identify malicious software activity Study running system configuration Identify inconsistencies (contradictions) in system Bypass packers, binary obfuscators, rootkits (including kernel mode) and other hiding tools. Analyze and track recent activity on the system Identify all recent activity in context Profile user or attacker activities Collect evidence that cannot be found anywhere else Memory-only malware Chat threads Internet activities

What is Memory Forensics? Study of data captured from memory of a target system Ideal analysis includes physical memory data (from RAM) as well as Page File (or SWAP space) data Acquire Context Analyze Capture Raw Memory Hibernation File Establish Context Find Key Memory Offsets Analyze Data For Significant Elements Recover Evidence

Windows Memory Acquisition LIVE System (RAM Acquisition) Win2k XP Win2003 VISTA Win2008 DumpIt.exe http://www.moonsols.com/2011/07/18/moonsols-dumpit-goes-mainstream/ win32dd.exe / win64dd.exe Author: Matthew Suiche http://www.moonsols.com/products/ Mandiant Redline http://www.mandiant.com/products/free_software/redline/ DEAD System Hibernation File Contains a compressed RAM Image %SystemDrive%/hiberfil.sys Windows 7

Virtual Machine Memory Acquisition VMware (Fusion/Workstation/Server/Player).vmem file = raw memory image Microsoft Hyper-V.bin file = raw memory image Parallels.mem file = raw memory image VirtualBox.sav file = partial memory image

Extract Memory from Hibernation File (hiberfil.sys) hibr2bin can acquire physical memory (RAM) from a Windows hibernation file (XP and VISTA only) Pro Version Compatible with XP-Win7/2008 (32 and 64 bit) hibr2bin.exe <input file> <output file> Location on COURSE DVD: D:\windows forensic tools\memory imaging\ Example: Extract hibernation file memory and save to a USB DRIVE D:\> hibr2bin D:\hiberfil.sys E:\hibernation_memory.img ** Volatility can also convert hibernation files **

DLL Injection

Normal DLL Interaction Library Call 1 4 User space ntdll.dll 2 3 Kernel Kernel space

DLL Injection Rootkit 7 2 Library Call 1 User space 3 ntdll.dll 6 4 5 Kernel Kernel space

Detecting Injection DLL injection is very common with modern malware VirtualAllocEx( ) and CreateRemoteThread( ) SetWindowsHookEx( ) Process hollowing is another injection technique Malware starts a new instance of legitimate process Original process code de-allocated and replaced Retains DLLs, handles, data, etc. from original process Code injection is relatively easy to detect Review memory sections marked as Page_Execute_ReadWrite and having no memory-mapped file present Scan for DLLs (PE files) and shellcode Process image not backed with file on disk = process hollowing

Zeus / Zbot Overview Persistent malware designed to steal credentials Many variants. A popular one does the following: Copies itself to %system32%\sdra64.exe Injects code into winlogon.exe or explorer.exe Further injects code into every process but csrss & smss Auto-start path: HKLM\Software\Microsoft\Windows NT\winlogon\userinit Creates local.ds & user.ds in %sytem32%\lowsec\ Retrieves files from command and control server Mutant: _AVIRA_ Hooks over 50 system APIs

Using Mandiant Redline Guided Analysis Host View Process View Information Pane

Detecting Code Injection: Zeus/Zbot DLL Injection

Detecting Code Injection: Finding Injected Sections

Volatility Command-line memory forensic tool Primarily Windows-focused Linux (Android) & Mac support now available Modular, portable

Help! The h flag gives configuration information in Volatility Used alone it identifies the version, currently loaded plugins, and common parameters Use h with a plugin to get details and plugin-specific usage

Code Injection ldrmodules Purpose DLLs are tracked in three different linked lists for each process. Stealthy malware can unlink loaded DLLs from these lists. This plugin queries each list and displays the results for comparison. Important Parameters Verbose -- show full paths from each of the three DLL lists (-v) Show information for specific process IDs (-p) Investigative Notes Most loaded DLLs will be in all 3 lists, having a 1 in each column. Legitimate entries may be missing in some of the lists e.g. the process executable will not be present in the InInit list If an entry has no MappedPath information it is indicative of an injected DLL not available on disk (usually bad)

Purpose Rootkit Detection apihooks Detect inline and Import Address Table function hooks used by rootkits to modify and control information returned Important Parameters Operate only on these process IDs (-p PID) Scan kernel modules instead of user-mode objects (-k) Investigative Notes A large number of legitimate hooks can exist, weeding them out takes practice and an eye for looking for anomalies This plug-in can take a long time to run due to the sheer number of locations it must query be patient!

Analyzing Process Objects: malfind Purpose Scans process memory sections looking for indications of code injection. Identified sections are extracted for further analysis. Important Parameters Directory to save extracted files (--dump-dir=directory) Show information for specific process IDs (-p PID) Use psscan to find processes = more rigorous (-s) Search using YARA rules (-y YARA rules file) Scan kernel modules/drivers using Yara Rules (-K) Investigative Notes While malfind has an impressive hit rate, false positives do occur Disassembled code provided can be helpful as a sanity check You may see multiple injected sections within the same process Dumped sections can be reverse engineered or sent to A/V

Process Hiding

EPROCESS Linked List smss.exe csrss.exe lsass.exe winlogon.exe wordpad.exe svchost.exe cmd.exe explorer.exe calc.exe wscntfy.exe wordpad.exe svchost.exe svchost.exe taskmgr.exe

Hiding a Process smss.exe csrss.exe lsass.exe winlogon.exe wordpad.exe svchost.exe cmd.exe explorer.exe calc.exe wscntfy.exe wordpad.exe svchost.exe svchost.exe taskmgr.exe

Rootkit Detection psxview (FU Rootkit) PID 1608 (svchost.exe) hidden via DKOM

Stop Pulling the Plug

Wrapping Up Any final questions? Thanks for listening! Hal Pomeranz SANS Institute hal@sans.org Twitter: @hal_pomeranz http://computer-forensics.sans.org/blog/author/halpomeranz/ http://www.sans.org/security-training/instructors/hal-pomeranz http://www.deer-run.com/~hal/