Computer Science CSC 405Dr. Peng Ning1 CSC 405 Introduction to Computer Security Topic 3. Program Security -- Part I.

Slides:



Advertisements
Similar presentations
Cross-Disciplinary Thinking Nick Feamster and Alex Gray CS 7001.
Advertisements

(Distributed) Denial of Service Nick Feamster CS 4251 Spring 2008.
Buffer Overflows Nick Feamster CS 6262 Spring 2009 (credit to Vitaly S. from UT for slides)
Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 5.1 Malicious Logic.
Thank you to IT Training at Indiana University Computer Malware.
Introduction to Information and Communication Technologies
C risis And A ftermath Eugene H. Spafford 발표자 : 손유민.
Communications of the ACM (CACM), Vol. 32, No. 6, June 1989
Lecture: Malicious Code CIS 3360 Ratan K. Guha. Malicious Code2 Overview and Reading Assignments Defining malicious logic Types Action by Viruses Reading.
By Hiranmayi Pai Neeraj Jain
CSE331: Introduction to Networks and Security Lecture 32 Fall 2002.
Week 6 - Friday.  What did we talk about last time?  Viruses and other malicious code.
Lecture 13 Malicious Software modified from slides of Lawrie Brown.
Computer Viruses and Worms* *Referred to slides by Dragan Lojpur, Zhu Fang at Florida State University.
1 Computer Security Instructor: Dr. Bo Sun. 2 Course Objectives Understand basic issues, concepts, principles, and mechanisms in computer network security.
Chapter 3 (Part 1) Network Security
________________ CS3235, Nov 2002 Viruses Adapted from Pfleeger[Chap 5]. A virus is a program [fragment] that can pass on malicious code [usually itself]
1 Pertemuan 05 Malicious Software Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
Protecting Yourself Online. VIRUSES, TROJANS, & WORMS Computer viruses are the "common cold" of modern technology. One in every 200 containing.
CSE331: Introduction to Networks and Security Lecture 31 Fall 2002.
CSE331: Introduction to Networks and Security Lecture 33 Fall 2002.
100% Security “ The only system which is truly secure is one which is switched off and unplugged, locked in a titanium lined safe, buried in a concrete.
Guide to Operating System Security Chapter 2 Viruses, Worms, and Malicious Software.
Henric Johnson1 Chapter 10 Malicious Software Henric Johnson Blekinge Institute of Technology, Sweden
1GMS-VU : Module 2 Introduction to Information and Communication Technologies Module 2 Computer Software.
1 Chap 10 Malicious Software. 2 Viruses and ”Malicious Programs ” Computer “Viruses” and related programs have the ability to replicate themselves on.
Chapter 15: Security (Part 1). The Security Problem Security must consider external environment of the system, and protect the system resources Intruders.
Viruses.
Unit 2 - Hardware Computer Security.
Malicious Code Brian E. Brzezicki. Malicious Code (from Chapter 13 and 11)
CMSC 414 Computer (and Network) Security Lecture 14 Jonathan Katz.
More Network Security Threats Worm = a stand-alone program that can replicate itself and spread Worms can also contain manipulation routines to perform.
Active Worms CSE 4471: Information Security 1. Active Worm vs. Virus Active Worm –A program that propagates itself over a network, reproducing itself.
Lecture 14 Overview. Program Flaws Taxonomy of flaws: – how (genesis) – when (time) – where (location) the flaw was introduced into the system 2 CS 450/650.
Terminology Worm –A computer program that duplicates itself over computer networks. Virus –A computer program that inspects it’s environment and copies.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Malware.
Information Technology Software. SYSTEM SOFTWARE.
1 Chap 10 Virus. 2 Viruses and ”Malicious Programs ” Computer “Viruses” and related programs have the ability to replicate themselves on an ever increasing.
Week 6 - Wednesday.  What did we talk about last time?  Exam 1  Before that?  Program security  Non-malicious flaws.
Administrative: Objective: –Tutorial on Risks –Phoenix recovery Outline for today.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 47 How Viruses Work.
Recent Internet Viruses & Worms By Doppalapudi Raghu.
©Ian Sommerville 2004Software Engineering Case Studies Slide 1 The Internet Worm Compromising the availability and reliability of systems through security.
Crisis And Aftermath Eugene H. Spafford 이희범.  Introduction  How the worm operated  Aftermath Contents.
Programmed Threats Richard Newman. What is a Programmed Threat? Potential source of harm from computer code May be in form of - Executable program - Executable.
4061 Session 26 (4/19). Today Network security Sockets: building a server.
Malicious Software.
A Failure to Learn from the Past Presented by Chad Frommeyer CSC 493/593 Professors Charles E. Frank/James Walden.
Mobile Code and Worms By Mitun Sinha Pandurang Kamat 04/16/2003.
Understand Malware LESSON Security Fundamentals.
Slammer Worm By : Varsha Gupta.P 08QR1A1216.
The Internet Worm Incident Eugene H. Spafford  Attack Format –Worm vs. Virus  Attack Specifications –Worm operation –Infection and propagaion  Topics.
Lecture 14 Page 1 CS 236 Online Worms Programs that seek to move from system to system –Making use of various vulnerabilities Other performs other malicious.
Program Security 1. Program Security – Outline 3.1. Secure Programs – Defining & Testing Introduction Judging S/w Security by Fixing Faults Judging S/w.
Week 6 - Monday.  What did we talk about last time?  Quantum cryptography  Non-malicious program errors.
1 Computer Security Instructor: Dr. Bo Sun. 2 Course Objectives Understand basic issues, concepts, principles, and mechanisms in computer network security.
Page 1 Viruses. Page 2 What Is a Virus A virus is basically a computer program that has been written to perform a specific set of tasks. Unfortunately,
Virus Infections By: Lindsay Bowser. Introduction b What is a “virus”? b Brief history of viruses b Different types of infections b How they spread b.
By: Austen Perelman-Hall COSC 101 Presentation.  What is a worm? What is a virus?  What is the Red Worm?  Where did it come from? Causes  Effects.
Network Attacks Instructor: Dr. X. Outline Worms DoS.
Security on the Internet Norman White ©2001. Security What is it? Confidentiality – Can my information be stolen? Integrity – Can it be changed? Availability.
CHAPTER 3 PROGRAM SECURITY.
The Internet Worm Compromising the availability and reliability of systems through security failure.
Viruses and Other Malicious Content
Chap 10 Malicious Software.
Brad Karp UCL Computer Science
Chap 10 Malicious Software.
CSE551: Introduction to Information Security
Crisis and Aftermath Morris worm.
Introduction to Internet Worm
Presentation transcript:

