Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows 2000 虛擬主機 IIS 安全鎖死 10 大關鍵設定

編輯:Windows Server 教學

虛擬主機環境對 IIS 安全性要求極高。本文彙整 10 項實戰驗證的鎖死設定,涵蓋 ASP 執行權限、元件封鎖、指令碼加密、URLScan 提取、標頭隱藏、錯誤修復、SYN Flood 防禦、版本資訊隱藏等核心面向。

  1. 禁止 ASP 以 System 權限執行
    虛擬目錄「應用程式保護」設為「高」或「中」(隔離進程),絕不可設「低」(In-Process 以 System 身分執行)。
  2. 封鎖 FSO (FileSystemObject) 組件
    cacls %systemroot%\system32\scrrun.dll /e /d guests 禁止 Guests 存取
    regsvr32 scrrun.dll /u /s 註銷組件 (註:網站 FSO 功能將失效)
  3. 封鎖 Shell.Application 組件
    cacls %systemroot%\system32\shell32.dll /e /d guests
    regsvr32 shell32.dll /u /s
  4. ASP 指令碼加密 (Microsoft Script Encoder)
    下載 sce10chs.exe 安裝產生 screnc.exe
    screnc /l vbscript source.asp destination.asp 產生加密版 (中文無法加密,僅適合英數混合碼)。
  5. 從 IIS Lockdown 提取 URLScan
    iislockd.exe /q /c /t:c:\urlscan 僅提取 URLScan 不執行完整鎖定。
  6. 防止 Content-Location 標頭洩露內部 IP
    cscript c:\inetpub\adminscripts\adsutil.vbs set w3svc/UseHostName True → 重啟 IIS。
  7. 修復 HTTP 500 內部錯誤 (IWAM 密碼不同步)
    cscript c:\inetpub\adminscripts\synciwam.vbs -v 同步 IWAM 帳號密碼至 COM+。
  8. 強化 TCP/IP 堆疊抵禦 SYN Flood (登錄檔)
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
    "SynAttackProtect"=dword:00000002
    "TcpMaxHalfOpen"=dword:00000064
    "TcpMaxHalfOpenRetried"=dword:00000050
    "TcpMaxConnectResponseRetransmissions"=dword:00000001
    "TcpMaxDataRetransmissions"=dword:00000003
    "TCPMaxPortsExhausted"=dword:00000005
    "DisableIPSourceRouting"=dword:00000002
    "TcpTimedWaitDelay"=dword:0000001e
    
    需重開機生效。參數說明見原文註解。
  9. 隱藏 IIS 版本資訊 (Banner)
    停止 IIS → 刪除 %SystemRoot%\system32\dllcache 同名 DLL → 用 16 進位編輯器修改:
    W3SVC.DLL (Web)、FTPSVC2.DLL (FTP)、SMTPSVC.DLL (SMTP)
    搜尋 Microsoft-IIS/5.0 替換為自訂字串 → 重啟 IIS。
  10. 停用不必要的服務與腳本對應
    移除 .htr、.idc、.shtm 等舊式副檔名對應,關閉 WebDAV、FrontPage Server Extensions 若未使用。

這 10 項設定構成虛擬主機 IIS 的鋼鐵防線,建議逐項落實並定期複核。

Copyright © Windows教程網 All Rights Reserved