Getting basic information of devices that is connected to network - javascript

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

Related

send command via tcp ip through javascript

I want to achieve following functionality and need the help for the same:
I have one server on which there is device connected that prints some bar codes based on pre-formatted command given to it.
Currently there is one desktop application which generates the command and does the job.
Now I want to do this via web, meaning there will be one webpage (say .aspx) and I want to achieve this by javascript.
I am able to generate the pre-formatted command required for printing but I don't know how to send the command to server, whether socket tcp ip or something else.
I have tried using node.js, socket.io, json-socket etc. but nothing is working,
If javascript is a fixed requirement, then no I don't think you'll find a direct solution. You will need to create an intermediary service that will translate websocket protocol to the tcp/ip protocol your software communicates on. I found a package called Websockify that has implementations of this kind of bridge in a few different languages.
Although if you are open to using Flash on the front end, and can meet the security requirements on your backend connection, then Flash socket API could work. I believe Java applets can also manage this.
I don't believe this is possible to do from inside a web browser. If it were it would be a huge security vulnerability (think about it, you visit an attackers page and all of a sudden your printer starts printing and every shared directory on your network fills to the brim with junk data).
You could run the command on the server (node/.net/anything else...) and have the web platform talk to the server to kick the process off. But that sounds kind of like what you already have set up...
Alternately, if you can change the software on the connected device you could try to give it an HTTP endpoint which responds to POSTs.

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.

getting client PC computer name or mac address

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

Help with android to chrome communication

I have been working on creating an application that sends a string from an android phone to a server and from there sending it to a Chrome extension. I am sitting with a few options to continue, I can convert everything to websockets, I can use normal sockets for android to computer and websockets for extension to server, or I can do some HTTPRequest stuff.
I am looking for suggestions on the best way to pull off this communication. I have a php server an android application and a chrome extension that need to be connected. If there is a way to connect the android application to the chrome extension without the server I would be happy to hear that too.
I need something secure and something that can be organized based on the correct person asking or sending information. So when someone sends a string from the android application the server stores it (probably using their gmail) and when the extension asks for it the server sends it along.
Also could the server just push the string to the extension without the extension calling it? This would occur after the initial websocket connection. I guess it would just store the IP address or something like that.
Any suggestions or comments would be appreciated I am just trying to make the most efficient and secure system I can come up with. I have done a significant amount of research about every aspect so I'm more suffering from information overload then anything.
Thanks in advance :]
Look into Windows Communication Foundation Services (WCF). That's what I have been using for my android applications working with a database - the .NET framework is great, and the services seem to be fairly dynamic.
http://msdn.microsoft.com/en-us/netframework/aa663324

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