Lesson 11.1 - 11.3 - Internet Worms, Spam, Denial of Service Attacks Flashcards
Virus
an infection of an existing program that results in the modification of the original program’s behavior
* Typically require user action/activity to spread (opening an attachment, running an executable file, etc.)
Worm
code that propagates/replicates across the network
- Usually spread by exploiting flaws in existing programs or open services
- Propagate automatically
Types of viruses
- Parasitic: typically infects an existing executable file
- Memory-resident: infects running programs
- Boot-sector: spreads whenever the system is booted
- Polymorphic: encrypts part of the virus program using a randomly generated key
Key difference between viruses and worms
- Viruses typically spread with manual user intervention. Worms typically spread automatically by scanning for vulnerabilities and infecting vulnerable hosts when vulnerabilities are discovered.
- A worm might use any of the above techniques to infect a particular host before spreading further
First internet worm
Morris worm
You can model a worm and how it spreads using analogies from ______
Epidemiology
What is/are the difference(s) between worms and viruses?
- Worms do not have destructive payloads
- Viruses only infect Windows machines
- Viruses can spread more rapidly
- Worms can spread automatically
-Worms can spread automatically
Lifecycle of an internet worm
- The infected machine might “scan” other machines on the internet to discover vulnerable hosts
- Infect the vulnerable machines that it discovers via remote exploit
(3. Remain undetectable)
Morris Worm
- Designed by Robert Morris, Jr. in 1988
- It had no malicious payload but it ended up bogging down the machines it infected by spawning new processes uncontrollably and exhausting resources
- Affected 10% of all internet hosts
- Spread through 3 different propagation vectors
- Tried to crack passwords using a small dictionary and a publicly readable password file, and also targeted hosts that were already listed in a trusted hosts file on the machine that was already infected
- Ability to perform remote execution was one way that it was allowed to spread. The second way was in a buffer overflow vulnerability in the finger daemon. It was a standard buffer overflow exploit, which is a very common attack that makes remote exploits possible, effectively resulting in the ability to run arbitrary code at the root level privilege.
- Third way that it spread was via the Debug command in sendmail, which is a mail sending service. In early sendmail, it was possible to execute a command on a remote machine by sending an SMTP message. The worm used this capability to spread automatically.
- A key theme that we’ll see in the design of other worms is this use of multiple vectors, depending on the remote vulnerabilities that it’s trying to exploit.
- The idea that any worm might be able to exploit multiple weaknesses in a system gives it more ways to spread and also often speeds up the propagation of the worm.
- Worm design general approach (we see this a lot):
- Scan, then spread, then remain undiscoverable/undiscovered so that it can continue to operate/spread without being removed from systems
What are the 3 steps in a worm’s lifecycle?
- Infect vulnerable host
- Patching the host’s vulnerability
- Scanning for vulnerable hosts
- Remaining undetectable
- Infect vulnerable host
- Scanning for vulnerable hosts
- Remaining undetectable
***Note: A worm does not necessarily need to patch the host’s vulnerability. Although, some internet worms have been known to do so to prevent other worms from subsequently infecting and interfering with the original worm infection.
What was the first modern worm?
Code Red 1
What were the 3 major outbreaks in the summer of 2001?
Code Red 1 v2, Code Red 2, and Nimda
Code Red 1
- Exploited a buffer overflow in Microsoft’s IIS server, and would spread on the 1st-20th of each month by finding new targets using a random scan of IP address space.
- It would spawn 99 new threads which generated IP addresses at random and then looked for vulnerable instances of IIS.
- Version 2 of Code Red 1 was released 6 days later
- Fixed the random scanning bug, so that each instance of the worm scanned a different IP address space
- After the scanning bug was fixed, the worm was able to compromise 350K hosts in 14 hours
- By most estimates, that was the complete set of hosts running the vulnerable version of IIS on the entire Internet
- Payload was to mount a DOS attack on whitehouse.gov, but a bug in the coding caused the worm to die on the 20th of each month.
- Fortunately, the attack was launched at a particular IP address, and not at the domain name, so the operators needed only to move the web server to a different IP address to defend against the DOS attack. A better worm design would have been much more catastrophic.
- By most estimates, that was the complete set of hosts running the vulnerable version of IIS on the entire Internet
Code Red 2
Code Red 2 exploited the same vulnerability but had a different payload.
- Released on Aug 4 2001
- Called Code Red 2 mainly because of a comment in the code
* Only spread on Windows 2000 (crashed on Windows NT)
* The scan preferred nearby addresses. It would choose addresses from the same /8 with probability 1/2, from the same /16 with probability 3/8, and randomly from the entire Internet with the remaining 1/8 probability
* Why? Because if there was one vulnerable host on the network, there was likely to be more, because the same administrator that failed to patch the compromised machine might have other machines on the same network that were also vulnerable. This notion of preferential scanning can speed up infections in some cases by increasing the probability that scanning will find another vulnerable host. - Payload: IIS backdoor.
- Worm was completely dead by design by Oct 1 2001
Nimda
Nimda: released on Sept 18 2001 and was interesting mostly because it spread using multiple propagation vectors
- It was effectively multi-modal
- Used same IIS vulnerability as Code Red 1 and 2, it also spread by:
* Bulk email (in an attachment)
* Copied itself across open network shares
* Installed an exploit code on web pages on the core running web server running on the machine so that any browser that visited the web page for that server would become infected itself
* Scan for the Code Red 2 backdoors that that worm had installed - The multi-modal nature meant signature-based defenses don’t necessarily help. Nimda was able to leap firewalls because it was able to spread via email or backdoors.
- This was the first instance of a worm that exploited what we call a zero-day attack, which is when a worm first appears in the wild, and the signature of the worm is not extracted until minutes or hours later. Zero-day attacks are particularly virulent because the worm can spread extremely quickly before any type of signature-based anti-virus has a chance to catch up and prevent the infections in the first place.
How to design a very fast spreading worm?
Increase the # of initial compromised rate (K)
How to calculate # of new infections in a given time period (dt)
Nda = (Na) * k(1 - a)dt
where:
K = initial compromised rate
N = # of vulnerable hosts
a = fraction of hosts already compromised
How to increase the compromised rate
- Increase compromise rate (K) to design a very fast spreading worm:
* Create a hit list (list of vulnerable hosts) ahead of time. The curve showed that the time to infect the first 10,000 hosts dominates infection time, so if we start by performing stealthy scans or some reconnaissance before we start spreading, we can get rid of the initial flat part of the curve where it’s effectively dormant.
* Use permutation scanning: every compromised host has a shared permutation of an IP address list to scan for vulnerabilities. Each host starts at its own IP address in the list and works down, different infected hosts wills tart scanning from different parts of the list, ensuring that compromised hosts don’t duplicate each other’s work.