简体   繁体   English

CMD.exe 立即关闭 - 自动运行注册表项中的异常行

[英]CMD.exe closes immediately - unusual line in AutoRun registry entry

I've noticed that my command line didn't start anymore, it just immediately minimized and closed itself upon running.我注意到我的命令行不再启动,它只是立即最小化并在运行时自行关闭。 I suspect this is due to a virus or at least some kind of malicious program having been executed.我怀疑这是由于病毒或至少某种恶意程序已被执行。 I found the following code inside my registry.我在注册表中找到了以下代码。 It seems legible but my knowledge of batch / the command line is limited.看起来很清晰,但我对批处理/命令行的了解是有限的。 Can anyone tell me what it does?谁能告诉我它是做什么的?

@mode 20,5 & tasklist /FI "IMAGENAME eq SoundModule.exe" 2>NUL | find /I /N "SoundModule.exe">NUL && exit & if exist "C:\Users\Leon\AppData\Roaming\Microsoft\SoundModule\SoundModule.exe" ( start /MIN "" "C:\Users\Leon\AppData\Roaming\Microsoft\SoundModule\SoundModule.exe" & tasklist /FI "IMAGENAME eq explorer.exe" 2>NUL | find /I /N "explorer.exe">NUL && exit & explorer.exe & exit ) else ( tasklist /FI "IMAGENAME eq explorer.exe" 2>NUL | find /I /N "explorer.exe">NUL && exit & explorer.exe & exit )

According to this reddit thread , it's a "vmprotected cryptocurrency miner".根据这个 reddit 线程,它是一个“受 vmprotected 的加密货币矿工”。

You most likely got it if you installed anything you downloaded from the torrent network, for example a popular game released in the past few weeks :^)如果您安装了从 torrent 网络下载的任何内容,例如过去几周发布的流行游戏,您很可能会得到它:^)

The following SO thread contains part of the solution: CMD.exe closes immediately after calling (Win7 64)以下 SO 线程包含部分解决方案: CMD.exe 在调用后立即关闭 (Win7 64)

The malicious party added an AutoRun directive via registry to the Windows Command Processor ( cmd.exe usually), which you need to remove from any of the following locations it's present in:恶意方通过注册表向 Windows 命令处理器(通常为cmd.exe )添加了一个AutoRun指令,您需要从它所在的以下任何位置删除该指令:

  • Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor
  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

What the directive does is to execute SoundModule.exe and then explorer.exe (if not already started).该指令的作用是执行SoundModule.exe ,然后执行explorer.exe (如果尚未启动)。

According to the other reply in this thread , they set %comspec% to run at startup, via Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon .根据此线程中的另一个回复,他们将%comspec%设置为在启动时通过Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon运行。

So on startup, it's running %comspec% (instead of the default Windows Explorer), which itself on start first runs SoundModule.exe and then explorer.exe .所以在启动时,它正在运行%comspec% (而不是默认的 Windows Explorer),它本身在启动时首先运行SoundModule.exe然后explorer.exe Not sure why they did it this way, anyone who makes use of cmd.exe was bound to figure it out and spread the word.不知道他们为什么这样做,任何使用cmd.exe的人一定会弄清楚并传播这个词。

There are at least two confirmed VirusTotal records for this file: [1] , [2]此文件至少有两条已确认的 VirusTotal 记录: [1][2]

I had the same program on my computer, check Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon for the shell value which is most likely "%comspec%" (which makes sense why it was just cmd running on startup since %comspec% is cmd.exe ) and change it to "explorer.exe"我的电脑上有相同的程序,检查Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon的 shell 值,这很可能是“%comspec%” (这很有意义,为什么它只是 cmd 在启动时运行%comspec%cmd.exe )并将其更改为"explorer.exe"

Run regedit Go to HKLM\Software\Microsoft\Command Processor\ or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\ or HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\运行 regedit Go 到 HKLM\Software\Microsoft\Command Processor\ 或 HKEY_CURRENT_USER\Software\Microsoft\Command Processor\ 或 HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\

For some reason there was AUTORUN key with "EXIT" inside.由于某种原因,里面有带有“EXIT”的AUTORUN键。

Remove the AutoRun key and cmd will work fine.删除 AutoRun 键,cmd 将正常工作。 Then check Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon for the shell value which is most likely "%comspec%" (which makes sense why it was just cmd running on startup since %comspec% is cmd.exe) and change it to "explorer.exe" as the user above said. Then check Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon for the shell value which is most likely "%comspec%" (which makes sense why it was just cmd running on startup since %comspec% is cmd.exe)并将其更改为上述用户所说的“explorer.exe”。

Edit: I also found that it was a cryptocurrency mining virus located at %appdata%\Microsoft\SoundModule or SoundMixer on my case.编辑:我还发现它是一种加密货币挖掘病毒,位于我的案例中的 %appdata%\Microsoft\SoundModule 或 SoundMixer。 You should probably delete this file too.您可能也应该删除此文件。

For reference, I will add that I was able to verify that my issue was the Autorun registry key by using Win-R to bring up the "Run" dialog, and typing cmd /d (which disables any autorun per the windows docs [https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd]. This successfully opened a command prompt window.作为参考,我将补充一点,我能够通过使用Win-R调出“运行”对话框并键入cmd /d (根据 windows 文档禁用任何自动运行)来验证我的问题是自动运行注册表项 [https ://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd]. 这成功打开了命令提示符 window。

Inspecting the registry, my HKEY_CURRENT_USER\Software\Microsoft\Command Processor had Autorun as Type= REG_SZ and Data= if exist .检查注册表,我的HKEY_CURRENT_USER\Software\Microsoft\Command Processor具有Autorun as Type= REG_SZ和 Data= if exist I made a restore point, then renamed that key to AutorunOld ... and then I was able to open a command prompt without issue.我创建了一个还原点,然后将该键重命名为AutorunOld ... 然后我能够毫无问题地打开命令提示符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM