worms 1. viruses don’t break into your computer – they are invited by you – they cannot spread...

110
Worms 1

Upload: magdalen-powell

Post on 24-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

1

Worms

Page 2: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Viruses don’t break into your computer – they are invited by you– They cannot spread unless you run infected application

or click on infected attachment– Early viruses spread onto different applications on your

computer– Contemporary viruses spread as attachments through

E-mail, they will mail themselves to people from your addressbook

• Worms break into your computer using some vulnerability, install malicious code and move on to other machines – You don’t have to do anything to make them spread 2

Viruses vs. Worms

Page 3: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• A program that:– Scans network for vulnerable machines– Breaks into machines by exploiting the vulnerability– Installs some piece of malicious code – backdoor, DDoS

tool– Moves on

• Unlike viruses– Worms don’t need any user action to spread – they

spread silently and on their own– Worms don’t attach themselves onto other programs –

they exist as a separate code in memory• Sometimes you may not even know your machine

has been infected by a worm 3

What is a Worm?

Page 4: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• They spread extremely fast• They are silent• Once they are out, they cannot be recalled• They usually install malicious code• They clog the network

4

Why Are Worms Dangerous?

Page 5: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Robert Morris, a PhD student at Cornell, was interested in network security

• He created the first worm with a goal to have a program live on the Internet in Nov. 1988– Worm was supposed only to spread, fairly slowly– It was supposed to take just a little bit of resources so not

to draw attention to itself– But things went wrong …

• Worm was supposed to avoid duplicate copies by asking a computer whether it is infected– To avoid false “yes” answers, it was programmed to

duplicate itself every 7th time it received “yes” answer– This turned out to be too much

5

First Worm Ever – Morris Worm

Page 6: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• It exploited four vulnerabilities to break in– A bug in sendmail

– A bug in finger deamon – A trusted hosts feature (/etc/.rhosts)– Password guessing

• Worm was replicating at a much faster rate than anticipated

• At that time Internet was small and homogeneous (SUN and VAX workstations running BSD UNIX)

• It infected around 6,000 computers, one tenth of then-Internet, in a day

6

First Worm Ever – Morris Worm

Page 7: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• People quickly devised patches and distributed them (Internet was small then)

• A week later all systems were patched and worm code was removed from most of them

• No lasting damage was caused• Robert Morris paid $10,000 fine, was placed

on probation and did some community work• Worm exposed not only vulnerabilities in UNIX

but moreover in Internet organization• Users didn’t know who to contact and report

infection or where to look for patches7

First Worm Ever – Morris Worm

Page 8: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• In response to Morris Worm DARPA formed CERT (Computer Emergency Response Team) in November 1988– Users report incidents and get help in handling them

from CERT– CERT publishes security advisory notes informing

users of new vulnerabilities that need to be patched and how to patch them

– CERT facilitates security discussions and advocates better system management practices

8

First Worm Ever – Morris Worm

Page 9: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Spread on July 12 and 19, 2001• Exploited a vulnerability in Microsoft Internet

Information Server that allows attacker to get full access to the machine (turned on by default)

• Two variants – both probed random machines, one with static seed for RNG, another with random seed for RNG (CRv2)

• CRv2 infected more than 359,000 computers in less than 14 hours– It doubled in size every 37 minutes– At the peak of infection more than 2,000 hosts were

infected each minute9

Code Red

Page 10: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

10

Code Red v2

Page 11: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• 43% of infected machines were in US• 47% of infected machines were home

computers• Worm was programmed to stop spreading at

midnight, then attack www1.whitehouse.gov– It had hardcoded IP address so White House was

able to thwart the attack by simply changing the IP address-to-name mapping

• Estimated damage ~2.6 billion

11

Code Red v2

Page 12: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Spread on January 25, 2003• The fastest computer worm in history

– It doubled in size every 8.5 seconds. – It infected more than 90% of vulnerable hosts within

10 minutes– It infected 75,000 hosts overall

• Exploited buffer overflow vulnerability in Microsoft SQL server, discovered 6 months earlier

12

Sapphire/Slammer Worm

Page 13: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• No malicious payload• The aggressive spread had severe consequences

– Created DoS effect– It disrupted backbone operation– Airline flights were canceled– Some ATM machines failed

