识别非计算机网络设备?
我目前正在开发一个程序,可以扫描我的网络并发现网络上的计算机和设备。我使用各种操作来查找我发现的设备上的数据,但希望将网络设备与计算机区分开来。我想知道是否有人知道我该怎么做?
我研究了一下 SNMP,并尝试连接到我的网络打印机、路由器和调制解调器。但我似乎只能连接到打印机,路由器或调制解调器都没有响应。
有没有其他方法可以识别IP地址属于哪类设备?
I'm current working on a program that scans my network and discoveres computers and devices on the network. I use various operations to find data on the devices I discover, but want to distinguish the network devices from computers. And I'm wondering if anyone knows how I could do this?
I looked a bit at SNMP, and tried connecting to my network printer, router and modem. But I seem to only be able to connect to the printer, neither the router or modem responds.
Is there another way to identify what kind of a device an IP address belongs to?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用诸如 nmap 之类的命令行工具,您可以对设备进行指纹识别,这可以为您提供各种信息。
也许您可以通过 C# 调用 nmap 并读回响应。
另一种选择是查找给定 MAC 地址的网络芯片供应商。但我不确定这会给你多少细节。
这是来自 nmap 站点的示例:
Using a command line tool such as nmap you can finger print the device which can give you all sorts of information.
Perhaps you can call nmap via c# and read back the response.
Another alternative is to look up the network chip vendor of a given MAC address. But I'm not sure how much detail that will give you.
Here is the example from the nmap site:
首先,这个答案对以太网有偏见。
这些想法也可以为其他场景提供提示。
有很多方法可以实现这一点,例如:
扫描
可能的,例如使用nmap。
优点:
缺点:
有针对性的发现
如果你的目标是映射你的网络、官方服务,你可以考虑一下他们的官方发现能力。例如CDP、SSDP、srvloc、snmp get广播等...
您必须知道您正在探测哪些服务。
优点:
缺点:
被动流量监控
曾几何时,您会发现以太网主机通过铜缆(CAT3 / CAT5)连接到集线器。
您可以在这些主机中的任何一个上运行一个程序来捕获所有流量,将以太网卡置于混杂模式,以便 NIC 将所有数据包传递给操作系统,以及 MAC 目标与主机的 MAC 地址不同的数据包。网卡。
你的程序可以分析这些原始数据,并解析里面的协议和数据包。
如今您使用以太网交换机,而不是集线器。您的电脑网卡在混杂模式下不会接收网络上的所有流量,因为交换机仅将您的主机或所有主机的数据包转发给您(广播和 - 如果注册 - 多播)。
您必须使用管理型交换机,并将其中一个端口配置为中继器或监控端口,以链接监控主机。
优点:
缺点:
这是一个简单的傻瓜发现介绍。发现工具可以混合使用两种方式来查找网络上的设备和服务。
例如,HP JetAdmin 发现使用不同的方法仅查找 HP 网络打印机和扫描仪,而不是查找 LAN 上的所有设备。
First, this answer is biased on ethernet networks.
The ideas can be tips also for other scenarios.
There is many ways to accomplish this, for example :
scanning
Possible, for example, with nmap.
Pro :
Cons:
targeted discovery
If your goal is to map your network, the official services, you can think about their official discovery capabilites. For example CDP, SSDP, srvloc, snmp get broadcast, etc...
You have to know what services you are probing.
Pro:
Cons:
passive traffic monitoring
Once upon a time, you find ethernet hosts linked with copper cables ( CAT3 / CAT5 ) to hubs.
You can run on any of these hosts a program to capture all the traffic, putting the ethernet card in promiscous mode, so the NIC pass to the operating system all the packets, also the packets with a MAC destination different than the MAC address of the NIC.
Your program can analyze these raw data, and parse the protocols and packets inside.
Nowadays you use ethernet switches, not hubs. Your pc' NIC in promiscous mode doesn't receive all the traffic on the network, because the switch forwards to you only the packets for your host or for all ( broadcast and - if registered - multicast ).
You have to use managed switches, and configured one port to be a repeater or monitor port, to link the monitoring host.
Pro:
Cons:
This is a simple discovery for dummies intro. Discovery tools can mix both ways to look for devices and services on the network.
For example, HP JetAdmin discovery uses different methods only to look for HP network printers and scanners not for all the devices on your LAN.
我的话可能看起来很简单。但大多数实现SNMP的设备都实现了MIB-II。正如您在此处看到的,在“系统”下存在一个名为“sysDescr”的条目,您可以在大部分时间使用该条目来识别设备。
My remark may look simple. But most of the device that implement SNMP implement the MIB-II. As you can see in here under it exists in 'System' an entry called 'sysDescr' the you can use most of the time to identify the device.
一般来说,您无法通过 IP 找到有关设备的更多信息。使用主机的 MAC 地址,您可以确定网络适配器的制造商。 MAC地址的前半部分是由制造商分配的。
您可以尝试使用 nmap。
Nmap(“网络映射器”)是一个免费的开源实用程序,用于网络探索或安全审核。它被设计用于快速扫描大型网络,尽管它对于单个主机也能正常工作。 Nmap 以新颖的方式使用原始 IP 数据包来确定网络上可用的主机、这些主机提供的服务(应用程序名称和版本)、它们运行的操作系统(和操作系统版本)、数据包过滤器/防火墙的类型正在使用中,以及数十个其他特性。 Nmap 可在大多数类型的计算机上运行,并且提供控制台和图形版本。 Nmap 是免费软件,可根据 GNU GPL 条款提供完整源代码。
In general you cannot find out much about a device from it's IP.Using the MAC address of the host, you could determine the manufacturer of the Network adapter. The first half of MAC addresses are assigned by manufacturer.
You could try using nmap.
Nmap ("Network Mapper") is a free open source utility for network exploration or security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. Nmap runs on most types of computers and both console and graphical versions are available. Nmap is free software, available with full source code under the terms of the GNU GPL.