computer security dd2395 · polymorphic virus ! a virus can take things one step further: rebuild...

42
Computer Security DD2395 http://www.csc.kth.se/utbildning/kth/kurser/DD2395/dasak12/ Fall 2012 Sonja Buchegger [email protected] Lecture 7 Malicious Software 1 DD2395 Sonja Buchegger

Upload: others

Post on 07-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Computer Security DD2395 http://www.csc.kth.se/utbildning/kth/kurser/DD2395/dasak12/

Fall 2012 Sonja Buchegger

[email protected]

Lecture 7 Malicious Software

1 DD2395 Sonja Buchegger

Page 2: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 2

Page 3: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Lab W

l  Specific solution presentation slots filled, but l  Thursday and Friday morning regular lab slots

still available l  Can show solutions during regular lab hours,

but without specific time guarantee

DD2395 Sonja Buchegger 3

Page 4: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Lab W

l  DO NOT use lab exercise attacks on websites that are not included in the lab exercise!

l  DO only use the lab websites listed in the lab instructions to test attacks!

DD2395 Sonja Buchegger 4

Page 5: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 5

Malicious Software

l  programs exploiting system vulnerabilities l  known as malicious software or malware

-  program fragments that need a host program l  e.g. viruses, logic bombs, and backdoors

-  independent self-contained programs l  e.g. worms, bots

-  replicating or not l  sophisticated threat to computer systems

Page 6: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 6

Malware Terminology

l  Virus l  Worm l  Logic bomb l  Trojan horse l  Backdoor (trapdoor)‏ l  Mobile code l  Auto-rooter Kit (virus generator)‏ l  Spammer and Flooder programs l  Keyloggers, Spyware l  Rootkit l  Zombie, bot l  Adware

Page 7: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Would you trust this program?

DD2395 Sonja Buchegger 7

Page 8: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Trojan Horse

l  First identified at NSA in 1972 by Daniel Edwards

l  It's a program with two purposes, one obvious and one hidden from the user

l  Today it's often used to install other software or backdoors

l  Trojan horses can be built from existing programs using a special wrapper

l  Or designed from the start to be one.

DD2395 Sonja Buchegger 8

Page 9: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

What would you do?

l  How to get someone to run a trojan?

l  How to not run a trojan?

DD2395 Sonja Buchegger 9

Page 10: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Backdoor

l  Software that gives access to a system l  Bypassing OS restrictions l  Can be part of a trojan l  Often installed for legitimate reasons l  Only to later be abused l  Typically very very hard to find

DD2395 Sonja Buchegger 10

Page 11: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Legitimate Reasons?

l  What would be a legitimate reason to install a backdoor?

DD2395 Sonja Buchegger 11

Page 12: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Grayware

l  In the gray zone between harmless and harmful, mostly annoying

l  Popup windows l  For teh lulz l  Can include adware, spyware

DD2395 Sonja Buchegger 12

Page 13: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Logic Bomb

l  A small bit of code that triggers on a specific condition

l  Typically with malicious results l  No vector for spreading l  Installed directly

DD2395 Sonja Buchegger 13

Page 14: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 14

Viruses

l  piece of software that infects programs -  modifying them to include a copy of the virus -  so it executes secretly when host program is run

l  specific to operating system and hardware -  taking advantage of their details and weaknesses

l  a typical virus goes through phases of: -  dormant -  propagation -  triggering -  execution

Page 15: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 15

Virus Structure

l  components: -  infection mechanism - enables replication -  modification engine – for disguise -  trigger - event that makes payload activate -  payload - what it does, malicious or benign

l  prepended / appended / embedded l  when infected program invoked, executes

virus code then original program code l  can block initial infection (difficult)‏ l  or propagation (with access controls)‏

Page 16: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 16

Virus Structure

Page 17: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 17

Virus Classification

l  boot sector l  file infector l  macro virus l  encrypted virus: different keys l  stealth virus: evade detection, e.g.

compression l  polymorphic virus l  metamorphic virus

Page 18: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 18

Compression Virus

Page 19: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 19

Page 20: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Polymorphic Virus

l  A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical

l  There are many ways to do nothing on a computer

l  Instructions can be reordered in many ways l  To detect these the AV engine often has to

simulate the virus to figure out what it is.

DD2395 Sonja Buchegger 20

Page 21: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Metamorphic Virus

l  Complete rewrite l  Can also change behavior

DD2395 Sonja Buchegger 21

Page 22: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 22

Macro Virus

