您当前的位置是:首页-DOS知识

批处理实现网络扫描

【发表于】:2010/11/20 23:01:00  已被访问:123次
@echo off
set /a ip0 = 192
set /a ip1 = 168
set /a ip2 = 1
set /a ip3 = 1
if exist ip.txt echo y | del ip.txt
if exist linux.txt echo y | del linux.txt
if exist windows.txt echo y | del windows.txt
:ping
ping %ip0%.%ip1%.%ip2%.%ip3% -n 1 -w 10 | find "TTL" >>ip.txt
set /a ip3 = %ip3% + 1
if %ip3% == 255 (set /a ip2 = %ip2% + 1) & (set /a ip3 = 1)
if not %ip2% == 255 goto ping
type ip.txt | find "TTL=6" >>linux.txt
type ip.txt | find "TTL=12" >>windows.txt
 
上下篇: 批处理实现网络检测 批处理实现发送网络消息

最新推荐信息