Identify router model via PHP or Javascript [closed]

0

Is it possible to identify a person's router model through PHP or Javascript?

I wanted the person to access an "X" page so php or javascript would identify the router's model and store that information in txt or BD.

Is this possible?

    
asked by anonymous 27.08.2016 / 23:56

1 answer

1

There are several means but none reliable because it will not always return what is expected. An example of gambiarra that you can try is to get the IP of the user's gateway. Usually the gateway IP is the IP that takes the router administration page. But note that you will only be able to access if the user is in the same IP range of the gateway and not always the IP of the gateway takes the admin page of the router. Routers allow the user to define a custom IP band or a pre-defined set that differs from the gateway band. Making this method impracticable. And even if you access the gateway, there is no guarantee of getting the information you need.

But if you want to understand the idea is, you need to get the IP of the gateway. You can do this with JavaScript using special access permissions via browser or through JAVA plugins (JAVA is just an example, it may be another language).

With the IP of the gateway in hand, the idea is to be able to read the page that returns from the HTTP protocol.

Getting the page, try extracting the meta tags or page title. Many routers place the name and template in the <title> tag.

That's the target. Get the contents of the <title> tag.

I stress again that it is just one of several means of achieving what you want and still requires access permissions to run JavaScript plugins and scripts that are usually blocked by basic security rules. It also has a lack of assurance that the name and model of the router will be described in the HTML page according to the method quoted above.

obs: My router does not display the name, brand or model in the title tag. Instead it displays "ク イ ッ ク 設定 Web."

Other means is to use network functions. Obviously you need permissions to execute on the user. Some routers return the model as host name or local DNS. Usually the name is abbreviated in a manufacturer-defined standard. But as you can see, it is also unsure of functionality because it will not always have this information and even if it does in some cases, you still have to interpret the abbreviations.

One detail, it can rule out any attempt with users connected in 3G, 4G, 5G telephony networks. And also users of mobile devices like smartphones and tablets that obviously will not allow to do any of this. Unless you explicitly install an application that extracts data from the local network.

At the end of the day, you will have a huge job with dozens of gambiarras that are not worth the return. It is easier for a dromedary to pass through the hole of a needle.

    
28.08.2016 / 09:13