Get mac address of remote computer php

Getting real client IP address in PHP

I think it can be done. I'll come back to you. If yes, then we can build something I guess. Hi Filips, Yes that worked fine. Respone as expected. Apple's at work at the moment so I'll try that in the morning and get back to you. There is another script I've be given to try as well, some thing that came out of the Linux box discussions I had with some people.

Get MAC ADDRESS from (windows) pc on PHP · GitHub

I've got to try this in the morning as well. Being asked to try this on a win server. Will get back to you tomorrow. I have to test the code too but it look a bit like what I had in mind. It uses the arp command and then strips the mac address out. Keep me posted. Well, getting closer. Here's one working solution. Question: are you able to execute PHP on your Windows web server?

Finding the MAC and IP Address of a Device

No not on the Uni web server, but if you can get a php script to work across the internet I have a windows web server running iis6. I could simple redirect from the uni server to mine and run form and database from there. That's OK for me but I always try to work towards the "perfect" solution.

In that case you would depend on 2 machines that should work and I guess 1 machine is better. However, we'll find a way. Thanks Filips, your help is really appreciated. Would that PHP script work on a win server with php installed, can someone with such a beast check. Don't really want to install PHP possibly screwing up my web server if it's still up in the air.

The idea of getting this to work on one windows server is best, but I have a deadline of next friday and a two machine solution is better than none. Students start to move into halls on the 1st sept. There is no possilblity of getting PHP installed on the uni server. I cant believe the way this has turned out. Sounded so simple in theory. I could run this script on one of my servers they are production machines so I'll give it a try tomorrow. If you are in intranet with same subnet and have permission on the web server to run executable, this all can be combined in to a working solution.

Want us to email you occasionally with Laracasts news?

CreateObject "WScri pt. Does it give any error? If yes and all your users are on the same subnet, this should work. I can write a script for you if both these are true. Oh one more thing, the users connect to the web server directly or through a proxy? In case of proxy the arp entry would not be created. You can designate a directory for all this. In my Test. An asp script would be great I guess and when users are on the intranet I guess they are not using the proxy for internal connections.

This is the solution I was talking about but I don't have the asp knowledge. Hope it works. Yes that would avoid the 2 computers but still there are few things that needs to be verified. Permissions issue should not be a big problem. Many people have succesfully run batch files from asp application. It needs little bit of tweaking on the server. Your guess about the Proxy should be correct. Hope this is one subnet also.

  1. data doctor recovery sim card mac.
  2. swf player mac os x!
  3. os x update for mac.
  4. Is there a way to get user's MAC address.

There are in total 8 different subnets spread over a large geographical area. Plus due to firewall restrictions, there is no direct connection to the internal network. The script that you are working on is supposed to be run on web server. Similarly the WSH would also run on only web server. From a web page nothing can be run on the client machine except an ActiveX or an Java Applet. You might want to test the result of arp without any coding first. As per my understanding it would not work in your multi subnet situation.

The arp command is to be run on the web server. Ping the web server from a machine on the web server's subnet. Do arp -a on the web server and see if you get the entry of the machine that pinged web server.

You should get an entry. Now repeat the same process from a machine outside of the web server's subnet. Most likely you would not get the entry of that machine. If this is correct, the way Filips suggested and I offered to put it in an asp script, would work only for the machines on the same subnet as the web server's subnet.

DoIT Help Desk Knowledgebase

I have notices in my network that a ping was not enough to get the IP in the arp list. And yes, very sadly, it will not work on different subnet. So again, back to the roots: Ideal case: a solution that runs on the existing webserver that can get MAC's from every PC that connects to that server. Alternate case: same as ideal but running on another server. Any help or ideas are welcome.

First thing I try to find is any way to get a MAC address from any client. Status: I searched a lot and found nothing better yet. So I guess we have to use the arp command. Last possitive news was your post that the last big script above worked. Based on this script I'll try to make something that could work. I'll keep you posted. Just a reminder for myself: arp I guess it's finished. Right I now have PHP running on a windows web box. Should it be run from the linux server instead? Nope, if it returns it means that it has not found a mac address for that ip address.

Let's try something: on the server in a DOS-box type command "arp" just "arp" without parameters. Now you should see a list of ip addresses and mac addresses. Then try the tool again. If that works we only have to see that the mac addresses get stored in the arp table. If they are not there, the tool can't find them. No luck. Just typing 'arp' displays arp - help. Sorted out the IP bit. So, does this part work then?

I can get the IP address but nothing after that. OK, please run this and send me the output like you get it in your browser. I get this: Debug 1: IP Address: I guess this is OK. When you execute the "arp -a" manually on the server where the script is hosted, do you see the address Is it now in the list?

If so try the php page again and post the results please. Hint: You are using IP Is that so? You have to be on the same "local network" as the server. Yes the client is on the same subnet. It must be something that PHP does different on your and my machine. Same result. I checked afterwards and the Ip does have an entry in the arp table.

How to obtain a clients MAC address from within a web page.

Thanks for all this effort. Regards Garys. What doesn 3a say? Output is as follows Debug 1: IP Address: I had to include this as well but I forgot so please put it in as 3b and run it again. That gives this: Debug 1: IP Address: Damn, that means that the "exec "arp -a ". That is very strange. Maybe just a thought when PHP executes a command via the web it is executed by a certain user and maybe this user has not enough rights to execute this command or does not have access to the arp cache.

I launch another question for assistance. Arp-requests can only be resolved correctly, if the server AND client aren't connected over a router!

How to get Client Information, IP Address in php

The router transfers and rewrites the IP-packages and thus no arp-can be resolved. So there is no solution which works everytime on the server. I don't know if this has been mentioned before, If so forget this comment. To: hernst42 Thanks for the comment but if we do the arp -a command on the console we get all the data. Active 4 years, 5 months ago.

Viewed k times. Allen Allen 1 1 gold badge 2 2 silver badges 4 4 bronze badges. Gilles, That question is related to email. The answers in both threads differ. Its actually lack of brains.

Solution 2

The MAC address of a client (in the sense of the computer that issued a caching proxy) $_SERVER['REMOTE ADDR'] will return the IP of the proxy, I don't think you can get MAC address in PHP, but you can get IP from. Basically, you can't. The MAC address is not broadcast beyond the LAN the device is connected to - it never leaves the router and passes to the.

In short the answer will be you can't. Shiva Shiva 3 3 silver badges 8 8 bronze badges. And that short answer is wrong. The only thing is that you probably are not seeing the actual IP of a device due to NAT , if you're on separate networks. The above comment is wrong. There are some cases where ARP masquerading is configured and will reply, but it's quite rare to do that as it causes other problems.

My main point is that you can always do a lookup. And, if you're on the same network, you will always get what you were looking for. That's how the Ethernet protocol works. U-D13 I have an IP address of a computer which I am currently away from ,in the question probably meant that the user is trying to find the MAC address of a computer which is not on the same network.

Shiva "probably meant". I can be away from my colleagues computer, but we're on the same network. I can be working from home via VPN and be away from my actual work machine, yet we're still on the same network. I strongly believe your answer should be reworded to clearly indicate that one can only resolve IPs to MACs in a local network, but one can always do that. I agree too.