skip to main content
10.1145/1177080.1177119acmconferencesArticle/Chapter ViewAbstractPublication PagesimcConference Proceedingsconference-collections
Article

binpac: a yacc for writing application protocol parsers

Authors Info & Claims
Published:25 October 2006Publication History

ABSTRACT

A key step in the semantic analysis of network traffic is to parse the traffic stream according to the high-level protocols it contains. This process transforms raw bytes into structured, typed, and semantically meaningful data fields that provide a high-level representation of the traffic. However, constructing protocol parsers by hand is a tedious and error-prone affair due to the complexity and sheer number of application protocols.This paper presents binpac, a declarative language and compiler designed to simplify the task of constructing robust and efficient semantic analyzers for complex network protocols. We discuss the design of the binpac language and a range of issues in generating efficient parsers from high-level specifications. We have used binpac to build several protocol parsers for the "Bro" network intrusion detection system, replacing some of its existing analyzers (handcrafted in C++), and supplementing its operation with analyzers for new protocols. We can then use Bro's powerful scripting language to express application-level analysis of network traffic in high-level terms that are both concise and expressive. binpac is now part of the open-source Bro distribution.

References

  1. M. B. Abbott and L. L. Peterson. A language-based approach to protocol implementation. IEEEACM Transactions on Networking, 1(1):4--19, 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. Arlitt, B. Krishnamurthy, and J. C. Mogul. Predicting short-transfer latency from TCP arcana: A trace-based validation. In Proceedings of the Internet Measurement Conference (IMC), October 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Abstract Syntax Notation One (ASN.1). ISOIEC 8824-1:2002.]]Google ScholarGoogle Scholar
  4. G. Back. Datascript - a specification and scripting language for binary data. In GPCE '02: The ACM SIGPLAN/SIGSOFT Conference on Generative Programming and Component Engineering, pages 66--77, London, UK, 2002. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. E. Biagioni, R. Harper, and P. Lee. A network protocol stack in Standard ML. Higher-Order and Symbolic Computation, 14(4):309--356, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. T. P. Blumer and J. C. Burruss. Generating a service specification of a connection management protocol. In PSTV, pages 161--170, 1982.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. N. Borisov, D. J. Brumley, H. J. Wang, J. Dunagan, P. Joshi, and C. Guo. Generic application-level protocol analyzer and its language. Under submission.]]Google ScholarGoogle Scholar
  8. Common Internet File System. http://www.snia.org/tech_activities/CIFS/CIFS-TR-1p00_FINAL.pdf.]]Google ScholarGoogle Scholar
  9. D. Crocker. RFC 2234: Augmented BNF for Syntax Specifications: ABNF.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. DCE 1.1: Remote procedure call. http://www.opengroup.org/onlinepubs/9629399/toc.htm.]]Google ScholarGoogle Scholar
  11. DSniff. www.monkey.org/dugsong/dsniff.]]Google ScholarGoogle Scholar
  12. The Ethereal Network Analyzer. http://www.ethereal.com/.]]Google ScholarGoogle Scholar
  13. A. Feldmann, N. Kammenhuber, O. Maennel, B. Maggs, R. D. Prisco, and R. Sundaram. A Methodology for Estimating Interdomain Web Traffic Demand. In Proceedings of the Internet Measurement Conference (IMC), October 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. R. Fielding, J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach, and T. Berners-Lee. RFC 2616: Hypertext Transfer Protocol - HTTP1.1, June 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. K. Fisher and R. Gruber. PADS: A domain-specific language for processing ad hoc data. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 295--304, New York, NY, USA, 2005. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. K. Fisher, Y. Mandelbaum, and D. Walker. The next 700 data description languages. In Proceedings of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 2--15, New York, NY, USA, 2006. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. Handley, C. Kreibich, and V. Paxson. Network Intrusion Detection: Evasion, Traffic Normalization, and End-to-End Protocol Semantics. In Proceedings of USENIX Security Symposium, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. G. J. Holzmann. The model checker SPIN. IEEE Trans. Softw. Eng., 23(5):279--295, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. V. Jacobson, C. Leres, and S. McCanne. TCPDUMP. ftp://ftp.ee.lbl.gov/libpcap.tar.Z.]]Google ScholarGoogle Scholar
  20. S. C. Johnson. YACC - Yet Another Compiler-Compiler. Computer Science Technical Report No. 32, Bell Laboratories, Murray Hill, New Jersey, July 1975.]]Google ScholarGoogle Scholar
  21. J. Jung and E. Sit. An Empirical Study of Spam Traffic and the Use of DNS Black Lists. In Proceedings of the Internet Measurement Conference (IMC), Taormina, Italy, October 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. E. Kohler, M. F. Kaashoek, and D. R. Montgomery. A readable TCP in the Prolac protocol language. In Proceedings of the ACM SIGCOMM Conference, pages 3--13, Cambridge, MA, August 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. C. Kreibich. NetDude (NETwork DUmp data Displayer and Editor). http://netdude.sourceforge.net/.]]Google ScholarGoogle Scholar
  24. C. Kreibich. Design and implementation of netdude, a framework for packet trace manipulation. June 2004.]]Google ScholarGoogle Scholar
  25. A. Kumar, V. Paxson, and N. Weaver. Exploiting Underlying Structure for Detailed Reconstruction of an Internet-scale Event. In Proceedings of the Internet Measurement Conference (IMC), October 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. P. J. McCann and S. Chandra. Packet Types: Abstract specifications of network protocol messages. In Proceedings of the ACM SIGCOMM Conference, pages 321--333, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. P. Mockapetris. DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION, Section 4.1.4, November 1987. RFC 1035.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. NFR Security. http://www.nfr.com.]]Google ScholarGoogle Scholar
  29. R. Pang, V. Yegneswaran, P. Barford, V. Paxson, and L. Peterson. Characteristics of Internet Background Radiation. In Proceedings of the Internet Measurement Conference (IMC), October 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. T. Parr and R. Quong. ANTLR: A predicated-ll (k) parser generator. Software, Practice and Experience, 25, July 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. V. Paxson. BRO: A system for detecting network intruders in real time. In Proceedings of USENIX Security Symposium, San Antonio, TX, January 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. V. Paxson, K. Asanovic, S. Dharmapurikar, J. Lockwood, R. Pang, R. Sommer, and N. Weaver. Rethinking hardware support for network analysis and intrusion prevention. In Proceedings of Workshop on Hot Topics in Security (HotSec), Vancouver, B.C., Canada, July 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. NetWare Core Protocol. http://forge.novell.com/modules/xfmod/project?ncp.]]Google ScholarGoogle Scholar
  34. T. H. Ptacek and T. N. Newsham. Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection. Technical report, Secure Networks, Inc., January 1998.]]Google ScholarGoogle Scholar
  35. M. Roesch. SNORT: Lightweight intrusion detection for networks. In Proceedings of USENIX LISA, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. The SNORT network intrusion detection system. http://www.snort.org.]]Google ScholarGoogle Scholar
  37. S. Saroiu, K. P. Gummadi, R. J. Dunn, S. D. Gribble, and H. M. Levy. An analysis of internet content delivery systems. In Proceedings of the Fifth Symposium on Operating Systems Design and Implementation (OSDI), December 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. C. Shannon and D. Moore. The Spread of the Witty Worm. http://www.caida.org/analysis/security/witty, 2004.]]Google ScholarGoogle Scholar
  39. R. Srinivasan. RFC 1831: RPC: Remote Procedure Call Protocol Specification.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. R. Srinivasan. RFC 1832: XDR: External Data Representation Standard.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Ethereal OSPF Protocol Dissector Buffer Overflow Vulnerability. http://www.idefense.com/intelligence/vulnerabilities/display.php?id=349.]]Google ScholarGoogle Scholar
  42. Snort TCP Stream Reassembly Integer Overflow Exploit. http://www.securiteam.com/exploits/5BP0O209PS.html.]]Google ScholarGoogle Scholar
  43. Symantec Multiple Firewall NBNS Response Processing Stack Overflow. http://www.eeye.com/html/research/advisories/AD20040512A.html.]]Google ScholarGoogle Scholar
  44. tcpdump ISAKMP packet delete payload buffer overflow. http://xforce.iss.net/xforce/xfdb/15680.]]Google ScholarGoogle Scholar
  45. Separation of concerns. http://en.wikipedia.org/wiki/Separation_of_concerns.]]Google ScholarGoogle Scholar
  46. C. Wong, S. Bielski, J. M. McCune, and C. Wang. A study of mass-mailing worms. In Proceedings of the 2005 ACM Workshop on Rapid Malcode (WORM), pages 1--10, New York, NY, USA, 2004. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. binpac: a yacc for writing application protocol parsers

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      IMC '06: Proceedings of the 6th ACM SIGCOMM conference on Internet measurement
      October 2006
      356 pages
      ISBN:1595935614
      DOI:10.1145/1177080

      Copyright © 2006 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 25 October 2006

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      Overall Acceptance Rate277of1,083submissions,26%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader