]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
smb: probing parser for start and midstream
authorPhilippe Antoine <contact@catenacyber.fr>
Tue, 2 Feb 2021 12:31:08 +0000 (13:31 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 26 Feb 2021 12:33:39 +0000 (13:33 +0100)
The probing parser is more strict at the start of the stream

rust/src/smb/smb.rs

index 8e313064245715868e5f038d402847ffe9bcbc7d..77db7c221aa87946350282c648d4523fa191e02e 100644 (file)
@@ -1978,8 +1978,10 @@ pub extern "C" fn rs_smb_probe_tcp(flags: u8,
     -> i8
 {
     let slice = build_slice!(input, len as usize);
-    if rs_smb_probe_tcp_midstream(flags, slice, rdir) == 1 {
-        return 1;
+    if flags & STREAM_MIDSTREAM == STREAM_MIDSTREAM {
+        if rs_smb_probe_tcp_midstream(flags, slice, rdir) == 1 {
+            return 1;
+        }
     }
     match parse_nbss_record_partial(slice) {
         Ok((_, ref hdr)) => {