13 releases (7 breaking)

0.8.0 Feb 29, 2024
0.7.1 Nov 15, 2021
0.7.0 Sep 13, 2021
0.6.0 Nov 29, 2020
0.1.1 Mar 17, 2018

#1321 in Parser implementations

Download history 3062/week @ 2023-12-07 2195/week @ 2023-12-14 1407/week @ 2023-12-21 1354/week @ 2023-12-28 1960/week @ 2024-01-04 2684/week @ 2024-01-11 3101/week @ 2024-01-18 2897/week @ 2024-01-25 2415/week @ 2024-02-01 4072/week @ 2024-02-08 3366/week @ 2024-02-15 2992/week @ 2024-02-22 3162/week @ 2024-02-29 4756/week @ 2024-03-07 4556/week @ 2024-03-14 4437/week @ 2024-03-21

17,480 downloads per month
Used in suricata

MIT/Apache

65KB
877 lines

Kerberos parser

License: MIT Apache License 2.0 Build Status Crates.io Version

Kerberos Parser

A Kerberos v5 (RFC4120) parser, implemented with the nom parser combinator framework.

The code is available on Github.

Specific parsing functions are provided for Kerberos message types. For ex. to parse a KRB_AS_REQ message, use parse_as_req.

Examples

Parsing a KRB_AS_REQ message:

use kerberos_parser::krb5::MessageType;
use kerberos_parser::krb5_parser::parse_as_req;

static AS_REQ: &'static [u8] = include_bytes!("../assets/as-req.bin");

let res = parse_as_req(AS_REQ);
match res {
    Ok((rem, kdc_req)) => {
        assert!(rem.is_empty());
        //
        assert_eq!(kdc_req.msg_type, MessageType::KRB_AS_REQ);
    },
    _ => panic!("KRB_AS_REQ parsing failed: {:?}", res),
}

Rusticata

This parser is part of the rusticata project. The goal of this project is to provide safe parsers, that can be used in other projects.

Testing of the parser is done manually, and also using unit tests and cargo-fuzz. Please fill a bugreport if you find any issue.

Feel free to contribute: tests, feedback, doc, suggestions (or code) of new parsers etc. are welcome.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.8–2.6MB
~49K SLoC