Computer Science CSC 405Dr. Peng Ning1 CSC 405 Introduction to Computer Security Topic 3. Program Security -- Part I

Computer Science CSC 405Dr. Peng Ning2 Program Security What is exactly a secure program? –Different people may give different answers –In general, a secure program should behave as their designers intended or uses expected Program security flaws –Unexpected program behavior –Two classes Inadvertent human errors Intentionally induced flaws Both types can cause serious damages

Computer Science CSC 405Dr. Peng Ning3 Non-malicious Program Errors Common non-malicious program errors –Buffer overflows –Incomplete mediation –Time-of-check to time-of-use errors

Computer Science CSC 405Dr. Peng Ning4 Buffer Overflows A buffer is a space in which data can be held –A buffer is finite Buffer overflow –Out of bound use of the buffer Example char sample[10]; for (int i=0; i<=9; i++) sample[i]=‘A’; sample[10]=‘B’;

Computer Science CSC 405Dr. Peng Ning5 An Example of Stack Buffer Overflow service(){ get_msg(); A:send_msg(); } get_msg(...){ char buf[96];... gets(buf);... B:return; } get_msg buf[96] RA = A saved FP RA = Y saved FP service RA = Z saved FP main get_msg malcode RA = m m m service main

Computer Science CSC 405Dr. Peng Ning6 Incomplete Program Mediation Illustration only. This by no means implies DELL has this problem. After clicking “order”, the system completes the transaction with 0&quantity=1&price=

Computer Science CSC 405Dr. Peng Ning7 Time-of-Check to Time-of-Use Errors Access control is often required, but access privileges are not checked universally

Computer Science CSC 405Dr. Peng Ning8 Example binmail vulnerability –On Sun OS 4.1.x –Permission of /var/spool/mail is rwxrwxrwt –Before it opens the mail file, binmail does an lstat() to check that it is not about to write to a linked file –It then use open() to access that file –If a link is created after lstat(), open() will then follow the link –Exploit Create/append to root’s.rhost file Note that binmail can write to anybody’s mailbox

Computer Science CSC 405Dr. Peng Ning9 Malicious Code Kinds of malicious code –Viruses –Trojan horses –Logic bombs –Trapdoor (backdoor) –Worms –Rabbits

Computer Science CSC 405Dr. Peng Ning10 Virus A virus is a program that attaches itself into one or more files and then performs some (possibly null) action Transient virus –A transient virus has a life that depends on the life of its host Runs when the attached program runs Terminates when that program terminates Resident virus –Locates itself in memory Remain active even when the attached program ends

Computer Science CSC 405Dr. Peng Ning11 Trojan Horses A Trojan horse is malicious code that, in addition to its primary effect, has a second, non-obvious malicious effect File F A:r A:w File G B:r A:w ACL User A Program Goodies Trojan Horse executes read write

Computer Science CSC 405Dr. Peng Ning12 Logic Bombs A logic bomb is a program that performs an action that violates the security policy when some external event occurs –Example Erase all the employee records when John Smith is no longer an active employee –Time bomb: a logic bomb whose trigger is a time or date

Computer Science CSC 405Dr. Peng Ning13 Trapdoor (Backdoor) A feature in a program by which someone can access the program other than by the obvious way, perhaps with special privilege –Example An ATM allows anyone entering on the keypad to get all the transactions

Computer Science CSC 405Dr. Peng Ning14 Worm A worm is a program that spreads copies of itself through a network Different from viruses –Viruses depend on other programs –Worms are usually standalone applications –Viruses usually trick people into propagating them –Worms can hack into vulnerable systems and spread without depending on others

Computer Science CSC 405Dr. Peng Ning15 Rabbits (Bacteria) A bacterium or a rabbit is a program that absorbs all of some class of resource –Could be a virus or worm Example –Exhaust disk space –Exhaust inode tables

Computer Science CSC 405Dr. Peng Ning16 How does Virus Work Two phases –Insertion phase The virus inserts itself into a file (or files) –Execution phase The virus executes Usually trick human users to execute the virus –This is necessary for the virus to take control –Examples attachments Hide in boot sector of bootable medium

Computer Science CSC 405Dr. Peng Ning17 Places to Insert Virus Code Virus appended to a program –Virus instruction first executed –Original program executed after the last virus instruction

Computer Science CSC 405Dr. Peng Ning18 Places to Insert Virus Code (Cont’d) Virus that surround a program –Has control before and after the virus execution –Example: modify the output of the original program

Computer Science CSC 405Dr. Peng Ning19 Places to Insert Virus Code (Cont’d) Virus integrated in the original program –The virus writer has to know the exact structure of the original program –Targeted infection; Rare

Computer Science CSC 405Dr. Peng Ning20 How Virus Gain Control Boot sector infectors –The boot sector is the part of a disk used to bootstrap the system. –Code in a boot sector is executed when the system “sees” the disk for the first time. 1.Move the disk interrupt vector 13H to 6DH 2.Set 13H to invoke Brian virus 3.Load the original boot sector Brian Virus

Computer Science CSC 405Dr. Peng Ning21 Boot Sector Infector (Cont’d) 1.Copy the old boot sector to alternative place; 2.Insert itself into the boot sector.

Computer Science CSC 405Dr. Peng Ning22 How Virus Gain Control (Cont’d) Executable infectors –Triggered if an infected program is executed –Infect executables COM and EXE Executable code and dataHeader Virus Header Executable code and data First program instruction

Computer Science CSC 405Dr. Peng Ning23 Terminate and Stay Resident (TSR) Virus TSR virus –Stays active in memory after the application (or bootstrapping) has terminated. 1.Move the disk interrupt vector 13H to 6DH 2.Set 13H to invoke Brian virus 3.Load the original boot sector Brian Virus New disks will be infected as long as the virus is in memory.

Computer Science CSC 405Dr. Peng Ning24 Viruses (Cont’d) Stealth viruses –Conceal the infection of files –Make itself difficult to detect Polymorphic viruses –Encrypt itself with a random key –Avoid detection by anti-virus programs, which search for patterns of viruses. Metamorphic viruses –Change its form each time it inserts itself into another program.

