]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dcerpc/tcp: improve detection
authorShivani Bhardwaj <shivanib134@gmail.com>
Fri, 12 Mar 2021 05:33:34 +0000 (11:03 +0530)
committerVictor Julien <victor@inliniac.net>
Tue, 20 Apr 2021 09:41:55 +0000 (11:41 +0200)
Lately, some of the TLS data was misdetected as DCERPC/TCP because of
the pattern |05 00|. Add more checks in DCERPC probe function to ensure
that it is in fact DCERPC/TCP.

rust/src/dcerpc/dcerpc.rs

index 356022ff977e121ce111996c26a7072491bc69f1..70ebb17977a16a46dddcd45d3a539ee0477a6909 100644 (file)
@@ -1351,7 +1351,10 @@ fn probe(input: &[u8]) -> (bool, bool) {
     match parser::parse_dcerpc_header(input) {
         Ok((_, hdr)) => {
             let is_request = hdr.hdrtype == 0x00;
-            let is_dcerpc = hdr.rpc_vers == 0x05 && hdr.rpc_vers_minor == 0x00;
+            let is_dcerpc = hdr.rpc_vers == 0x05 &&
+                hdr.rpc_vers_minor == 0x00 &&
+                hdr.packed_drep[0] & 0xee == 0 &&
+                hdr.packed_drep[1] <= 3;
             return (is_dcerpc, is_request);
         },
         Err(_) => (false, false),