Fighting malware on your own



Similar documents
Software Fingerprinting for Automated Malicious Code Analysis

Introduction to Reverse Engineering

Abysssec Research. 1) Advisory information. 2) Vulnerable version

TitanMist: Your First Step to Reversing Nirvana TitanMist. mist.reversinglabs.com

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

Introduction. Figure 1 Schema of DarunGrim2

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

Computer Organization and Assembly Language

Return-oriented programming without returns

Heap-based Buffer Overflow Vulnerability in Adobe Flash Player

Windows XP SP3 Registry Handling Buffer Overflow

Self Protection Techniques in Malware

Evaluating a ROP Defense Mechanism. Vasilis Pappas, Michalis Polychronakis, and Angelos D. Keromytis Columbia University

1. General function and functionality of the malware

Attacking x86 Windows Binaries by Jump Oriented Programming

esrever gnireenigne tfosorcim seiranib

Off-by-One exploitation tutorial

INTRODUCTION TO MALWARE & MALWARE ANALYSIS

Title: Bugger The Debugger - Pre Interaction Debugger Code Execution

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

Absolute Backdoor Revisited. Vitaliy Kamlyuk, Kaspersky Lab Sergey Belov, Kaspersky Lab Anibal Sacco, Cubica Labs

Reverse Engineering and Computer Security

Software Vulnerabilities

Authoring for System Center 2012 Operations Manager

Using fuzzing to detect security vulnerabilities

Chapter 14 Analyzing Network Traffic. Ed Crowley

Harnessing Intelligence from Malware Repositories

CS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 20: Stack Frames 7 March 08

Analysis of Win32.Scream

A Tiny Guide to Programming in 32-bit x86 Assembly Language

Assembly Language: Function Calls" Jennifer Rexford!

Bypassing Anti- Virus Scanners

Identification and Removal of

Violating Database - Enforced Security Mechanisms

Systems Design & Programming Data Movement Instructions. Intel Assembly

CORPORATE AV / EPP COMPARATIVE ANALYSIS

Hacking Techniques & Intrusion Detection. Ali Al-Shemery arabnix [at] gmail

The Value of Physical Memory for Incident Response

FortKnox Personal Firewall

Anti-Virus Evasion Techniques and Countermeasures

Computer Virus Strategies and Detection Methods

Diving into a Silverlight Exploit and Shellcode - Analysis and Techniques

REpsych. : psycholigical warfare in reverse engineering. def con 2015 // domas

64-Bit NASM Notes. Invoking 64-Bit NASM

Kaspersky Fraud Prevention: a Comprehensive Protection Solution for Online and Mobile Banking

Stitching the Gadgets On the Ineffectiveness of Coarse-Grained Control-Flow Integrity Protection

WLSI Windows Local Shellcode Injection. Cesar Cerrudo Argeniss (

Storm Worm & Botnet Analysis

EU FP6 LOBSTER. personal view on the future of ero-day Worm Containment. European Infrastructure for accurate network monitoring

Hotpatching and the Rise of Third-Party Patches

Efficient Program Exploration by Input Fuzzing

Format string exploitation on windows Using Immunity Debugger / Python. By Abysssec Inc

Malware Detection in Android by Network Traffic Analysis

Astaro Security Gateway V8. Remote Access via L2TP over IPSec Configuring ASG and Client

A Museum of API Obfuscation on Win32

Packers. (5th April 2010) Ange Albertini Creative Commons Attribution 3.0

Certified Ethical Hacker Exam Version Comparison. Version Comparison

Buffer Overflows. Security 2011

Mission 1: The Bot Hunter

Networks and Security Lab. Network Forensics

The Beast is Resting in Your Memory On Return-Oriented Programming Attacks and Mitigation Techniques To appear at USENIX Security & BlackHat USA, 2014

Hide and seek - how targeted attacks hide behind clean applications Szappanos Gábor

PE Explorer. Heaventools. Malware Code Analysis Made Easy

Malicious Programs. CEN 448 Security and Internet Protocols Chapter 19 Malicious Software

Detecting the One Percent: Advanced Targeted Malware Detection

Deep Dive into.net Malwares

Penetration Testing with Kali Linux

Semantic based Web Application Firewall (SWAF V 1.6) Operations and User Manual. Document Version 1.0

Detecting Malware With Memory Forensics. Hal Pomeranz SANS Institute

Packers Models. simple. malware. advanced. allocation. decryption. decompression. engine loading. integrity check. DRM Management

Customer Tips. Xerox Network Scanning HTTP/HTTPS Configuration using Microsoft IIS. for the user. Purpose. Background

Security Correlation Server Quick Installation Guide

McAfee Avert Labs Finding W32/Conficker.worm

Firewalls and Software Updates

Agenda. Taxonomy of Botnet Threats. Background. Summary. Background. Taxonomy. Trend Micro Inc. Presented by Tushar Ranka

Peeling The Layers Of Vawtrak

Penetration Test Methodology on Information-Security Product Utilizing the Virtualization Technology

Abysssec Research. 1) Advisory information. 2) Vulnerable version

