How to find the network router's model programmatically

不问归期 提交于 2019-12-11 16:53:33

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/30747309/how-to-find-the-network-routers-model-programmatically

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!