DOS批处理脚本语言简介与详细说明

2019-09-19 07:08:23刘景俊

  用这种方法可以同时执行多条命令,而不管命令是否执行成功
  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
.  2002-05-14 23:51
..   2002-05-14 23:51 14 sometips.gif
3.  
  Usage:第一条命令    第二条命令 [   第三条命令...]
  用这种方法可以同时执行多条命令,当碰到执行正确的命令后将不执行后面的命令,
如果没有出现正确的命令则一直执行完所有命令;
  Sample:
  C:Ex4rch>dir sometips.gif    del sometips.gif
  Volume in drive C has no label.
  Volume Serial Number is 0078-59FB
  Directory of C:Ex4rch
  2002-05-14 23:55 14 sometips.gif
  1 File(s) 14 bytes
  0 Dir(s) 768,696,320 bytes free
  组合命令使用的例子:
  sample:
  @copy trojan.exe %1admin$system32 && if not errorlevel 1 echo IP %1 US
ER %2 PASS %3 >>victim.txt
四、管道命令的使用
  1.  命令
  Usage:第一条命令   第二条命令 [  第三条命令...]
  将第一条命令的结果作为第二条命令的参数来使用,记得在unix中这种方式很常见。

 sample:
  time /t>>D:IP.log
  netstat -n -p tcp find ":3389">>D:IP.log
  start Explorer
  看出来了么?用于终端服务允许我们为用户自定义起始的程序,来实现让用户运行下
面这个bat,以获得登录用户的IP。
  2.>、>>输出重定向命令
  将一条命令或某个程序输出结果的重定向到特定文件中, > 与 >>的区别在于,>会清
除调原有文件中的内容后写入指定文件,而>>只会追加内容到指定文件中,而不会改动其
中的内容。
  sample1:
  echo hello world>c:hello.txt (stupid example?)
  sample2:
  时下DLL木马盛行,我们知道system32是个捉迷藏的好地方,许多木马都削尖了脑袋往
那里钻,DLL马也不例外,针对这一点我们可以在安装好系统和必要的应用程序后,对该目
录下的EXE和DLL文件作一个记录:
  运行CMD--转换目录到system32--dir *.exe>exeback.txt & dir *.dll>dllback.txt
,
相关文章 大家在看