Przeglądaj źródła

Client: Disconnect connection when inappropriate NetBIOS session packet is received

Tal Aloni 5 lat temu
rodzic
commit
48c6822454

+ 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)