Self Protection Techniques in Malware



Similar documents
CIT 480: Securing Computer Systems. Malware

Computer Security DD2395

Parasitics: The Next Generation. Vitaly Zaytsev Abhishek Karnik Joshua Phillips

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

Malware. Björn Victor 1 Feb [Based on Stallings&Brown]

Malicious Software. Ola Flygt Växjö University, Sweden Viruses and Related Threats

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

Computer Virus Strategies and Detection Methods

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

Introduction to Reverse Engineering

Cryptography and Network Security Chapter 21. Malicious Software. Backdoor or Trapdoor. Logic Bomb 4/19/2010. Chapter 21 Malicious Software

Bypassing Anti- Virus Scanners

Lecture 26: Obfuscation

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

Malware: Malicious Software

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

Security Engineering Part III Network Security. Intruders, Malware, Firewalls, and IDSs

CS 356 Lecture 9 Malicious Code. Spring 2013

Anti-Virus Evasion Techniques and Countermeasures

Malicious Software. Malicious Software. Overview. Backdoor or Trapdoor. Raj Jain. Washington University in St. Louis

ZeroAccess. James Wyke. SophosLabs UK

Security+ Guide to Network Security Fundamentals, Third Edition. Chapter 2 Systems Threats and Risks

INTRODUCTION TO MALWARE & MALWARE ANALYSIS

Analysis and Diversion of Duqu s Driver

Fighting malware on your own

CSE509 System Security

Detecting the One Percent: Advanced Targeted Malware Detection

Introduction to Malware. Engin Kirda

CS549: Cryptography and Network Security

Detecting Computer Viruses

CORPORATE AV / EPP COMPARATIVE ANALYSIS

OS Security. Malware. Radboud University Nijmegen, The Netherlands. Winter 2014/2015

Reverse Engineering and Computer Security

Code Obfuscation Literature Survey

LASTLINE WHITEPAPER. Why Anti-Virus Solutions Based on Static Signatures Are Easy to Evade

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

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

(General purpose) Program security. What does it mean for a pgm to be secure? Depends whom you ask. Takes a long time to break its security controls.

ACS-3921/ Computer Security And Privacy. Lecture Note 5 October 7 th 2015 Chapter 5 Database and Cloud Security

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

Computer Viruses: How to Avoid Infection

Anti-virus Evasion Techniques. By: Abhinav Singh a.k.a DaRkLoRd

Description: Objective: Attending students will learn:

Malware. CS 161: Computer Security Prof. Vern Paxson. TAs: Jethro Beekman, Mobin Javed, Antonio Lupher, Paul Pearce & Matthias Vallentin

Sandy. The Malicious Exploit Analysis. Static Analysis and Dynamic exploit analysis. Garage4Hackers

Advanced Persistent Threats

LASTLINE WHITEPAPER. In-Depth Analysis of Malware

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

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

Identification and Removal of

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

Fine-grained covert debugging using hypervisors and analysis via visualization

Contact details For contacting ENISA or for general enquiries on information security awareness matters, please use the following details:

DESIGN OF GENERIC ANTIVIRUS SYSTEM

How to easily clean an infected computer (Malware Removal Guide)

INSIDE. Hunting For Metamorphic. Evolution of Code Metamorphic Virus Detection Examples Possible Future Virus Developments. Symantec Security Response

Title: Bugger The Debugger - Pre Interaction Debugger Code Execution

What are Viruses, Trojans, Worms & Spyware:

AntiRE en Masse. Investigating Ferrie s Documented AntiUnpacking. Kurt Baumgartner, VP Behavioral Threat Research PCTools ThreatFire

Violating Database - Enforced Security Mechanisms

Hotpatching and the Rise of Third-Party Patches

Storm Worm & Botnet Analysis

Malware Trend Report, Q April May June

WHITE PAPER. Understanding How File Size Affects Malware Detection

Cybercrime: evoluzione del malware e degli attacchi. Cesare Radaelli Regional Sales Manager, Italy cradaelli@paloaltonetworks.com

NGBPA Next Generation BotNet Protocol Analysis

Software Reversing Engineering (a.k.a. Reversing) Spiros Mancoridis. What is Reverse Engineering? Software Reverse Engineering: Reversing

Covert Operations: Kill Chain Actions using Security Analytics

