如何以编程方式查找网络路由器的模型 [英] How to find the network router's model programmatically

查看:61
本文介绍了如何以编程方式查找网络路由器的模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的本​​地网络中有一个路由器(型号:D-Link Micro Httd),我知道它的 IP 地址.我想使用 C# 以编程方式找到路由器的模型.同样在路由器上,SNMP 服务被禁用,我忘记了管理员密码.我使用了 LanSweeper NMS,它找到了模型,我还使用了 nMap 它也找到了模型.我也使用了 UPnP API,但即使它也找不到路由器.

此应用程序如何找到路由器的型号,而 SNMP 服务已禁用且我忘记了管理员密码?

解决方案

如果您可以获得设备的 MAC 地址,那么您可以使用这里的在线服务来获取针对 MAC 地址存储的关联元数据.

>

http://www.macvendorlookup.com/api

一个例子是:

http://www.macvendorlookup.com/api/v2/00-23-AB-7B-58-99

返回以下内容:

<预><代码>[{"startHex":"0023AB000000","endHex":"0023ABFFFFFF","startDec":"153192759296","endDec":"153209536511","company":"CISCO SYSTEMS, INC.","addressL1":"170 W. TASMAN DRIVE","addressL2":"M\/S SJA-2","addressL3":"SAN JOSE CA 95134-1706","国家":"美国",类型":oui24"}]

更新:但是您特别提到了型号.遗憾的是,这不会在面向公众的 API 上提供,而 UPNP 可能对您有用.但是如果路由器没有启用 UPNP 或者它被阻止,那么这也不起作用.查看 Port Mapper(用 Java 编写)以获得一些灵感.

https://github.com/kaklakariada/portmapper

I have a router in my local network (Model: D-Link Micro Httd), and I know its IP address. I want to find the model of router programattically using C#. Also on the router the SNMP service is disabled and I forgot the admin password. I used the LanSweeper NMS, and it finds the model, and also I used the nMap and it finds the model too. Also I used the UPnP APIs, but even it can't find the router.

How do this Apps find the router's model, whereas the SNMP service is disabled and I forgot the admin password?

解决方案

If you can get the devices MAC address, then you can use an online service like this one here to fetch the associated metadata stored against the MAC address.

http://www.macvendorlookup.com/api

An example would be:

http://www.macvendorlookup.com/api/v2/00-23-AB-7B-58-99

Which returns the following:

[
   {
      "startHex":"0023AB000000",
      "endHex":"0023ABFFFFFF",
      "startDec":"153192759296",
      "endDec":"153209536511",
      "company":"CISCO SYSTEMS, INC.",
      "addressL1":"170 W. TASMAN DRIVE",
      "addressL2":"M\/S SJA-2",
      "addressL3":"SAN JOSE CA 95134-1706",
      "country":"UNITED STATES",
      "type":"oui24"
   }
]

UPDATE: However you specifically mention the Model Number. Sadly this isn't going to be available on a publicly facing API and UPNP might work for you. But if the router doesn't have UPNP enabled OR it's blocked, then this won't work either. Check out Port Mapper (written in Java) for some inspiration.

https://github.com/kaklakariada/portmapper

这篇关于如何以编程方式查找网络路由器的模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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