有没有办法在 Windows 上进行 ARP ping?

Eti*_*mps 28 windows arp ping

在 Linux 和其他系统上,有一个名为 arping 的实用程序,可用于发送 ARP 请求(“ping”)并显示答案,很像“ping”实用程序,但使用 ARP 而不是 ICMP。

有没有办法在 Windows 上做同样的事情?(我使用 Windows 7)

小智 15

如果您清除 Window 的 arp 缓存 ( arp -d ),然后尝试 ping ip 地址,它将发出 arp 广播。

使用 Wireshark 进行检查。

  • @Pacerier:是的,因为 ICMP(ping)建立在 IP 层之上。IP 层需要给定 IP 地址的硬件地址,以便知道将其数据包发送给谁。如果 ARP 缓存为空,IP 层将别无选择,只能在发送数据包之前发出 ARP 请求。 (2认同)

Rya*_*ner 15

Windows 的 Arping 确实存在。

http://freshmeat.net/projects/arping/

更正:这适用于 Linux、MAC OSX 等...但可以通过 cygwin 安装在 Windows 上。


spa*_*rks 9

在 Windows 中执行此操作的内置方法:

cmd /V /C "set "IP=10.0.2.2" & FOR /L %i in () do @ping -n 1 -w 1000 "!IP!" >NUL & arp -a | findstr /c:"!IP! "  
Run Code Online (Sandbox Code Playgroud)

如果你想每次都显示一个新的ARP结果(需要以管理员身份运行)

cmd /V /C "set "IP=10.0.2.2" & FOR /L %i in () do @arp -d & @ping -n 1 -w 1000 "!IP!" >NUL & arp -a | findstr /c:"!IP! "
Run Code Online (Sandbox Code Playgroud)


小智 6

WinXP 的 ARP 命令仅用于显示数据。试试 Nmap,它是免费的,而且很容易进行这种类型的扫描。Nmap 可在 insecure.org 上获得。

  • 这可能是我最接近 arping 实用程序的方法(使用 nmap -PR -sP <host>)。恭喜你,你赢了。 (5认同)

Val*_*mas 5

尝试“arp-ping.exe”

以为我会添加这个直接从命令提示符运行的工具:

arp-ping.exe 命令行选项

Usage: arp-ping.exe [options] target
        -s ip : specify source ip
        -n X  : ping X times
        -t    : ping until stopped with CTRL-C
        -x    : exit immediately after successful ping
        -i X  : ping every X seconds
        -d    : do an 'arp -d *' between pings (requires Administrator)
                (-d prevents cached ARP responses on Windows XP.)
        -c    : include date and time on each line
        -m X  : ignore failures that take less than X milliseconds
        -.      : print a dot (.) for every ignored failure
        -l    : print debug log
        -v    : print version and exit
Run Code Online (Sandbox Code Playgroud)

与 Linux 的“arping”命令行选项对比

Usage: arping [-fqbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination
-f : quit on first reply
-q : be quiet
-b : keep broadcasting, don't go unicast
-D : duplicate address detection mode
-U : Unsolicited ARP mode, update your neighbours
-A : ARP answer mode, update your neighbours
-V : print version and exit
-c count : how many packets to send
-w timeout : how long to wait for a reply
-I device : which ethernet device to use (eth0)
-s source : source ip address
destination : ask for what ip address
Run Code Online (Sandbox Code Playgroud)