spicy a unified deep packet inspection framework
play

Spicy: A Unified Deep Packet Inspection Framework Dissecting All - PowerPoint PPT Presentation

Spicy: A Unified Deep Packet Inspection Framework Dissecting All Your Data Robin Sommer International Computer Science Institute, & Corelight, Inc. robin@icsi.berkeley.edu robin@corelight.io http://www.icir.org/robin Deep Packet


  1. Spicy: A Unified Deep Packet Inspection Framework Dissecting All Your Data Robin Sommer International Computer Science Institute, & Corelight, Inc. robin@icsi.berkeley.edu robin@corelight.io http://www.icir.org/robin

  2. Deep Packet Inspection Tap Local Internet Network IDS 2

  3. Deep Packet Inspection Tap Local Internet Network IDS Example: Finding downloads of known malware. 1. Find and parse all Web traffic. 2. Find and extract binaries. 3. Compute hash and compare with database. 4. Report, and potentially kill, if found. 2

  4. Deep Packet Inspection Tap Local Internet Network IDS Example: Finding downloads of known malware. 1. Find and parse all Web traffic. 2. Find and extract binaries. 3. Compute hash and compare with database. 4. Report, and potentially kill, if found. 2

  5. Protocol Parsing Web Web Request for /x/y/foo.zip Client Server Status OK plus data 5.6.7.8/80 1.2.3.4/4321 3

  6. Protocol Parsing Web Web Request for /x/y/foo.zip Client Server Status OK plus data 5.6.7.8/80 1.2.3.4/4321 ACK ... ... SYN SYN ACK ACK ACK FIN FIN TCP connection established 3

  7. Protocol Parsing Web Web Request for /x/y/foo.zip Client Server Status OK plus data 5.6.7.8/80 1.2.3.4/4321 ACK ... ... SYN SYN ACK ACK ACK FIN FIN TCP connection established TCP stream reassembly for originator GET /x/y/foo.zip HTTP/1.1 … Request for /x/y/foo.zip, protocol version 1.1, HTTP headers 3

  8. Protocol Parsing Web Web Request for /x/y/foo.zip Client Server Status OK plus data 5.6.7.8/80 1.2.3.4/4321 ACK ... ... SYN SYN ACK ACK ACK FIN FIN TCP connection established TCP stream reassembly for originator GET /x/y/foo.zip HTTP/1.1 … Request for /x/y/foo.zip, protocol version 1.1, HTTP headers TCP stream reassembly for responder 200 OK … Reply with page content for further analysis (e.g., hash; unpack & parse files) 3

  9. Protocol Parsing Web Web Request for /x/y/foo.zip Client Server Status OK plus data 5.6.7.8/80 1.2.3.4/4321 ACK ... ... SYN SYN ACK ACK ACK FIN FIN TCP connection established TCP stream reassembly for originator GET /x/y/foo.zip HTTP/1.1 … Request for /x/y/foo.zip, protocol version 1.1, HTTP headers TCP stream reassembly for responder 200 OK … Reply with page content for further analysis (e.g., hash; unpack & parse files) TCP connection tear down 3

  10. Parsing Is Hard ... ... SYN SYN ACK ACK ACK ACK FIN FIN 4

  11. Parsing Is Hard ... ... SYN SYN ACK ACK ACK ACK FIN FIN Must be robust Lots of “crud” in real-world networks Cannot trust input 4

  12. Parsing Is Hard ... ... SYN SYN ACK ACK ACK ACK FIN FIN Must be robust Lots of “crud” in real-world networks Cannot trust input Must be efficient 100,000s of concurrent connections Incremental processing for low latency & memory usage 4

  13. Parsing Is Hard ... ... SYN SYN ACK ACK ACK ACK FIN FIN Must be robust Lots of “crud” in real-world networks Cannot trust input Must be efficient 100,000s of concurrent connections Incremental processing for low latency & memory usage Must be complete Leaving out parts of the protocol opens evasion opportunities Protocols can be really complex (SMB …) 4

  14. There are a lot of protocols out there … Even a simple case involves 5 protocols HTTP TCP IP Ethernet PCAP 5

  15. There are a lot of protocols out there … Even a simple case involves 5 protocols HTTP TCP A few popular protocols account for the bulk of traffic in most environments 
 IP (e.g., TCP/IP , HTTP , TLS, DNS, SMTP , IMAP) Ethernet PCAP 5

  16. There are a lot of protocols out there … Even a simple case involves 5 protocols HTTP TCP A few popular protocols account for the bulk of traffic in most environments 
 IP (e.g., TCP/IP , HTTP , TLS, DNS, SMTP , IMAP) Ethernet Long tail of further protocols, often PCAP environment-specific 
 (e.g., SMB, Modbus, BACnet, more L2) 5

  17. There are a lot of protocols out there … Even a simple case involves 5 protocols HTTP TCP A few popular protocols account for the bulk of traffic in most environments 
 IP (e.g., TCP/IP , HTTP , TLS, DNS, SMTP , IMAP) Ethernet Long tail of further protocols, often PCAP environment-specific 
 (e.g., SMB, Modbus, BACnet, more L2) File formats amplify the challenge 5

  18. Example: Bro 2.5 AYIYA Kerberos BitTorrent Login SIP DCE_RPC Modbus SMTP DHCP MySQL SNMP DNP3 NCP SOCKS DNS NFS SSH DTLS NTP SSL FTP NetBIOS Syslog Finger PE TCP GTPv1 POP3 Telnet Gnutella Portmapper Teredo HTTP Radius UDP ICMP RDP X509 IPv4/6 Rlogin ZIP IRC Rsh Ident SMB 6

  19. A Tale of Three Open-Source IDS Suricata 7

  20. A Tale of Three Open-Source IDS Shared parsers? None. Suricata Every DPI application rewrites its parsers — usually in C/C++! 7

  21. Opportunity: Provide Platform for Parsers 8

  22. Opportunity: Provide Platform for Parsers Protocols leverage a rather small set of patterns Readable line-based formats for text protocols Static “prototocol data units” (PDU) for binary protocols Request/response structure Common sub-formats (HTTP/MIME/ASN.1) Fragmentation (even at app layer!) 8

  23. Opportunity: Provide Platform for Parsers Protocols leverage a rather small set of patterns Readable line-based formats for text protocols Static “prototocol data units” (PDU) for binary protocols Request/response structure Common sub-formats (HTTP/MIME/ASN.1) Fragmentation (even at app layer!) But: Potpourri of protocols remains diverse still Every protocol does something different 8

  24. Opportunity: Provide Platform for Parsers Protocols leverage a rather small set of patterns Readable line-based formats for text protocols Static “prototocol data units” (PDU) for binary protocols Request/response structure Common sub-formats (HTTP/MIME/ASN.1) Fragmentation (even at app layer!) But: Potpourri of protocols remains diverse still Every protocol does something different Can we leverage similarities, while remaining flexible? 8

  25. Opportunity: Provide Platform for Parsers Protocols leverage a rather small set of patterns Readable line-based formats for text protocols Static “prototocol data units” (PDU) for binary protocols Request/response structure Common sub-formats (HTTP/MIME/ASN.1) Fragmentation (even at app layer!) But: Potpourri of protocols remains diverse still Every protocol does something different Can we leverage similarities, while remaining flexible? Can we reuse code across applications? 8

  26. Meanwhile, in another domain … There are powerful tools for implementing parsers for programming languages. 9

  27. Meanwhile, in another domain … There are powerful tools for implementing parsers for programming languages. exp: NUM { $$ = $1; } | exp '+' exp { $$ = $1 + $2; } | exp ‘-' exp { $$ = $1 - $2; } | exp ‘*' exp { $$ = $1 * $2; } | exp ‘/' exp { $$ = $1 / $2; } 9

  28. Meanwhile, in another domain … There are powerful tools for implementing parsers for programming languages. exp: NUM { $$ = $1; } | exp '+' exp { $$ = $1 + $2; } | exp ‘-' exp { $$ = $1 - $2; } | exp ‘*' exp { $$ = $1 * $2; } | exp ‘/' exp { $$ = $1 / $2; } Host yyparse() Application Yacc 9

  29. Meanwhile, in another domain … There are powerful tools for implementing parsers for programming languages. These parsers aren’t suitable for DPI, unfortunately. exp: NUM { $$ = $1; } No support for concurrent, incremental processing | exp '+' exp { $$ = $1 + $2; } | exp ‘-' exp { $$ = $1 - $2; } No support for domain-specific idioms | exp ‘*' exp { $$ = $1 * $2; } | exp ‘/' exp { $$ = $1 / $2; } Host yyparse() Application Yacc 9

  30. Domain-specific Parser Generation IMC 2006 10

  31. Domain-specific Parser Generation IMC 2006 type ClientHello(rec: HandshakeRecord) = record { client_version: uint16; gmt_unix_time : uint32; random_bytes : bytestring &length = 28; session_len : uint8; session_id : uint8[session_len]; dtls_cookie : case client_version of { DTLSv10, DTLSv12 -> cookie : ClientHelloCookie(rec); default -> nothing: bytestring &length=0; }; […] TLS v3 Client Hello (Source: Bro’s TLS analyzer) } 10

  32. Domain-specific Parser Generation IMC 2006 type ClientHello(rec: HandshakeRecord) = record { client_version: uint16; gmt_unix_time : uint32; random_bytes : bytestring &length = 28; session_len : uint8; session_id : uint8[session_len]; dtls_cookie : case client_version of { DTLSv10, DTLSv12 -> cookie : ClientHelloCookie(rec); default -> nothing: bytestring &length=0; }; […] TLS v3 Client Hello (Source: Bro’s TLS analyzer) } Host class binpac:: Application ConnectionAnalyzer BinPAC 10

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend