following the packets a walk through bro s internal
play

Following the Packets: A Walk Through Bros Internal Processing - PowerPoint PPT Presentation

Following the Packets: A Walk Through Bros Internal Processing Pipeline Robin Sommer robin@icir.org Corelight, Inc. International Computer Science Institute Lawrence Berkeley National Laboratory Outline Bros Architecture & Data


  1. Following the Packets: A Walk Through Bro’s Internal Processing Pipeline Robin Sommer robin@icir.org Corelight, Inc. International Computer Science Institute Lawrence Berkeley National Laboratory

  2. Outline Bro’s Architecture & Data Flow Components Protocol & file analysis Log writer & input readers Bro Plugins

  3. Bro Architecture Script Interpreter Events Event Engine Network Packets

  4. Bro Architecture Script Interpreter Events Event Engine Packet Source Network Packets

  5. Bro Architecture Script Interpreter Events Event Engine I/O Loop Packet Source Network Packets

  6. Bro Architecture Script Interpreter Events Event Engine Session I/O Loop Table Packet Source Network Packets

  7. Bro Architecture Script Interpreter Events Event Engine Connection Session I/O Loop Table Packet Source Network Packets

  8. Bro Architecture Script Interpreter Events Protocol Analysis Event Engine Connection Session I/O Loop Table Packet Source Network Packets

  9. Bro Architecture Script Interpreter Events File Analysis Protocol Analysis Event Engine Connection Session I/O Loop Table Packet Source Network Packets

  10. Bro Architecture Script Interpreter Events File Analysis Signature Engine Protocol Analysis Event Engine Connection Session I/O Loop Table Packet Source Network Packets

  11. Bro Architecture Script Interpreter Events Event File Queue Analysis Signature Engine Protocol Analysis Event Engine Connection Session I/O Loop Table Packet Source Network Packets

  12. Bro Architecture Script Interpreter Events Event File Queue Analysis Signature Engine Protocol Timer Analysis Queue Event Engine Connection Session I/O Loop Table Packet Source Network Packets

  13. Bro Architecture Script Event Handlers Interpreter Events Event File Queue Analysis Signature Engine Protocol Timer Analysis Queue Event Engine Connection Session I/O Loop Table Packet Source Network Packets

  14. Bro Architecture Script Modules Expressions Values Event Handlers Interpreter Functions Statements Types Events Event File Queue Analysis Signature Engine Protocol Timer Analysis Queue Event Engine Connection Session I/O Loop Table Packet Source Network Packets

  15. Bro Architecture Script Modules Expressions Values Event Handlers Interpreter Functions Statements Types BiF Types Event prototypes Events Elements Constants Functions Event File Queue Analysis Signature Engine Protocol Timer Analysis Queue Event Engine Log Connection Manager Session I/O Loop Table Packet Source Network Packets

  16. Bro Architecture Script Modules Expressions Values Event Handlers Interpreter Functions Statements Types BiF Types Event prototypes Events Elements Constants Functions Event File Queue Analysis Signature Engine Protocol Timer Analysis Queue Event Engine Remote- Log Connection Serializer Manager Session I/O Loop Table Packet Source Network Packets

  17. Bro Architecture Script Modules Expressions Values Event Handlers Interpreter Functions Statements Types BiF Types Event prototypes Events Elements Constants Functions Event File Communic. Queue Analysis Signature Process Engine Protocol Timer Analysis Queue Event Engine Remote- Log Connection Serializer Manager Session I/O Loop Table Packet Source Network Packets

  18. Bro Architecture Script Modules Expressions Values Event Handlers Interpreter Functions Statements Types BiF Types Event prototypes Events Elements Constants Functions Event File Communic. Queue Analysis Signature Process Engine Protocol Timer Analysis Queue Event Engine Remote- Log Input Connection Serializer Manager Manager Session I/O Loop Table Packet Source Network Packets

  19. Bro Architecture Script Modules Expressions Values Event Handlers Interpreter Functions Statements Types BiF Types Event prototypes Events Elements Constants Functions Event File Communic. Queue Analysis Signature Process Engine Protocol Timer Analysis Queue Event Engine Remote- Log Input Connection Serializer Manager Manager Thread Session I/O Loop Manager Table Packet Source Network Packets

  20. Bro Architecture Script Modules Expressions Values Event Handlers Interpreter Functions Statements Types BiF Types Event prototypes Events Elements Constants Functions Event File Communic. Queue Analysis Signature Process Engine Protocol Timer Analysis Queue Event Engine Remote- Log Input Connection Serializer Manager Manager Thread Session I/O Loop Manager Table Packet Source Network Packets

  21. Protocol & File Analysis Example: SSL Session IP

  22. Protocol & File Analysis Example: SSL Session IP TCP connection_established()

  23. Protocol & File Analysis Example: SSL Session IP TCP SSL connection_established() ssl_{client,server}_hello()

  24. Protocol & File Analysis Example: SSL Session IP TCP SSL X.509 connection_established() ssl_{client,server}_hello() x509_certificate()

  25. Protocol & File Analysis Example: SSL Session ? IP TCP SSL X.509 connection_established() ssl_{client,server}_hello() x509_certificate()

  26. Dynamic Protocol Detection IP TCP

  27. Dynamic Protocol Detection IP TCP PIA Buffer

  28. Dynamic Protocol Detection Analyzer::register_for_port(Analyzer::SSL, 443/tcp); IP TCP PIA Buffer

  29. Dynamic Protocol Detection signature dpd_ssl_server { ip-proto == tcp payload /^(\x16\x03[\x00\x01\x02\x03[…].*/ tcp-state responder enable "ssl" } Analyzer::register_for_port(Analyzer::SSL, 443/tcp); IP TCP PIA Buffer

  30. Dynamic Protocol Detection signature dpd_ssl_server { ip-proto == tcp payload /^(\x16\x03[\x00\x01\x02\x03[…].*/ tcp-state responder enable "ssl" } Analyzer::register_for_port(Analyzer::SSL, 443/tcp); IP TCP PIA Buffer SSL

  31. Dynamic Protocol Detection signature dpd_ssl_server { ip-proto == tcp payload /^(\x16\x03[\x00\x01\x02\x03[…].*/ tcp-state responder enable "ssl" } Analyzer::register_for_port(Analyzer::SSL, 443/tcp); IP TCP PIA Buffer SSL X.509

  32. Dynamic Protocol Detection signature dpd_ssl_server { ip-proto == tcp payload /^(\x16\x03[\x00\x01\x02\x03[…].*/ tcp-state responder enable "ssl" } Analyzer::register_for_port(Analyzer::SSL, 443/tcp); IP TCP PIA Buffer SSL HTTP X.509

  33. Dynamic Protocol Detection signature dpd_ssl_server { ip-proto == tcp payload /^(\x16\x03[\x00\x01\x02\x03[…].*/ tcp-state responder enable "ssl" } Analyzer::register_for_port(Analyzer::SSL, 443/tcp); IP TCP PIA Buffer SSL HTTP X.509

  34. Protocol Analyzer API class Analyzer { virtual void Init (); virtual void Done (); virtual void DeliverPacket (int len, const u_char* data, bool orig, bool orig, uint64 seq, const IP_Hdr* ip, int caplen); virtual void DeliverStream (int len, const u_char* data, bool orig); virtual void Undelivered (uint64 seq, int len, bool orig); virtual void EndOfData (bool is_orig); virtual void FlipRoles (); } class TCP_ApplicationAnalyzer : public Analyzer { virtual void EndpointEOF (bool is_orig); virtual void ConnectionFinished (int half_finished); virtual void ConnectionReset (); };

  35. File Analyzer API class Analyzer { virtual void Init (); virtual void Done (); virtual bool DeliverChunk (const u_char* data, uint64 len, uint64 offset); virtual bool DeliverStream (const u_char* data, uint64 len); virtual bool EndOfFile (); virtual bool Undelivered (uint64 offset, uint64 len); };

  36. Bro Architecture Script Modules Expressions Values Event Handlers Interpreter Functions Statements Types BiF Types Event prototypes Events Elements Constants Functions Event File Communic. Queue Analysis Signature Process Engine Protocol Timer Analysis Queue Event Engine Remote- Log Input Connection Serializer Manager Manager Thread Session I/O Loop Manager Table Packet Source Network Packets

  37. Bro Architecture Script Modules Expressions Values Event Handlers Interpreter Functions Statements Types BiF Types Event prototypes Events Elements Constants Functions Event File Communic. Queue Analysis Signature Process Engine Protocol Timer Analysis Queue Event Engine Remote- Log Input Connection Serializer Manager Manager Thread Session I/O Loop Manager Table Packet Source Network Packets

  38. Writers & Readers Log Writers Input Readers ASCII ASCII Binary SQLite Raw file SQLite

  39. Log Writer API class WriterBackend { virtual bool DoInit (const WriterInfo& info, int num_fields, virtual bool DoWrite (int num_fields, const Field* const* fields, threading::Value** vals); virtual bool DoSetBuf (bool enabled); virtual bool DoFlush (double network_time); virtual bool DoRotate (const char* rotated_path, double open, double close, bool terminating); virtual bool DoFinish (double network_time); virtual bool DoHeartbeat (double network_time, double current_time); }; Each writer runs in its own thread.

Recommend


More recommend