l  became very common in mid-1990s since -  platform independent -  infects documents -  is easily spread

l  exploit macro capability of office apps -  executable program embedded in office doc -  often a form of Basic

l  more recent releases include protection l  recognized by many anti-virus programs

Page 23: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 23

E-Mail Viruses

l  more recent development l  e.g. Melissa

-  exploits MS Word macro in attached doc -  if attachment opened, macro activates -  sends email to all on users address list -  and does local damage

l  then saw versions triggered reading email l  hence much faster propagation

Page 24: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 24

Virus Countermeasures

l  prevention - ideal solution but difficult l  realistically need:

-  detection -  identification -  removal

l  if detected but can’t identify or remove, must discard and replace infected program

Page 25: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 25

Anti-Virus Evolution

l  virus & antivirus tech have both evolved l  early viruses simple code, easily removed l  as become more complex, so must the

countermeasures l  generations

-  first - signature scanners -  second - heuristics -  third - identify actions -  fourth - combination packages

Page 26: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 26

Generic Decryption

l  runs executable files through GD scanner: -  CPU emulator to interpret instructions -  virus scanner to check known virus signatures -  emulation control module to manage process

l  lets virus decrypt itself in interpreter l  periodically scan for virus signatures l  issue is long to interpret and scan

-  tradeoff chance of detection vs time delay

Page 27: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 27

Digital Immune System

Page 28: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 28

Behavior-Blocking Software

Page 29: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 29

Worms

l  replicating program that propagates over net -  using email, remote exec, remote login

l  has phases like a virus: -  dormant, propagation, triggering, execution -  propagation phase: searches for other systems, connects to

it, copies self to it and runs l  may disguise itself as a system process l  implemented by Xerox Palo Alto labs in 1980’s

Page 30: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 30

Morris Worm

l  one of best known early worms l  released by Robert Morris in 1988 l  various attacks on UNIX systems

-  cracking password file to use login/password to logon to other systems

-  exploiting a bug in the finger protocol -  exploiting a bug in sendmail

l  if succeed have remote shell access -  sent bootstrap program to copy worm over

Page 31: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 31

Worm Propagation Model

Page 32: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 32

Recent Worm Attacks l  Code Red

-  July 2001 exploiting MS IIS bug -  probes random IP address, does DDoS attack -  consumes significant net capacity when active

l  Code Red II variant includes backdoor l  SQL Slammer

-  early 2003, attacks MS SQL Server -  compact and very rapid spread

l  Mydoom -  mass-mailing e-mail worm that appeared in 2004 -  installed remote access backdoor in infected systems

Page 33: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

Sept. 3, 2012 Computer Security, Sonja Buchegger 33

Security Trends Still true?

Page 34: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 34

Recent Worm Attacks l  Conficker 2009

l  Stuxnet 2010

l  Duqu 2011

l  Flame 2012

Page 35: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 35

Worm Technology

l  multiplatform l  multi-exploit l  ultrafast spreading l  polymorphic l  metamorphic l  transport vehicles l  zero-day exploit

Page 36: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 36

Worm Countermeasures

l  overlaps with anti-virus techniques l  once worm on system A/V can detect l  worms also cause significant net activity l  worm defense approaches include:

-  signature-based worm scan filtering -  filter-based worm containment -  payload-classification-based worm containment -  threshold random walk scan detection -  rate limiting and rate halting

Page 37: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 37

Proactive Worm Containment

Page 38: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 38

Network Based Worm Defense

Page 39: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 39

Bots

l  program taking over other computers l  to launch hard to trace attacks l  if coordinated form a botnet l  characteristics:

-  remote control facility l  via IRC/HTTP etc

-  spreading mechanism l  attack software, vulnerability, scanning strategy

l  various counter-measures applicable

Page 40: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 40

Rootkits

l  set of programs installed for admin access l  malicious and stealthy changes to host O/S l  may hide its existence

-  subverting report mechanisms on processes, files, registry entries etc

l  may be: -  persistent or memory-based -  user or kernel mode

l  installed by user via trojan or intruder on system l  range of countermeasures needed

Page 41: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 41

Rootkit System Table Mods

Page 42: Computer Security DD2395 · Polymorphic Virus ! A virus can take things one step further: Rebuild the whole virus at every infection to something functionally identical ! There are

DD2395 Sonja Buchegger 42

Summary

l  introduced types of malicous software -  incl backdoor, logic bomb, trojan horse -  virus types and countermeasures

l  worm types and countermeasures l  bots l  rootkits