getting client PC computer name or mac address - javascript

i need to get computer Name or Mac address from client side who browse my website
i mad a research from 1 month ago until now i couldn't find the correct code , is it hard to do or possible ! in JavaScript or PHP ?

This post explains that this is not possible on the server side and the explanation is also given.
how to get a client's MAC address from HttpServlet?
Client side software may be able to do it but only by tricks. From pure JS this is surely not possible.
Getting MAC address on a web page using a Java applet

No, it's not possible and you need some knowledge in Computer networks to understand why.
To be able to track the MAC address of every client, you need to interact with it at the Link Layer (or OSI Layer 2). This is the case when you are the router that the client uses as a Point of access to the Internet. Not when you are just the server hosting the website the client is connecting to.
However, your server interacts with the Application Layer. At this layer, you can track your clients' UA (User Agent) but this won't identify them in a unique way.
Moreover, people can change their Wifi MAC address => on a MAC OSX, run the command "sudo ifconfig en0 lladdr 00:01:02:03:04:05"
For a good introduction to Computer Networking: https://class.stanford.edu/courses/Engineering/Networking/Winter2014/about

Related

Any way to generate a unique and predictable id of the local computer in JavaScript/Angular?

We have several computers running Microsoft Edge (no option to change the browser).
We have a central web server with pages created for each individual computer. I want users of these computers to be able to enter a single URL and be redirected to the specific page for that computer. So if I enter www.foo.com on computer A, I want to be redirected to the page www.foo.com/A.
In the past there seems to have been a way to do this by getting the private IP via WebRTC in Chrome and Firefox: Can You Get A Users Local LAN IP Address Via JavaScript?
That would also work in our case, but from what I read it is no longer possible in most browsers and has never been possible with Edge, and it indeed does not work when I try it.
We could theoretically run a service on each computer that we can fetch the ip from but that is not an option for many practical reasons.
But it doesn't need to be the IP, any unique identifier would do. Is there ANY way of generating an id that would be unique to each computer and also predictable in the backend?
It's possible to identify computer through MacAddress and there was a way to get mac address in old versions of IE(through ActiveX, you can find solutions), but now it's not possible and there is a reason for that - security.
I think, you should place this logic about redirecting to the server, e.g. for nginx you can add list of rules where you can tell, where every mac address should go.

Need to send ASCII string from website to PC via UDP

I'm looking for some ideas on how to approach this challenege.
I have a tablet that I'm using as a remote control to trigger software on a PC.
The trigger is an ASCII string that has to be sent via UDP.
The network is closed, no protection or security enabled. The server has a static IP.
I've built the website and created all the functions but haven't found a great way to actually send the text from the website to the PC.
I'm thinking that node.js -- which I have no experience with -- is the only way to do this but I'd appreciate some other thoughts.
Thanks.
Dave

Getting basic information of devices that is connected to network

Base of my question: I am trying to create a simple code that can list basic information of a device that is connected to a network. For example, I have a wireless router, and there is a device(Mobile Phone) connected via wireless connection, and a device(Laptop/Desktop) that is connected via LAN. Now I want to find out what kind of device it is, also: the IP address, MAC address, processor, RAM, HDD/Internal Storage, Flash Drive(if connected) and let's say hardware manufacturer (If possible) etc..
Now I already have searched for these, and I found that this can be done by .NET, but I am thinking that this would be better if I can access this via web so even I'm at the office/work I can check the devices that are connected to our network. So I decided to do this using PHP, but don't know how to begin because I only have little knowledge of PHP, anyone can give me a sample of what I am tryng to achieve? Or any better reference on getting information of connected device on network via PHP?
PHP is a server side scripting language.
It will not allow you to enumerate connected devices due to security reasons.
Take a look at PHP with NMAP:
https://nmap.org/
Some examples to look at:
How to use Nmap in PHP exec
PHP trim nmap MAC address

Detect local devices using HTML5 websocket

I'm working on a project which uses HTML5 WebSockets to connect with an iOS App. I need to display a list of near by (within the same local WiFi network) iPhones/iPads inside the webpage.
Is it possible to use any discovery mechanism like Bonjour to achieve this?
Is there any way to detect the local IP address from the website (using Javascript or from server side script) so that I can scan the local IP range?
If you're only looking to match devices on the same network, you could just check the public IP, since everyone connected to the same router will likely share one. That said, while a native iOS app should be able to detect a local IP address, I don't know of any way to do so using Javascript.
The one exception is if you have a server running inside the local network (or a custom binary running on their machine). It doesn't sound from your description like this is an option for you, but in case it is, a server within the user's LAN will see their local IP rather than their public IP. It could then relay that to a public server if needed.
I'd love to be proven wrong though, because I could think of some really cool things to do if it were possible.

Can I find the BSSID (MAC address) of a wireless access point from an HTTP request?

Let's say someone is setting in a coffee shop wireless connected to the internet and they send an HTTP request to johnsveryownserver.com. Server-side, is there any way that I can determine the MAC address of the wireless access point that they are connected to? (Note that I am not interested in the MAC address of their machine.)
If I can't do this with a plain old HTTP request, is there anything I can do in-browser (e.g. via javascript) in order to scan for the MAC addresses of any nearby wireless access points? This might even be better because I can collect all nearby wireless MAC addresses.
I'm trying to avoid having the user download a plugin or an independent executable.
No, you can't. Using a plugin is your only option (it may be possible with Java, but that's outside my area of expertise).
I'll say this might be possible because there are people far smarter than me.
However, it is hard enough to get the local MAC address by querying WMI using client side scripting, let alone attempt to query past the local machine. I'm confident in saying that this is not currently possible to accomplish, and if you do, you'll be missing out on a large set of data due to browser security settings halting your script.

Categories

Resources