PHP - you can find out if the user is browsing from behind the router and gets information about the router

Hi guys.

I think this is not possible just using PHP, but to be sure.

  • Is it possible for PHP to know the user is accessing the network because of a Router ?
  • And if so, how can I get some information about this router, for example:
    • Router name, brand, serial number, ...
    • Users connected on the same network.
  • Can PHP find the local IP address? Address for the visitor on this Network?

A few simple questions. To which I did not find a reliable answer, and I firmly said that some ingenious PHP could tell me. And teach me.

Thanks for your help.

EDIT: Motives for this secret privacy issue.

I didn’t think I should have said that ... But I think I do

I am writing a couple of functions that will receive the preferred browser languages ​​and find out which country the user comes from based on IP in order to deliver the contents of their site in the right language to the visitor.

Then I began to think that most people browse because of the router, can I find out if they really are?


Then it occurred to me to make one of those simple programs that display information about the network, people connected to your network. My idea was to do this, but a non-desktop based web application based on all other programs of this kind.

I value privacy above all, as most developers do, so I understand how Down Down I would probably vote myself.

Sorry, if you underestimated me because of my strange question, I have nothing to do ... These things just appeared on my head.

+4
source share
3 answers

First, are you talking about discovering information about users visiting your site? Keep in mind that this implies an invasion of their privacy (you can try it with yourself, though;))

Is it possible for PHP to know if a user is logging out of the Internet from behind a router?

No, you can’t. Only when you know that, for example, you have many visitors from the same company, and they all have the same IP address, they can be behind the router, but it can also be a proxy server.

And if so, how can I get some information about this router, for example:

  • Router name, brand, serial number, ...

If you have an IP address, you can discover various things about the host with tools like nmap . You could find out the brand of the router and the host system, but definitely not the serial number and such things. nmap is not PHP. Note: Using such tools without permission is prohibited in some countries. In any case, the use of such tools without permission is morally questionable.

  • Users connected on the same network.

As I mentioned in the first question, if you have different users with the same IP address, they can be on the same network. They can also be on different subnets. In any case, you cannot get your local IP addresses.

Can PHP also find the local IP address for a visitor on this network?

See previous answer.


You see, everything is very vague and basically based on assumptions. You cannot receive reliable information, and I am very glad that we are not yet completely transparent.

Once we all use IPv6 , the whole story is different.

+7
source

I have no idea what you're trying to do, but it bothers me a bit.

Therefore, I am glad that (as you suspected) this is impossible.

All the details that you are asking about are information that there is no reason for those who are outside the local network, this would be a huge security problem if the router passed this to the world.

+5
source

This is not possible by the design of network protocols. However, some routers use special PHP assemblies in their admin control panels.

0
source

Source: https://habr.com/ru/post/1305810/


All Articles