13

Sapphire/Slammer Worm

Page 14: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

14

Sapphire/Slammer Worm

Page 15: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Both Slammer and Code Red 2 use random scanningo Code Red uses multiple threads that invoke TCP

connection establishment through 3-way handshake – must wait for the other party to reply or for TCP timeout to expire

o Slammer packs its code in single UDP packet – speed is limited by how many UDP packets can a machine send

o Could we do the same trick with Code Red?• Slammer authors tried to use linear congruential

generators to generate random addresses for scanning, but programmed it wrong

15

Why Was Slammer So Fast?

Page 16: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• 43% of infected machines were in US• 59% of infected machines were home computers• Response was fast – after an hour sites started

filtering packetsfor SQL server port

16

Sapphire/Slammer Worm

Page 17: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

17

BGP Impact of Slammer Worm

Page 18: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

18

Stuxnet Worm• Discovered in June/July 2010• Targets industrial equipment• Uses Windows vulnerabilities (known and new) to

break in• Installs PLC (Programmable Logic Controller)

rootkit and reprograms PLC– Without physical schematic it is impossible to tell what’s

the ultimate effect• Spread via USB drives• Updates itself either by reporting to server or by

exchanging code with new copy of the worm

Page 19: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Many worms use random scanning• This works well only if machines have very

good RNGs with different seeds• Getting large initial population represents a

problem– Then the infection rate skyrockets– The infection eventually reaches saturation since

all machines are probing same addresses

19

Scanning Strategies

“Warhol Worms: The Potential for Very Fast Internet Plagues”, Nicholas C Weaver

Page 20: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

20

Random Scanning

Page 21: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Worm can get large initial population with hitlist scanning

• Assemble a list of potentially vulnerable machines prior to releasing the worm – a hitlist– E.g., through a slow scan

• When the scan finds a vulnerable machine, hitlist is divided in half and one half is communicated to this machine upon infection– This guarantees very fast spread – under one minute!

21

Scanning Strategies

Page 22: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

22

Hitlist Scanning

Page 23: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Worm can get prevent die-out in the end with permutation scanning

• All machines share a common pseudorandom permutation of IP address space

• Machines that are infected continue scanning just after their point in the permutation– If they encounter already infected machine they will

continue from a random point• Partitioned permutation is the combination of

permutation and hitlist scanning– In the beginning permutation space is halved, later

scanning is simple permutation scan 23

Scanning Strategies

Page 24: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

24

Permutation Scanning

Page 25: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Worm can get behind the firewall, or notice the die-out and then switch to subnet scanning

• Goes sequentially through subnet address space, trying every address

25

Scanning Strategies

Page 26: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Several ways to download malicious code– From a central server– From the machine that performed infection– Send it along with the exploit in a single packet

26

Infection Strategies

Page 27: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Three factors define worm spread:– Size of vulnerable population

• Prevention – patch vulnerabilities, increase heterogeneity

– Rate of infection (scanning and propagation strategy)

• Deploy firewalls• Distribute worm signatures

– Length of infectious period• Patch vulnerabilities after the outbreak

Worm Defense

Page 28: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• This depends on several factors:– Reaction time– Containment strategy – address blacklisting and

content filtering– Deployment scenario – where is response

deployed• Evaluate effect of containment 24 hours after

the onset

How Well Can Containment Do?

“Internet Quarantine: Requirements for Containing Self-Propagating Code”, Proceedings of INFOCOM 2003, D. Moore, C. Shannon, G. Voelker, S. Savage

Page 29: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Well Can Containment Do?Code Red

Idealized deployment: everyone deploysdefenses after given period

Page 30: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Well Can Containment Do?Depending on Worm Aggressiveness

Idealized deployment: everyone deploysdefenses after given period

Page 31: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Well Can Containment Do?Depending on Deployment Pattern

Page 32: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Reaction time needs to be within minutes, if not seconds

• We need to use content filtering• We need to have extensive deployment on key

points in the Internet

How Well Can Containment Do?

Page 33: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Monitor outgoing connection attempts to new hosts

• When rate exceeds 5 per second, put the remaining requests in a queue

• When number of requests in a queue exceeds 100 stop all communication

Detecting and Stopping Worm Spread

