Top Banner
Lecture 14 Page 1 CS 236 Online Malware CS 236 On-Line MS Program Networks and Systems Security Peter Reiher
39

Malware CS 236 On-Line MS Program Networks and Systems Security Peter Reiher

Feb 25, 2016

Download

Documents

nizana

Malware CS 236 On-Line MS Program Networks and Systems Security Peter Reiher. Outline. Introduction Viruses Trojan horses Trap doors Logic bombs Worms Botnets Spyware Rootkits. Introduction. Clever programmers can get software to do their dirty work for them - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 1CS 236 Online

MalwareCS 236

On-Line MS ProgramNetworks and Systems Security

Peter Reiher

Page 2: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 2CS 236 Online

Outline• Introduction• Viruses• Trojan horses• Trap doors• Logic bombs• Worms• Botnets• Spyware• Rootkits

Page 3: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 3CS 236 Online

Introduction

Clever programmers can get software to do their dirty work for them

Programs have several advantages for these purposes– Speed– Mutability– Anonymity

Page 4: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 4CS 236 Online

Where Does Malicious Code Come From?

• Most typically, it’s willingly (but unwittingly) imported into the system– Electronic mail– Downloaded executables

• Often automatically from web pages– Sometimes shrink-wrapped software

• Sometimes it breaks in• Sometimes an insider intentionally introduces it

Page 5: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 5CS 236 Online

Is Malicious Code Really a Problem?

• Considering viruses only, by 1994 there were over 1,000,000 annual infections– One survey shows 10-fold increase in viruses

since 1996• In November 2003, 1 email in 93 scanned by

particular survey contained a virus• 2008 CSI report shows 50% of survey respondents

had virus incidents– Plus 20% with bot incidents

• 2009 Trend Micro study shows 50% of infected machines still infected 300 days later

Page 6: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 6CS 236 Online

More Alarming Statistics

• In 1992, there were around 2000 unique viruses known

• In 2007, Symantec’s databases of viruses included 73,000+ entries

• Kaspersky Labs has over 83,000 virus signatures in its database

• The numbers continue to grow

Page 7: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 7CS 236 Online

But Don’t Get Too Alarmed

• Most viruses are never found “in the wild”• Most viruses die out quickly• The Wild List1 shows 549 active spreading

malwares worldwide (November 2012)– Reported by two or more independent

observers– Many are slight variants on a particular

virus1www.wildlist.org

Page 8: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 8CS 236 Online

But Do I Really Have to Worry About Viruses?

• “After all, I run Linux/Mac OS/Solaris/BSD”• “Aren’t all viruses for Windows?”• Decreasingly true in practice

– Definitely not true in theory– Mac malware increasingly common– Viruses for palmtops and cellphones

• Anyone, at any time, can write and release malware that can clobber your machine, regardless of what OS you run

Page 9: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 9CS 236 Online

Viruses

• “Self-replicating programs containing code that explicitly copies itself and that can ‘infect’ other programs by modifying them or their environment”

• Typically attached to some other program– When that program runs, the virus

becomes active and infects others• Not all malicious codes are viruses

Page 10: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 10CS 236 Online

How Do Viruses Work?

• When a program is run, it typically has the full privileges of its running user

• Including write privileges for some other programs

• A virus can use those privileges to replace those programs with infected versions

Page 11: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 11CS 236 Online

Typical Virus Actions

1). Find uninfected writable programs2). Modify those programs3). Perform normal actions of infected

program4). Do whatever other damage is desired

Page 12: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 12CS 236 Online

Before the Infected Program Runs

Infected Program

UninfectedProgram

Virus Code

Page 13: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 13CS 236 Online

The Infected Program Runs

Infected Program

UninfectedProgram

Virus Code

Page 14: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 14CS 236 Online

Infecting the Other Program

Infected Program

UninfectedProgram

Virus Code Virus Code

InfectedProgram

Page 15: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 15CS 236 Online

Macro and Attachment Viruses• Modern data files often contain executables

– Macros– Email attachments– Ability to run arbitrary executables from

many applications, embedded in data• Easily the most popular form of new viruses

– Requires less sophistication to get right• Most widespread viruses today use attachments

Page 16: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 16CS 236 Online

Virus Toolkits

• Helpful hackers have written toolkits that make it easy to create viruses

• A typical smart high school student can easily create a virus given a toolkit

• Generally easy to detect viruses generated by toolkits–But we may see “smarter” toolkits

Page 17: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 17CS 236 Online

How To Find Viruses

• Basic precautions• Looking for changes in file sizes• Scan for signatures of viruses• Multi-level generic detection

Page 18: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 18CS 236 Online

Precautions to Avoid Viruses

• Don’t import untrusted programs– But who can you trust?

• Viruses have been found in commercial shrink-wrap software

• The hackers who released Back Orifice were embarrassed to find a virus on their CD release

• Trusting someone means not just trusting their honesty, but also their caution

Page 19: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 19CS 236 Online

Other Precautionary Measures

• Scan incoming programs for viruses– Some viruses are designed to hide

• Limit the targets viruses can reach• Monitor updates to executables

carefully– Requires a broad definition of

“executable”

Page 20: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 20CS 236 Online

Containment

• Run suspect programs in an encapsulated environment– Limiting their forms of access to

prevent virus spread• Requires versatile security model and

strong protection guarantees

