SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Design and Implementation
    of an IPv6 Plugin for the
Snort Intrusion Detection System

           Martin Schütte




         22. September 2011
IPv6             IDS/Snort   Snort APIs                 IPv6 Plugin   Tests                 Fazit




 IPv6 als Sicherheitsproblem

 Intrusion Detection Systems and Snort

 Snort APIs

 Snort IPv6 Plugin

 Tests

 Fazit



         Martin Schütte             IPv6 Snort-Plugin                         22. 9. 2011   2 / 38
IPv6            IDS/Snort   Snort APIs                 IPv6 Plugin   Tests                 Fazit




                            Stand ∼ 1994


       • IPv4-Internet: Forschungs-
         und Uni-Netze
       • bekannte Design- &
         Implementierungs-Fehler
       • wenig Erfahrung mit
         Protokoll-Sicherheit
       • wenig Druck zur Verbesserung




        Martin Schütte             IPv6 Snort-Plugin                         22. 9. 2011   3 / 38
IPv6            IDS/Snort   Snort APIs                 IPv6 Plugin                   Tests                 Fazit




                            Stand ∼ 2011


       • IPv6-Internet: Forschungs-
         und Uni-Netze
       • bekannte Design- &
         Implementierungs-Fehler
       • wenig Erfahrung mit

                                                                     I WANT YOU
         Protokoll-Sicherheit
       • wenig Druck zur Verbesserung
                                                                     TO USE IPv6
                                                                                             – Vint Cerf
                                                       www.cs.brown.edu/~adf/cerf/




        Martin Schütte             IPv6 Snort-Plugin                                         22. 9. 2011   4 / 38
IPv6             IDS/Snort   Snort APIs                 IPv6 Plugin   Tests                 Fazit




                             IPv6 Probleme



       • RFCs von 1995/1998
  ⇒ 15 Jahre IPv4-Sicherheits-Erfahrung nachzuholen
   • viele Internet-Drafts (IPsec, SEND, . . . )
   • wenig Implementierungen
   • fast nichts in Endgeräten




         Martin Schütte             IPv6 Snort-Plugin                         22. 9. 2011   5 / 38
IPv6           IDS/Snort    Snort APIs                 IPv6 Plugin   Tests                 Fazit




                           Angriffe auf IPv6


Das übliche:                                IPv6-spezifisch:
  • Wertebereiche für Felder                  • variable Header
  • Fragmentierung                            • Autokonfiguration
  • Denial of Service                         • Multicast
  • Portscans                                 • Routing
  • Fehler in Anwendungsschicht               • v4/v6-Transition




       Martin Schütte              IPv6 Snort-Plugin                         22. 9. 2011   6 / 38
IPv6                IDS/Snort                 Snort APIs                  IPv6 Plugin            Tests                 Fazit




                                    IPv6 Header Format
 0      3 4           7 8       11 12        15 16                 23 24                 31
                                                                                              9
  Version        Traffic Class                               Flow Label                         >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
               Payload Length                        Next Header             Hop Limit
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                        Source Address                                        >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              > basic
                                                                                              >
                                                                                              =
                                                                                                header
                                                                                              > (40 octets)
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                  Destination Address
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              >
                                                                                              ;


            Martin Schütte                            IPv6 Snort-Plugin                                  22. 9. 2011   7 / 38
IPv6           IDS/Snort       Snort APIs                 IPv6 Plugin   Tests                 Fazit




                           IPv6 Extension Header




       Martin Schütte                 IPv6 Snort-Plugin                         22. 9. 2011   8 / 38
IPv6           IDS/Snort           Snort APIs                 IPv6 Plugin                Tests                 Fazit




        Destination/Hop-by-Hop Option Header

        0                  7 8                  15 16                       23 24                     31

            Next Header          Hdr Ext Len              Opt Type                    Opt Len

             Opt Value                                        ...




        0                  7 8                  15 16                       23 24                     31

        Next Header: 0x3a Hdr Ext Len: 0x00               Opt Type:                 Opt Data Len:
             ICMPv6            8 octets                 0x05 Rtr alert              0x02 2 octets
                     Opt Data:                            Opt Type:                 Opt Data Len:
                 0x00 0x00 MLD                           0x01 PadN                  0x00 0 octets




       Martin Schütte                     IPv6 Snort-Plugin                                      22. 9. 2011   9 / 38
