smb: do not rely on one valid NBSS byte for probing

Need to have the SMB header so as to validate
pull/5627/head
Philippe Antoine 6 years ago committed by Victor Julien
parent 48f0c612e3
commit 6181459086

@ -44,6 +44,9 @@ impl<'a> NbssRecord<'a> {
};
valid
}
pub fn needs_more(&self) -> bool {
return self.is_valid() && self.length >= 4 && self.data.len() < 4;
}
pub fn is_smb(&self) -> bool {
let valid = self.is_valid();
let smb = if self.data.len() >= 4 &&

@ -1977,9 +1977,8 @@ pub extern "C" fn rs_smb_probe_tcp(direction: u8,
if hdr.is_smb() {
SCLogDebug!("smb found");
return 1;
} else if hdr.is_valid() {
SCLogDebug!("nbss found, assume smb");
return 1;
} else if hdr.needs_more(){
return 0;
}
},
_ => { },

Loading…
Cancel
Save