...

Sicurezza nelle Reti Cosa vedremo

by user

on
Category: Documents
18

views

Report

Comments

Transcript

Sicurezza nelle Reti Cosa vedremo
Sicurezza nelle Reti
Gianluca Dini
[email protected]
0
Cosa vedremo
• Problemi
• Principali primitive crittografiche
• Algoritmi simmetrici o a chiave segreta (DES)
• Algoritmi Asimmetrici o a chiave pubblica (RSA)
• Funzioni hash (MD5)
• Principali servizi
• Segretezza, autenticazione, integrità, non-ripudio
• Esempi
• IPSEC
A.A. 2009-2010
28-12.-09
Introduzione
Introduzione
1
Sistema Centralizzato
Caratteristiche
• Sviluppo SW, simulazioni, Information System
• Informazioni ed elaborazione centralizzate
•
•
•
•
Accesso per mezzo di terminali “stupidi”
Unico dominio amministrativo
Protezione fisica
Utenti noti e fidati
Obiettivo
• Integrità del sistema
Meccanismi
• Meccanismi HW, Sistema Operativo
A.A. 2009-2010
Introduzione
2
Local Area Network
Caratteristiche
•
•
•
•
•
Sviluppo SW, simulazioni, Information system
Condivisione di risorse (file, stampanti, CPU)
Workstation (Windows, Unix, MS-DOS)
Unico dominio amministrativo
Protezione fisic
Obiettivo
• Integrità del sistema
Meccanismi
• Autenticazione basata sull’indirizzo
(address-based authentication)
A.A. 2009-2010
Introduzione
3
Wide Area Network
Caratteristiche
• Applicazioni “sensibili”: e-commerce,
telemedicina,…
• Domini applicativi differenti
• Utenti sconosciuti o inaffidabili
• La rete è insicura
Obiettivo
• Confidenzialità, Autenticazione,
Integrità, Non-ripudio
Meccanismi
• Cifratura, firma digitale, funzioni hash
A.A. 2009-2010
Introduzione
4
Attacchi alla sicurezza
Rilascio del contenuto dei messaggi
Analisi del traffico
Impersonificazione (masquerade)
Modifica dei messaggi
Cancellazione dei messaggi
Replicazione dei messaggi (replay)
A.A. 2009-2010
Introduzione
5
Rilascio del contenuto dei messaggi
Bob
Alice
Avversario Passivo
(eavesdropper; sniffer)
Da Bob ad Alice:
vediamoci alle 20:00!
L’avversario ricava il contenuto delle trasmissioni
A.A. 2009-2010
Introduzione
6
Analisi del traffico
Avversario passivo
Da Bob ad Alice:
xhhjo12&v d2}} hfo0
L’avversario determina l’identità degli host comunicanti, la
frequenza e la dimensione dei messaggi
A.A. 2009-2010
Introduzione
7
Impersonificazione (masquerade)
Sono Alice, trasferisci1000€ dal mio
conto a quello di Mr. Lou Cipher
Avversario attivo
L’avversario finge di essere un entità (host, user)
diversa.
A.A. 2009-2010
Introduzione
8
Modifica dei messaggi
Pagate 100€ a
Mr. Lou Cipher
Pagate 1000€ a
Mr. Lou Cipher
Avversario ATTIVO
L’avversario modifica porzioni di un messaggio
A.A. 2009-2010
Introduzione
9
Cancellazione dei messaggi
Avversario attivo
A.A. 2009-2010
Introduzione
10
Replicazione dei messaggi (replay)
Pagate 100€ a
Mr. Lou Cipher
Avversario attivo
L’avversario intercetta un messaggio e lo ritrasmette una
o più volte
A.A. 2009-2010
Introduzione
11
Attacchi alla sicurezza
Tipo
PASSIVO
ATTIVO
Attacco
• Rilascio messaggi
• Analisi del flusso
•
•
•
•
Masquerade
Modifica messaggi
Replay
Negazione del
servizio
A.A. 2009-2010
Contromisure
• Difficili da rilevare
• Facili da controbattere
• Facili da rilevare
• Difficili da controbattere
Introduzione
12
Servizi di sicurezza
Confidenzialità
secrecy
privacy
Integrità dei dati
Autenticazione
• Identificazione
• Provenienza dei messaggi
• Strettamente legata ad integrità
Non-ripudio
A.A. 2009-2010
Introduzione
13
Crittografia e primitive crittografiche
La crittografia è la disciplina che studia le
tecniche matematiche relative alla sicurezza
Le primitive crittografiche sono:
• cifrari
• simmetrici
• asimmetrici
• funzioni hash
• firma digitale
A.A. 2009-2010
Introduzione
14
Due Messaggi
Inventare un algoritmo crittografico è compito
dei matematici, ma utilizzarlo correttamente è
compito di un ingegnere informatico
Crittografia non è sinonimo di sicurezza
“Whenever anyone says that a problem is easily
solved by cryptography, it shows that he doesn’t
understand it”
(Roger Needham/Butler Lampson)
A.A. 2009-2010
Introduzione
15
Un esempio concreto
IP spoofing
A.A. 2009-2010
Introduzione
16
Overview
Problemi nella TCP/IP protocol suite:
Autenticazione basata sull’indirizzo IP
Meccanismi di controllo della rete (ad esempio,
i protocolli di routing) fanno un uso molto
limitato, o addirittura nessun uso, della
autenticazione
A.A. 2009-2010
Introduzione
17
Trust relationship in the Unix world
IPS
IPB
• S si fida di bob quando
parla da B
• S si fida della capacità di B
di identificare i propri utenti
~/.rhosts
…
ips bob
…
~/.rhosts
…
ipb bob
…
• Bob can use any of the r* commands without the annoying
hassle of password authentication
• The r* commands are based on address-based
authentication
A.A. 2009-2010
Introduzione
18
TCP 3-way handshake
Handshake for connection establishment
S: server (target host);
C: client (trusted host);
ISN: initial sequence number;
M1 C -> S: SYN(ISNC)
M2 S -> C: SYN(ISNS), ACK(ISNC)
M3 C -> S: ACK(ISNS)
trasmissione dati
Sequence numbers allow TCP to implement data sequencing
and acknowledging for communication reliability
A.A. 2009-2010
Introduzione
19
TCP spoofing: basic idea
If an adversary X is able to “guess” ISNS, then he can
impersonate the trusted host C
M1
M2
M3
M4
X
S
X
X
->
->
->
->
S:
C:
S:
S:
SYN(ISNX), SRC = C
SYN(ISNS), ACK(ISNX)
ACK(ISNS)
ACK(INSS), malicious payload
X does not receive M2, but he is able to guess ISNS and
thus generate M3
S believes that the connection is with C
A.A. 2009-2010
Introduzione
20
TCP spoofing: basic idea
Problem
• Upon receiving M2, the trusted host C would send the RST
command
Target host
• The trusted host has to be taken KO
M2
Trusted host is
taken KO
M1
M3
A.A. 2009-2010
Introduzione
21
TCP spoofing: attack planning
Choose the target host
Discover a pattern of trust and a trusted host
• background information is known
• try neighbouring IP addresses
Disable the trusted host
Impersonate the trusted host
sample sequence numbers
make connection attempt
Leave a backdoor, if the attack succeeds
A.A. 2009-2010
Introduzione
22
Disabling trusted host
TCP SYN flooding
SYN
port
SYN ⋮
SYN
backlog
Backlog limits the
number of concurrent
SYN requests TCP
can process for a
given socket
backlog
Unix
5
Linux
6
A.A. 2009-2010
Introduzione
23
ISN sampling and prediction
RTT: Round Trip Time
attacker
genuine
connection
target
The ISN counter
• is initialized to 1
• is incremented by 128k every second
• is incremented by 64k at every connection
RTT
ISNS
ISNS and (an estimation of) RTT allow the attacker to estimate
the next value for ISNS to be used in the spoofing attack
A.A. 2009-2010
Introduzione
24
Insert a backdoor
Trusted host
Target
host
cat ++ > ~/.rhosts
• Quick
• Simple re-entry
• Not interactive
A.A. 2009-2010
28-12.-09
Introduzione
Introduzione
25
Preventive measures (I)
(not unique)
Be un-trusting and un-trustworthy
• Disable all r* commands
• Remove all .rhosts
• Empty /etc/equiv (host wide trust relationships)
• Force users to use other means of remote access,
• e.g. ssh
Packet filtering
• Impose trust relationships only among internal hosts
• No internal host should trust and external host
• Filter out all traffic from the outside that purports to come
from the inside
A.A. 2009-2010
Introduzione
26
Preventive measures (II)
Cryptographic methods
• Require all network traffic to be authenticated and/or
encrypted
• ISN Randomizing
• Sequence numbers are chosen randomly and
unpredictably
• ISN = Clock + (upon every new connection)
H(localhost,localport,remotehost,remoteport, s),
where s is secret material
A.A. 2009-2010
Introduzione
27
Fly UP