IPv6           IDS/Snort   Snort APIs                 IPv6 Plugin   Tests              Fazit




       Autokonfiguration und Neighbor Discovery
 Design-Prämisse: sicheres und vertrauenswürdiges LAN

 einfacher Denial of Service:
   1. Host Alice startet Duplicate Address Detection
      „Benutzt jemand die IP X?“
   2. Host Eve antwortet „Ich benutze IP X.“
   3. goto 1

 Routing/Man in the Middle:
  1. Host Eve sendet ICMPv6 Redirect
     „Hier Router Bob, für google.com bitte Router Eve benutzen.“


       Martin Schütte             IPv6 Snort-Plugin                     22. 9. 2011   10 / 38
IPv6           IDS/Snort       Snort APIs                 IPv6 Plugin   Tests              Fazit




                           Routing und Transition

 Routing:
   • Umfangreiche Spezifikation
   • RH0 (source routing) deprecated
   • RH2 für MobileIPv6 nötig

 Transition:
   • Dual-Stack: zwei Paketfilter
   • Tunnelling: leichte Filter-Umgehung
   • Automatic Tunnel Routing Loops



       Martin Schütte                 IPv6 Snort-Plugin                     22. 9. 2011   11 / 38
IPv6           IDS/Snort   Snort APIs                 IPv6 Plugin   Tests              Fazit




                 Angriffs-Sammlung: THC Toolkit

 Tools/Angriffe/Tests für:
   • Autoconfiguration DoS
   • Neighbour Cache
   • Routing/Redirect
   • Flood-Attacks
   • Multicast Listener Discovery
   • DHCPv6
   • implementation6




       Martin Schütte             IPv6 Snort-Plugin                     22. 9. 2011   12 / 38
IPv6           IDS/Snort   Snort APIs                 IPv6 Plugin   Tests                                                                 Fazit




           (Network) Intrusion Detection System




                                                                                  Lazarević et al, Intrusion Detection: A Survey, 2005
       Martin Schütte             IPv6 Snort-Plugin                     22. 9. 2011                                                      13 / 38
IPv6           IDS/Snort    Snort APIs                 IPv6 Plugin   Tests              Fazit




                   Zielsystem: Snort 2.9.1


   • verbreitetes Open Source NIDS
   • Packet-Sniffer (IDS)
   • Filter-/inline-Modus
     (Intrusion Prevention System)
   • Plugin APIs
   • Dekoder für gängige
     Tunnelprotokolle




       Martin Schütte              IPv6 Snort-Plugin                     22. 9. 2011   14 / 38
IPv6           IDS/Snort   Snort APIs                 IPv6 Plugin   Tests              Fazit




                           IPv6 Support
                           im Prinzip Ja, aber . . .

 Alle relevanten IDS haben IPv6-Support.

 Aber was heißt das?
   • Fragment-Reassemblierung
   • TCP & UDP Dekodierung
   • Decoder-Warnung bei groben Protokollfehlern

 (Noch?) nicht:
   • neue Erweiterungen (Routing Header, Jumbograms)
   • alle Regeloptionen (fragbits)
   • IPv6-spezifischer Angriffe (ICMPv6/neighbor discovery)

       Martin Schütte             IPv6 Snort-Plugin                     22. 9. 2011   15 / 38
IPv6           IDS/Snort    Snort APIs                 IPv6 Plugin   Tests                  Fazit




                           IPv6 Signaturen
 Viele Protokollfelder und Regeln abwärtskompatibel.
 alert ip icmp any -> any any                                                          
     ( msg :" IPv6 ICMP Echo - Request ?"; itype :128;                                 
     classtype : icmp - event ; sid :2000001; rev :1;)

 alert icmp any any -> any any                            
     ( msg :" ICMP ID 0 xdead ( THC ?)"; icmp_id : 57005; 
     sid :124860; rev :1;)


 Keine Schlüsselwörter für neue IPv6-Felder.
 Kein Weg nur-IPv6 Regeln zu schreiben.

 ⇒ eigenes IPv6-Plugin

       Martin Schütte              IPv6 Snort-Plugin                     22. 9. 2011       16 / 38
