Week 06 Slides
Week 06 Slides
Computer Security I
<MEETING TIME AND INSTRUCTOR>
WEEK 6
1
Software
Security
Preview
2
Malware
CH. 6
Software that attacks
Malware = malicious software
◦ Software purposely designed to carry out an attack on behalf of the threat agent(s)
◦ We want to think about how different malware attacks affect C, I, and A
Has become increasingly sophisticated and adaptive over the last 30 years
◦ Originally, individual criminal mischief; now organized crime groups and even governments involved
◦ Underground malware economy
Classifying Malware
We will classify malware along two axes:
◦ How it propagates (spreads)
◦ What type of action it takes / payload it carries
Spreads by copying itself to other files on the system, and then infected files are shared
between users
◦ Floppy disk, USB drive, email, Dropbox
Virus code has all access rights of the user who runs the program
Virus Terminology
Infection mechanism/vector: the means by which a virus propagates
Payload: what the virus does besides spreading; the portion of the code that “does the damage”
◦ Anything a user can do: Spying on data, changing permissions, opening ports for network attacks, data
corruption/deletion, random “haunting” behavior …
◦ May be nothing; a virus may have no other function than to spread itself.
Resident: A virus that is resident has its program code loaded into RAM, as opposed to just sitting
on disk
◦ But may still be dormant.
Virus Types
File Infector
◦ A piece of executable code that attaches itself to an executable program’s machine code.
◦ When file is executed, virus loads itself into memory, and usually continues program execution.
Macro Virus
◦ Viruses written in the macro language of a software suite
◦ Propagated through sharing of document files
Traditional file infector virus operation
A traditional virus is created as a piece of executable
code attached to a program’s machine code.
◦ Usually at the beginning Code entry point Virus
When the program is executed, first the virus code
runs.
◦ This is when it may try to copy itself to other files, or
trigger its payload operations Executable
The virus then “jumps” to the start of the original
executable code and the program continues as if
nothing is wrong
A Classic infection vector - autorun.inf
The “autorun” feature of Windows allows a CD-ROM, USB stick, or floppy disk to specify a
program to be run automatically when the media is inserted.
◦ Goal is to make software installation more user-friendly.
◦ But a security disaster!
Macro Viruses
The most prevalent virus type of the 1990’s
Not a machine code virus
◦ Many productivity software packages include what is known as a macro language – an embedded
scripting language that allows users to add functionality to the document or program. (Ex: VBA)
◦ A macro is a small executable script in the macro language, saved with the document
◦ Macros can be set to execute on document open; virus then installs itself in the “standard template” of
the user’s installation, from whence it can infect every document opened with the software.
◦ Early versions had very weak or no protection against macros modifying the whole system
Newer versions of MS Office disable the running of macros by default, for files created by
someone else
The “Melissa” virus
Macro Virus released into the wild March 1999
The fastest-spreading virus to date: across the globe within hours of initial discovery
VBA code in Word file (.doc), which runs when document is opened
◦ Used Microsoft Outlook to email itself to all addresses in address book, with subject line “Important
message from USERNAME”
◦ Recipients likely to open documents from people they know
Payload activated when the minutes of the hour matched the day of the month
◦ Inserts a Simpsons quote into a currently open Word document
However, the prevalence of the internet, and the way it is used, also exposes the average PC to
many more threats than previously.
◦ The web browser is the primary vector of malware delivery to PC, mainly through software
vulnerabilities in the browser scripting engine.
◦ Malware doesn’t have to fit the traditional definition of a file infector virus to do a lot of damage
15
Trojan Horse
An apparently useful program or installer that
also delivers malware.
The payload can be anything; very commonly
used to deliver adware
16
Spam – unsolicited email
Spam has non-malware-related goals:
◦ Advertising actual products (legal or illegal) for sale
◦ Traditional money-making scams
Spam can also be used as a malware propagation mechanism, where it takes the form of social
engineering
◦ Getting user to open infected attachments
◦ Directing to a drive-by download site
18
Windows Infection Vector:
file extension hiding
By default, Windows hides the filename extension in
the file browser
◦ Extensions are used to determine which files are
executable: .exe, .com, .bat
Viruses and other malware are often spread through social engineering methods
◦ Trojan horses
◦ Spam and phishing emails
◦ Any way to get a user to unknowingly execute a program.
Worms,
Drive-by
downloads
PROPAGATION THROUGH SOFTWARE
VULNERABILITY EXPLOIT
What is a worm?
A worm is malware that involves standalone code, not just a fragment attached to a host
program, and is able to propagate itself.
This means that worms typically:
◦ Are more network-oriented – actively seeks out other machines to exploit
◦ Exploit software vulnerabilities in OS, client, or server programs to infect and spread themselves without
human interaction
Remote file transfer: using a remote file transfer service (such as anonymous ftp), copies itself
onto new hosts
Remote login: if it can log itself as a user on a remote system, can issue commands to copy itself
onto the new system
Remote Execution Capability: Exploiting a software bug (e.g. in a network service program) that
allows code execution on a remote machine
◦ Any machine on the internet that hasn’t been patched against the vulnerability can potentially be infected
◦ Server programs are especially vulnerable, because they are configured (as we saw) to allow new
incoming connections.
◦ Potential for extremely rapid propagation
The first stage of worm propagation
Target discovery, AKA scanning
◦ Worm scans hosts on the network to find machines that are susceptible to its infection vector
Scan types:
◦ Random IP address
◦ “Hit list”, list of potentially vulnerable machines compiled over time
◦ Local network/topological: the worm tries to gain information about its host’s local network
environment to find targets
Mathematical model of worm
propagation
Slow start phase, followed by exponential
growth
In middle phase, growth slows to linear, but
spread is most rapid because of increasing
number of infected hosts
Slow finish phase, as fewer vulnerable hosts
left to find
Clearly, we want to stop a worm in the slow
start phase.
The Morris Worm – one of the first
internet worms
Written by a Cornell University grad student and released onto the internet in November 1988
(!!)
Designed to infect UNIX systems
Multiple methods of system invasion, some of which we have studied and will study later:
◦ Attempts to log on as a legitimate user, using previously discovered passwords
◦ Runs dictionary attack on the local password file
◦ Exploits bugs in the sendmail server and UNIX finger protocol
A zero-day exploit is a vulnerability that has not been disclosed to the security community at
large
◦ Thus, it can be exploited before anyone has had a chance to patch it – defenders have “zero days” to
prepare a defense against it.
◦ Underground economy for selling and buying zero-days.
The Code Red worm
July 2001
Exploited a security hole in Internet Information Server (IIS) – Microsoft’s web server program
◦ A buffer overflow bug could cause a long input stream to be written to a region of memory that would be
treated as executable code.
Changes system settings/services: prevents Windows Update from running and disables antivirus
Infected machine sets up an HTTP (web) server to send the worm to new targets
“has been unusually difficult to counter because of its combined use of many advanced malware
techniques.” (Wikipedia)
Infected machines form a botnet – so far, has not been used to carry out any malicious actions,
but anything is possible
Source: https://www.sans.org/security-resources/malwarefaq/conficker-worm.php
Client vs. Server Exploits
Most vulnerabilities exploited by worms are bugs in the code of an internet-facing program, with
the result of allowing code execution on the host machine.
◦ So far we’ve seen that they are mainly server programs (IIS, Apache, or SQL server)
◦ Server software can be attacked directly, because it provides services to any host that makes a request.
◦ Remember that personal firewalls are configured to reject incoming connections, unless an exception
has been made for a specific service.
◦ Conficker attacks Windows PCs in one of its server-type roles (answering RPC requests).
One hopes PCs and personal devices are relatively safe from these
◦ They sit behind firewalls and NAT routers, so are often not publicly reachable
◦ They run few server-style programs (Is this true?)
Of course, once a system is compromised by malware, the malware itself can automatically
download and install additional malware
The web of code
The WWW has progressed from originally being a medium for serving static hyperlinked pages
to an environment overflowing with executable code
A web browser is an extremely complex piece of software
◦ Has essentially become a virtual machine for running website code
◦ The Javascript interpreter should be “sandboxed”, but bugs in the interpreter can potentially allow code
to ‘escape’ into the system at large.
Mobile Malware
In the US, mobile phone infection rate remains low—
why?
◦ App stores
◦ Though apps that show intrusive advertisements (adware)
are exceedingly common
Today’s threats often display a combination of Trojan, Virus, and Worm attributes.
https://www.symantec.com/security_response/landing/threats.jsp
Malware Payloads
WHAT IT CAN DO
Payload Types
Data destruction
◦ Wiping out data
Information theft
◦ Backdoors, stealing passwords and credentials
Revenue-generating activity
◦ Adware
◦ Ad fraud (click-jacking)
◦ Spambots
◦ Bitcoin mining
Many programs gain revenue for the creators by showing advertising within the application.
A more serious kind is adware that installs itself as a system service and displays advertisements
in other programs and throughout the operating system.
Controversy was caused when (formerly) reputable shareware/freeware download sites began
to “bundle” adware installers with their downloads.
◦ The “search assistant toolbar” was one of the most common types
Potential privacy issues caused by adware that gathers information from user’s computer usage
in order to display targeted ads – spyware
Ad fraud/clickjacking
The other side of the online advertising economy is that advertisers pay the
advertising hosting company for the number of times their ad is viewed or
clicked on (“clicks”, “impressions”).
Malware can simulate viewing or clicking on online ads in order to fraudulently
generate revenue for the ad hosting company.
Listed as the 2nd largest Malware concern of 2016 (after ransomware) by
MalwareBytes: https://
www.malwarebytes.com/pdf/white-papers/stateofmalware.pdf
40
Backdoors & Rootkits
OBTAINING FURTHER ACCESS
Backdoors
A backdoor is a secret entry point into a system, which allows the one who knows about it to gain
access without going through the usual authentication procedure.
OS
The Sony XCP Rootkit (2005)
Distributed on audio CDs published by Sony to prevent copying (DRM)
When CD is inserted into Windows PC, EULA pops up.
If user accepts, installs a driver to intercept all system accesses to the CD
◦ Prevents all other software from playing or accessing the audio tracks on a Sony CD
◦ Employs cloaking to make processes invisible to task manager
◦ No visible means of uninstalling the software
Hardware
Defense against virtualization-based
rootkits
Need a secure boot process
◦ Maintain the integrity of the bootloader and low-level OS code
◦ Code signing mechanisms built into hardware, such as UEFI “Secure Boot”
Ransomware
ONE OF THE FASTEST-GROWING THREATS
Definition
Ransomware is a type of malicious software designed to block access to a computer system
and/or data until a sum of money is paid.
48
Non-encrypting ransomware –
“Scareware”
Scareware is a type of malware designed to trick users into purchasing bogus software or sending
money
◦ Fake antivirus
◦ “FBI alerts”
Encrypting Ransomware
Actually encrypts user data to make it inaccessible.
Some types of ransomware can be broken and the files decrypted without paying, due to storing
the secret key on the user’s own computer or a mistake in the implementation.
More sophisticated kinds are considered unbreakable.
WannaCry
The biggest ransomware attack of
2017, starting on May 12.
Exploited a vulnerability in
unpatched versions of Windows 7.
Infected 230,000 computers in
over 150 countries within the first
day.
Affected many critical service
sectors: England’s National Health
Service, FedEx, …
Internet Hero: Marcus Hutchins, a
22-year-old web security
researcher, discovered an effective
kill switch by registering a domain
name he found in the code of the
ransomware. This greatly slowed
the spread of the infection.
Growth of Ransomware
“6 in 10 malware payloads were
ransomware in Q1 2017.”
Click fraud
◦ Computer-generated clicks on web advertisements in order to generate money in pay-per-click
advertising schemes
Source:
http://www.justice.gov/opa/pr/us-leads-multi-national-action-against-gameover-zeus-botn
et-and-cryptolocker-ransomware
Malware Defenses
MALWARE-SPECIFIC DEFENSES
Why can there be no perfect defense against malware?
Because malware is just programs. If you stop everything that malware can do, you stop
everything that any program can do.
For this reason, one of the best defenses is user education.
◦ Help people be aware of what their devices are running.
User awareness-based defense against
potentially unsafe code
Dialog boxes to warn users about programs downloaded from internet
Work by scanning files and checking for the known viruses or malware, or detecting suspicious
code patterns
Basic Scanning Techniques
Simplest: Signature-based scanning
◦ Detect a fixed bit pattern corresponding to the code of known malware
Heuristic scanning: Look for fragments of code often associated with malware
◦ Decryption/inflation routines
◦ Self-modifying code
Integrity checking
◦ Scanner separately stores a checksum (hash) of executable files on the system, then rechecks to detect
modifications.
On-demand vs. real time scanning
On-demand scanning means that the anti-virus program is only run occasionally or at preset
times, to scan for viruses on disk or in memory
◦ Up side: no performance penalty when the scan is not running
◦ Down side: no ability to catch malware as it enters the system perimeter
In real-time scanning, the antivirus remains resident in memory, and inserts hooks into the
operating system to scan code as it enters the system perimeter
◦ File downloaded or extracted, program loaded
◦ Up side: can often catch malware before it can do any damage.
◦ Down side: may reduce system performance
Anti-anti-virus
Sophisticated viruses can employ various techniques attempt to hide themselves from anti-virus
software.
Encrypted virus: A portion of the virus creates a random encryption key and encrypts another
portion of the virus, decrypting it in memory when the virus executes.
◦ Some part has to remain unencrypted for the virus to run at all.
Stealth virus: General term for viruses that actively work to hide themselves, including use of
rootkit techniques (intercepting system calls)
Polymorphic virus: each copy the virus makes of itself is slightly different
◦ If the change is small and/or predictable, the AV scanner can still detect it using pattern matching.
Metamorphic virus: more sophisticated version of polymorphic viruses; rewrites itself using
multiple transformation techniques.
The increasing sophistication of viruses, and the response of antivirus software to detect them,
produces a kind of “arms race”
70
Assignments
1. Read through Chapter 10 of the textbook
2. Homework 6, posted on Blackboard
3. Research Paper Discussion
71