MENU

内网无工具扫描

October 26, 2014 • Security

一条 cmd 命令解决:

for /l %i in (1,1,255) do @ping 192.168.1.%i -w 1 -n 1 | find /i "ttl"

ping 整个 c 段,只输出有响应的主机。% H" g% Q+ _6 q- P7 t

更变态的:4 o4 g8 X- v9 x& w

域机器对应IP

FOR /F "eol=- tokens=1 delims=\ " %a IN ('net view') DO @(echo name: %a, ip: & ping %a -w 1 -n 1 | find /i "ttl" & echo.)

把 net view 的结果,挨个 ping 一遍,并输出机器名和ip地址。

找主机名

for /l %i in (1,1,255) do @ping -a 10.0.1.%i -w 1 -n 1 | find /i "Pinging"

B段查找

for /l %i in (1,1,255) do @ping -a 10.0.%i.1 -w 1 -n 1 | find /i "Pinging"

win7

for /l %i in (1,1,255) do @ping -a 10.0.1.%i -w 1 -n 1 | find /i "Pinging"
for /l %i in (1,1,255) do @ping -a 10.0.%i.1 -w 1 -n 1 | find /i "Pinging"

改成

for /l %i in (1,1,255) do @ping -a 10.0.1.%i -w 1 -n 1 | find /i "Ping"
for /l %i in (1,1,255) do @ping -a 10.0.%i.1 -w 1 -n 1 | find /i "Ping"

就可以兼容 Win7 了。(Win7 ping -a 输出结果关键词为“Ping”)

另外

findstr /i "pinging" 或 findstr /i "ping" 可以换成 findstr "[" 的  可以适合多语言环境
Archives QR Code
QR Code for this page
Tipping QR Code