PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Ok, I decided to keep track of MAC addresses of my visitors (just for security purposes)…
But I fact I have absolutely no idea how to get it from the client by using PHP…
(I only know it like this run-> cmd->ipconfig/all so it will give me my local ip, mac, subnet, gt, etc.)
So how can I get MAC address in PHP?
PS: Just in case: MAC is Media Access Control in other wards physical address of the Ethernet card (or some sort of S/N if you wish)
That would be almost 100% impossible. Especially with users using a Linksys or other firewall. Ditch this idea now and find a better way, or a way that will actually work. Even if you were to get the MAC address, you can spoof a MAC address easier than you can spoof an IP.
I don’t care whether it will be firewall or NIC MAC address I just need to have an address…
+ I don’t know what you mean by saying “spoof”, but the MAC addr. Is only one physical evidence of accessing the site… no meter what you can not change the mac addr. (only destroy the NIC physically)
IPs is like nick name I can change them all the time, but mac is your official name, you can not changed in “soft” way…
I can get remote MAC in C++ but I don’t now how to do this In php
You can spoof a MAC address in software, trust me. It's easy in Linux or Windows. I can't think of a reliable way, in any languge to get the remote MAC address of a machine, that is accessing a website. Not that I have any expirience in trying to do so.
Its not impossible to get a mac address, both windows and gnu/linux systems usually use ARP tables, so you can try to get it from something like
exec('/path/to/arp -a ipOrHost',$result);
echp join("<br>\n",$result);
But this is useless on a public webserver, as it usually contains entries from machines on the same LAN/subnets and/or the same switches/hubs only, so I would say its only usable within a small Intranet area.
as already mentioned, MAC address doesnt offer much more reliable id than the ip, it can be set by software on many nics, so if you have internal hackers and they find out you aare authing on MAC rather than on IP it is actually easier to change MAC to be someone else..
Arp tables is even easier way that I thought about… then I just can combine current subnet then global arp table then next subnet, global table etc. while I get to client computer….
+ You can only hide mac in software way, so I wouldn’t talk to OS only to device itself…
+2 Hacker should know that I tracing him my mac address… trust me people don’t change their mac so frequently as IPs
and like they said, mac is only relelvant on an INTRAnet, not an INTERnet set up
getting that adapter...it's ptrobalby impossible. if you're going to suggest something insane like the number they used to connect, know that most dial up isps have multiple lines, and that i sincerely doubt you can get more than the isp and the town the dialup bank is in
oi vey. where do some people crawl out from??????????
anyone who understand networking knows that. they also understand something you are missing entirely.
namely that once you get out of YOUR INTERNAL NETWORK you wont see mac addresses except form the last router.
that's right, you only see the mac from the last router when the packet gets sent to you unless you pull the originating one and have it sent in a higher level, in which case if i know you're doing that it's very very simple for me to write a small java or c prgram to send you what i want instead of what it really is. hell. i could write one that will let me send "<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>.youy.ouid.iot!" instead of something valid.
taking mac from the packets means you client 2 will never see client one's mac address
it will only see the router's mac
if you get it to be put into a higher level (3 or up) then it is simple to write a program to give you a fake mac address without touching my own mac address. and it's still a simple matter to CHANGE the mac address
Ok, I almost found the solution, and I even don’t need custom DLL….
Microsoft has “GETMAC” command line utility that will give you mac addresses of your company network computers, AND it also include REMOTE mac address check!!!