LASTLINE WHITEPAPER. In-Depth Analysis of Malware

Outline. Outline. Why virtualization? Why not virtualize? Today s data center. Cloud computing. Virtual resource pool

Windows 7, Enterprise Desktop Support Technician

Project Proposal Active Honeypot Systems By William Kilgore University of Advancing Technology. Project Proposal 1

Workshop on Network Traffic Capturing and Analysis IITG, DIT, CERT-In, C-DAC. Host based Analysis. {Himanshu Pareek,

Windows 7, Enterprise Desktop Support Technician Course 50331: 5 days; Instructor-led

Net Protector Admin Console

How To Hack The Steam Voip On Pc Orchesterian Moonstone 2.5 (Windows) On Pc/Robert Kruber (Windows 2) On Linux (Windows 3.5) On A Pc

A Study on the Live Forensic Techniques for Anomaly Detection in User Terminals

McAfee Labs Threat Advisory W32/Autorun.worm.aaeb-h

Syscall Proxying - Simulating remote execution Maximiliano Caceres <maximiliano.caceres@corest.com> Copyright 2002 CORE SECURITY TECHNOLOGIES

McAfee One Time Password

Reverse Engineering Malware Part 1

"Charting the Course to Your Success!" MOC D Windows 7 Enterprise Desktop Support Technician Course Summary

Contents 1. Introduction 2. Security Considerations 3. Installation 4. Configuration 5. Uninstallation 6. Automated Bulk Enrollment 7.

THE SCRIPTING THREAT GAINING POPULARITY

Architecture. The DMZ is a portion of a network that separates a purely internal network from an external network.

Removing Sentinel SuperPro dongle from Applications and details on dongle way of cracking Shub-Nigurrath of ARTeam Version 1.

Botnets Die Hard Owned and Operated

Setting up PostgreSQL

Disassembly of False Positives for Microsoft Word under SCRAP

Transcription:

Fighting malware on your own Vitaliy Kamlyuk Senior Virus Analyst Kaspersky Lab Vitaly.Kamluk@kaspersky.com

Why fight malware on your own? 5 reasons: 1. Touch 100% of protection yourself 2. Be prepared for attacks 3. Maintain confidentiality 4. Restore system here and now 5. Time matters

What is available in Windows XP? System tools: Explorer, Task manager, Regedit, SigVerif, Console utils: netstat,tasklist,reg,expand Interpreters: Batch, JS/VBS Text editors: notepad,wordpad,edit,edlin, Binary editing tool: debug Symbolic debugger: ntsd OLE repository

Email-Worm.Win32.Warezov Detected on 15 th August, 2006 430 modifications (~25000 of files) All application data is encrypted Code mutates very often (server-side polymorphic engine) Downloads additional modules from the Internet Hides its modules from Task Manager

Warezov: Infecting the system

Warezov: Installing KAV 6.0

Warezov: What really happened?

Warezov: Inspecting the system

Warezov: Manual removal

Warezov: Resistance to manual removal

Analysis 1. Malware restores registry values when the application terminates (seems to be when malicious dll is unloaded) 2. There is a set of processes running/closing from time to time. So the routine is called several times. 3. The value is restored only if it doesn t exist. We can hack the malware removal resistance mechanism! 4. Looks like the malware uses one of the following functions: strstr/wcsstr/cstring::find, strtok or its own substring find routine

Warezov: Hacking the resistance to manual removal

Trojan.Win32.Agent.ach Detected on 12 th December, 2006 Made in Japan Silently removes itself after being run Suspends running destructive functionality until the following Friday, and after that: Disables pressing Ctrl-Alt-Delete Disables running any executable file from shell Disables system shutdown/reboot If you try hard-reboot, it disables loading the system in any available mode

Agent.ach: : Infecting the system

Agent.ach: : Infection symptoms

Hard reset result - time matters!

Agent.ach: : Inspecting the system

Agent.ach: : Removing the malware

Agent.ach: : Control check

Virus.Win32.Saburex.a Detected on 10 th December, 2006 The virus infects executable files located on a hard disk partition which is selected at random Injects own DLL into every process that has visible window Injected DLL makes screenshots of active windows on the victim machine, encrypts them, and publishes them on a website

Saburex: : Getting the code

Saburex: : Code listing push ebp mov ebp,esp sub esp,0x318 push ebx push esi push edi push 0x100 lea eax,[ebp-0x204] push eax push 0x0 call dword ptr [kernel32!getmodulefilenamea (7c80b357)] push 0x0 push 0x0 push 0x3 push 0x0 push 0x3 push 0x80000000 lea ecx,[ebp-0x204] push ecx call dword ptr [kernel32!createfilea (7c801a24)] mov [ebp-0x318],eax push 0x2 push 0x0 push 0xf8 mov edx,[ebp-0x318] push edx call dword ptr [kernel32!setfilepointer (7c810da6)] push 0x0 lea eax,[ebp-0x314] push eax push 0x8 lea ecx,[ebp-0x310] push ecx mov edx,[ebp-0x318] push edx call dword ptr [kernel32!readfile (7c80180e)] push 0x2 push 0x0 mov eax,0xfffffff8 sub eax,[ebp-0x310] push eax mov ecx,[ebp-0x318] push ecx call dword ptr [kernel32!setfilepointer (7c810da6)] mov edx,[ebp-0x310] push edx push 0x0 call dword ptr [kernel32!localalloc (7c8099bd)] mov [ebp-0x4],eax mov eax,[ebp-0x30c] push eax push 0x0 call dword ptr [kernel32!localalloc (7c8099bd)] mov [ebp-0x308],eax push 0x0 lea ecx,[ebp-0x314] push ecx mov edx,[ebp-0x310] push edx mov eax,[ebp-0x4] push eax mov ecx,[ebp-0x318] push ecx call dword ptr [kernel32!setfilepointer (7c810da6)] mov edx,[ebp-0x4] mov dword ptr [edx],0x4643534d push edx mov eax,[ebp-0x310] call dword ptr [kernel32!writefile (7c810f9f)] push eax mov eax,[ebp-0x318] mov edx,[ebp-0x308] push eax mov ecx,[ebp-0x4] call dword ptr [kernel32!closehandle (7c809b77)] call KODAKIMG+0x1060 (00401060) Subroutine_1 mov edi,0x401054 lea ecx,[ebp-0x104] lea edx,[ebp-0x304] push ecx or ecx,0xffffffff mov ebx,ecx push 0x100 xor eax,eax mov edi,edx call dword ptr [kernel32!gettemppatha (7c8221cf)] repne scasb or ecx,0xffffffff lea edx,[ebp-0x304] not ecx xor eax,eax push edx sub edi,ecx repne scasb push 0x0 mov esi,edi add edi,0xffffffff push 0x401434 mov ebx,ecx mov ecx,ebx lea eax,[ebp-0x104] mov edi,edx shr ecx,0x2 push eax or ecx,0xffffffff rep movsd call dword ptr [kernel32!gettempfilenamea (7c8606df)] xor eax,eax mov ecx,ebx push 0x0 repne scasb and ecx,0x3 push 0x0 add edi,0xffffffff rep movsb push 0x2 mov ecx,ebx push 0x0 push 0x0 shr ecx,0x2 push 0x0 push 0x2 rep movsd lea eax,[ebp-0x304] push 0x40000000 mov ecx,ebx push eax lea ecx,[ebp-0x304] and ecx,0x3 push 0x401048 push ecx rep movsb push 0x0 call dword ptr [kernel32!createfilea (7c801a24)] lea edi,[ebp-0x204] push 0x0 mov [ebp-0x318],eax lea edx,[ebp-0x304] call dword ptr [SHELL32!ShellExecuteA (7ca40e80)] push 0x0 or ecx,0xffffffff pop edi lea edx,[ebp-0x314] xor eax,eax pop esi push edx repne scasb pop ebx mov eax,[ebp-0x30c] not ecx mov esp,ebp push eax sub edi,ecx pop ebp mov ecx,[ebp-0x308] mov esi,edi ret push ecx mov edx,[ebp-0x318]

Saburex: : Analysis Source File Src PE Header compress Infected File Virus PE Header Virus Section Cured File Src PE Header Src Sections Src Sections Src Sections Compressed chunk of src file Compressed virus module decompress

Simple PE Structure

Saburex: : Curing tool in machine code

Saburex: : Applying the tool

System evolution 1. MS DOS 2. Windows NT 3. Windows 9x/ME 4. Windows 2000 5. Windows XP 6. Windows Vista 1970 th 1980 1990 2000 2001 2007 Unix

Microsoft.NET in the wild

Sniffing malware communication Methods: Analysis of Windows network monitor Catching DNS requests (server emulation) Catching HTTP request (server emulation) Implementing IP packet filter

Trojan-Downloader.Win32.Small.eup

Packet Filtering Explained

Backdoor.Win32.IRCBot.ach

Advanced techniques Viewing PE header Ways of terminating a process Dumping loaded executable image Extracting string data from binary images

Viewing PE header How to view PE header of target PE file in Windows: 1. Run: ntsd <path to target PE file> 2. Locate image base of the loaded module 3.!dh <image base>

Ways of terminating a process Task manager tasklist + taskkill console apps (starting from WinXP Pro) WMI (starting from WinXP) using: Windows Scripting Host WbemTest Application ntsd (starting from NT4) own pskill-like utility with PID received from: Qprocess Msinfo32 Performance monitor etc.

Kill Process:tasklist+taskkill

Kill Process:WMI+WSH

Kill Process:WMI+WbemTest

Kill Process:ntsd

Kill Process: Own tool in machine code User code for pskill.exe: f 1600 1700 90 e 1600 ff,15,04,10,40,00,68,00,15,40,00,83,c0,04,50 e 1610 ff,15,20,10,40,00,83,c0,04,6a,0a,6a,00,ff,30 e 1620 ff,15,30,10,40,00,8b,d8,ff,15,08,10,40,00, 3b,c3 e 1630 74,3E,53,6a,00,6a,01,ff,15,0c,10,40,00,6a,00,50 e 1640 ff,15,10,10,40,00,eb,38 e 1670 33,c0 e 1680 50,ff,15,00,10,40,00 Usage: Pskill.exe <Target Process Id> Getting Process Id using: Qprocess Msinfo32 Performance monitor

Kill Process:Getting PID

Dumping a process

Extracting string data The idea: Grab all sequences of bytes from given file that form a string consisting of 3 or more ASCII characters. JScript implementation: var fso=new ActiveXObject("Scripting.FileSystemObject"); var fi=fso.opentextfile(wscript.arguments(0), 1, 0); var fo=fso.createtextfile(wscript.arguments(1), 1); var pdb=""; while(!fi.atendofstream) { var db=fi.read(1); if(pdb.length>0) { if((db.charcodeat(0)>=32 && db.charcodeat(0)<=127)) pdb+=db; else { if(pdb.length>4) fo.write(pdb+"\n"); pdb=""; continue; } } else if((db.charcodeat(0)>=32 && db.charcodeat(0)<=127)) pdb=db; } fo.close(); fi.close();

Krotten: Bypassing system policies

Fight malware on your own! Results: 1. You can touch 100% of protection 2. You are ready for being attacked 3. You can preserve your confidentiality 4. You can restore system here and now 5. You know why time matters

Questions?

Fighting malware on your own May the force be with you! Vitaliy Kamlyuk Senior Virus Analyst Kaspersky Lab Vitaly.Kamluk@kaspersky.com