IPv6              IDS/Snort    Snort APIs                 IPv6 Plugin   Tests              Fazit




                              Snort-Architektur




       • Dynamic Rule API
       • Dynamic Preprocessor API



          Martin Schütte              IPv6 Snort-Plugin                     22. 9. 2011   17 / 38
IPv6              IDS/Snort       Snort APIs                 IPv6 Plugin   Tests              Fazit




                              Snort Dynamic Rule API



       • genau eine Regel als dynamische Bibliothek (.so)
       • Funktionsaufruf mit Rückgabe match/no_match
  ⇒ nicht weiter betrachtet




          Martin Schütte                 IPv6 Snort-Plugin                     22. 9. 2011   18 / 38
IPv6              IDS/Snort   Snort APIs                 IPv6 Plugin   Tests              Fazit




                    Snort Dynamic Preprocessor API



       • dynamische Bibliothek (.so)
       • aus snort.conf geladen, aktiviert, konfiguriert
       • Präprozessor und/oder Regeloptionen




          Martin Schütte             IPv6 Snort-Plugin                     22. 9. 2011   19 / 38
IPv6           IDS/Snort   Snort APIs                 IPv6 Plugin   Tests              Fazit




              Snort Dynamic Preprocessor Plugin


 Funktionsweise:
   • Registriert Callback für Pakete von Typ
     IP/ICMP/UDP/TCP/. . .
   • Zugriff auf Snort-Teilsysteme
   • Kann Zustand halten
   • Kann Logs/Alarme erzeugen
   • Kann Regeloptionen implementieren




       Martin Schütte             IPv6 Snort-Plugin                     22. 9. 2011   20 / 38
IPv6              IDS/Snort     Snort APIs                 IPv6 Plugin   Tests              Fazit




                              IPv6 Präprozessor


 Funktionsweise:
   • Liest ICMPv6-Nachrichten
   • Verfolgt Netz-Zustand, d. h. (MAC, IP) von
            • Routern
            • Hosts
            • laufenden DADs
       • Alert bei neuen Hosts, Router-Änderungen u. ä.




          Martin Schütte               IPv6 Snort-Plugin                     22. 9. 2011   21 / 38
IPv6           IDS/Snort   Snort APIs                 IPv6 Plugin   Tests              Fazit




                           Konfiguration
                               in snort.conf



 preprocessor ipv6 :                                                            
     net_prefix 2001:0 db8 :1::/64                                              
     router_mac 00:16:76:07: bc :92                                             
     host_mac   ...                                                             
     max_unconfirmed 32768                                                      
     max_routers 8                                                              
     expire_run 20                                                              
     keep_state 180




       Martin Schütte             IPv6 Snort-Plugin                     22. 9. 2011   22 / 38
IPv6             IDS/Snort   Snort APIs                 IPv6 Plugin   Tests              Fazit




                              IPv6 Checks
   SID     Message
     1     RA from new router
     2     RA from non-router MAC address
     3     RA prefix changed
     4     RA flags changed
     5     RA for non-local net prefix
     6     RA with lifetime 0
     7     new DAD started
     8     new host in network
     9     new host with non-allowed MAC address
    10     DAD with collision
    11     DAD with spoofed collision
    12     mismatch in MAC and NDP source linkaddress option
    13     ipv6: extension header has only padding options (evasion?)
    14     ipv6: option lengths != ext length
         Martin Schütte             IPv6 Snort-Plugin                     22. 9. 2011   23 / 38
IPv6              IDS/Snort     Snort APIs                 IPv6 Plugin   Tests              Fazit




                              IPv6 Regeloptionen

 Ziel:
       • IPv6-Felder für Signaturen zugänglich machen
       • Basis-Header, Erweiterungs-Header, Neighbor
         Discovery-Optionen

 Funktionsweise:
   • Callbacks für Options-Schlüsselwörter
   • Aufruf mit Parametern und Paket
   • Rückgabe match/no_match




          Martin Schütte               IPv6 Snort-Plugin                     22. 9. 2011   24 / 38
