修正:當您將「封鎖超過 (MB) 」選項以允許非常大的檔案時,惡意軟體掃描時間比Microsoft預期更長

重要 本文包含如何降低安全設定或關閉電腦安全功能的資訊。 您可以進行這些變更,為特定的問題尋求因應措施。 在您做出這些變更之前,Microsoft 建議您評估在特定環境中實施此解決方案所帶來的風險。 如果您選擇實施這項決議,請採取任何適當的額外措施來保護您的系統。

當你使用 Microsoft Forefront Threat Management Gateway (TMG) 2010 惡意軟體掃描時,可以透過「 封鎖大於 (MB) 」選項來限制下載檔案大小。

注意: 阻擋檔案大於 (MB) 選項位於 惡意軟體檢查 對話框的檢查設定標籤中。

如果你設定此選項的值讓 TMG 2010 掃描非常大的檔案,TMG 惡意軟體掃描會比預期花更久的時間。 例如,一個 4 GB (GB 的) 檔案,惡意軟體檢查引擎掃描可能需要長達 30 分鐘。

注意:您無法設定 TMG 惡意軟體掃描執行部分掃描,且只掃描下載檔案的前幾兆位元組。

症狀

警告:此解決方案可能使您的電腦或網路更容易受到惡意使用者或惡意軟體(如病毒)的攻擊。 Microsoft 不建議採用此決議,但提供此資訊是為了讓您自行決定是否實施此決議。 使用此決議需自行承擔風險。

為了解決此問題,請安裝以下 Microsoft 知識庫文章中所述的軟體更新:

2517957 Forefront Threat Management Gateway (TMG) 2010 服務包 1 軟體更新 1 Rollup 4 此熱修補引入新設定 ScanMaxSizeOnlyIfExceeds。 此設定會將 Block 檔案大於 MB () 設定的行為從限制下載檔案最大大小,改為將 ScanMaxSizeOnlyIfExceed 設 為 True 時,部分掃描限制(以兆位元組計)。