“Implementing and testing a virus throttle”, Proceedings of Usenix Security Symposium 2003,J. Twycross, M. Williamson

Page 34: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Detecting and Stopping Worm Spread

Page 35: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Detecting and Stopping Worm Spread

Page 36: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Organizations share alerts and worm signatures with their “friends” – Severity of alerts is increased as more infection

attempts are detected– Each host has a severity threshold after which it

deploys response• Alerts spread just like worm does

– Must be faster to overtake worm spread– After some time of no new infection detections,

alerts will be removed

Cooperative Strategies for Worm Defense

“Cooperative Response Strategies for Large-Scale Attack Mitigation”, Proceedings of DISCEX 2003, D. Norjiri, J. Rowe, K. Levitt

Page 37: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• As number of friends increases, response is faster

• Propagating false alarms is a problem

Cooperative Strategies for Worm Defense

Page 38: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Early detection would give time to react until the infection has spread

• The goal of this paper is to devise techniques that detect new worms as they just start spreading

• Monitoring:– Monitor and collect worm scan traffic – Observation data is very noisy so we have to filter

new scans from• Old worms’ scans• Port scans by hacking toolkits

Early Worm Detection

C. C. Zou, W. Gong, D. Towsley, and L. Gao. "The Monitoring and Early Detection of Internet Worms," IEEE/ACM Transactions on Networking.

Page 39: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Detection: – Traditional anomaly detection: threshold-based

• Check traffic burst (short-term or long-term).• Difficulties: False alarm rate

– “Trend Detection” • Measure number of infected hosts and use it to detect

worm exponential growth trend at the beginning

Early Worm Detection

Page 40: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Worms uniformly scan the Internet– No hitlists but subnet scanning is allowed

• Address space scanned is IPv4

Assumptions

Page 41: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Simple epidemic model:

Worm Propagation Model

Detect wormhere. Shouldhave exp. spread

Page 42: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Monitoring System

Page 43: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Provides comprehensive observation data on a worm’s activities for the early detection of the worm

• Consists of :– Malware Warning Center (MWC)– Distributed monitors

• Ingress scan monitors – monitor incoming traffic going to unused addresses

• Egress scan monitors – monitor outgoing traffic

Monitoring System

Page 44: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Ingress monitors collect:– Number of scans received in an interval– IP addresses of infected hosts that have sent

scans to the monitors• Egress monitors collect:

– Average worm scan rate• Malware Warning Center (MWC) monitors:

– Worm’s average scan rate– Total number of scans monitored– Number of infected hosts observed

Monitoring System

Page 45: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• MWC collects and aggregates reports from distributed monitors

• If total number of scans is over a threshold for several consecutive intervals, MWC activates the Kalman filter and begins to test the hypothesis that the number of infected hosts follows exponential distribution

Worm Detection

Page 46: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Population: N=360,000, Infection rate: = 1.8/hour, • Scan rate = 358/min, Initially infected: I0=10• Monitored IP space 220, Monitoring interval: = 1 minute

Code Red Simulation

Infected hosts estimation

Page 47: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Population: N=100,000• Scan rate = 4000/sec, Initially infected: I0=10• Monitored IP space 220, Monitoring interval: = 1 second

Slammer Simulation

Infected hosts estimation

Page 48: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Dynamic Quarantine• Worms spread very fast (minutes, seconds)

– Need automatic mitigation• If this is a new worm, no signature exists

– Must apply behaviour-based anomaly detection– But this has a false-positive problem! We don’t

want to drop legitimate connections!• Dynamic quarantine

– “Assume guilty until proven innocent” – Forbid access to suspicious hosts for a short time– This significantly slows down the worm spread

