1 Part 2: Attacks and Countermeasures u Vulnerabilities u System Attacks Virus, Trojan, Worm ...

49
1 Part 2: Attacks and Countermeasures Vulnerabilities System Attacks Virus, Trojan, Worm Buffer overflow Rootkit Zombies Web based attacks Network Attacks Eavesdropping Man-in-the-middle Denial of service Authentication attacks Pharming, RATS Social Engineering Attacks

Transcript of 1 Part 2: Attacks and Countermeasures u Vulnerabilities u System Attacks Virus, Trojan, Worm ...

1

Part 2: Attacks and Countermeasures

Vulnerabilities System Attacks

Virus, Trojan, Worm Buffer overflow Rootkit Zombies Web based attacks

Network Attacks Eavesdropping Man-in-the-middle Denial of service Authentication attacks Pharming, RATS

Social Engineering Attacks

2

The Attackers

Script kiddies Hackers Would-be hackers Crackers Industrial espionage Elite Blackhat

A whitehat attacks too, but for the purpose of securing systems

3

Vulnerabilities

Vulnerabilities are weak spots Hard to spot, hard to predict

Can exist in any complex system Human vulnerabilities:

Greed, friendship, attraction, guilt….. much more

System Infrastructure Vulnerabilities “process has holes”, “laws have loopholes”

Software Vulnerabilities Bad code, bad design, unforeseen problems

Hardware Vulnerabilities Failures, faulty design

4

Vulnerability Origins

Too many to reason about “Bad design” Use of shared secrets Human’s do not comprehend large systems

Permutation is not what we do best

A set of ways to do things + some thinking on the part of a miscreant…..

The Windows Vista Audio Attack

5

Examples

Coke machine hack http://youtube.com/watch?v=TBgHH8ZmB_s

ATM hack The video disappeared “security via obscurity”

SQL Injection http://youtube.com/watch?v=MJNJjh4jORY

WiFi range extender? http://youtube.com/watch?v=LY8Wi7XRXCA

6

More Problems

Lack of transparency to humans Windows registry

Feature Creep Lack of adequate “Idiot Proofing”

Counterintuitive?

Ease of use is paramount Now we know, but its too late.

Lack of end-user understanding of vulnerable operations and situations

7

Malware

“Malware” is just one problem, but a major problem How does it work? How does it get there? What can it do?

The OS is supposed to prevent such external attacks Does not work Not in our lifetimes, will these problems get fixed

8

Virus-Trojans-Worms

“Malware” – software that causes harm All software is capable of causing harm

Can perform any computations on a computer Can reproduce

BUT: How did it get to the host machine

Easy Methods: Social engineering Trojans

Harder methods Vulnerability exploits Buffer overflows

9

The Ultimate Trojan

“Reflections on Trusting Trust” -- Ken Thompson, Turing Award Lecture 1984

How to break into Unix? Write custom “login” program Write custom compiler Write even more custom compiler Now the goose is cooked

A trojan that lives forever and can never be disabled?

10

Nothing can be trusted

From login programs to compilers to bootstraps – maybe extending to microcode

“The moral is obvious. You can't trust code that you did not totally create yourself….

“No amount of source-level verification or scrutiny will protect you from using untrusted code…..

“A well installed microcode bug will be almost impossible to detect….

– KEN THOMPSON

Since 1984, we know “Software cannot be trusted”. Yet we do!

11

Trusted Software

We have to trust software No choice

We have to acquire software from “reliable sources” Insider attacks happen

We have to check the software regularly Virus detectors are not the answer

All software have “vulnerabilities” Operating systems, applications, servers, compilers and so on

Vulnerabilities can be exploited by attackers “Buffer overflow” is the major attack, there are many more

12

Buffer Overflow

Reading input data causes overwriting of some data already on the system

Stack smashing Heap smashing Data changing Calling existing routines with different parameters

Can be installed form network communications or from a data file

Result: Easy to install viruses without intervention from the user.

13

Details of Buffer Overflow

foo()Int a[3];{ read n; i = 0; do n times read(a[i]); i++;}

a[2]

Return address

a[1]

a[0]

14

What is vulnerable to Buffer Overflow?

Network connections Structured files User inputs Scripts

All software contain vulnerabilities (just have not been discovered yet)

15

After a Buffer Overflow…

Goal is too install a virus Buffer overflow allows:

1. an attacker to introduce malicious code into a process

OR

2. An attacked to call an existing routine in the application process, with doctored arguments

It is a powerful technique to start the compromise a computer process

16

Rootkits, the Grand Finale

Buffer overflows, open the door, the real deal is the “rootkit”.

Operating system patch Hides all evidence of the compromise Impossible to detect from within the system

Need external detectors

Can be designed to be very difficult, if not impossible to clean up

Reinstall is the only sure way to stop a rootkit

17

What can rootkits do?

Run any software as “root” or administrator Update itself as well as implant newer attacks later “Very Stealthy” Install keyboard sniffers Access any data stored on the computer

