Intrusion Detection Host Vulnerability and Exploits, Common Attacks on Hosts.

Slides:



Advertisements
Similar presentations
Buffer Overflows Nick Feamster CS 6262 Spring 2009 (credit to Vitaly S. from UT for slides)
Advertisements

Network Security Attack Analysis. cs490ns - cotter2 Outline Types of Attacks Vulnerabilities Exploited Network Attack Phases Attack Detection Tools.
Lecture 16 Buffer Overflow modified from slides of Lawrie Brown.
CHAPTER 2 KNOW YOUR VILLAINS. Who writes it: Malware writers vary in age, income level, location, social/peer interaction, education level, likes, dislikes.
1 Topic 1 – Lesson 3 Network Attacks Summary. 2 Questions ► Compare passive attacks and active attacks ► How do packet sniffers work? How to mitigate?
CS426Fall 2010/Lecture 81 Computer Security CS 426 Lecture 8 User Authentication.
1 CHAPTER 8 BUFFER OVERFLOW. 2 Introduction One of the more advanced attack techniques is the buffer overflow attack Buffer Overflows occurs when software.
Cryptography and Network Security Chapter 20 Intruders
Computer Viruses.
Stack-Based Buffer Overflows Attacker – Can take over a system remotely across a network. local malicious users – To elevate their privileges and gain.
Silberschatz, Galvin and Gagne  Operating System Concepts The Security Problem A system is secure iff its resources are used and accessed as.
1 Protection Protection = access control Goals of protection Protecting general objects Example: file protection in Linux.
19.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 19: Security The Security Problem Authentication Program Threats.
Security A system is secure if its resources are used and accessed as intended under all circumstances. It is not generally possible to achieve total security.
Building Secure Software Chapter 9 Race Conditions.
Silberschatz, Galvin and Gagne  Operating System Concepts Module 19: Security The Security Problem Authentication Program Threats System Threats.
Internet Relay Chat Chandrea Dungy Derek Garrett #29.
Java Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
SHASHANK MASHETTY security. Introduction Electronic mail most commonly referred to as or e- mail. Electronic mail is one of the most commonly.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
Windows This presentation is an amalgam of presentations by Mark Michael, Randy Marchany and Ed Skoudis. I have edited and added material. Dr. Stephen.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Basic Security Networking for Home and Small Businesses – Chapter 8.
Malicious Code Brian E. Brzezicki. Malicious Code (from Chapter 13 and 11)
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Malware  Viruses  Virus  Worms  Trojan Horses  Spyware –Keystroke Loggers  Adware.
Buffer overflows.
The Truth About Protecting Passwords COEN 150: Intro to Information Security Mary Le Carol Reiley.
Lecture 10 Intrusion Detection modified from slides of Lawrie Brown.
Fall 2008CS 334: Computer SecuritySlide #1 Smashing The Stack A detailed look at buffer overflows as described in Smashing the Stack for Fun and Profit.
More Network Security Threats Worm = a stand-alone program that can replicate itself and spread Worms can also contain manipulation routines to perform.
BLENDED ATTACKS EXPLOITS, VULNERABILITIES AND BUFFER-OVERFLOW TECHNIQUES IN COMPUTER VIRUSES By: Eric Chien and Peter Szor Presented by: Jesus Morales.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 45 How Hackers can Cripple the Internet and Attack Your PC How Hackers can Cripple the.
Trojan Horses on the Web. Definition: A Trojan horse a piece of software that allows the user think that it does a certain task, while actually does an.
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 10 “Buffer Overflow”.
Lecture 20 Hacking. Over the Internet Over LAN Locally Offline Theft Deception Modes of Hacker Attack.
CIS 450 – Network Security Chapter 14 – Specific Exploits for UNIX.
Understanding Computer Viruses: What They Can Do, Why People Write Them and How to Defend Against Them Computer Hardware and Software Maintenance.
Security CS Introduction to Operating Systems.
INTERNET SAFETY FOR KIDS
1 Chapter 9 Intruders. 2 Outline Intruders –Intrusion Techniques –Password Protection –Password Selection Strategies –Intrusion Detection Statistical.
Buffer Overflow Attack Proofing of Code Binary Gopal Gupta, Parag Doshi, R. Reghuramalingam, Doug Harris The University of Texas at Dallas.
Lecture 9: Buffer Ovefflows and ROP EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014,
Unix Security Assessing vulnerabilities. Classifying vulnerability types Several models have been proposed to classify vulnerabilities in UNIX-type Oses.
Computer Skills and Applications Computer Security.
Chapter 9 Intruders.
Understand Malware LESSON Security Fundamentals.
INTRODUCTION TO COMPUTER & NETWORK SECURITY INSTRUCTOR: DANIA ALOMAR.
Information Security - 2. A Stack Frame. Pushed to stack on function CALL The return address is copied to the CPU Instruction Pointer when the function.
Foundations of Network and Computer Security J J ohn Black CSCI 6268/TLEN 5550, Spring 2013.
Security Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
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,
Week-14 (Lecture-1) Malicious software and antivirus: 1. Malware A user can be tricked or forced into downloading malware comes in many forms, Ex. viruses,
 Computer Network Attack  “… actions taken through the use of computer networks to disrupt, deny, degrade, or destroy information resident in computers.
