 |
 |
 |
 |
| Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc. |

9th March 2012, 05:33 AM
|
 |
Registered User
|
|
Join Date: Mar 2011
Posts: 4

|
|
Find MAC address from client machine
I need some help for our final year project from you guys. We are are implementing security measures for a banking system, so it is required that we track the MAC address of the registered clients[like online bank users] along with other parameters. How do we get the MAC address from client machine using JSP or running scripts in client side?
We've already done something using getHostAddress() method, but the problem is, it only shows the MAC if user is disconnected from internet, and we can't get MAC addr if someone is using wireless data card. So, please help. Thanks in advance.
Last edited by nehalem; 9th March 2012 at 05:36 AM.
|

15th March 2012, 03:41 AM
|
|
Registered User
|
|
Join Date: Dec 2009
Location: Centennial, Colorado USA
Posts: 128

|
|
|
Re: Find MAC address from client machine
"arp" will give you the MAC address of hosts on your local network (collision domain). However, arp addresses expire in about 30 seconds on the local network. You can't get MAC addresses from machines that are beyond the first default gateway! Though I suspect ipv6 uses MAC addresses for IP address which I think puts a firewalled network's address out on the Internet.
ifconfig will give the hardware address of your own machine.
You might go looking in /proc/net for info. A lot of kernel modules put stuff out there for reading if you have the privileges.
I hope this is the question you wanted answer (but I don't think it is)!
|

15th March 2012, 05:05 PM
|
 |
Registered User
|
|
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,346

|
|
|
Re: Find MAC address from client machine
Quote:
Originally Posted by nehalem
I need some help for our final year project from you guys. We are are implementing security measures for a banking system, so it is required that we track the MAC address of the registered clients[like online bank users] along with other parameters. How do we get the MAC address from client machine using JSP or running scripts in client side?
We've already done something using getHostAddress() method, but the problem is, it only shows the MAC if user is disconnected from internet, and we can't get MAC addr if someone is using wireless data card. So, please help. Thanks in advance.
|
Many problems with this idea.
MAC addresses only occur on IEEE802.1 media. So someone connecting via a dial-up modem, or a 3G/4G cell phone network doesn't have a MAC address.
MAC addresses are only relevant on an 802.1 media LAN. As so as you get to a router the LAN/MACs are stripped and replaced with the router MAC on the adjacent. In modern networks your packets (often above the 802 wrapper) are sent via all sorts of non-802 mechanisms. Docsis cable modems and ATM telephone networks and who knows what else.
So a bank website for example typically has zero useful MAC addresses to distinguish users. This is different from say a hotel's wifi service which will see the end-user's MAC.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
|

15th March 2012, 05:23 PM
|
|
Registered User
|
|
Join Date: Apr 2008
Location: www.metasdata.com
Posts: 414

|
|
|
Re: Find MAC address from client machine
Quote:
Originally Posted by lensman3
Though I suspect ipv6 uses MAC addresses for IP address which I think puts a firewalled network's address out on the Internet.
|
While this is true for the default of some ipv6 implementations, due to the problems this could cause, there are ways of getting around this. So extracting MAC addresses from ipv6 addresses is not a reliable way of getting them.
Answer for the OP is because MAC addresses are only used for Layer 2 communication, the client MAC address is only needed until it hits the client's gateway. Once there, a new frame is created for communication from that device to it's next hop and no longer contains the client's MAC address as the source, but it's own instead... and so on until it reaches the destination.
|

15th March 2012, 06:06 PM
|
 |
Registered User
|
|
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,346

|
|
|
Re: Find MAC address from client machine
ip neigh is the non-deprecated version of 'arp' and this dumps the system's arp table.
---------- Post added at 01:06 PM ---------- Previous post was at 01:02 PM ----------
Quote:
Originally Posted by metatron
While this is true for the default of some ipv6 implementations, due to the problems this could cause, there are ways of getting around this. So extracting MAC addresses from ipv6 addresses is not a reliable way of getting them.
Answer for the OP is because MAC addresses are only used for Layer 2 communication, the client MAC address is only needed until it hits the client's gateway. Once there, a new frame is created for communication from that device to it's next hop and no longer contains the client's MAC address as the source, but it's own instead... and so on until it reaches the destination.
|
Accurate on IEEE802.1 media and a few others, but not generally.. The lower layers can be entirely different with no concept of a 'MAC'.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
|

15th March 2012, 09:59 PM
|
 |
Administrator
|
|
Join Date: Aug 2009
Posts: 6,620

|
|
|
Re: Find MAC address from client machine
About the only way you could possibly get a MAC address would be to run an application on the client system and have it send the information to you. I don't think javascript running in a web browser would work for this, either, since it's pretty much locked out of that type of information for security purposes.
Microsoft's leaky ActiveX might be able to get that information on Windows systems, but I'm not certain, and don't really know how you could get in on a linux machine from a web browser.
|

16th March 2012, 05:02 AM
|
 |
Registered User
|
|
Join Date: Mar 2011
Posts: 4

|
|
|
Re: Find MAC address from client machine
Thank you guys for all your help, much appreciated and sorry for my late reply.
We can now find MAC address of our local machine correctly. But as DBelton pointed out, we are to run this app on a client machine. We searched for it and there are(hypothetically) 2 approaches, using applet or js.
As far as the info I got, js can only get ip, not MAC, so we are stuck with applet. But i saw in stackoverflow that applet is prohibited to get MAC by (browser+ jvm) sandboxing, so i'm stuck again
|

16th March 2012, 05:26 AM
|
 |
Registered User
|
|
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,346

|
|
|
Re: Find MAC address from client machine
No idea why this is so hard to understand.
A/ Not all client interfaces have a MAC address.
B/ The MAC address does not generally cross gateways or routers.
C/ The ability to get a client MAC by executing some code on the client represents a security error and even if it's present on some OSes, it won't be available generally, and isn't a practical approach.
No idea why you want the MAC, but you need to rethink that approach.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
|

16th March 2012, 10:57 AM
|
 |
Registered User
|
|
Join Date: Mar 2011
Posts: 4

|
|
|
Re: Find MAC address from client machine
@stevea
I guess I've to agree with you, learned it the hard way... and thanks for the help.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 02:52 (Thursday, 20-06-2013)
|
|
 |
 |
 |
 |
|
|