火绒安全软件

标题: 开启火绒时powershell崩溃 [打印本页]

作者: Aalivexy    时间: 2025-5-6 10:49
标题: 开启火绒时powershell崩溃
本帖最后由 Aalivexy 于 2025-5-6 10:52 编辑

一段时间以来我一直被一个未知来源的弹窗困扰:



弹窗总是在我闲置电脑一段时间之后出现,计划任务给我翻了个底朝天都没有啥powershell的痕迹。

昨天终于抓到一次,在火绒剑里显示是这样的



命令行为
  1. C:\WINDOWS\system32\compattelrunner.exe -cv:ZhKnJltWckWrh0Iy.0.8 -wce:0000000000000218  -m:appraiser.dll -f:DoScheduledTelemetryRun
复制代码
powershell的命令为
  1. powershell.exe -ExecutionPolicy Restricted -Command
  2.                     $Res = 0
  3.                     [UInt64]$MinDiskSpaceThreshold = 25 * 1024 * 1024 * 1024

  4.                     try {
  5.                         $SystemDrive = (Get-CimInstance Win32_OperatingSystem).SystemDrive
  6.                         $SystemDriveLetter = $SystemDrive[0]
  7.                         $SystemDriveSpace = (Get-Volume -DriveLetter $SystemDriveLetter).SizeRemaining
  8.                         Write-Host 'Current system drive space:', $SystemDriveSpace.ToString('N0')
  9.                         if ($SystemDriveSpace -lt $MinDiskSpaceThreshold) {
  10.                             Write-Host 'System drive space is less than the threshold:', $MinDiskSpaceThreshold.ToString('N0'), 'Applying safeguard.'
  11.                             $Res = 1
  12.                         }
  13.                     } catch {
  14.                         # Do nothing
  15.                     }

  16.                     Write-Host 'Final result:', $Res
复制代码
然后定位到了 任务计划程序 > Microsoft > Windows > Application Experience > Microsoft Compatibility Appraiser,似乎是它的问题,但我不确定。
知道powershell运行的命令之后我尝试写了一个小脚本,尝试复现崩溃:

  1. $ErrorActionPreference = "Stop"
  2. $Res = 0
  3. $MinDiskSpaceThreshold = 25 * 1024 * 1024 * 1024  # 25 GB

  4. try {
  5.     Write-Host "获取系统驱动器..."
  6.     $SystemDrive = (Get-CimInstance Win32_OperatingSystem).SystemDrive
  7.     Write-Host "系统驱动器是:$SystemDrive"

  8.     $SystemDriveLetter = $SystemDrive[0]
  9.     Write-Host "驱动器字母是:$SystemDriveLetter"

  10.     $Volume = Get-Volume -DriveLetter $SystemDriveLetter
  11.     Write-Host "驱动器卷信息:$($Volume | Out-String)"

  12.     $SystemDriveSpace = $Volume.SizeRemaining
  13.     Write-Host "当前可用空间(字节): $SystemDriveSpace"

  14.     if ($SystemDriveSpace -lt $MinDiskSpaceThreshold) {
  15.         Write-Host "磁盘空间不足!"
  16.         $Res = 1
  17.     }
  18. } catch {
  19.     Write-Error "发生异常:$($_.Exception.Message)"
  20. }

  21. Write-Host "最终结果: $Res"