Lecture 19 Page 1 CS 236 Online 6. Application Software Security Why it’s important: –Security flaws in applications are increasingly the attacker’s entry.
Chapter 9 Intruders.
Protecting Memory What is there to protect in memory?
Instructor Materials Chapter 7 Network Security
Protecting Memory What is there to protect in memory?
Protecting Memory What is there to protect in memory?
NET 311 Information Security
Attack Examples : DOS, Social Engineering
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Software Security Lesson Introduction
Chapter 9 Intruders.
Security.
CS5123 Software Validation and Quality Assurance
Operating System Concepts
Crisis and Aftermath Morris worm.
Understanding and Preventing Buffer Overflow Attacks in Unix
6. Application Software Security
Presentation transcript:

Intrusion Detection Host Vulnerability and Exploits, Common Attacks on Hosts

CS795-Fall Why Care About Hosts? Most Attacks/Intrusions Have Targeted Hosts –Break-in, penetration –Root privilege compromise –Steal, delete, modify and fabricate information in server Why? –Hosts are more interesting It has (almost) all the sensitive and useful information –Medical record –Payroll information –Classified information –Hosts have all the executables It has potentially more vulnerabilities It is easier for the intruders to exploit with many executables

CS795-Fall Common Attack on Hosts Gain Unauthorized Access to Host –User level Could impersonate that user, change, delete or forge information –Root level Could do everything to the host – worst possible scenario Denial of Service Provided by the Host –Denial of use of a host completely Disable the mail server –Denial of use of an application Disable the online stock trading –Denial of use of data Make the financial record inaccessible to users What Else?

CS795-Fall DoS: Web Server Attacks Many DoS Attacks Are Against Web Servers –Attacker sends enormous amount of bogus requests to the web server i.e. Syn-flood attack –Attacker sends a request consisting of thousands of ‘/’s. Some servers go belly up at this How to Detect? How To Handle This Kind of DoS? –Shutdown the web server?

CS795-Fall DoS: Mailbomb Exploits The Open-Door Nature of System –Mail server is supposed to receive s –Attacker sends thousands of huge junk s Fill up disks, overflow the quotas Deny access to s Cause legitimate s lost Usually done by some automated tools Mailbomb Is Different From Spam –There is no particular desire to have the read, responded, or even necessarily received –The goal is to jam the server and make is unusable How To Detect This? How To Handle This?

CS795-Fall DoS: Resource Hogging Resource Hogs –Programs that uses up the resources of the machine Fill up disks Use all the memory Use all the CPU cycle –Could be some executable downloaded –Code Wars was a game Let opponents write programs that would use up all the resources, until the opponent’s code was unable to run Detection Is Not Difficult –Except for memory leak How To Handle This?

CS795-Fall Unauthorized Access to Host Widely Considered –A much more serious threat than DoS All the sensitive information Impersonation –More difficult to detect than DoS Attack could come from inside Attacker could have the legitimate user name and password –Steal/crack password Attacker may gain access through backdoor

CS795-Fall Ways To Gain Unauthorized Access to Host Steal Account –Looking over one’s shoulder –Social engineering/Phishing –Sniffing –Spyware, key logger –Guessing the password –Cracking the password –What else?

CS795-Fall Ways To Gain Unauthorized Access to Host Abuse The Guest Account –Many systems have default guest account that requires no password Anonymous FTP Trojan Horse Exploit Race Conditions –Usually used for gaining root privilege from normal user privilege Exploit Buffer Overflow –Could gain root access remotely

CS795-Fall Social Engineering/Phishing Tricking People into Giving Access Example –“Hello, this Smith, the Vice President of marketing. I need to update my photo in the corporate directory, and I’ve fogot my password” –“Hello, I’m a customer support from Citibank, and we are upgrading the security mechanism of our customer account management. Please login into web site to verify the status of your account” How to detect this automatically?

