Università Politecnica delle Marche Dipartimento di Elettronica Intelligenza artificiale e Telecomunicazioni D.E.I.T. Secure Active Switch (SAS): hardening del Linux kernel bridge implementato su sistema embedded ColdFire Motorola Giuseppe Gottardi Relatore: Prof. Massimo Conti Correlatore: Dott. Ing. Valerio Frascolla SAS © 2005 - Giuseppe Gottardi 1 Secure Active Switch 1. 2. 3. Cos’è il SAS Perché usarlo Come funziona SAS © 2005 - Giuseppe Gottardi 2 Secure Active Switch Cos’è il SAS? SAS © 2005 - Giuseppe Gottardi 3 SAS: IT security tool Tool di prevenzione verso gli attacchi informatici in rete locale basato su un algoritmo di nuova concezione sviluppato dall’autore della tesi in collaborazione con il DEIT. Hardening del kernel Linux v2.6 – Modifica al kernel di Linux nel modulo “bridge” Switch di rete Attivo e Sicuro – Attivo: capace di mandare pacchetti di controllo – Sicuro: capace di bloccare attacchi di tipo ARP Sistema embedded su MCF5485EVB – Board Freescale con µproc ColdFire Motorola (MIPS 32-bit) SAS © 2005 - Giuseppe Gottardi 4 Secure Active Switch Perché usarlo? SAS © 2005 - Giuseppe Gottardi 5 Attacchi in Local Area Network STATS – CSI/FBI Fonte: Computer Security Institute Abusi della rete Federal dall’interno Bureau of (60% sulla Investigation totalità degli attacchi nel 2004) Perdite per oltre 11.000.000 $ SAS © 2005 - Giuseppe Gottardi 6 Attacchi in Local Area Network TYPOLOGIES LAN non commutata (HUB) - 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: - ARP poisoning - DNS spoofing - Port stealing - STP mangling DA LOCALE A REMOTO (attraverso il gateway): - ARP poisoning - DNS spoofing - DHCP spoofing - ICMP redirection - IRDP spoofing - route mangling SAS © 2005 - Giuseppe Gottardi 7 Attacchi “Man In The Middle” HTTPS (SSL) 1111 18 2222 08 3333 19 4444 09 Giuseppe Gottardi [email protected] SAS © 2005 - Giuseppe Gottardi 8 Attacchi “Man In The Middle” KEY EXCHANGING - HTTPS Consiste nella modifica del certificato SSL scambiato tra un server web HTTPS e un client (vale anche per SSH v1). Questa tecnica consente di decodificare sessioni codificate. start Server KEY-ARSA S-KEY M MITM Ekey-A(S-Key) Eskey(M) S-KEY Client KEY-BRSA Ekey-B(S-Key) S-KEY D(E(M)) D(E(M)) SAS © 2005 - Giuseppe Gottardi 9 Attacchi “Man In The Middle” FILTERING - HTTPS redirection Una form in HTTPS viene forzata all'autenticazione in HTTP Change form destination to http://mitm Http post (login\password) Client Http main page with https login form MITM Auto-submitting hidden form with right authentication data login password Server Real https authentication post Authenticated connection SAS © 2005 - Giuseppe Gottardi 10 Secure Active Switch Come funziona? SAS © 2005 - Giuseppe Gottardi 11 ARP poisoning SIMULATION Switch DEV-1 DEV-2 DEV-3 Host A Host B ARP Packet poisoning from B IP 10.0.0.2 MAC 01:02:03:04:05:0B IP 10.0.0.1 MAC 01:02:03:04:05:0A Attaccante CAMcache table A ARP IP 10.0.0.3 MAC 01:02:03:04:05:0C DEV MAC DEV-1 01:02:03:04:05:0A IP Packet ARP poisoning from A STATE MAC FORWARDING ARP cache B IP MAC DEV-3 01:02:03:04:05:0C FORWARDING 10.0.0.2 01:02:03:04:05:0B 01:02:03:04:05:0C 10.0.0.1 01:02:03:04:05:0A 01:02:03:04:05:0C DEV-2 01:02:03:04:05:0B FORWARDING 10.0.0.3 01:02:03:04:05:0C 10.0.0.3 01:02:03:04:05:0C … SAS © 2005 - Giuseppe Gottardi 12 Secure Active Switch HOW IT WORKS - simulation Packet header Lo switch SAS src MAC 01:02:03:04:05:0A 01:02:03:04:05:0B 01:02:03:04:05:0C aggiunge alla CAM dest MAC 01:02:03:04:05:0A 01:02:03:04:05:0C 01:02:03:04:05:0B src IP 10.0.0.1 10.0.0.3 10.0.0.2 table tradizionale le dest IP 10.0.0.3 del 10.0.0.2 10.0.0.1 informazioni ? … layer 3 mismatch CAM table SAS DEV MAC IP STATE DEV-1 01:02:03:04:05:0A --- 10.0.0.1 --- FORWARDING LEARNING DEV-3 01:02:03:04:05:0B --- 10.0.0.2 --- FORWARDING WAITING LEARNING WAITING DEV-2 01:02:03:04:05:0C --- 10.0.0.3 10.0.0.2 --- FORWARDING BLOCKING DISABLED LEARNING BLOCKING … Switch SAS DEV-1 Host A IP 10.0.0.1 MAC 01:02:03:04:05:0A DEV-2 DEV-3 ARP poisoning Host C Attaccante Host B ARP reply request TIMEOUT IP 10.0.0.2 10.0.0.3 MAC 01:02:03:04:05:0B IP 10.0.0.3 10.0.0.2 MAC 01:02:03:04:05:0C SAS © 2005 - Giuseppe Gottardi 13 Secure Active Switch HOW IT WORKS – practical example SWITCH SAS (kernel messages) Bridge SAS: MAC ARP SAS attack 00:00:b4:5f:5a:fd registered detected to SYSCTL from [unknow] [eth1] IP SAS:192.168.1.3 port 3(eth0) MAC 00:00:b4:5f:5a:fd [not entering exist]learning [know] state IP [exist] SAS:192.168.1.2 port 2(eth1) [eth1 | 00:00:b4:5f:5a:fd entering learning | state SAS: port entering state SAS:192.168.1.3] port 2(eth1) 1(eth1)REGISTERED entering blocking learning state SAS: 1(eth2) waiting stateIP SAS: port Secure MAC 00:50:da:71:61:a6 Activeentering Switch [started] [unknow] SAS: ARP REQUEST to eth2 SAS:192.168.1.1 logging [started] [notsent exist] SAS: waiting port [eth2] SAS: packet debugging [eth0 |from 00:50:da:71:61:a6 [started] | SAS: port 2(eth1) entering disabled state SAS:192.168.1.1] topology change REGISTERED detected, propagating SAS: entering SAS: port port 1(eth2) MAC 3(eth0) 00:0e:a6:7f:75:46 entering forwarding forwarding [unknow] state state IP SAS: ARP POISONING on [eth1] propagating SAS:192.168.1.2 topology change [not exist] detected, SAS: for 1forwarding seconds SAS: [eth1] port 2(eth1) [eth2 |DISABLED 00:0e:a6:7f:75:46 entering | state SAS: [eth1] DISABLED for 2 seconds SAS:192.168.1.2] topology change REGISTERED detected, propagating SAS: DISABLED for 3forwarding seconds state SAS: [eth1] port 1(eth2) entering ATTACCANTE $ ./poisoning Usage: ./poisoning srcip srcmac destip $ ./poisoning 192.168.1.2 00:00:b4:5f:5a:fd 192.168.1.1 42: 192.168.1.2[00:00:b4:5f:5a:fd] -> 192.168.1.1 42: 192.168.1.2[00:00:b4:5f:5a:fd] -> 192.168.1.1 42: 192.168.1.2[00:00:b4:5f:5a:fd] -> 192.168.1.1 42: 192.168.1.2[00:00:b4:5f:5a:fd] -> 192.168.1.1 HOST VITTIMA $ arp -a 192.168.1.2 (192.168.1.2) at 00:0e:a6:7f:75:46 [ether] on eth0 192.168.1.3 (192.168.1.3) at 00:00:b4:5f:5a:fd [ether] on eth0 SAS © 2005 - Giuseppe Gottardi 14 Secure Active Switch EMBEDDED SYSTEM - FREESCALE M5485 • Elevato grado di riconfigurabilità del sistema embedded • Possibilità di sviluppo con licenza GPL (a costo zero) Porta Ethernet 10/100 su BUS PCI 2 Porte Ethernet 10/100 integrate Host B Host A Attaccante SAS © 2005 - Giuseppe Gottardi 15 Secure Active Switch PERFORMANCE EVALUATIONS $ ping hosta PING hosta (192.168.1.1): 56 data bytes 64 bytes from 192.168.1.1: icmp_seq=0 ttl=117 time=0.428 ms 64 bytes from 192.168.1.1: icmp_seq=1 ttl=117 time=0.493 ms 64 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 loss round-trip min/avg/max = 0.417/0.473/0.539 ms non SAS Round Trip SAS Round Trip massimo 0.532 massimo 0.539 minimo 0.413 minimo 0.417 media 0.468 media 0.473 deviazione 0.047 deviazione 0.049 SAS © 2005 - Giuseppe Gottardi Variazione percentuale +1.06% 16 Conclusioni • 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 Gottardi 17 Giuseppe Gottardi [email protected] http://overet.securitydate.it S.P.I.N.E Research Group, Inc. S.D.G. Security Date Group, Inc. SAS © 2005 - Giuseppe Gottardi 18