SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 11
Secure Active Switch Secure Active Switch (SAS): (SAS): hardening del Linux kernel hardening del Linux kernel
bridgebridgeimplementato su sistema implementato su sistema
embeddedembeddedColdFire MotorolaColdFire Motorola
Giuseppe Gottardi
Università Politecnica delle Marche
Dipartimento di Elettronica Intelligenza artificiale e Telecomunicazioni
D.E.I.T.
Correlatore:Dott. Ing. Valerio
Frascolla
Relatore:Prof. Massimo Conti
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 22
SSecure ecure AActive ctive SSwitchwitch
1.1. Cos’è il SASCos’è il SAS
2.2. Perché Perché usarlousarlo
3.3. Come Come funzionafunziona
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 33
SSecure ecure AActive ctive SSwitchwitch
Cos’è il Cos’è il SAS?SAS?
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 44
SAS: IT security toolSAS: IT security tool
Tool di prevenzione verso gli attacchi Tool di prevenzione verso gli attacchi informatici in rete locale basato su un algoritmo informatici in rete locale basato su un algoritmo di nuova concezione sviluppato dall’autore di nuova concezione sviluppato dall’autore della tesi in collaborazione con il DEIT.della tesi in collaborazione con il DEIT.
Hardening del kernel Linux v2.6Hardening del kernel Linux v2.6– Modifica al kernel di Linux nel modulo “bridge”Modifica al kernel di Linux nel modulo “bridge”
Switch di rete Attivo e SicuroSwitch di rete Attivo e Sicuro– Attivo: capace di mandare pacchetti di controlloAttivo: capace di mandare pacchetti di controllo– Sicuro: capace di bloccare attacchi di tipo ARPSicuro: capace di bloccare attacchi di tipo ARP
Sistema embedded su MCF5485EVBSistema embedded su MCF5485EVB– Board Freescale con µproc ColdFire Motorola (MIPS 32-bit) Board Freescale con µproc ColdFire Motorola (MIPS 32-bit)
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 55
SSecure ecure AActive ctive SSwitchwitch
Perché usarlo?Perché usarlo?
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 66
Attacchi Attacchi in Local Area NetworkSTATS – CSI/FBISTATS – CSI/FBI
Fonte: Computer Security Institute Federal Bureau of Investigation
Abusi della rete dall’interno (60% sulla totalità degli attacchi nel 2004)
Perdite per oltre11.000.000 $
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 77
Attacchi Attacchi in Local Area NetworkTYPOLOGIESTYPOLOGIES LAN non commutata (HUB)
- T- Tutti i pacchetti transitano per l’host attaccante. LAN commutata (switching tradizionale)
- I pacchetti degli host attaccati transitano per l’host attaccante dopo un attacco M.I.T.M.
Tipologia di attacchi M.I.T.M.
DA LOCALE A LOCALE:DA LOCALE A LOCALE:- ARP poisoning- ARP poisoning - DNS spoofing- DNS spoofing - STP mangling- STP mangling- Port stealing- Port stealing
DA LOCALE A REMOTO (attraverso il gateway):DA LOCALE A REMOTO (attraverso il gateway):- ARP poisoning- ARP poisoning - DNS spoofing- DNS spoofing - DHCP spoofing - DHCP spoofing - ICMP redirection- ICMP redirection - IRDP spoofing- IRDP spoofing - route - route manglingmangling
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 88
Attacchi Attacchi ““Man In The Man In The Middle”Middle”HTTPS (SSL)HTTPS (SSL)
1111 2222 3333 4444
18 08 19 09
Giuseppe Gottardi
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 99
Attacchi Attacchi ““Man In The Man In The Middle”Middle”KEY EXCHANGING - HTTPSKEY EXCHANGING - HTTPS Consiste nella modifica del certificato SSL scambiato Consiste nella modifica del certificato SSL scambiato
tra un server web HTTPS e un clienttra un server web HTTPS e un client (vale anche per (vale anche per SSH v1). Questa tecnica consente di decodificare SSH v1). Questa tecnica consente di decodificare sessioni codificate.sessioni codificate.
Server Client
MITM
start
KEY-ARSA KEY-BRSA
Ekey-B(S-Key)Ekey-A(S-Key)S-KEY S-KEY S-KEY
MEskey(M)
D(E(M))
D(E(M))
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 1010
Attacchi Attacchi ““Man In The Man In The Middle”Middle”FILTERING -FILTERING - HTTPS redirectionHTTPS redirectionUna form in HTTPS viene forzata all'autenticazione in HTTPUna form in HTTPS viene forzata all'autenticazione in HTTP
Http main page with https login form
Change form destination to http://mitm
Http post (login\password)
Auto-submitting hidden form with right authentication data
Real https authentication post
Authenticated connection
Client
Server
MITMlogin
password
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 1111
SSecure ecure AActive ctive SSwitchwitch
Come Come funziona?funziona?
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 1212
ARP poisoningARP poisoningSIMULATIONSIMULATION
IPIP MACMAC
10.0.0.210.0.0.2 01:02:03:04:05:0B
10.0.0.310.0.0.3 01:02:03:04:05:0C
IPIP MACMAC
10.0.0.110.0.0.1 01:02:03:04:05:0A
10.0.0.310.0.0.3 01:02:03:04:05:0C
IPIP MACMAC
10.0.0.210.0.0.2 01:02:03:04:05:0C
10.0.0.310.0.0.3 01:02:03:04:05:0C
Host A
Host B
Attaccante
Switch
ARP poisoning
ARP poisoning
Packet from A
IP 10.0.0.1MAC 01:02:03:04:05:0A
IP 10.0.0.3MAC 01:02:03:04:05:0C
IP 10.0.0.2MAC 01:02:03:04:05:0B
ARP cache A
ARP cache B
IPIP MACMAC
10.0.0.110.0.0.1 01:02:03:04:05:0C
10.0.0.310.0.0.3 01:02:03:04:05:0C
Packet from B
DEV-1 DEV-2 DEV-3
DEV MAC STATE
DEV-1 01:02:03:04:05:0AFORWARDIN
G
DEV-3 01:02:03:04:05:0CFORWARDIN
G
DEV-2 01:02:03:04:05:0BFORWARDIN
G
…
CAM table
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 1313
SSecure ecure AActive ctive SSwitchwitchHOW IT WORKS - simulationHOW IT WORKS - simulation
src MAC 01:02:03:04:05:0A
dest MAC
01:02:03:04:05:0B
src IP 10.0.0.1
dest IP 10.0.0.2
…
DEV MAC IP STATEDEV-
101:02:03:04:05:0
A10.0.0.
1FORWARDIN
G
DEV-3
--- --- LEARNING
DEV-2
--- --- LEARNING
…
src MAC 01:02:03:04:05:0B
dest MAC
01:02:03:04:05:0C
src IP 10.0.0.2
dest IP 10.0.0.3
…
Host A
Host B
Attaccante
ARP poisoningIP 10.0.0.1
MAC 01:02:03:04:05:0A
IP 10.0.0.2MAC 01:02:03:04:05:0B
IP 10.0.0.3MAC 01:02:03:04:05:0C
Switch SASDEV-1
DEV-2 DEV-3
Packet header
CAM table SASDEV MAC IP STATE
DEV-101:02:03:04:05:
0A10.0.0.
1FORWARDIN
G
DEV-301:02:03:04:05:
0B10.0.0.
2FORWARDIN
G
DEV-2 --- --- LEARNING
…
src MAC 01:02:03:04:05:0C
dest MAC
01:02:03:04:05:0B
src IP 10.0.0.3
dest IP 10.0.0.2
…
DEV MAC IP STATE
DEV-101:02:03:04:05:
0A10.0.0.
1FORWARDIN
G
DEV-301:02:03:04:05:
0B10.0.0.
2FORWARDIN
G
DEV-201:02:03:04:05:
0C10.0.0.
3FORWARDIN
G
…
src MAC 01:02:03:04:05:0C
dest MAC
01:02:03:04:05:0A
src IP 10.0.0.2
dest IP 10.0.0.1
…
?mismatch
DEV MAC IP STATE
DEV-101:02:03:04:05:
0A10.0.0.
1FORWARDIN
G
DEV-301:02:03:04:05:
0B10.0.0.
2WAITING
DEV-201:02:03:04:05:
0C10.0.0.
3BLOCKING
…
ARP requestARP reply
src MAC 01:02:03:04:05:0B
dest MAC
01:02:03:04:05:0A
src IP 10.0.0.2
dest IP 10.0.0.1
…
DEV MAC IP STATE
DEV-101:02:03:04:05:
0A10.0.0.
1FORWARDIN
G
DEV-301:02:03:04:05:
0B10.0.0.
2FORWARDIN
G
DEV-201:02:03:04:05:
0C10.0.0.
3DISABLED
…
DEV MAC IP STATE
DEV-101:02:03:04:05:
0A10.0.0.
1FORWARDIN
G
DEV-301:02:03:04:05:
0B10.0.0.
2FORWARDIN
G
DEV-201:02:03:04:05:
0C10.0.0.
3FORWARDIN
G
…
Host CIP 10.0.0.2MAC 01:02:03:04:05:0C
IP 10.0.0.3MAC 01:02:03:04:05:0B
src MAC 01:02:03:04:05:0C
dest MAC
01:02:03:04:05:0A
src IP 10.0.0.2
dest IP 10.0.0.1
…
TIMEOUT
DEV MAC IP STATE
DEV-101:02:03:04:05:
0A10.0.0.
1FORWARDIN
G
DEV-301:02:03:04:05:
0B10.0.0.
2WAITING
DEV-201:02:03:04:05:
0C10.0.0.
3BLOCKING
…
DEV MAC IP STATE
DEV-101:02:03:04:05:
0A10.0.0.
1FORWARDIN
G
DEV-3 --- --- LEARNING
DEV-201:02:03:04:05:
0C10.0.0.
2FORWARDIN
G
…
DEV MAC IP STATEDEV-1 --- --- LEARNING
DEV-3 --- --- LEARNING
DEV-2 --- --- LEARNING
…
Lo switch SAS Lo switch SAS aggiunge alla aggiunge alla CAM table CAM table tradizionale le tradizionale le informazioni del informazioni del layer 3layer 3
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 1414
SSecure ecure AActive ctive SSwitchwitchHOW IT WORKS – practical exampleHOW IT WORKS – practical example
Bridge SAS registered to SYSCTLSAS: port 3(eth0) entering learning
stateSAS: port 2(eth1) entering learning
stateSAS: port 1(eth1) entering learning
stateSAS: Secure Active Switch [started]SAS: logging [started]SAS: debugging [started]SAS: topology change detected,
propagatingSAS: port 3(eth0) entering forwarding
stateSAS: topology change detected,
propagatingSAS: port 2(eth1) entering forwarding
stateSAS: topology change detected,
propagatingSAS: port 1(eth2) entering forwarding
state
SWITCH SAS (kernel messages)
SAS: MAC 00:00:b4:5f:5a:fd [unknow] IP
192.168.1.3 [not exist]SAS: [eth1 | 00:00:b4:5f:5a:fd | 192.168.1.3] REGISTEREDSAS: MAC 00:50:da:71:61:a6 [unknow]
IP 192.168.1.1 [not exist]SAS: [eth0 | 00:50:da:71:61:a6 | 192.168.1.1] REGISTEREDSAS: MAC 00:0e:a6:7f:75:46 [unknow]
IP 192.168.1.2 [not exist]SAS: [eth2 | 00:0e:a6:7f:75:46 | 192.168.1.2] REGISTERED
$ ./poisoningUsage: ./poisoning srcip srcmac destip$ ./poisoning 192.168.1.2 00:00:b4:5f:5a:fd 192.168.1.142: 192.168.1.2[00:00:b4:5f:5a:fd] -> 192.168.1.142: 192.168.1.2[00:00:b4:5f:5a:fd] -> 192.168.1.142: 192.168.1.2[00:00:b4:5f:5a:fd] -> 192.168.1.142: 192.168.1.2[00:00:b4:5f:5a:fd] -> 192.168.1.1
SAS: ARP attack detected from [eth1]SAS: MAC 00:00:b4:5f:5a:fd [know] IP
192.168.1.2 [exist]SAS: port 2(eth1) entering blocking
stateSAS: port 1(eth2) entering waiting
stateSAS: ARP REQUEST sent to eth2SAS: packet from waiting port [eth2]SAS: port 2(eth1) entering disabled
stateSAS: port 1(eth2) entering forwarding
stateSAS: ARP POISONING on [eth1]SAS: [eth1] DISABLED for 1 secondsSAS: [eth1] DISABLED for 2 secondsSAS: [eth1] DISABLED for 3 seconds
ATTACCANTE
$ arp -a192.168.1.2 (192.168.1.2) at 00:0e:a6:7f:75:46 [ether] on eth0192.168.1.3 (192.168.1.3) at 00:00:b4:5f:5a:fd [ether] on eth0
HOST VITTIMA
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 1515
SSecure ecure AActive ctive SSwitchwitchEMBEDDED SYSTEM - FREESCALE EMBEDDED SYSTEM - FREESCALE M5485M5485
Attaccante
Host A Host B
2 Porte Ethernet10/100 integrate
Porta Ethernet 10/100 su BUS PCI
• Elevato grado di riconfigurabilità del sistema embedded• Possibilità di sviluppo con licenza GPL (a costo zero)
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 1616
SSecure ecure AActive ctive SSwitchwitchPERFORMANCE EVALUATIONSPERFORMANCE EVALUATIONS
non SASnon SAS Round TripRound Trip
massimo 0.532
minimo 0.413
media 0.468
deviazione 0.047 0.047
$ ping hostaPING hosta (192.168.1.1): 56 data bytes64 bytes from 192.168.1.1: icmp_seq=0 ttl=117 time=0.428 ms64 bytes from 192.168.1.1: icmp_seq=1 ttl=117 time=0.493 ms64 bytes from 192.168.1.1: icmp_seq=2 ttl=117 time=0.469 ms…--- ping statistics ---1000 packets transmitted, 1000 packets received, 0% packet lossround-trip min/avg/max = 0.417/0.473/0.539 ms
SASSAS Round TripRound Trip
massimo 0.539
minimo 0.417
media 0.473
deviazione 0.0490.049
Variazione percentuale
+1.06%
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 1717
ConclusioniConclusioni• Gli attacchi ARP attuabili in rete locale
dall’attaccante sono stati efficacemente bloccati
• Il carico di lavoro introdotto in condizioni normali di funzionamento della rete è stato del 1.06% (misurato con il round trip medio su un campione di 1000 ICMP)
• Il porting del bridge Linux con patch S.A.S. su architettura ColdFire è stato ottenuto con successo.
SAS © 2005 - Giuseppe GottardiSAS © 2005 - Giuseppe Gottardi 1818
Giuseppe Gottardi Giuseppe Gottardi
[email protected]@securitydate.ithttp://overet.securitydate.ithttp://overet.securitydate.it
S.P.I.N.E Research Group, Inc. S.P.I.N.E Research Group, Inc.
S.D.G. Security Date Group, Inc.S.D.G. Security Date Group, Inc.