Page 21: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 21CS 236 Online

Viruses and File Sizes

• Typically, a virus tries to hide• So it doesn’t disable the infected program• Instead, extra code is added• But if it’s added naively, the size of the file grows• Virus detectors look for this growth• Won’t work for files whose sizes typically change• Clever viruses find ways around it

– E.g., cavity viruses that fit themselves into “holes” in programs

Page 22: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 22CS 236 Online

Signature Scanning

• If a virus lives in code, it must leave some traces

• In early and unsophisticated viruses, these traces were essentially characteristic code patterns

• Find the virus by looking for the signature

Page 23: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 23CS 236 Online

How To Scan For Signatures

• Create a database of known virus signatures

• Read every file in the system and look for matches in its contents

• Also check every newly imported file• Also scan boot sectors and other

interesting places

Page 24: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 24CS 236 Online

Weaknesses of Scanning for Signatures

• What if the virus changes its signature?• What if the virus takes active measures

to prevent you from finding the signature?

• You can only scan for known virus signatures

Page 25: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 25CS 236 Online

Polymorphic Viruses

• A polymorphic virus produces varying but operational copies of itself

• Essentially avoiding having a signature• Sometimes only a few possibilities

– E.g., Whale virus has 32 forms• But sometimes a lot

– Storm worm had more than 54,000 formats as of 2006

Page 26: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 26CS 236 Online

Stealth Viruses

• A virus that tries actively to hide all signs of its presence

• Typically a resident virus• For example, it traps calls to read infected

files– And disinfects them before returning the

bytes– E.g., the Brain virus

Page 27: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 27CS 236 Online

Combating Stealth Viruses

• Stealth viruses can hide what’s in the files

• But may be unable to hide that they’re in memory

• Also, if you reboot carefully from a clean source, the stealth virus can’t get a foothold

Page 28: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 28CS 236 Online

Other Detection Methods• Checksum comparison• Intelligent checksum analysis

– For files that might legitimately change• Intrusion detection methods

– E.g., look for attack invariants instead of signatures

• Identify and handle “clusters” of similar malware

Page 29: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 29CS 236 Online

Preventing Virus Infections• Run a virus detection program

– Almost all CSI reporting companies do– And many still get clobbered

• Keep its signature database up to date– Modern virus scanners do this by default

• Disable program features that run executables without users asking– Quicktime had this problem a few years ago

• Make sure users are very careful about what they run

Page 30: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 30CS 236 Online

How To Deal With Virus Infections

• Reboot from a clean, write-protected floppy or from a clean CD ROM– Important to ensure that the medium really is

clean– Necessary, but not sufficient

• If backups are available and clean, replace infected files with clean backup copies– Another good reason to keep backups

• Recent proof-of-concept code showed infection of firmware in peripherals . . .

Page 31: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 31CS 236 Online

Disinfecting Programs

• Some virus utilities try to disinfect infected programs– Allowing you to avoid going to backup

• Potentially hazardous, since they may get it wrong– Some viruses destroy information needed

to restore programs properly

Page 32: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 32CS 236 Online

• When you run it, the Greeks creep out and slaughter your system

Trojan Horses

• Seemingly useful program that contains code that does harmful things

Page 33: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 33CS 236 Online

Basic Trojan Horses• A program you pick up somewhere that is

supposed to do something useful• And perhaps it does

– But it also does something less benign• Games are common locations for Trojan

Horses• Downloaded applets are also popular locations• Frequently found in email attachments• Bogus security products also popular

Page 34: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 34CS 236 Online

Trojan Horse Login Programs

• Probably the original Trojan horse• Spoof the login or authentication

screen of a machine or service• Capture attempts to access that service• Then read the user IDs and the

passwords

Page 35: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 35CS 236 Online

Recent Trends in Trojan Horses

• Trojan horses in pirated copies of iWorks, Adobe Photoshop CS4, Windows 7 Release Candidate– Found on peer file sharing networks

• Macs aren’t safe any more• Zeus Trojan horse very widespread

– Used for on-line bank fraud, stealing proprietary data, etc.

– Spread by phishing, drive-by downloads

Page 36: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 36CS 236 Online

Trapdoors

• A secret entry point into an otherwise legitimate program

• Typically inserted by the writer of the program

• Most often found in login programs or programs that use the network

• But also found in system utilities

Page 37: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 37CS 236 Online

Trapdoors and Other Malware• Malware that has taken over a machine

often inserts a trapdoor• To allow the attacker to get back in

– If the normal entry point is closed• Infected machine should be handled

carefully to remove such trapdoors– Otherwise, attacker comes right back

Page 38: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 38CS 236 Online

Logic Bombs• Like trapdoors, typically in a legitimate program• A piece of code that, under certain conditions,

“explodes”• Also like trapdoors, typically inserted by program

authors• Often used by disgruntled employees to get revenge

– Disgruntled TSA employee recently sentenced for planting one

– Earlier, a Fannie Mae employee planted one– Both discovered before they went off

Page 39: Malware CS 236 On-Line MS Program Networks and Systems Security  Peter Reiher

Lecture 14Page 39CS 236 Online

Extortionware• Also known as ransomware• Attacker breaks in and does something bad

– Demands money to undo it• Encrypting vital data is common

– Some incidents also encrypted backups• Unlike logic bombs, not timed or triggered• Case in Australian medical center in 2012

– With encrypted backups