IPv6           IDS/Snort     Snort APIs                 IPv6 Plugin   Tests              Fazit




                           IPv6 Regeloptionen


 alert icmp any any          ->   any any ( itype :8;   ipv : 4; 
   msg :" ICMPv4 PING        in   v4 pkt "; sid :100000; rev :1;)
 alert icmp any any          ->   any any ( itype :8;   ipv : 6; 
   msg :" ICMPv4 PING        in   v6 pkt "; sid :100001; rev :1;)

 alert icmp any any          ->   any any ( itype :128; ipv : 4; 
   msg :" ICMPv6 PING        in   v4 pkt "; sid :100002; rev :1;)
 alert icmp any any          ->   any any ( itype :128; ipv : 6; 
   msg :" ICMPv6 PING        in   v6 pkt "; sid :100003; rev :1;)




       Martin Schütte               IPv6 Snort-Plugin                     22. 9. 2011   25 / 38
IPv6           IDS/Snort     Snort APIs                 IPv6 Plugin   Tests              Fazit




                           IPv6 Regeloptionen


 alert ip any any -> any any ( ip6_rh : !2;                                                 
   msg :" invalid routing hdr "; sid :1000004; rev :1;)

 event_filter gen_id 1 , sig_id 1000004 , type limit ,                                      
   track by_dst , count 1 , seconds 60

 alert icmp any any -> any any ( ipv : 6; itype : 134;    
   detection_filter : track by_dst , count 5 , seconds 1; 
   msg :" ICMPv6 / RA flooding "; sid :124850; rev :1;)




       Martin Schütte               IPv6 Snort-Plugin                     22. 9. 2011   26 / 38
IPv6           IDS/Snort           Snort APIs           IPv6 Plugin          Tests                                                       Fazit
                                                                                     3.7 Die Output-

                     Snort Detection Engine (alt)

                                                                                                                                Abbildung
                                                                                                                                Dreidimens
                                                                                                                                verlinkte Li




                                                                                            Bechtold/Heinlein, Snort, Acid & Co, 2004
 Sind alle Signaturen durchgearbeitet, und das Paket passt zu keiner von ihnen, wird
         Martin Schütte                 IPv6 Snort-Plugin                     22. 9. 2011                                               27 / 38
IPv6              IDS/Snort                Snort APIs                 IPv6 Plugin                Tests                Fazit




                 Snort Detection Engine (optimiert)

                         Port Group                                                          Port Group
                       ICMP any->any                                                       ICMP any->any


                             NC Rule                                                          NC Rule
                            Tree Root                                  ⇒                     Tree Root


itype:8           itype:8         itype:128             itype:128              itype:8                   itype:128


  ipv:4             ipv:6           ipv:4                 ipv:6                 ipv:4                      ipv:6


   leaf              leaf               leaf               leaf                     leaf                    leaf




          Martin Schütte                          IPv6 Snort-Plugin                                  22. 9. 2011     28 / 38
IPv6           IDS/Snort     Snort APIs                 IPv6 Plugin   Tests              Fazit




                   Regeloptionen des IPv6-Plugins

               ipv         IP version
        ip6_tclass         Traffic Class
          ip6_flow         Flow Label
        ip6_exthdr         Extension Header
        ip6_extnum         Num. of Ext Hdrs.
        ip6_option         Destination-/HbH-Option
        ip6_optval         Destination-/HbH-Option Value
            ip6_rh         Routing Header
          icmp6_nd         Neighbor Discovery (bool)
   icmp6_nd_option         Neighbor Discovery Option



       Martin Schütte               IPv6 Snort-Plugin                     22. 9. 2011   29 / 38
IPv6              IDS/Snort    Snort APIs                 IPv6 Plugin   Tests              Fazit




                              Funktionaler Test


 Snort-Funktionen gut zu testen:
   • Eingabe:
            • PCAP-Datei (anstatt Netzwerk-Input)
            • snort.conf
       • Ausgabe:
           • Log-Ereignisse und Alarme




          Martin Schütte              IPv6 Snort-Plugin                     22. 9. 2011   30 / 38