If the data is encrypted, the rootkit can find where the key is located

18

Zombies

A virus A process that listens to commands from “home” Can download another programs Can start attacks on other systems Can do spamming without being easily detected

Advantage: Upgradeable, reprogrammable!

19

Sniffers

Record keystrokes typed by a user Can see all data entered by a user, including secret data

Passwords, credit card numbers, personal information Can see data that is encrypted (as it can access it before

encryption, or after decryption)

Would you use a computer that does not belong you?

20

Web Attacks

A variance of the buffer overflow and virus attack Use web software to attack a browser Utilize vulnerabilities in a browser

Java script vulnerabilities Active X vulnerabilities Install “browser helper objects” Can be hidden in web popups

Often used to install Adware Spyware

Web-beacons Single pixel images, that detect a user reading a web page (or

email, or any HTML content)

21

Cross Site Scripting

Fun with Javascript and browsers and servers

Type 0 Run a script on the users machine when visiting a malicious site.

The local script has higher privileges

Type 1 Inject a client side script into a server. A crafted URL followed while

logged into a good site can make the good site do what the attacker wants

Type 2 A message board contains crafter URLs that can send cookies to

the attacker

Many attacks, including the recent gmail attack were done via XSS

22

Gmail Attack

[from a blog]

Haochi Chen discovered what looks like a Gmail XSS (cross-site scripting) security problem. Using a small piece of JavaScript you can put on any server, the user’s contact names & email addresses are revealed (provided you’re logged in to your Google account). I was able to reproduce this using Firefox, and an updated version of the original snippet. With Haochi’s code, a malicious website would be able to grab your contact list and transmit it to their server behind the scenes, storing this data for other purposes – like spamming, or finding out more about you.

If you’re worried about this Google vulnerability, the best thing until it’s fixed is to only visit sites you know and trust, or to turn off your browser’s JavaScript, or to log out of Gmail.

23

Password Attacks

Find password by brute force, or by guessing, or by dictionary attacks

Hardy ever used any more, even simple passwords are hard to crack!

So many easier ways, why bother!

Phishing is hard? Phishing is easy? Sniffing too

24

Network Eavesdropping

Ethernet and broadcast networks “promiscuous mode” Get every packet Password sniffing MAC sniffing WEP cracking

Network eavesdropping can lead to loss of privacy is data is being sent un-encrypted

Not a common attack

25

Man in the Middle

Insert a malicious relay between sender and receiver of a network connection

Change data packets, or replay them Need to sniff and then inject Or need to establish to connections (redirect traffic)

Causes confusion Gain information, use authentication surreptitiously Not effective against modern cryptographic protocols

(encryption and digital signatures)

26

Denial of Service

Flood the network with fake traffic Overwhelm servers with large numbers of queries Distributed DoS uses Zombies

Very difficult to contain

Attacking the network stack Use malformed packets to cause TCP-IP software to block/crash

Does not cause any loss of privacy, or system compromises

27

Authentication Attacks

Steal authentication information Phishing is the most common method Man in the middle, eavesdropping can do it too

Steal keys and other shared secrets Physical theft Viruses Brute force (for bad cryptographic algorithms)

28

Pharming

Corrupt a DNS server Man in the middle System attack

A host translates a DNS name to a attackers IP address E.g. “mybank.com” leads to a hacker site, set up to look like the

mybank.com site

Then a standard phishing attack can be performed on the user-name and password

29

RATS

Remote Access Trojans

New! Improved!! More efficient!!!

These new remote-access Trojans are designed specifically to lurk in the background, waiting until the unsuspecting user types the name of a well-known bank into a Web browser. Then, the program springs into action, copying every keystroke. The data is sent back to the criminal, who now can raid the online bank.

30

Social Engineering

Phishing, via spam or web sites Sending pictures or other interesting things, with

compelling reasons to “open it” Download interesting programs, with Trojans Giving up personal information using baits of various kinds If we figure out all the tricks, more will be invented

31

Countermeasures

Patches and security fixes Virus Scanners Intrusion Detectors / Firewalls Integrity Checking and Virtual Machines Cryptography

Digital Signatures and PKI systems

Smartcards / RFID Awareness and Education Out of band notifications Simple yet effective (vs. Complex and breakable) Proper administration, configuration

32

Patches and Fixes

Software updates To fix buffer overflow and such attacks Doublespeak: “attacker can gain complete control over a computer.” Also fixes bugs and other vulnerabilities “Hardens” software

Updates can be dangerous Introduces more bugs and vulnerabilities Can be fake Target for attackers who distribute malicious patches

33

Password Managers

Stops users from using the same user-id and password Creates strong passwords Sometimes a pain to use Password managers built into browsers – not a good idea Have to transport data between computers, if using multiple

computers (or run from USB stick) Master password can be sniffed

34

Virus Scanners

