diff --git a/doc/userguide/rules/smb-keywords.rst b/doc/userguide/rules/smb-keywords.rst index 13133354403d..228b834fc254 100644 --- a/doc/userguide/rules/smb-keywords.rst +++ b/doc/userguide/rules/smb-keywords.rst @@ -61,6 +61,47 @@ Examples:: ``smb.ntlmssp_domain`` can be used as ``fast_pattern``. +smb.version +-------------- + +Used to match the SMB version, that can be 1 or 2. + +Example signatures:: + + alert smb any any -> any any (msg: "SMB1 version rule"; smb.version: 1; sid: 44;) + alert smb any any -> any any (msg: "SMB2 version rule"; smb.version: 2; sid: 45;) + +Matching in transition from SMBv1 to SMBv2 +******************************************** + +In the initial negotiation protocol request, a client supporting SMBv1 and SMBv2 can send an initial SMBv1 request and receive an SMBv2 response from server, indicating that SMBv2 will be used. + +This first SMBv2 response made by the server will match as SMBv1, since the entire transaction will be considered a SMBv1 transaction. + +Does `smb.version` match SMBv3? +**************************************** + +Yes, it will match SMBv3 messages using `smb.version: 2;`, which will match SMBv2 and SMBv3, since they use the same version identifier in the SMB header. + +This keyword will use the Protocol ID specified in SMB header to determine the version. Here is a summary of the Protocol ID codes: + +- 0xffSMB is SMB1 `header `_ +- 0xfeSMB is SMB2 `normal header `_ (can be `sync `_ or `async `_) +- 0xfdSMB is SMB2 `transform header `_. This is only valid for the SMB 3.x dialect family. +- 0xfcSMB is SMB2 `transform compression header `_ (can be `chained `_ or `unchained `_). These ones requires the use of 3.1.1 dialect. + +The Protocol ID in header distinguishes only SMB1 and SMB2 since they are totally different protocols with total different message formats, types and implementation. + +On the other hand SMB3 is more an extension for SMB2. When using SMB2 we can select one of the following dialects for the conversation between client and server: + +- 2.0.2 +- 2.1 +- 3.0 +- 3.0.2 +- 3.1.1 + +We say we are using SMB3 when we select a 3.x dialect for the conversation, so you can use SMB3.0, SMB3.0.2 or SMB3.1.1. The higher you choose, the more capabilities you have, but the message syntax and message command number remains the same. + file.name --------- @@ -74,4 +115,4 @@ Signature Example: :example-rule-options:`file.name; content:"file.txt";` \ classtype:bad-unknown; sid:1; rev:1;) -For additional information on the ``file.name`` keyword, see :doc:`file-keywords`. \ No newline at end of file +For additional information on the ``file.name`` keyword, see :doc:`file-keywords`.