除了 UDP 广播或多播之外,我还可以在 WiFI 网络上使用哪些其他方法来发现计算机? [英] Other than UDP Broadcast or Multicast, what other methods can I use on a WiFI network to discover computers?

查看:82
本文介绍了除了 UDP 广播或多播之外,我还可以在 WiFI 网络上使用哪些其他方法来发现计算机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了一个简单的 UDP ping/pong 协议来发现连接到同一 WiFI 路由器的其他计算机.这在许多 WiFI 和以太网路由器上都可以正常工作,但是当我在街上尝试时,许多公共 WiFI 网络似乎要么禁用了 UDP 广播/多播,要么完全禁用了 UDP.

I've implemented a simple UDP ping/pong protocol to discover other computers connected to the same WiFI router. This works fine on many WiFI and Ethernet routers, but when I go out on the street to give it a try, many public WiFI networks seem to have either UDP Broadcasts/Multicast disabled, or UDP disabled completely.

我还有什么其他选择可以发现连接到 WiFI 路由器的计算机?(我很想在我的网络成员之间创建一个 Ad-Hoc 网络,但这是不可能的)

What other options do I have to discover the computers connected to the WiFI router? (I'd love to create an Ad-Hoc network between the members of my network but this is not possible)

我正在考虑暴力破解 TCP 尝试(尝试打开到我子网上所有可能 IP 的连接),但这会非常昂贵,而且我必须循环多次,但仍然找不到最近连接到网络的每台机器.

I was thinking of brute forcing TCP attempts (trying to open connections to all possible IPs on my subnetwork) but this would be very costly and I would have to cycle several times and still not find every machine that's recently connected to the network.

推荐答案

没有简单的方法可以只发现计算机".但是,您可以找到几乎所有使用 ARP 请求的网络设备.

There is no easy way to discover only "computers". You can however find almost all network devices using ARP requests.

步骤是:

  1. 连接到网络
  2. 获取网络 IP 地址范围(例如:192.168.0.0/24")
  3. 为此范围内的每个可能的地址发送 ARP 请求(192.168.0.1"=>192.168.0.254")
  4. 等待回复

通常,网络设备会响应 ARP 请求,因为 IPv4 需要 ARP 才能工作.

Usually, network devices respond to ARP requests because ARP is needed for IPv4 to work.

您可以在此处找到其他资源.

You may find additional resources here.

注意:您可能需要具有管理员权限(UNIX 上的 root)才能执行此操作.发送伪造的 ARP 请求通常需要提升权限.

Note: you'll problably need to have Administrator privileges (root on UNIX) in order to do that. Sending forged ARP requests usually requires elevated privileges.

另一种方法是发送广播 ping(在 UNIX 操作系统上为 ping -b 192.168.0.255).但是 Windows 计算机(和一些其他设备)通常不会响应此类 ping.

Another way could be to send broadcast pings (ping -b 192.168.0.255 on UNIX OSes). But Windows computers (and some other devices) usually don't respond to such pings.

这篇关于除了 UDP 广播或多播之外,我还可以在 WiFI 网络上使用哪些其他方法来发现计算机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