Page 1 of 2
MAC address, how can I get it with PHP?
Posted: Sun Jul 13, 2003 11:01 pm
by alexus
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)
Posted: Sun Jul 13, 2003 11:28 pm
by kcomer
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.
Posted: Sun Jul 13, 2003 11:37 pm
by alexus
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
Posted: Mon Jul 14, 2003 12:36 am
by kcomer
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.
Posted: Mon Jul 14, 2003 6:40 am
by Stoker
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..
Posted: Mon Jul 14, 2003 11:36 am
by alexus
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
Posted: Mon Jul 14, 2003 11:45 am
by m3rajk
umm... unless you're on dial up, you keep your ip for months.
Posted: Mon Jul 14, 2003 11:49 am
by alexus
diel up? what is that?
yes people still use that ...
but not me I'm on T1
but dile up is enother way to trace the the user... I'll do enother post on it
Posted: Mon Jul 14, 2003 11:54 am
by m3rajk
no
post here.
it's relevant here
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
Posted: Mon Jul 14, 2003 12:23 pm
by alexus
Well Internet is a many Intranets connected together with bridges...
And even the purpose of ARPANet was to create non centralized network, the Internet was some comps that are managers for connections and DNS, arps
Posted: Mon Jul 14, 2003 12:27 pm
by m3rajk
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.
Posted: Mon Jul 14, 2003 12:36 pm
by alexus
yes, so I get from one subnet to enother, or even simpler I just trace, and go to the first router and from there obtaining my client mac,
all of this can be done in PHP if I wrire DLL for it...
Posted: Mon Jul 14, 2003 12:43 pm
by m3rajk
you don't get what i'm saying
ok.. here's the set up
***client 1***-----***router***----***client 2****
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
Posted: Mon Jul 14, 2003 12:57 pm
by alexus
Let’s start again:
I hope you agree that I will be able to get to the last router?!
Then the router and client will be on the same sub net (otherwise the client will not be able to get to the Internet)
So then I’ll send direct request to that subnet..
Well if somebody had change their mac , that will be second part (I’ll think about thet)
Posted: Mon Jul 14, 2003 5:40 pm
by alexus
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!!!