C. C. Zou, W. Gong, and D. Towsley. "Worm Propagation Modeling and Analysis under Dynamic Quarantine Defense," ACM CCS Workshop on Rapid Malcode (WORM'03),

Page 49: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Dynamic Quarantine• Behavior-based anomaly detection can point

out suspicious hosts– Need a technique that slows down worm spread

but doesn’t hurt legitimate traffic much– “Assume guilty until proven innocent” technique

will briefly drop all outgoing connection attempts (for a specific service) from a suspicious host

– After a while just assume that host is healthy, even if not proven so

– This should slow down worms but cause only transient interruption of legitimate traffic

Page 50: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Dynamic Quarantine• Assume we have some anomaly detection

program that flags a host as suspicious– Quarantine this host– Release it after time T– The host may be quarantined multiple times if the

anomaly detection raises an alarm– Since this doesn’t affect healthy hosts’ operation a

lot we can have more sensitive anomaly detection technique

Page 51: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Dynamic Quarantine• An infectious host is quarantined after time

units • A susceptible host is falsely quarantined after

time units

• Quarantine time is T, after that we release the host

• A few new categories:– Quarantined infectious R(t)– Quarantined susceptible Q(t)

Page 52: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Slammer With DQ

Page 53: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

DQ With Large T?

T=10sec T=30sec

Page 54: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

DQ And Patching?

Page 55: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Patch Only Quarantined Hosts

Cleaning I(t) Cleaning R(t)

Page 56: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

DOMINO• The goal is to build an overlay network so that

nodes cooperatively detect intrusion activity– Cooperation reduces the number of false positives

• Overlay can be used for worm detection• Main feature are active-sink nodes that detect

traffic to unused IP addresses• The reaction is to build blacklists of infected

nodes V. Yegneswaran, P. Barford, S. Jha, “Global Intrusion Detection in the DOMINOOverlay System,” NDSS 2004

Page 57: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

DOMINO Architecture

Page 58: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

DOMINO Architecture• Axis nodes collect, aggregate and share data

– Nodes in large, trustworthy ISPs– Each node maintains a NIDS and an active sink over

large portion of unused IP space• Access points grant access to axis nodes after

thorough administrative checks• Satellite nodes form trees below an axis node,

collect information, deliver it to axis nodes and pull relevant information

• Terrestrial nodes supply daily summaries of port scan data

Page 59: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Information Sharing• Every axis node maintains a global and local

view of intrusion activity• Periodically a node receives summaries from

peers which are used to update global view– List of worst offenders grouped per port– Lists of top scanned ports

• RSA is used to authenticate nodes and signed SHA digests are used to ensure message integrity and authenticity

Page 60: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Many Nodes We Need?

40 for port summaries

20 for worst offender list

Page 61: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Frequent Info Exchange?Staleness doesn’t matter much but more frequent lists are better to catch worst offenders

Page 62: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Long Blacklists?About 1000 IPs are enough

Page 63: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Close Monitoring Nodes?Blacklists in same /16 space are similar satellites in /16 space should be groupedunder the same axis node and sets of /16 spaces should be randomly distributed among different axis nodes

Page 64: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Automatic Worm Signatures• Focus on TCP worms that propagate via

scanning• Idea: vulnerability exploit is not easily mutable

so worm packets should have some common signature

• Step 1: Select suspicious TCP flows using heuristics

• Step 2: Generate signatures using content prevalence analysis

Kim, H.-A. and Karp, B., Autograph: Toward Automated, Distributed Worm Signature Detection, in the Proceedings of the 13th Usenix Security Symposium (Security 2004), San Diego, CA, August, 2004.

Page 65: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Suspicious Flows• Detect scanners as hosts that make many

unsuccessful connection attempts (>2)• Select their successful flows as suspicious• Build suspicious flow pool

– When there’s enough flows inside trigger signature generation step

Page 66: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Signature Generation• Use most frequent byte sequences across

flows as the signature• Naïve techniques fail at byte insertion,

deletion, reordering• Content-based payload partitioning (COPP)

– Partition if Rabin fingerprint of a sliding window matches breakmark = content blocks

– Configurable parameters: window size, breakmark– Analyze which content blocks appear most

frequently and what is the smallest set of those that covers most/all samples in suspicious flow pool

Page 67: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Well Does it Work?• Tested on traces of HTTP traffic interlaced with

known worms• For large block sizes and large coverage of

suspicious flow pool (90-95%) Autograph performs very well– Small false positives and false negatives

Page 68: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Distributed Autograph• Would detect more scanners• Would produce more data for suspicious flow

pool– Reduce false positives and false negatives

Page 69: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Automatic Signatures (approach 2)• Detect content prevalence

– Some content may vary but some portion of worm remains invariant

• Detect address dispersion– Same content will be sent from many hosts to many

destinations• Challenge: how to detect these efficiently (low

cost = fast operation)

S.Singh, C. Estan, G. Varghese and S. Savage “Automated Worm Fingerprinting,” OSDI 2004

Page 70: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Content Prevalence Detection• Hash content + port + proto and use this as key

to a table where counters are kept– Content hash is calculated over overlapping blocks

of fixed size – Use Rabin fingerprint as hash function– Autograph calculates Rabin fingerprint over

variable-length blocks that are non-overlapping– Rabin fingerprint is a hash function that is efficient

to recalculate if a portion of the input changes

Page 71: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Address Dispersion Detection• Remembering sources and destinations for

each content would require too much memory• Scaled bitmap:

– Sample down input space, e.g., hash into values 0-63 but only remember those values that hash into 0-31

– Set the bit for the output value (out of 32 bits)– Increase sampling-down factor each time bitmap is

full = constant space, flexible counting

Page 72: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Well Does This Work?• Implemented and deployed at UCSD network

Page 73: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Well Does This Work?• Some false positives

– Spam, common HTTP protocol headers .. (easily whitelisted)

– Popular BitTorrent files (not easily whitelisted)• No false negatives

– Detected each worm outbreak reported in news– Cross-checked with Snort’s signature detection

Page 74: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Polymorphic Worm Signatures• Insight: multiple invariant substrings must be

present in all variants of the worm for the exploit to work– Protocol framing (force the vulnerable code down

the path where the vulnerability exists)– Return address

• Substrings not enough = too short• Signature: multiple disjoint byte strings

– Conjunction of byte strings– Token subsequences (must appear in order)– Bayes-scored substrings (score + threshold)

J. Newsome, B. Karp and D. Song, “Polygraph: Automatically Generating Signatures for Polymorphic Worms,”IEEE Security and Privacy Symposium, 2005

Page 75: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Worm Code Structure• Invariant bytes: any change makes the worm

fail• Wildcard bytes: any change has no effect• Code bytes: Can be changed using some

polymorphic technique and worm will still work– E.g., encryption

Page 76: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Polygraph Architecture• All traffic is seen, some is identified as part of

suspicious flows and sent to suspicious traffic pool– May contain some good traffic– May contain multiple worms

• Rest of traffic is sent to good traffic pool• Algorithm makes a single pass over pools and

generates signatures

Page 77: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Signature Detection• Extract tokens (variable length) that occur in at

least K samples– Conjuction signature is this set of tokens– To find token-subsequence signatures samples in

the pool are aligned in different ways (shifted left or right) so that the maximum-length subsequences are identified

– Contiguous tokens are preferred– For Bayes signatures for each token a probability is

computed that it is contained by a good or a suspicious flow – use this as a score

– Set high value of threshold to avoid false positives

Page 78: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Well Does This Work?• Legitimate traffic traces: HTTP and DNS

– Good traffic pool– Some of this traffic mixed with worm traffic to

model imperfect separation• Worm traffic: Ideally-polymorphic worms

generated from 3 known exploits• Various tests conducted

Page 79: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How Well Does This Work?• When compared with single signature (longest

substring) detection, all proposed signatures result in lower false positive rates– False negative rate is always zero if the suspicious

pool has at least three samples• If some good traffic ends up in suspicious pool

– False negative rate is still low– False positive rate is low until noise gets too big

• If there are multiple worms in suspicious pool and noise– False positives and false negatives are still low

Page 80: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Borrowed from Brent ByungHoon Kang, GMU

Botnets

Page 81: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

A Network of Compromised Computers on the Internet

IP locations of the Waledac botnet.

Borrowed from Brent ByungHoon Kang, GMU

Page 82: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Botnets

• Networks of compromised machines under the control of hacker, “bot-master”

• Used for a variety of malicious purposes:• Sending Spam/Phishing Emails• Launching Denial of Service attacks • Hosting Servers (e.g., Malware download site)• Proxying Services (e.g., FastFlux network)• Information Harvesting (credit card, bank

credentials, passwords, sensitive data.)

Borrowed from Brent ByungHoon Kang, GMU

Page 83: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Botnet with Central Control Server

After resolving the IP address for the IRC server, bot-infected machines CONNECT to the server, JOIN a channel, then wait for commands.

Borrowed from Brent ByungHoon Kang, GMU

Page 84: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Botnet with Central Control Server

The botmaster sends a command to the channel. This will tell the bots to perform an action.

Borrowed from Brent ByungHoon Kang, GMU

Page 85: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Botnet with Central Control Server

The IRC server sends (broadcasts) the message to bots listening on the channel.

Borrowed from Brent ByungHoon Kang, GMU

Page 86: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Botnet with Central Control Server

The bots perform the command. In this example: attacking / scanning CNN.COM.

Borrowed from Brent ByungHoon Kang, GMU

Page 87: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Botnet Sophistication Fueled by Underground Economy

• Unfortunately, the detection, analysis and mitigation of botnets has proven to be quite challenging

• Supported by a thriving underground economy – Professional quality sophistication in creating

malware codes – Highly adaptive to existing mitigation efforts such

as taking down of central control server.

87

Borrowed from Brent ByungHoon Kang, GMU

Page 88: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Emerging Decentralized Peer to Peer Multi-layered Botnets

• Traditional botnet communication– Central IRC server for Command & Control (C&C)– Single point of mitigation:

• C&C Server can be taken down or blacklisted

• Botnets with peer to peer C&C– No single point of failure.– E.g., Waldedac, Storm, and Nugache

• Multi-layered architecture to obfuscate and hide control servers in upper tiers.

Borrowed from Brent ByungHoon Kang, GMU

Page 89: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Expected Use of DHT P2P Network Publish and Search

Botmaster publishes commands under the key.

Bots are searching for this key periodically

Bots download the commands

=>Asynchronous C&C

Borrowed from Brent ByungHoon Kang, GMU

Page 90: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Multi-Layered Command and Control Architecture Through P2P

Each Supernode (server) publishes its location (IP address) under the key 1 and key 2

Subcontrollers search for key 1

Subnodes (workers) search for key 2

to open connection to the Supernodes

=> Synchronous C&C

Borrowed from Brent ByungHoon Kang, GMU

Page 91: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Current Botnet Defenses

• Virus Scanner at Local Host– Polymorphic binaries against signature scanning– Not installed even though it is almost free– Rootkit

• Network Intrusion Detection Systems– Keeping states for network flows– Deep packet inspection is expensive– Deployed at LAN, and not scalable to ISP-level – Requires Well-Trained Net-Security SysAdmin

Borrowed from Brent ByungHoon Kang, GMU

Page 92: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

92

Conficker infections are still increasing after one year!!!

There are millions of computers on the Internetthat do not have virus scanner nor IDS

Borrowed from Brent ByungHoon Kang, GMU

Page 93: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Botnet Enumeration Approach

• Used for spam blocking, firewall configuration, DNS rewriting, and alerting sys-admins regarding local infections.

• Fundamentally differs from existing Intrusion Detection System (IDS) approaches – IDS protects local hosts within its perimeter (LAN) – An enumerator would identify both local as well as

remote infections • Identifying remote infections is crucial

– There are numerous computers on the Internet that are not under the protection of IDS-based systems.

93

Borrowed from Brent ByungHoon Kang, GMU

Page 94: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

How to Enumerate Botnet

• Need to know the method and protocols for how a bot communicates with its peers

• Using sand-box technique– Run bot binary in a controlled environment– Network behaviors are captured/analyzed

• Investigating the binary code itself– Reversing the binary into high level codes– C&C Protocol knowledge and operation details

can be accurately obtained

Borrowed from Brent ByungHoon Kang, GMU

Page 95: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Simple Crawler Approach

• Given network protocol knowledge, crawlers:1. collect list of initial bootstrap peers into queue2. choose a peer node from the queue3. send to the node look-up or get-peer requests4. add newly discovered peers to the queue5. repeat 2-5 until no more peer to be contacted

• Can’t enumerate a node behind NAT/Firewall• Would miss bot-infected hosts at home/office!

Borrowed from Brent ByungHoon Kang, GMU

Page 96: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Passive P2P Monitor (PPM)

• Given P2P protocol knowledge that bot uses• A collection of “routing-only” nodes that

– Act as peer in the P2P network, but– Controlled by us, the defender

• PPM nodes can observe the traffic from the peer infected hosts

• PPM node can be contacted by the infected hosts behind NAT/Firewall

Borrowed from Brent ByungHoon Kang, GMU

Page 97: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Crawler and Passive P2P Monitor (PPM)

Crawler

PPM

PPM

PPM

Borrowed from Brent ByungHoon Kang, GMU

Page 98: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Crawler vs. PPM: # of IPs found

Borrowed from Brent ByungHoon Kang, GMU

Page 99: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Botnet Enumeration Challenges

• DHCP• NATs• Non-uniform bot distribution• Churn• Most estimates put size of largest botnets at

tens of millions of bots– Actual size may be much smaller if we account for

all of the above

Page 100: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Fast Flux• Botnets use a lot of newly-created domains

for phishing and malware delivery• Fast flux: changing name-to-IP mapping very

quickly, using various IPs to thwart defense attempts to bring down botnet

• Single-flux: changing name-to-IP mapping for individual machines, e.g., a Web server

• Double-flux: changing name-to-IP mapping for DNS nameserver too

• Proxies on compromised nodes fetch content from backend servers

Page 101: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Fast Flux

• Advantages for the attacker:– Simplicity: only one back end server is needed to

deliver content– Layers of protection through disposable proxy

nodes– Very resilient to attempts for takedown

Page 102: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Fast Flux Detection

• Look for domain names where mapping to IP changes often– May be due to load balancing– May have other (non-botnet) cause, e.g., adult content

delivery– Easy to fabricate domain names

• Look for DNS records with short-lived domain names, with lots of A records, lots of NS records and diverse IP addresses (wrt AS and network access type)

• Look for proxy nodes by poking them

Page 103: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Poking Botnets is Dangerous• They have been known to fight back

– DDoS IPs that poke them (even if low workers are scanned)

• They have been known to fabricate data for honeynets– Honeynet is a network of computers that sits in

otherwise unused (dark) address space and is meant to be compromised by attackers

Page 104: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• Researchers subverted a botnet’s command and control infrastructure (proxy bots)– Modified its spam messages to point to the Web

server under researcher control• That server mimicked the original Web page

from the spam emails– A pharmacy site– A greeting card download site

Botnets Fun Facts: ROI for Attackers

"Spamalytics: An Empirical Analysis of Spam Marketing Conversion” C. Kanich, C. Kreibich, K. Levchenko, B. Enright, G. Voelker, V. Paxson, and S. Savage, ACM CCS 2009

Page 105: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

• How many spam emails reach recipients: open a few email accounts themselves and append them to email delivery lists in spam messages

• How many emails result in Web page visits– Must filter out defense accesses

• How many users actually buy advertised products or download software– No “sale” is finalized

• Ethical issues abound

What Is ROI for Attackers

"Spamalytics: An Empirical Analysis of Spam Marketing Conversion” C. Kanich, C. Kreibich, K. Levchenko, B. Enright, G. Voelker, V. Paxson, and S. Savage, ACM CCS 2009

Page 106: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Most-targeted E-mail Domains

"Spamalytics: An Empirical Analysis of Spam Marketing Conversion” C. Kanich, C. Kreibich, K. Levchenko, B. Enright, G. Voelker, V. Paxson, and S. Savage, ACM CCS 2009

Page 107: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Spam Conversion Pipeline

"Spamalytics: An Empirical Analysis of Spam Marketing Conversion” C. Kanich, C. Kreibich, K. Levchenko, B. Enright, G. Voelker, V. Paxson, and S. Savage, ACM CCS 2009

Page 108: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Spam Conversion Pipeline

"Spamalytics: An Empirical Analysis of Spam Marketing Conversion” C. Kanich, C. Kreibich, K. Levchenko, B. Enright, G. Voelker, V. Paxson, and S. Savage, ACM CCS 2009

Page 109: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

Spam Filter Misses

"Spamalytics: An Empirical Analysis of Spam Marketing Conversion” C. Kanich, C. Kreibich, K. Levchenko, B. Enright, G. Voelker, V. Paxson, and S. Savage, ACM CCS 2009

Page 110: Worms 1. Viruses don’t break into your computer – they are invited by you – They cannot spread unless you run infected application or click on infected

For More on Botnetshttp://www.shadowserver.orghttp://www.honeynet.org/papers/bots/http://www.honeynet.org/papers/ff