By:XÇzA A TÅÅtÜ ]A `t{åééw

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

Analysis of Win32.Scream

Bypass Antivirus Dynamic Analysis

Attacking Obfuscated Code with IDA Pro. Chris Eagle

Application of Data Mining based Malicious Code Detection Techniques for Detecting new Spyware

Diving into a Silverlight Exploit and Shellcode - Analysis and Techniques

Software Fingerprinting for Automated Malicious Code Analysis

(Self-Study) Identify How to Protect Your Network Against Viruses

BE SAFE ONLINE: Lesson Plan

Where s the FEEB? The Effectiveness of Instruction Set Randomization

CS574 Computer Security. San Diego State University Spring 2008 Lecture #7

ITSC Training Courses Student IT Competence Programme SIIS1 Information Security

COMPUTER-INTERNET SECURITY. How am I vulnerable?

Defending Against Cyber Attacks with SessionLevel Network Security

1. General function and functionality of the malware

A Museum of API Obfuscation on Win32

Transcription:

DSIE 10 5 th Doctoral lsymposium on Informatics Engineering i January 28 29, 2010 Porto, Portugal Self Protection Techniques in Malware Tiago Santos

Overview Introduction Malware Types Why Self Protection? Stealth, Evasion, Obfuscation Code Obsfuscation Entry Point Obfuscation Compression / Packers Encryption Anti Debugger Anti Emulation Anti Disassemble Retrovirus Conclusions

Introduction

Malware Software that can disrupt the normal functioning of a system. Installed without the knowledge or approval of the user Why? Experimental or Research Anti social bh behaviour Prank Ideological Profit/Extortion Warfare

Malware Software that can disrupt the normal functioning of a system. Installed without the knowledge or approval of the user Why? Experimental or Research Anti social bh behaviour Prank Ideological Profit/Extortion Warfare

Malware Software that can disrupt the normal functioning of a system. Installed without the knowledge or approval of the user Why? Experimental or Research Anti social bh behaviour Prank Ideological Profit/Extortion Warfare

Types Adware Ransomware Browser Hijack Rootkit Backdoor Scumware Botnet Spam Bugs Cryptovirus Dialer Exploit e Bomb Keylogger Hoaxes Logic Bombs Rabbit Spyware Trojans Virus Worms

Why Self Protection? Increase thespace betweenthetemporal the temporal points of the malware s life: infection > detection > analysis > defense

Why Self Protection? Increase thespace betweenthetemporal the temporal points of the malware s life: infection > detection > analysis > defense

Stealth, Evasion, Obfuscation

Self Protection Methods PASSIVE Code Obfuscation Entry Point Obfuscation Encryption Compression Packing Oligomorphism Polymorphism Metamorphism ACTIVE Anti emulation Anti debugging Anti disassembling Retro virus

Self Protection Methods PASSIVE Code Obfuscation Entry Point Obfuscation Encryption Compression Packing Oligomorphism Polymorphism Metamorphism ACTIVE Anti emulation Anti debugging Anti disassembling Retro virus

Self Protection Methods PASSIVE Code Obfuscation Entry Point Obfuscation Encryption Compression Packing Oligomorphism Polymorphism Metamorphism ACTIVE Anti emulation Anti debugging Anti disassembling Retro virus

Source: Alisa Shevchenko

Code Obsfuscation Inserting junk code Code transposition Exchanging registers Instruction substitution Commom problem: the code can increase significantly! Solution: opcode confusion undocumented instructions LEA EAX, DWORD PTR [040200H] JMP EAX MOV AX, 0200H MOVBX BX, 0004H AND EAX, 0XFFFF SHL EBX, 16 OR EAX, EBX JMP EAX

Code Obsfuscation Inserting junk code Code transposition Exchanging registers Instruction substitution Commom problem: the code can increase significantly! Solution: opcode confusion undocumented instructions LEA EAX, DWORD PTR [040200H] JMP EAX MOV AX, 0200H MOVBX BX, 0004H AND EAX, 0XFFFF SHL EBX, 16 OR EAX, EBX JMP EAX

Code Obsfuscation Inserting junk code Code transposition Exchanging registers Instruction substitution Commom problem: the code can increase significantly! Solution: opcode confusion undocumented instructions LEA EAX, DWORD PTR [040200H] JMP EAX

Code Obsfuscation Inserting junk code Code transposition Exchanging registers Instruction substitution Commom problem: the code can increase significantly! Solution: opcode confusion undocumented instructions LEA EAX, DWORD PTR [040200H] JMP EAX MOV AX, 0200H MOVBX BX, 0004H AND EAX, 0XFFFF SHL EBX, 16 OR EAX, EBX JMP EAX

Entry Point Obfuscation Anti heuristic method Hard to detect, desinfect and remove Can get control in any point (e.g. in the end => replace API ExistProcess() by a jump to the viral section )

Entry Point Obfuscation Anti heuristic method Hard to detect, desinfect and remove Can get control in any point (e.g. in the end => replace API ExistProcess() by a jump to the viral section )

Entry Point Obfuscation Anti heuristic method Hard to detect, desinfect and remove Can get control in any point (e.g. in the end => replace API ExistProcess() by a jump to the viral section )

Compression / Packers Reduces significantly the malware size Makes the code analysis much more difficult and tedious Efficient commercial andfree software (Problem: compression/decompression algorithm are known by the AV software Can use available software in the infected system It is possible to change the entire packed code by just changing gone single byte Some packers incorporates in the packed file antidebugging capabilities.

Compression / Packers Reduces significantly the malware size Makes the code analysis much more difficult and tedious Efficient commercial andfree software (Problem: compression/decompression algorithm are known by the AV software Can use available software in the infected system It is possible to change the entire packed code by just changing gone single byte Some packers incorporates in the packed file antidebugging capabilities.

Compression / Packers Reduces significantly the malware size Makes the code analysis much more difficult and tedious Efficient commercial andfree software (Problem: compression/decompression algorithm are known by the AV software Can use available software in the infected system It is possible to change the entire packed code by just changing gone single byte Some packers incorporates in the packed file antidebugging capabilities.

Compression / Packers Reduces significantly the malware size Makes the code analysis much more difficult and tedious Efficient commercial andfree software (Problem: compression/decompression algorithm are known by the AV software Can use available software in the infected system It is possible to change the entire packed code by just changing gone single byte Some packers incorporates in the packed file antidebugging capabilities.

Compression / Packers Reduces significantly the malware size Makes the code analysis much more difficult and tedious Efficient commercial andfree software (Problem: compression/decompression algorithm are known by the AV software Can use available software in the infected system It is possible to change the entire packed code by just changing gone single byte Some packers incorporates in the packed file antidebugging capabilities.

Compression / Packers Reduces significantly the malware size Makes the code analysis much more difficult and tedious Efficient commercial andfree software (Problem: compression/decompression algorithm are known by the AV software Can use available software in the infected system It is possible to change the entire packed code by just changing gone single byte Some packers incorporates in the packed file antidebugging capabilities.

Encryption why? To hide the malware s fixed signature, making it unrecognizable to a scanner Camouflage constants (e.g.,.exe exe, windows/system32, email addresses, etc) To intricatei the code analysis

Encryption why? To hide the malware s fixed signature, making it unrecognizable to a scanner Camouflage constants (e.g.,.exe exe, windows/system32, email addresses, etc) To intricatei the code analysis

Encryption why? To hide the malware s fixed signature, making it unrecognizable to a scanner Camouflage constants (e.g.,.exe exe, windows/system32, email addresses, etc) To intricatei the code analysis

Encryption Key Points Strenght Key origin and distribution Publicvs private key Speed and reliability (e.g. RC4 faster than RSA) Implementation

Encryption Key Points Strenght Key origin and distribution Publicvs private key Speed and reliability (e.g. RC4 faster than RSA) Implementation

Encryption Key Points Strenght Key origin and distribution Publicvs private key Speed and reliability (e.g. RC4 faster than RSA) Implementation

Encryption Key Points Strenght Key origin and distribution Publicvs private key Speed and reliability (e.g. RC4 faster than RSA) Implementation

Encryption Key Points Strenght Key origin and distribution Publicvs private key Speed and reliability (e.g. RC4 faster than RSA) Implementation

Anti Debugger Different techniques to different debuggers Modified code based detection breakpoint detection : Checksum comparation Checking instructions Software interrupts : INT 3 (for standard Debug Breakpoint 0xCC) Timing based detection check for slowdown in runtime API (e.g. isdebuggerpresent()) Exception based detection many times difficult to bypass (INT 2Dh, INT 0x03, 0xF1, 0Fh 0Bh) Decryption based Instructions prefetching

Anti Debugger Different techniques to different debuggers Modified code based detection breakpoint detection : Checksum comparation Checking instructions Software interrupts : INT 3 (for standard Debug Breakpoint 0xCC) Timing based detection check for slowdown in runtime API (e.g. isdebuggerpresent()) Exception based detection many times difficult to bypass (INT 2Dh, INT 0x03, 0xF1, 0Fh 0Bh) Decryption based Instructions prefetching

Anti Debugger Different techniques to different debuggers Modified code based detection breakpoint detection : Checksum comparation Checking instructions Software interrupts : INT 3 (for standard Debug Breakpoint 0xCC) Timing based detection check for slowdown in runtime API (e.g. isdebuggerpresent()) Exception based detection many times difficult to bypass (INT 2Dh, INT 0x03, 0xF1, 0Fh 0Bh) Decryption based Instructions prefetching

Anti Debugger Different techniques to different debuggers Modified code based detection breakpoint detection : Checksum comparation Checking instructions Software interrupts : INT 3 (for standard Debug Breakpoint 0xCC) Timing based detection check for slowdown in runtime API (e.g. isdebuggerpresent()) Exception based detection many times difficult to bypass (INT 2Dh, INT 0x03, 0xF1, 0Fh 0Bh) Decryption based Instructions prefetching

Anti Emulation Use of triggers Sparse infection Sparse payload delivery Decryption: Nested decryption loops Brute force decryption algorithms Non linear decryption algorithms Overextending: Undocumented instructions Instructions not implemented dby the emulator Fool the emulator Network connection

Anti Emulation Use of triggers Sparse infection Sparse payload delivery Decryption: Nested decryption loops Brute force decryption algorithms Non linear decryption algorithms Overextending: Undocumented instructions Instructions not implemented dby the emulator Fool the emulator Network connection

Anti Emulation Use of triggers Sparse infection Sparse payload delivery Decryption: Nested decryption loops Brute force decryption algorithms Non linear decryption algorithms Overextending: Undocumented instructions Instructions not implemented dby the emulator Fool the emulator Network connection

Anti Emulation Use of triggers Sparse infection Sparse payload delivery Decryption: Nested decryption loops Brute force decryption algorithms Non linear decryption algorithms Overextending: Undocumented instructions Instructions not implemented dby the emulator Fool the emulator Network connection

Anti Disassemble Trick the disassembler by generating an incorrect disassembled code

Anti Disassemble Trick the disassembler by generating an incorrect disassembled code

Anti Disassemble Trick the disassembler by generating an incorrect disassembled code MOV BX, 0xF0F0 CMP BX, 0 JE @OPAQUE JNE @REALCODE @OPAQUE: DB 50H @REALCODE: ADD CX,BX XOR EAX, EAX...

Anti Disassemble Trick the disassembler by generating an incorrect disassembled code MOV BX, 0xF0F0 CMP BX, 0 JE @OPAQUE JNE @REALCODE @OPAQUE: DB 50H @REALCODE: ADD CX,BX XOR EAX, EAX... 401000 MOV BX,0F0F0 401004 CMP BX,0 401008 JE SHORT 0040100C 40100A JNZ SHORT 40100D 40100C PUSH EAX 40100D XOR CX,BX 401010 ADD EAX,EAX...

Fighting AV Software Retrovirus Actively attacks the AV software by trying to bypass or to block the AV s operations, personal firewall or other security programs Easy to implement Attacks: Modify the AV code Delete theav Change the infected system in a way that affects the AV Remove CPU time to the AV Kill pre determinated processes

Fighting AV Software Retrovirus Actively attacks the AV software by trying to bypass or to block the AV s operations, personal firewall or other security programs Easy to implement Attacks: Modify the AV code Delete theav Change the infected system in a way that affects the AV Remove CPU time to the AV Kill pre determinated processes

Fighting AV Software Retrovirus Actively attacks the AV software by trying to bypass or to block the AV s operations, personal firewall or other security programs Easy to implement Attacks: Modify the AV code Delete theav Change the infected system in a way that affects the AV Remove CPU time to the AV Kill pre determinated processes

Conclusions Can a system be safe with an up to date AV software? Due the continue evolution techniques and the development of new ones, it is impossible to have a complete protection even with an up to dt date state tt of the art AV software, making prudent to always assume that a system is unprotected and already infected. It s a never ending conflict between malware writers and AV developers.

Conclusions Can a system be safe with an up to date AV software? Due the continue evolution techniques and the development of new ones, it is impossible to have a complete protection even with an up to dt date state tt of the art AV software, making prudent to always assume that a system is unprotected and already infected. It s a never ending conflict between malware writers and AV developers.

Conclusions Can a system be safe with an up to date AV software? Due the continue evolution techniques and the development of new ones, it is impossible to have a complete protection even with an up to dt date state tt of the art AV software, making prudent to always assume that a system is unprotected and already infected. It s a never ending conflict between malware writers and AV developers.

Conclusions... virus writers don t have to achieve perfect infection. It isn t crucial that infection attempts sometimes fail, or if a virus can t reliably tell whether a file is already infected. Viruses are messy and an imperfect virus can spread quite well in the real world. Conversely, an anti virus product must be extremelyreliable reliable. Unreliable detection, either by identifying a benign file as infected or vice versa, is a fatal flaw flaw. Richard Ford