CS795-Fall Account Guessing Attacker Can Simply Guess The Password –Knowing something about the user helps Kids/spouse/mother’s maiden name Birthdays Social security numbers –Sometimes just need to try a few obvious things to get in How to Detect This? –Count the unsuccessful login attempts! –What if the attacker is really lucky such that he/she gets the right password in the first try?

CS795-Fall Sniffing Wiretap the network Sniffer the wireless There Are Tools –That automatically look for user IDs and password from the sniffered trace How To Prevent? –Use encryption –Never send password in plaintext How To Detect?

CS795-Fall Trojan Horse A Program –That appears to do one thing but secretly does another Could Be Planted From Local –Running a trojan that simulate the login screen of a computer in a public lab –The trojan records the first login, and prompts the victim with error message –The trojan exits and let the real login program runs Could Be Planted From Remote –The attacker send an with an attachment of a really cool screen saver –Once the victim is tricked into using it The screen saver opens a backdoor and allows the attacker access to the computer whenever the screen saver is running

CS795-Fall Trojan Horse Program with an expected and hidden effect –Appears normal/expected –hidden effect violates security policy User tricked into executing Trojan horse –Expects (and sees) expected behavior –Hidden effect performed with user’s authorization

CS795-Fall Cracking The Password In Unix –Password is not stored in plaintext, but in hashed form (user name, Hash(password)) –When a user enters the password, system computes Hash(password); a match on the hash would allow user to login Offline Guessing the Password –Steal the password file /etc/passwd Some cgi scripts let you do this through a web server –Run crack on the password file Try all possible passwords and compare the hashes of them with Hash(password) in the password file

CS795-Fall Cracking The Password Case Study Farmer and Venema performed the following study in 1993 –Tried to obtain password files from 656 hosts –Succeeded on 24 hosts –Tried to crack the passwords –Got 5 root passwords 259 passwords in total Access to 19 (out of 24) hosts

CS795-Fall Brute Force Password Cracking Assume the password consists of 6 characters from 80 possible choices Totally 2.62×10 11 possible passwords Assume a 1.7GHz computer can check 17,000,000 password per second It would take 15,420 seconds to check every possible password That’s a just a little over 4 hours!

CS795-Fall Brute Force Password Cracking Assume the password consists of 8 characters from 80 possible choices Totally 1.67×10 15 possible passwords Assume a 1.7GHz computer can check 17,000,000 password per second It would take 10 8 seconds to check every possible password That’s about 3 years Assume the computation power doubles every 18 months (Moore’s Law) –It would need another 19 years to be able to crack 8 character password in 4 hours

CS795-Fall Defense Against Password Cracking Use Strong Password –Longer –Not in dictionary Shadow the password –Only the root has access to the actual hashes of passwords Watch for Failed Login Attempts Make Sure There Are No Open Accounts Use Encryption for Access from Remote Is Password Cracking Detectable?

CS795-Fall Defense Against Password Cracking Question: –With increased number of accounts and passwords, how are you going to organize and remember them? Interesting approaches: –Site-Specific Password [HP Lab TR’03] –PwdHash [USENIX Security’05]

CS795-Fall Exploit Race Condition To Trick The Operating System into Letting You Access (Read, Write) a Root File, by Switching Files In the Middle of File Open –Create a temporary file –Open the temporary file to read or write –Between the permission check and the open, switch the file –Read or write the file Also Called Time-of-Check-to-Time-of-Use Flaw

CS795-Fall Exploit Race Condition Example –Create a temporary file /tmp/X –Open the temporary file to write. The OS will check if you have permission You do, since it is your file anyway! –Before the file is opened, but after the permission check, remove /tmp/X, and create a symbolic link to /etc/passwd! –/etc/password will be opened for writing –Write something to /etc/passwd –This would allow one to create new account (or modify existing account) in the password file!!!

CS795-Fall Exploit Race Condition / /tmp/etc /tmp/X/etc/passwd Create X in /tmp

CS795-Fall Exploit Race Condition / /tmp/etc /tmp/X/etc/passwd Access /tmp/X to write

CS795-Fall Exploit Race Condition / /tmp/etc /tmp/X/etc/passwd Link /tmp/X to /etc/passwd

CS795-Fall Exploit Race Condition / /tmp/etc /tmp/X/etc/passwd Write /tmp/X

CS795-Fall Buffer Overflow Buffer Overflow is Hacker’s Best Friend –The most common way of getting unauthorized access to a host Buffer Overflow Exists In Many Places –Many daemons (or server) run with root privilege –Once these root-privileged daemon is exploited with buffer over flow Attacker could get root access remotely!!! First Well-Known Buffer Overflow –Morris’s Worm in 1988