當 ScanMaxSizeOnlyIfExceeds 設 為 True 時,下載的檔案不會受到大小限制。 然而,當你下載的檔案大於 Block 檔案設定的 MB) 選項中設定的值時,掃描 () 時,只有部分檔案 (該選項設定的大小。

ScanMaxSizeOnlyIfExceeds 的預設設定是 錯誤的。 你可以在陣列層級或規則層級套用此設定。 要使用腳本啟用設定,請從下方提供的腳本中選擇相應的腳本,然後在其中一個陣列成員上執行。 你也可以使用 TMG 管理主控台設定區塊檔案的值大於 MB) (選項。

高階文字

將以下腳本複製到記事本,儲存為 EnableMaxSizeScanAllowRule.vbs 的腳本,然後在命令提示字元執行該腳本,如下:

手稿 EnableMaxSizeScanAllowRule.vbs

Const SE_VPS_GUID = "{DFAEF493-C442-4F80-9622-5DA4143287D8}"
Const SE_VPS_NAME = "ScanMaxSizeOnlyIfExceeds"
Const SE_VPS_VALUE = true

Sub SetValue()

    ' Create the root obect.
    Dim root  ' The FPCLib.FPC root object
    Set root = CreateObject("FPC.Root")

    'Declare the other objects needed.
    Dim array       ' An FPCArray object
    Dim VendorSets  ' An FPCVendorParametersSets collection
    Dim VendorSet   ' An FPCVendorParametersSet object

    ' Get references to the array object
    ' and the network rules collection.
    Set array = root.GetContainingArray
    set malwareInspectionSettings = array.MalwareInspectionSettings
    set scannerSettings = malwareInspectionSettings.ScannerSettings
    Set VendorSets = scannerSettings.VendorParametersSets

    On Error Resume Next
    Set VendorSet = VendorSets.Item( SE_VPS_GUID )

    If Err.Number <> 0 Then
        Err.Clear

        ' Add the item
        Set VendorSet = VendorSets.Add( SE_VPS_GUID )
        CheckError
        WScript.Echo "New VendorSet added... " & VendorSet.Name

    Else
        WScript.Echo "Existing VendorSet found... value- " &  VendorSet.Value(SE_VPS_NAME)
    End If

    if VendorSet.Value(SE_VPS_NAME) <> SE_VPS_VALUE Then

        Err.Clear
        VendorSet.Value(SE_VPS_NAME) = SE_VPS_VALUE

        If Err.Number <> 0 Then
            CheckError
        Else
            VendorSets.Save false, true
            CheckError

            If Err.Number = 0 Then
                WScript.Echo "Done with " & SE_VPS_NAME & ", saved!"
            End If
        End If
    Else
        WScript.Echo "Done with " & SE_VPS_NAME & ", no change!"
    End If

End Sub

Sub CheckError()

    If Err.Number <> 0 Then
        WScript.Echo "An error occurred: 0x" & Hex(Err.Number) & " " & Err.Description
        Err.Clear
    End If

End Sub

SetValue

規則層級腳本

將以下腳本複製到記事本,儲存為 EnableMaxSizeScanAllowRule.vbs 的腳本,然後在命令提示字元執行該腳本,如下:

cscript EnableMaxSizeScanAllowRule /RuleName:“MyRule”將佔位符 MyRule 替換為相關的 TMG 存取規則名稱。

Const SE_VPS_GUID = "{DFAEF493-C442-4F80-9622-5DA4143287D8}"
Const SE_VPS_NAME = "ScanMaxSizeOnlyIfExceeds"
Const SE_VPS_VALUE = true

Sub SetValue()

    ' Create the root obect.
    Dim root  ' The FPCLib.FPC root object
    Set root = CreateObject("FPC.Root")

    'Declare the other objects needed.
    Dim array       ' An FPCArray object
    Dim VendorSets  ' An FPCVendorParametersSets collection
    Dim VendorSet   ' An FPCVendorParametersSet object

    ' Get references to the array object
    ' and the network rules collection.
    Set array = root.GetContainingArray
    ruleName= WScript.Arguments.Named("RuleName")
    set rule = array.ArrayPolicy.PolicyRules.Item(ruleName)

    set malwareInspectionSettings = rule.MalwareInspectionProperties
    set scannerSettings = malwareInspectionSettings.ScannerSettings
    Set VendorSets = scannerSettings.VendorParametersSets

    On Error Resume Next
    Set VendorSet = VendorSets.Item( SE_VPS_GUID )

    If Err.Number <> 0 Then
        Err.Clear

        ' Add the item
        Set VendorSet = VendorSets.Add( SE_VPS_GUID )
        CheckError
        WScript.Echo "New VendorSet added... " & VendorSet.Name

    Else
        WScript.Echo "Existing VendorSet found... value- " &  VendorSet.Value(SE_VPS_NAME)
    End If

    if VendorSet.Value(SE_VPS_NAME) <> SE_VPS_VALUE Then

        Err.Clear
        VendorSet.Value(SE_VPS_NAME) = SE_VPS_VALUE

        If Err.Number <> 0 Then
            CheckError
        Else
            VendorSets.Save false, true
            CheckError

            If Err.Number = 0 Then
                WScript.Echo "Done with " & SE_VPS_NAME & ", saved!"
            End If
        End If
    Else
        WScript.Echo "Done with " & SE_VPS_NAME & ", no change!"
    End If

End Sub

Sub CheckError()

    If Err.Number <> 0 Then
        WScript.Echo "An error occurred: 0x" & Hex(Err.Number) & " " & Err.Description
        Err.Clear
    End If

End Sub

SetValue

若要還原你使用陣列腳本或規則腳本所做的更改,並回復到大於 () MB 的區塊檔案預設行為,請編輯相關腳本並更改以下行:

Const SE_VPS_VALUE = trueTo:

Const SE_VPS_VALUE = false 然後,用適當的指令重執行腳本。

解決方式

重要! 請注意,當你將 ScanMaxSizeOnlyIfExceeds 設為 False 時,會帶來安全風險。 這是因為一個包含惡意軟體、未掃描部分存在惡意軟體的大檔案,TMG 可能會將檔案傳給用戶端。

Microsoft 建議使用完整檔案掃描。 因此,我們建議您只有在仔細評估風險後,且採用防禦深度的惡意軟體偵測方法,包括適當的用戶端防惡意軟體,才使用此設定。

更多資訊