浏览代码

Detecting IIS by "Windows_NT" response to SYST as the welcome message was seen to be empty (Dan Smith)

Source commit: 8b46ec6163322d824e4283a3296d4de74138080a
Martin Prikryl 9 年之前
父节点
当前提交
e5648809ad
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      source/core/FtpFileSystem.cpp

+ 4 - 2
source/core/FtpFileSystem.cpp

@@ -637,7 +637,8 @@ void __fastcall TFTPFileSystem::CollectUsage()
   // 220 Microsoft FTP Service
   // SYST
   // 215 Windows_NT
-  else if (ContainsText(FWelcomeMessage, L"Microsoft FTP Service"))
+  else if (ContainsText(FWelcomeMessage, L"Microsoft FTP Service") ||
+           ContainsText(FSystem, L"Windows_NT"))
   {
     FTerminal->Configuration->Usage->Inc(L"OpenedSessionsFTPIIS");
   }
@@ -3589,7 +3590,8 @@ void __fastcall TFTPFileSystem::HandleReplyStatus(UnicodeString Response)
           FTerminal->LogEvent(L"The server requires TLS/SSL handshake on transfer connection before responding 1yz to STOR/APPE");
           FTransferActiveImmediately = true;
         }
-        if (ContainsText(FWelcomeMessage, L"Microsoft FTP Service"))
+        // The FWelcomeMessage usually contains "Microsoft FTP Service" but can be empty
+        if (ContainsText(FSystem, L"Windows_NT"))
         {
           FTerminal->LogEvent(L"The server is probably running Windows, assuming that directory listing timestamps are affected by DST.");
           FWindowsServer = true;