复制代码
不出意外崩溃了:
  1. PS C:\Users\Aalivexy\Desktop> .\test1.ps1
  2. 获取系统驱动器...
  3. 系统驱动器是:C:
  4. 驱动器字母是:C

  5. 未经处理的异常:  System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
  6.    在 System.Management.Automation.AmsiUtils.AmsiNativeMethods.AmsiScanBuffer(IntPtr amsiContext, IntPtr buffer, UInt32 length, String contentName, IntPtr amsiSession, AMSI_RESULT& result)
  7.    在 System.Management.Automation.AmsiUtils.ScanContent(String content, String sourceMetadata)
  8.    在 System.Management.Automation.CompiledScriptBlockData.PerformSecurityChecks()
  9.    在 System.Management.Automation.CompiledScriptBlockData.ReallyCompile(Boolean optimize)
  10.    在 System.Management.Automation.CompiledScriptBlockData.CompileOptimized()
  11.    在 System.Management.Automation.CompiledScriptBlockData.Compile(Boolean optimized)
  12.    在 System.Management.Automation.ScriptBlock.GetCodeToInvoke(Boolean& optimized, ScriptBlockClauseToInvoke clauseToInvoke)
  13.    在 System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
  14.    在 System.Management.Automation.ScriptBlock.<>c__DisplayClass57_0.<InvokeWithPipe>b__0()
  15.    在 System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
  16.    在 System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsToTop, List`1 variablesToDefine, Dictionary`2 functionsToDefine, Object[] args)
  17.    在 System.Management.Automation.ScriptBlock.DoInvokeReturnAsIs(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Object[] args)
  18.    在 System.Management.Automation.ScriptBlock.InvokeReturnAsIs(Object[] args)
  19.    在 Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifestData(String moduleManifestPath, ScriptBlock scriptBlock, String[] validMembers, ManifestProcessingFlags manifestProcessingFlags, Boolean& containedErrors)
  20.    在 Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifestData(ExternalScriptInfo scriptInfo, String[] validMembers, ManifestProcessingFlags manifestProcessingFlags, Boolean& containedErrors)
  21.    在 Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifestData(ExternalScriptInfo scriptInfo, ManifestProcessingFlags manifestProcessingFlags, Hashtable& data, Hashtable& localizedData, Boolean& containedErrors)
  22.    在 Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModule(PSModuleInfo parentModule, String fileName, String moduleBase, String prefix, SessionState ss, Object privateData, ImportModuleOptions& options, ManifestProcessingFlags manifestProcessingFlags, Boolean& found, Boolean& moduleFileFound)
  23.    在 Microsoft.PowerShell.Commands.ImportModuleCommand.ImportModule_LocallyViaName(ImportModuleOptions importModuleOptions, String name)
  24.    在 Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord()
  25.    在 System.Management.Automation.CommandProcessor.ProcessRecord()
  26.    在 System.Management.Automation.CommandProcessorBase.DoExecute()
  27.    在 System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
  28.    在 System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
  29.    在 System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()
  30.    在 System.Management.Automation.Runspaces.LocalPipeline.StartPipelineExecution()
  31.    在 System.Management.Automation.Runspaces.PipelineBase.CoreInvoke(IEnumerable input, Boolean syncCall)
  32.    在 System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
  33.    在 System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
  34.    在 System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
  35.    在 System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
  36.    在 System.Management.Automation.PowerShell.Invoke[T]()
  37.    在 System.Management.Automation.CommandDiscovery.AutoloadSpecifiedModule(String moduleName, ExecutionContext context, SessionStateEntryVisibility visibility, Exception& exception)
  38.    在 System.Management.Automation.CommandDiscovery.TryModuleAutoDiscovery(String commandName, ExecutionContext context, String originalCommandName, CommandOrigin commandOrigin, SearchResolutionOptions searchResolutionOptions, CommandTypes commandTypes, Exception& lastError)
  39.    在 System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)
  40.    在 System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)
  41.    在 System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)
  42.    在 System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)
  43.    在 System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
  44.    在 System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
  45.    在 System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
  46.    在 System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
  47.    在 System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
  48.    在 System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
  49.    在 System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
  50.    在 System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
  51.    在 System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
  52.    在 System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
  53.    在 System.Management.Automation.DlrScriptCommandProcessor.Complete()
  54.    在 System.Management.Automation.CommandProcessorBase.DoComplete()
  55.    在 System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop)
  56.    在 System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
  57.    在 System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
  58.    在 System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
  59.    在 System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
  60.    在 System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
  61.    在 System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
  62.    在 System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
  63.    在 System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
  64.    在 System.Management.Automation.DlrScriptCommandProcessor.Complete()
  65.    在 System.Management.Automation.CommandProcessorBase.DoComplete()
  66.    在 System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop)
  67.    在 System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
  68.    在 System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
  69.    在 System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()
  70.    在 System.Management.Automation.Runspaces.PipelineThread.WorkerProc()
  71.    在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
  72.    在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
  73.    在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  74.    在 System.Threading.ThreadHelper.ThreadStart()

  75. [已退出进程,代码为 3221225477 (0xc0000005)]
复制代码
果然也出现了同样的弹窗:

异常似乎与AMSI有关,我尝试关闭火绒后代码运行正常:
  1. PS C:\Users\Aalivexy\Desktop> .\test1.ps1
  2. 获取系统驱动器...
  3. 系统驱动器是:C:
  4. 驱动器字母是:C
  5. 驱动器卷信息:
  6. DriveLetter FriendlyName FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining      Size
  7. ----------- ------------ -------------- --------- ------------ ----------------- -------------      ----
  8. C           Windows      NTFS           Fixed     Healthy      OK                     120.7 GB 899.12 GB



  9. 当前可用空间(字节): 129601699840
  10. 最终结果: 0
复制代码
重新启动火绒后似乎也运行正常,但当我重启一个powershell之后再次运行test1.ps1就又会崩溃。


我一开始没怀疑过火绒,因为我其他装了火绒的电脑上从来没有过这个问题。


出问题的环境:

火绒:
版本:6.0.6.1 病毒库:2025-05-05 17:51


版本        Windows 11 专业工作站版
版本号        24H2
安装日期        ‎2024/‎12/‎22
操作系统版本        26100.3775
体验        Windows 功能体验包 1000.26100.66.0

测试脚本:https://bbs.huorong.cn/forum.php?mod=attachment&aid=MTMxNTUzfDRlY2JmMTA2NDdhYzZhODM5ZGM0NGY4ZmQ2OTRjN2Q4fDE3NjM2Nzc5ODk%3D&request=yes&_f=.7z



作者: 火绒运营专员    时间: 2025-5-6 10:51
您好,这边确认下~
作者: 火绒运营专员    时间: 2025-5-6 11:23
您好,您这边是否有勾选高级启发式扫描呢?


作者: Aalivexy    时间: 2025-5-6 11:47
火绒运营专员 发表于 2025-5-6 11:23
您好,您这边是否有勾选高级启发式扫描呢?

没有勾选
作者: 火绒运营专员    时间: 2025-5-6 11:57
Aalivexy 发表于 2025-5-6 11:47
没有勾选

您好,火绒安全日志麻烦您看下是否有记录,您看下防护中心--文件实时监控--AMSI功能是否有勾选



作者: Aalivexy    时间: 2025-5-6 14:11
火绒运营专员 发表于 2025-5-6 11:57
您好,火绒安全日志麻烦您看下是否有记录,您看下防护中心--文件实时监控--AMSI功能是否有勾选

启用通过AMSI对脚本和其它对象的高级扫描已勾选
作者: 火绒运营专员    时间: 2025-5-6 14:17
Aalivexy 发表于 2025-5-6 14:11
启用通过AMSI对脚本和其它对象的高级扫描已勾选

您好,您之前是勾选的状态吗,如果取消勾选的话是否存在该问题呢
作者: 火绒运营专员    时间: 2025-5-6 17:13
Aalivexy 发表于 2025-5-6 14:11
启用通过AMSI对脚本和其它对象的高级扫描已勾选

您好,您提出的问题已经提交给研发团队跟进处理,有新进展我会随时给您同步,您也可以根据ID联系我查询问题处理进展,感谢反馈,【问题ID:58170】
作者: Aalivexy    时间: 2025-5-6 18:45
火绒运营专员 发表于 2025-5-6 14:17
您好,您之前是勾选的状态吗,如果取消勾选的话是否存在该问题呢

一直是勾选的状态,似乎是我之前勾选的。
取消勾选之后问题消失了
作者: 火绒运营专员    时间: 2025-5-6 18:47
Aalivexy 发表于 2025-5-6 18:45
一直是勾选的状态,似乎是我之前勾选的。
取消勾选之后问题消失了

您好,内部已提交优化哈,有进展同步您。
作者: 火绒运营专员    时间: 2025-7-4 13:55
您好,之前您反馈的问题已在火绒6.0.7.0版本解决,目前该版本还在灰度中,您可以到官网下载最新版本安装包覆盖安装后本地测试下是否还有问题,感谢您的反馈~【问题id:58170】
作者: Aalivexy    时间: 2025-8-20 11:50
没有频繁崩溃了,应该解决了




欢迎光临 火绒安全软件 (https://bbs.huorong.cn/) Powered by Discuz! X3.4