CS795-Fall Overview of Buffer Overflow Vulnerability Run-Time Memory Management of Executables –Use stack to hold local (or automatic) variables Return address of function calls (in x86) Programming Language C Emphasizes Performance –No check on buffer bounds strcpy() gets() etc. Overflow of Local Variables Could –Overwrite the return address –Control what to be run after current function

CS795-Fall Run-Time Stack Memory Organization Text (Initialized) Data (Uninitialized) Run-Time Stack Lower mem address Higher mem address text section Data-bss section SP Stack growth FP SP: Stack Pointer; FP: Frame Pointer

CS795-Fall Run-Time Stack Memory Management Procedure Prolog (Before A Function is Executed) –Advance SP to reserve space for parameters (if any) –Save the IP (Instruction Pointer) to stack as return address –Save current FP (so that is can be restored later) –Copy SP to FP to create a new FP –Advance SP to reserve space for local variables Procedure Epilog (Before A Function Exits) –Clean up the stack –Restore previous SP & FP

CS795-Fall Example C Program void function(int a, int b, int c) { char buffer1[5]; char buffer2[10]; } int main() { function(1,2,3); return 0; }

CS795-Fall Current Run-Time Stack Text (Initialized) Data (Uninitialized) Lower mem address Higher mem address text section Data-bss section SP FP SP: Stack Pointer; FP: Frame Pointer

CS795-Fall Reserve Space for Parameters Text (Initialized) Data (Uninitialized) c Lower mem address Higher mem address text section Data-bss section SP FP SP: Stack Pointer; FP: Frame Pointer b a

CS795-Fall Save Return Address & FP Text (Initialized) Data (Uninitialized) c Lower mem address Higher mem address text section Data-bss section SP FP SP: Stack Pointer; FP: Frame Pointer b a RET SFP

CS795-Fall Allocate New Stack Frame Text (Initialized) Data (Uninitialized) c Lower mem address Higher mem address text section Data-bss section SP FP SP: Stack Pointer; FP: Frame Pointer b a RET SFP

CS795-Fall Allocate Space for Local Variables Text (Initialized) Data (Uninitialized) c Lower mem address Higher mem address text section Data-bss section SP SP: Stack Pointer; FP: Frame Pointer b a RET SFP buffer1 buffer2 FP

CS795-Fall Overflow Buffer1 To Overwrite RET Text (Initialized) Data (Uninitialized) c Lower mem address Higher mem address text section Data-bss section SP SP: Stack Pointer; FP: Frame Pointer b a RET SFP buffer1 buffer2 FP My program somewhere

CS795-Fall Stack Smashing Attack Inject Attack Code –Overflow the buffer with string that is actually executable binary code native to the machine –Most common attack code is to spawn a shell Change the Return Address –Overwrite the return address with pointer to attack code Once the Current Function Returns –The attack code will get control with the same privilege of the original process

CS795-Fall StackGuard: Detection & Prevention of Buffer Overflow Attack Idea –When attacker overwrite the return address, the adjacent word is likely to be overwritten as well –Inject some special number, called canary word, adjacent to the return address –Before jump to the return address, check the canary word If it is changed, then there is buffer overflow If it is not changed, go ahead It can be done by compiler –No source code change is needed! –Just recompile the source code

CS795-Fall Code Injection Defense Security Extensions –Non-Executable Stack –MemGuard, StackGuard, … –Libsafe NX Protection –Hardware vs. Software Randomization –Address Space Layout Randomization –Instruction Set Randomization

Virus Checking Algorithms

CS795-Fall Problem Formulation The virus bit strings are collected {bs i | i =1,N}. Assume each string is K bits. Incoming string is I with a length of L bits. L > K Objective: Determine if I contains any bs i string. Stop at the first match. A match means that I is infected.

CS795-Fall Brute Force J=1 Compare I with bs J string. Slide bs J across I until match is found. Match found – done No match; J=J+1, repeat I: a b c f a b c c f d {L} bs J : c f a b c f {K} Worst case O(K.L)

CS795-Fall Random Compute signature of the K string Compute signature of each K substring of the L string Compare the two signature strings If signature match then virus Signature could be a simple mod operation O(K.L) – practical approach

CS795-Fall KMP Algorithm Pre-process the K string Compute repetition distance – this will correspond to a legit shift in case of mismatch c f a b c f {K} a b c f a b c c f d {L} Pre processing O (K) Processing O (L)

CS795-Fall Automata Scheme Use automata to reduce computation Use K string to fix state transitions Correct sequence leads to match state

CS795-Fall Source: Cormen, Leiserson, Rivest, Stein, Introduction To Algorithms