如何扫描LAN网络中的设备 [英] How Scan devices in a LAN network

查看:222
本文介绍了如何扫描LAN网络中的设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在LAN网络中进行扫描以查找链接的设备。
我正在IOS中为IPAD开发应用程序
我该怎么做???

解决方案

因为这些是移动设备,我假设你想在无线网络上找到设备。从理论上讲,由于wifi使用共享介质进行通信,因此您可以被动地侦听流经网络的流量并收集有关客户端的数据,而无需发送任何数据包。这通常被称为混杂模式。实际上,网络适配器驱动程序有99%的可能性只允许您获取发往您MAC地址的流量。在这种情况下,您将需要主动扫描不是100%准确的网络子网,并且根据网络的实现方式,可以将其视为可能的攻击。<​​/ p>

简单的扫描方法是将ICMP请求(ping)发送到子网中的每个IP地址,并从发回回应答的人那里收集数据。这是不可靠的,因为某些主机即使它们处于活动状态也不会响应ICMP回应请求。首先需要找出自己的IP地址和子网掩码,并计算子网中可能的地址范围。通过使用逻辑AND运算符获取范围,其中操作数是IP地址和子网掩码的二进制值。这是一个程序的例子,计算典型的192.168.1.1子网,255.255.255.0子网掩码(CIDR表示法为192.168.1.1/24):

 地址:192.168.1.1 11000000.10101000.00000001 .00000001 
网络掩码:255.255.255.0 = 24 11111111.11111111.11111111 .00000000
通配符:0.0.0.255 00000000.00000000.00000000 .11111111

网络:192.168.1.0/24 11000000.10101000.00000001 .00000000
广播:192.168.1.255 11000000.10101000.00000001 .11111111
HostMin:192.168.1.1 11000000.10101000.00000001 .00000001
HostMax :192.168.1.254 11000000.10101000.00000001 .11111110

然后你将遍历范围并ping每个地址。您可以考虑的另一件事是监听ARP等广播流量并以这种方式收集一些信息。我不知道你想要做什么,但除了主机网络适配器的供应商之外,你不能用这种方式获得许多有用的信息。


I would like to do a scan in a LAN network to find devices linked. I'm developping an app in IOS for IPAD How do I do???

解决方案

Because those are mobile devices I will assume you want to find devices on a wireless network. Theoretically, since wifi uses shared medium for communication, you can passively listen for traffic flowing through the network and collect data about client without sending any packets. This is something that is commonly referred to as a promiscuous mode. In practice there is 99% chance that the network adapter driver will allow you only to get traffic destined for your MAC address. In that case you will need to resort to actively scanning the network subnet which is not 100% accurate and depending on how the network is implemented can be considered as a possible attack.

The simple way of scanning is sending ICMP requests (ping) to every IP address in the subnet and collecting data from those who send back the echo reply. This is not reliable because some hosts won't respond to ICMP echo request even if they are active. First thing you need is to find out your own IP address and the subnet mask, and calculate the range of possible addresses in your subnet. The range is obtained by using logical AND operator where operands are binary values of your IP address and subnet mask. This is an example from the program that calculates this for typical 192.168.1.1 subnet with 255.255.255.0 subnet mask (192.168.1.1/24 in CIDR notation):

Address:   192.168.1.1           11000000.10101000.00000001 .00000001
Netmask:   255.255.255.0 = 24    11111111.11111111.11111111 .00000000
Wildcard:  0.0.0.255             00000000.00000000.00000000 .11111111

Network:   192.168.1.0/24        11000000.10101000.00000001 .00000000
Broadcast: 192.168.1.255         11000000.10101000.00000001 .11111111
HostMin:   192.168.1.1           11000000.10101000.00000001 .00000001
HostMax:   192.168.1.254         11000000.10101000.00000001 .11111110

Then you would iterate through the range and ping every address. Another thing you can consider is listening for broadcast traffic such as ARP and collecting some of the information that way. I don't know what are you trying to make but you can't get many useful information this way, except for vendor of a host's network adapter.

这篇关于如何扫描LAN网络中的设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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