IPv6             IDS/Snort        Snort APIs                 IPv6 Plugin   Tests              Fazit




                                    tester.pl


       PCAP data
                              Test Runner
                                                                logfile
                             (snort -c -r)
       snort.conf
          lines



       Specification                                          Comparator            Result




         Martin Schütte                  IPv6 Snort-Plugin                     22. 9. 2011   31 / 38
IPv6              IDS/Snort   Snort APIs                 IPv6 Plugin   Tests              Fazit




                              Beispiel-Tests

 -
       test :    sendpees6
       pcap :    sendpees6_1sec . pcap
       conf :    simple . conf
       spec :    "[1:124806:1] ,[1:124851:1] ,[248:12:1]"
 -
 # ping with empty hbh ext ( i . e . only padding )
   test : ping_padding
   pcap : ping_hbh_pad . pcap
   conf : simple . conf
   spec : "[116:432:1] ,[248:13:1]"




          Martin Schütte             IPv6 Snort-Plugin                     22. 9. 2011   32 / 38
IPv6              IDS/Snort   Snort APIs                 IPv6 Plugin   Tests              Fazit




                               Performance


       • Zustandslose Checks sind schnell:
         Plugin liest struct SFSnortPacket
       • Zustand verfolgen kostet Zeit und Speicher:
         ⇒ DoS-Gefahr, daher Limits
 ⇒ ähnlich wie andere Plugins (SSL, SMTP, . . . )
 ⇒ Snort-Dekoder ist Bottleneck




          Martin Schütte             IPv6 Snort-Plugin                     22. 9. 2011   33 / 38
IPv6           IDS/Snort    Snort APIs                 IPv6 Plugin   Tests              Fazit




                           Snort-Funktionen



 IPv6-fertige Snort-Komponenten
   • Portscans (sfportscan) & Fragmentierung (frag3)
   • Paketfilter (Inline-Modus, je nach DAQ)
   • Logging (unified2)
   • nach und nach mehr Dekoder-Checks




       Martin Schütte              IPv6 Snort-Plugin                     22. 9. 2011   34 / 38
IPv6              IDS/Snort      Snort APIs                 IPv6 Plugin   Tests              Fazit




                              Praktische Probleme



       • kein Snort-SQL-Schema für IPv6-Events
         ⇒ keine IPv6-Events in barnyard2-DB-Output,
         BASE, Snorby, u. ä.
       • Präprozessor-/Dekoder-Alarme nicht eindeutig




          Martin Schütte                IPv6 Snort-Plugin                     22. 9. 2011   35 / 38
IPv6             IDS/Snort      Snort APIs                 IPv6 Plugin   Tests              Fazit




                             Praktische Probleme


 Idee:
 alert ip      any any -> any any ( ipv : 6;         
   ip6_exthdr : 44; fragbits : ! M ; fragoffset : 0; 
   msg :" IPv6 : redundant fragment hdr ( THC ?)";   
   sid :124860; rev :1;)

 aber mit Decoder Alerts:
     123:8:1 frag3: Fragmentation overlap
    123:10:1 frag3: Bogus fragmentation packet. Possible BSD attack




         Martin Schütte                IPv6 Snort-Plugin                     22. 9. 2011   36 / 38
IPv6           IDS/Snort      Snort APIs                 IPv6 Plugin   Tests              Fazit




                           Grenze der Erkennung



 Grundlegende Einschränkung: Layer 2/Ethernet

 ⇒ keine sichere Host-ID
 ⇒ kein Filter

 Unsicherer Layer 2 nicht auf Layer 3 zu sichern.




       Martin Schütte                IPv6 Snort-Plugin                     22. 9. 2011   37 / 38
IPv6              IDS/Snort    Snort APIs                 IPv6 Plugin   Tests              Fazit




                                            Fazit



       • Plugin funktioniert
       • Als dynamische Bibliothek installierbar
       • Grundlage für neue Signaturen
       • Snort & Plugin erkennen THC-Angriffe
  ⇒ jetzt Praxistest in realen Netzen




          Martin Schütte              IPv6 Snort-Plugin                     22. 9. 2011   38 / 38

Weitere ähnliche Inhalte

