域渗透用的批处理

/ 0评 / 0

[task]

@echo off
setlocal ENABLEDELAYEDEXPANSION
@FOR /F "usebackq   delims=, " %%J IN (`net view /domain ^|find "命令執行成功" /v ^|find "The command completed successfully." /v ^|find "命令成功完成" /v ^|find "--" /v ^|find "Domain" /v ^|find "" /v ^|find "コマンドは正常に終了しました" /v /i`) do (
@echo =====domain:%%J========
@FOR /F "usebackq eol=;   delims=, " %%i in (`net view /domain:%%J ^|findstr "\\"`) DO (
@FOR /F "usebackq eol=; tokens=1,2,3* delims=\\" %%a in (`echo %%i`) do (
@FOR /F "tokens=1,2,3,4* usebackq delims=: " %%K IN (`@ping -a -n 1 -w 100 %%a ^|findstr "Pinging"`) do (
@echo \\%%L      %%M
)
)
)
)
pause
del %0
==============================end===================================

[/task]

发表评论

电子邮件地址不会被公开。 必填项已用*标注