浏览代码

Client: Disconnect connection when inappropriate NetBIOS session packet is received

Tal Aloni 5 年之前
父节点
当前提交
48c6822454
共有 2 个文件被更改,包括 10 次插入0 次删除
  1. 5 0
      SMBLibrary/Client/SMB1Client.cs
  2. 5 0
      SMBLibrary/Client/SMB2Client.cs

+ 5 - 0
SMBLibrary/Client/SMB1Client.cs

@@ -515,6 +515,11 @@ namespace SMBLibrary.Client
             {
                 // [RFC 1001] NetBIOS session keep alives do not require a response from the NetBIOS peer
             }
+            else
+            {
+                Log("Inappropriate NetBIOS session packet");
+                state.ClientSocket.Close();
+            }
         }
 
         internal SMB1Message WaitForMessage(CommandName commandName)

+ 5 - 0
SMBLibrary/Client/SMB2Client.cs

@@ -410,6 +410,11 @@ namespace SMBLibrary.Client
             {
                 // [RFC 1001] NetBIOS session keep alives do not require a response from the NetBIOS peer
             }
+            else
+            {
+                Log("Inappropriate NetBIOS session packet");
+                state.ClientSocket.Close();
+            }
         }
 
         internal SMB2Command WaitForCommand(SMB2CommandName commandName)