How to find the network router's model programmatically

1.2k views Asked by At

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

There are 1 answers

2
Daniel Maclean On

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