Everyone should have them installed Even though they are ineffective? Slows down performance

Uses Black Lists Polymorphism and other techniques are used by viruses to

avoid detection Can be disabled or tampered with Problem with DLL, browser objects, active X, registry

hacks, cookies Adware different from spyware and viruses

Not true

A patch that works for now

35

Firewalls

Software and hardware firewalls “Network Address Translation” Incoming filter is needed Outgoing filter is effective but irritating Software firewalls can be defeated

Hardware firewalls are incoming only

36

Intrusion Detection Systems

A set of layered network-wide service for large computer installations

May just be a firewall

Typical configuration have DMZ and honeypots Bastion hosts Signature based detection Monitoring and logging

Attacks possible Polymorphic attacks Noise camouflaged attacks

37

Virtual Private Networks

An authenticated, encrypted tunnel between a client and a host on a secure network

Not popular, but effective Reverse attacks are possible

If the host is on an open network, the client does not have firewall protection

Corporate users are required to use VPNs

38

File Integrity Checkers

Scan each “clean” file and store a signature (or hash) Compare files to stored hashes whenever they are used Easy to bypass or to store hash after file corruption occurs Hash storage prone to attack Sometimes irritating to use A virus can fake user input and fool the integrity checker E,g, Tripwire

39

Single Sign on Systems

Sing on to a secure server and your credential will be forwarded to any site you need to sign on to

Most implementations are flawed Need too much private information (or shared secrets) to

float around Kerberos is probably one of the best, but difficult to

administer Microsoft Passport and Liberty Alliance have products that

are struggling (or dead) Certificate based systems would be much better

40

Sandboxing

Running applications with limited privileges System calls from sandboxed applications can only acces

some “harmless” functions and can cause no damage The above statement is large untrue Sandboxed applications may be able to

Fool the user Send network packets, or spam Run more sandboxed applications Denial of service

41

Virtual Machine Monitors

The ultimate sandbox Multiple copies of the operating system runs on the same

machine (guest operating systems) The core of the system is the “Virtual Machine Monitor” Everything is totally separate, each OS has a different file

system, different network address Isolation can be perfect, but isolation is not security VMM based integrity checking has much promise

42

Cryptography

Cryptography has a treasure chest of algorithms and protocols for handling security (or computation and data)

(Cryptographically Secure) Random Numbers (One way) Hash functions Symmetric Encryption (e.g. DES, AES, IDEA) Asymmetric Encryption (RSA, Rabin, ECC)

Cryptography, if properly implemented can provide high degrees of data security and reliable authentication

Without using shared secret “IF” keys are kept secret Prone to viral attacks

43

PKI Systems

PKI = Public Key Infrastructure A set of protocols that use asymmetric encryption and hashing Authentication Systems Digital signatures for non-repudiable transactions Digital Certificates for secure authentication

PKI based authentication stops the phishing problem and password leakage problem

Keyboard sniffers are not always effective with PKI systems Microsoft Cardspace seems to be the first “consumer”

targeted PKI based identity management system PKI based smartcards are the best implementation

Not yet being deployed

44

Smartcards

Smartcard = Stored secrets Compute engine Communication path Non tamperable

Most smartcards are not very smart Stored value cards, shared secret challenge response cards, GSM

SIM cards

PKI based smartcards provide an excellent authentication solution

DoD CAC Belgian ID card

secrets

processor

45

RFID cards

More common, less secure Contactless – Accessible via radio waves. Can be read at large distances, with expensive equipment Prone to the tracking vulnerability Many attacks against RFID passport discovered Challenge-response RFID cards are better

The current crop is tainted with bad algorithms Stops cloning, but does not stop stealing Room for improvement

46

Out of band communications

A simple and yet powerful technique Many scenarios possible for example:

Make a web transaction that involves a credit card payment An automated phone call received Confirm PIN using phone keypad Confirm amount Must be resilient against fake phone calls

Very hard for attacker to compromise credit card and cellphone and phone PIN

47

Simple is Effective

Complex is breakable All complicated solutions have vulnerabilities and features

that can be exploited Think of a complex piece of software….

– Web browser

– Microsoft Office

– Outlook

– Many more examples

We need simple solutions Easy to understand Easy to detect anomalous behavior

48

Awareness and Education

Education is the answer to many problems, but Cannot educate the masses effectively

Computing and network infrastructure has very deep penetration Consumers are getting educated, but more keep coming online

Learn by experience? Bad idea

Smart people protect themselves ….but the others create problems for everyone

49

Administration and Configuration

Out of the box configurations of systems and gadgets are vulnerable

Default passwords Security features disabled

“Proper Configuration” is of paramount important

e.g. 500 mile email radius How? Very few smart administrators

seem to know Obscurity is used to defeat attackers

(in a way, bad idea)

• Security policy of your organization

• Host system security • Auditing • Router security • Firewalls • Intrusion detection

systems • Incident response plan

Checklist for organizational systems