CMD 标签文章 - 李海鑫个人博客

(2008-4-30)Windows 命令行下扫描IP地址

编辑文章 没有评论 :

点击《开始》–>《运行》输入 CMD 按回车,打开命令行窗口

本文HTML永久地址 doc

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>for /l %p in (1,1,254) do @ping 192.168.1.%p
-n 1 -l 16 -w 20 |find "reply from" /I     ←循环ping一个网段,前面是小写的L,后面是大写的i
Reply from 192.168.1.1: bytes=16 time=1ms TTL=64
Reply from 192.168.1.2: bytes=16 time<1ms TTL=64
Reply from 192.168.1.6: bytes=16 time<1ms TTL=128

C:\Documents and Settings\Administrator>for /l %a in (1,1,254) do start /min
/low telnet 192.168.1.%a

start参数中的min表示窗口开始时最小化,low表示程序运行时的优先级。如果start后不跟参数则运行后会生成一个新的DOS窗口,start具体的参数使用可是使用“start /?”查看。“telnet 192.168.1.%a”表示一个命令,从%a参数中读取IP地址的最后一个数字。其运行原理就是将IP值做成循环,避免手工输入,运行命令后,会在任务栏上开254个小窗口,然后telnet链接失败的窗口会在大约5秒后自动退出,开放23端口的IP地址会在telnet窗口显示

(2008-4-30)Windows 命令行下修改IP地址

编辑文章 没有评论 :

点击《开始》-->《运行》输入 CMD 按回车,打开命令行窗口

本文HTML永久地址doc

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\lihaixin>ipconfig /all  ←查看IP相关配置

Windows IP Configuration

    Host Name . . . . . . . . . . . . : lhx
    Primary Dns Suffix  . . . . . . . :
    Node Type . . . . . . . . . . . . : Unknown
    IP Routing Enabled. . . . . . . . : No
    WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter 本地连接:    ←网卡名称,下面命令要用到

    Connection-specific DNS Suffix  . :
    Description . . . . . . . . . . . : Broadcom NetLink (TM) Fast Ethernet
    Physical Address. . . . . . . . . : 00-1B-38-A4-02-9B
    Dhcp Enabled. . . . . . . . . . . : No
    IP Address. . . . . . . . . . . . : 192.168.1.12   ←原来网卡IP地址
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . : 192.168.1.1
    DNS Servers . . . . . . . . . . . : 202.96.128.166
                                        202.96.128.86
    NetBIOS over Tcpip. . . . . . . . : Disabled

Ethernet adapter {BB84C057-824E-4EFA-BB64-BCFB7A093B69}:

    Media State . . . . . . . . . . . : Media disconnected
    Description . . . . . . . . . . . : TAP VPN Adapter - 数据包计划程序微型
端口
    Physical Address. . . . . . . . . : 00-FF-BB-84-C0-57

运行netsh修改IP地址或网关

C:\Documents and Settings\lihaixin>netsh interface ip set address name=本地连接source=static 192.168.1.8 255.255.255.0 192.168.1.1 1 ←修改IP地址为192.168.1.8确定。

重新查看IP地址

C:\Documents and Settings\lihaixin>ipconfig /all  ←查看IP相关配置

Windows IP Configuration

    Host Name . . . . . . . . . . . . : lhx
    Primary Dns Suffix  . . . . . . . :
    Node Type . . . . . . . . . . . . : Unknown
    IP Routing Enabled. . . . . . . . : No
    WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter 本地连接:

    Connection-specific DNS Suffix  . :
    Description . . . . . . . . . . . : Broadcom NetLink (TM) Fast Ethernet
    Physical Address. . . . . . . . . : 00-1B-38-A4-02-9B
    Dhcp Enabled. . . . . . . . . . . : No
    IP Address. . . . . . . . . . . . : 192.168.1.8  ←已经修改网卡IP地址
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . : 192.168.1.1
    DNS Servers . . . . . . . . . . . : 202.96.128.166
                                        202.96.128.86
    NetBIOS over Tcpip. . . . . . . . : Disabled

Ethernet adapter {BB84C057-824E-4EFA-BB64-BCFB7A093B69}:

    Media State . . . . . . . . . . . : Media disconnected
    Description . . . . . . . . . . . : TAP VPN Adapter - 数据包计划程序微型
端口
    Physical Address. . . . . . . . . : 00-FF-BB-84-C0-57

C:\Documents and Settings\lihaixin>