Identify router template via PHP or Javascript

Asked

Viewed 383 times

0

You can identify a person’s router model through PHP or Javascript?

I wanted when the person accesses a "X" page php or javascript to identify which is the model of its router and save this information in txt or BD.

That’s possible ?

  • 2

    If PHP runs inside the person’s network, and has access to internal Ips, it would be the case to access the router page and try to identify. But for that you would have to devise a suitable verification method for each model. To put it simply, the best answer would be "no, you don’t have it and thank God you don’t, for the sake of privacy and security". Within very limited conditions, and far from the ideal "you can identify in some specific cases", but in general, it would suck the result.

  • Would you have an example of how I can check in these "one-off cases"? Just so I have an idea, because I have no idea how to start.

  • @Mark I think he meant, don’t start because it won’t work.

1 answer

1


There are several means but no reliable because it will not always return what is expected. An example of gambiarra you can try to do is get the IP of the user gateway. Normally 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 as the gateway and the IP does not always take the router admin page. Routers allow the user to define a custom IP range or a preset set that differs from the gateway range. Making this method unviable. 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 gateway IP. You can do this with Javascript using special browser access permissions or through JAVA plugins (JAVA is a mere example, it could be another language).

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

Getting the page, try to extract the metatags or page title. Many routers put the name and template in the tag <title>.

That’s the target. Get the content from the tag <title>.

I stress again that it is only one of several means of achieving what you want and yet requires access permissions for running Javascript plugins and scripts that are usually blocked by basic security standards. And still has the lack of assurance that the name and model of the router will be described in the HTML page as above mentioned method.

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. You obviously need permissions to run on the user. Some routers return the model as host name or local DNS. Usually the name is abbreviated in a default defined by the manufacturer. But as you can see it’s also insecure about functionality because you won’t always have that information and even if you do in some cases, you’ll still have to interpret the abbreviations.

A detail, can rule out any attempt with connected users in 3G, 4G, 5G telephony networks. And also mobile users like smartphones and tablets that obviously won’t allow you 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’ll have a huge job with dozens of scammers that aren’t worth the return. It’s easier for a dromedary to go through the orifice of a needle.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.