Computer Science CSC 405Dr. Peng Ning25 Viruses (Cont’d) Document (Macro) viruses –Viruses composed of instructions that are interpreted, rather than executed. –Examples Word viruses viruses –MS Office suite is the most popular target.

Computer Science CSC 405Dr. Peng Ning26 Virus Signature and Virus Scanner Virus code must be stored somewhere Virus signature –Characteristics of a virus Virus scanner –Program that looks for virus signatures –A virus scanner is effective only if it is kept up-to- date with the current virus signatures –Examples Symantec AntiVirus Norton AntiVirus

Computer Science CSC 405Dr. Peng Ning27 Virus Signatures Storage patterns –A virus needs to take control of the program –Attach to a file ==> increased file size Remove a part of the original file ==> program function impaired

Computer Science CSC 405Dr. Peng Ning28 Truths and Misconceptions about Virus Virus can only infect Microsoft Windows system Viruses can modify “hidden” or “read only” files Viruses can appear only in data files, or only in Word documents, or only in programs Viruses spread only on disks or only in Viruses cannot remain in memory after a complete power off/power on reboot Viruses cannot infect hardware Viruses can be malevolent, benign, or benevolent

Computer Science CSC 405Dr. Peng Ning29 The Internet Worm Morris Worm, Nov 2 nd, 1988 –The first worm –Robert T. Morris, Jr. 23 years old Cornell grad student –Wrote a self-propagating program as a “test concept” Exploited Unix vulnerabilities in sendmail and fingerd Released at MIT Bug in the worm caused it to go wild –Probably wouldn’t have caused much damage otherwise!

Computer Science CSC 405Dr. Peng Ning30 The Internet Worm (Cont’d) Targeted at Sun 3 and VAX Workstations running BSD based Unix operating systems Infected about 6,000 Unix hosts –About 10% of the 60,000 hosts on the Internet Reactions –People didn’t know what to do, so they panicked Disconnected from net Unable to receive patches! –Morris fined $10k, 3 yrs probation, 400 hrs community service –CERT was created

Computer Science CSC 405Dr. Peng Ning31 The Internet Worm (Cont’d) Code accomplishes three objectives 1.Determine to where it could spread Offline password guessing (use the dictionary for the spell checker) Buffer overflow vulnerability in fingerd ==> remote shell Sendmail vulnerability (debug mode) to execute arbitrary commands 2.Spread its infection First a bootstrap loader to the target machine Bootstrap loader fetch the rest of the worm –Use a one-time password to authenticate the bootstrap loader

Computer Science CSC 405Dr. Peng Ning32 The Internet Worm (Cont’d) Code accomplishes three objectives (Cont’d) –Remain undiscovered and undiscoverable If worm fetching runs into a transmission error, the bootstrap loader deletes all the code already transferred Once worm is received, it loads the code into memory, encrypt it, and delete all the original copies Periodically change its name and process id Definitely discoverable: The huge traffic resulting from the spread!!!

Computer Science CSC 405Dr. Peng Ning33 Code Red Appeared in July and August in 2001 Exploit a buffer overflow vulnerability in Microsoft’s Internet Information Service (IIS) –Buffer in the dynamic link library idq.dll Three versions –Code Red I version 1 –Code Red I version 2 –Code Red II Substantial rewrite

Computer Science CSC 405Dr. Peng Ning34 Code Red I Version 1 Easy to spot –Deface the website HELLO! Welcome to ! Hacked by Chinese! Activities determined by date –Day 1 to 19 of the month Scan and compromise vulnerable computers, starting at the same IP –Day 20 to 27 Distributed denial of service (DDoS) attacks against –Day 28 to end of month Do nothing

Computer Science CSC 405Dr. Peng Ning35 Code Red I Version 2 Discovered near the end of July 2001 –Did not deface the website –Propagation is randomized and optimized to infect servers more quickly

Computer Science CSC 405Dr. Peng Ning36 Code Red II Discovered on August 4, 2002 Inject a Trojan hose in the target Modify software to ensure a remote attacker can execute any command on the server –Copy cmd.exe to four places C(D):\inetpub\scripts\root.ext C(D):\progra~1\common~1\system\MSADC\root.exe –Its own copy of explorer.exe –Modify the registry to disable certain file protection –Reset the registry every 10 minutes Automatically stop propagating in October 2002 Reboot the server after 24 or 48 hours, wiping itself from memory but leaving the Trojan horse