Empfohlen

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Empfohlen (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection System

  • 1. Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection System Martin Schütte 22. September 2011
  • 2. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit IPv6 als Sicherheitsproblem Intrusion Detection Systems and Snort Snort APIs Snort IPv6 Plugin Tests Fazit Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 2 / 38
  • 3. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Stand ∼ 1994 • IPv4-Internet: Forschungs- und Uni-Netze • bekannte Design- & Implementierungs-Fehler • wenig Erfahrung mit Protokoll-Sicherheit • wenig Druck zur Verbesserung Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 3 / 38
  • 4. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Stand ∼ 2011 • IPv6-Internet: Forschungs- und Uni-Netze • bekannte Design- & Implementierungs-Fehler • wenig Erfahrung mit I WANT YOU Protokoll-Sicherheit • wenig Druck zur Verbesserung TO USE IPv6 – Vint Cerf www.cs.brown.edu/~adf/cerf/ Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 4 / 38
  • 5. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit IPv6 Probleme • RFCs von 1995/1998 ⇒ 15 Jahre IPv4-Sicherheits-Erfahrung nachzuholen • viele Internet-Drafts (IPsec, SEND, . . . ) • wenig Implementierungen • fast nichts in Endgeräten Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 5 / 38
  • 6. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Angriffe auf IPv6 Das übliche: IPv6-spezifisch: • Wertebereiche für Felder • variable Header • Fragmentierung • Autokonfiguration • Denial of Service • Multicast • Portscans • Routing • Fehler in Anwendungsschicht • v4/v6-Transition Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 6 / 38
  • 7. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit IPv6 Header Format 0 3 4 7 8 11 12 15 16 23 24 31 9 Version Traffic Class Flow Label > > > > > > > > Payload Length Next Header Hop Limit > > > > > > > > > > > > > > > > > > > > > > > Source Address > > > > > basic > = header > (40 octets) > > > > > > > > > > > > > > > > > > > > > > Destination Address > > > > > > > > > > > > > > ; Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 7 / 38
  • 8. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit IPv6 Extension Header Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 8 / 38
  • 9. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Destination/Hop-by-Hop Option Header 0 7 8 15 16 23 24 31 Next Header Hdr Ext Len Opt Type Opt Len Opt Value ... 0 7 8 15 16 23 24 31 Next Header: 0x3a Hdr Ext Len: 0x00 Opt Type: Opt Data Len: ICMPv6 8 octets 0x05 Rtr alert 0x02 2 octets Opt Data: Opt Type: Opt Data Len: 0x00 0x00 MLD 0x01 PadN 0x00 0 octets Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 9 / 38
  • 10. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Autokonfiguration und Neighbor Discovery Design-Prämisse: sicheres und vertrauenswürdiges LAN einfacher Denial of Service: 1. Host Alice startet Duplicate Address Detection „Benutzt jemand die IP X?“ 2. Host Eve antwortet „Ich benutze IP X.“ 3. goto 1 Routing/Man in the Middle: 1. Host Eve sendet ICMPv6 Redirect „Hier Router Bob, für google.com bitte Router Eve benutzen.“ Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 10 / 38
  • 11. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Routing und Transition Routing: • Umfangreiche Spezifikation • RH0 (source routing) deprecated • RH2 für MobileIPv6 nötig Transition: • Dual-Stack: zwei Paketfilter • Tunnelling: leichte Filter-Umgehung • Automatic Tunnel Routing Loops Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 11 / 38
  • 12. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Angriffs-Sammlung: THC Toolkit Tools/Angriffe/Tests für: • Autoconfiguration DoS • Neighbour Cache • Routing/Redirect • Flood-Attacks • Multicast Listener Discovery • DHCPv6 • implementation6 Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 12 / 38
  • 13. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit (Network) Intrusion Detection System Lazarević et al, Intrusion Detection: A Survey, 2005 Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 13 / 38
  • 14. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Zielsystem: Snort 2.9.1 • verbreitetes Open Source NIDS • Packet-Sniffer (IDS) • Filter-/inline-Modus (Intrusion Prevention System) • Plugin APIs • Dekoder für gängige Tunnelprotokolle Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 14 / 38
  • 15. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit IPv6 Support im Prinzip Ja, aber . . . Alle relevanten IDS haben IPv6-Support. Aber was heißt das? • Fragment-Reassemblierung • TCP & UDP Dekodierung • Decoder-Warnung bei groben Protokollfehlern (Noch?) nicht: • neue Erweiterungen (Routing Header, Jumbograms) • alle Regeloptionen (fragbits) • IPv6-spezifischer Angriffe (ICMPv6/neighbor discovery) Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 15 / 38
  • 16. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit IPv6 Signaturen Viele Protokollfelder und Regeln abwärtskompatibel. alert ip icmp any -> any any ( msg :" IPv6 ICMP Echo - Request ?"; itype :128; classtype : icmp - event ; sid :2000001; rev :1;) alert icmp any any -> any any ( msg :" ICMP ID 0 xdead ( THC ?)"; icmp_id : 57005; sid :124860; rev :1;) Keine Schlüsselwörter für neue IPv6-Felder. Kein Weg nur-IPv6 Regeln zu schreiben. ⇒ eigenes IPv6-Plugin Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 16 / 38
  • 17. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Snort-Architektur • Dynamic Rule API • Dynamic Preprocessor API Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 17 / 38
  • 18. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Snort Dynamic Rule API • genau eine Regel als dynamische Bibliothek (.so) • Funktionsaufruf mit Rückgabe match/no_match ⇒ nicht weiter betrachtet Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 18 / 38
  • 19. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Snort Dynamic Preprocessor API • dynamische Bibliothek (.so) • aus snort.conf geladen, aktiviert, konfiguriert • Präprozessor und/oder Regeloptionen Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 19 / 38
  • 20. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Snort Dynamic Preprocessor Plugin Funktionsweise: • Registriert Callback für Pakete von Typ IP/ICMP/UDP/TCP/. . . • Zugriff auf Snort-Teilsysteme • Kann Zustand halten • Kann Logs/Alarme erzeugen • Kann Regeloptionen implementieren Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 20 / 38
  • 21. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit IPv6 Präprozessor Funktionsweise: • Liest ICMPv6-Nachrichten • Verfolgt Netz-Zustand, d. h. (MAC, IP) von • Routern • Hosts • laufenden DADs • Alert bei neuen Hosts, Router-Änderungen u. ä. Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 21 / 38
  • 22. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Konfiguration in snort.conf preprocessor ipv6 : net_prefix 2001:0 db8 :1::/64 router_mac 00:16:76:07: bc :92 host_mac ... max_unconfirmed 32768 max_routers 8 expire_run 20 keep_state 180 Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 22 / 38
  • 23. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit IPv6 Checks SID Message 1 RA from new router 2 RA from non-router MAC address 3 RA prefix changed 4 RA flags changed 5 RA for non-local net prefix 6 RA with lifetime 0 7 new DAD started 8 new host in network 9 new host with non-allowed MAC address 10 DAD with collision 11 DAD with spoofed collision 12 mismatch in MAC and NDP source linkaddress option 13 ipv6: extension header has only padding options (evasion?) 14 ipv6: option lengths != ext length Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 23 / 38
  • 24. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit IPv6 Regeloptionen Ziel: • IPv6-Felder für Signaturen zugänglich machen • Basis-Header, Erweiterungs-Header, Neighbor Discovery-Optionen Funktionsweise: • Callbacks für Options-Schlüsselwörter • Aufruf mit Parametern und Paket • Rückgabe match/no_match Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 24 / 38
  • 25. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit IPv6 Regeloptionen alert icmp any any -> any any ( itype :8; ipv : 4; msg :" ICMPv4 PING in v4 pkt "; sid :100000; rev :1;) alert icmp any any -> any any ( itype :8; ipv : 6; msg :" ICMPv4 PING in v6 pkt "; sid :100001; rev :1;) alert icmp any any -> any any ( itype :128; ipv : 4; msg :" ICMPv6 PING in v4 pkt "; sid :100002; rev :1;) alert icmp any any -> any any ( itype :128; ipv : 6; msg :" ICMPv6 PING in v6 pkt "; sid :100003; rev :1;) Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 25 / 38
  • 26. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit IPv6 Regeloptionen alert ip any any -> any any ( ip6_rh : !2; msg :" invalid routing hdr "; sid :1000004; rev :1;) event_filter gen_id 1 , sig_id 1000004 , type limit , track by_dst , count 1 , seconds 60 alert icmp any any -> any any ( ipv : 6; itype : 134; detection_filter : track by_dst , count 5 , seconds 1; msg :" ICMPv6 / RA flooding "; sid :124850; rev :1;) Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 26 / 38
  • 27. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit 3.7 Die Output- Snort Detection Engine (alt) Abbildung Dreidimens verlinkte Li Bechtold/Heinlein, Snort, Acid & Co, 2004 Sind alle Signaturen durchgearbeitet, und das Paket passt zu keiner von ihnen, wird Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 27 / 38
  • 28. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Snort Detection Engine (optimiert) Port Group Port Group ICMP any->any ICMP any->any NC Rule NC Rule Tree Root ⇒ Tree Root itype:8 itype:8 itype:128 itype:128 itype:8 itype:128 ipv:4 ipv:6 ipv:4 ipv:6 ipv:4 ipv:6 leaf leaf leaf leaf leaf leaf Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 28 / 38
  • 29. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Regeloptionen des IPv6-Plugins ipv IP version ip6_tclass Traffic Class ip6_flow Flow Label ip6_exthdr Extension Header ip6_extnum Num. of Ext Hdrs. ip6_option Destination-/HbH-Option ip6_optval Destination-/HbH-Option Value ip6_rh Routing Header icmp6_nd Neighbor Discovery (bool) icmp6_nd_option Neighbor Discovery Option Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 29 / 38
  • 30. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Funktionaler Test Snort-Funktionen gut zu testen: • Eingabe: • PCAP-Datei (anstatt Netzwerk-Input) • snort.conf • Ausgabe: • Log-Ereignisse und Alarme Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 30 / 38
  • 31. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit tester.pl PCAP data Test Runner logfile (snort -c -r) snort.conf lines Specification Comparator Result Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 31 / 38
  • 32. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Beispiel-Tests - test : sendpees6 pcap : sendpees6_1sec . pcap conf : simple . conf spec : "[1:124806:1] ,[1:124851:1] ,[248:12:1]" - # ping with empty hbh ext ( i . e . only padding ) test : ping_padding pcap : ping_hbh_pad . pcap conf : simple . conf spec : "[116:432:1] ,[248:13:1]" Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 32 / 38
  • 33. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Performance • Zustandslose Checks sind schnell: Plugin liest struct SFSnortPacket • Zustand verfolgen kostet Zeit und Speicher: ⇒ DoS-Gefahr, daher Limits ⇒ ähnlich wie andere Plugins (SSL, SMTP, . . . ) ⇒ Snort-Dekoder ist Bottleneck Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 33 / 38
  • 34. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Snort-Funktionen IPv6-fertige Snort-Komponenten • Portscans (sfportscan) & Fragmentierung (frag3) • Paketfilter (Inline-Modus, je nach DAQ) • Logging (unified2) • nach und nach mehr Dekoder-Checks Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 34 / 38
  • 35. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Praktische Probleme • kein Snort-SQL-Schema für IPv6-Events ⇒ keine IPv6-Events in barnyard2-DB-Output, BASE, Snorby, u. ä. • Präprozessor-/Dekoder-Alarme nicht eindeutig Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 35 / 38
  • 36. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Praktische Probleme Idee: alert ip any any -> any any ( ipv : 6; ip6_exthdr : 44; fragbits : ! M ; fragoffset : 0; msg :" IPv6 : redundant fragment hdr ( THC ?)"; sid :124860; rev :1;) aber mit Decoder Alerts: 123:8:1 frag3: Fragmentation overlap 123:10:1 frag3: Bogus fragmentation packet. Possible BSD attack Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 36 / 38
  • 37. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Grenze der Erkennung Grundlegende Einschränkung: Layer 2/Ethernet ⇒ keine sichere Host-ID ⇒ kein Filter Unsicherer Layer 2 nicht auf Layer 3 zu sichern. Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 37 / 38
  • 38. IPv6 IDS/Snort Snort APIs IPv6 Plugin Tests Fazit Fazit • Plugin funktioniert • Als dynamische Bibliothek installierbar • Grundlage für neue Signaturen • Snort & Plugin erkennen THC-Angriffe ⇒ jetzt Praxistest in realen Netzen Martin Schütte IPv6 Snort-Plugin 22. 9. 2011 38 / 38