Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 9th March 2012, 05:33 AM
nehalem's Avatar
nehalem Offline
Registered User
 
Join Date: Mar 2011
Posts: 4
linuxfirefox
Post 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.
Reply With Quote
  #2  
Old 15th March 2012, 03:41 AM
lensman3 Offline
Registered User
 
Join Date: Dec 2009
Location: Centennial, Colorado USA
Posts: 128
linuxchrome
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)!
Reply With Quote
  #3  
Old 15th March 2012, 05:05 PM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,346
linuxfirefox
Re: Find MAC address from client machine

Quote:
Originally Posted by nehalem View Post
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
Reply With Quote
  #4  
Old 15th March 2012, 05:23 PM
metatron Offline
Registered User
 
Join Date: Apr 2008
Location: www.metasdata.com
Posts: 414
windows_7chrome
Re: Find MAC address from client machine

Quote:
Originally Posted by lensman3 View Post
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.
Reply With Quote
  #5  
Old 15th March 2012, 06:06 PM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,346
linuxfirefox
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 View Post
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
Reply With Quote
  #6  
Old 15th March 2012, 09:59 PM
DBelton's Avatar
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 6,620
linuxfirefox
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.
Reply With Quote
  #7  
Old 16th March 2012, 05:02 AM
nehalem's Avatar
nehalem Offline
Registered User
 
Join Date: Mar 2011
Posts: 4
windows_7firefox
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
Reply With Quote
  #8  
Old 16th March 2012, 05:26 AM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,346
linuxfirefox
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
Reply With Quote
  #9  
Old 16th March 2012, 10:57 AM
nehalem's Avatar
nehalem Offline
Registered User
 
Join Date: Mar 2011
Posts: 4
linuxfirefox
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.
Reply With Quote
Reply

Tags
address, client, mac, machine

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find the IP-ADRESS of a machine using the MAC-ADDRESS within a Subnet codingfreak Servers & Networking 11 31st May 2009 08:01 PM
No IP address for local machine manugupt1 Servers & Networking 1 31st March 2009 08:49 PM
mapping ip address to machine address, need help EUSEBIUS Servers & Networking 2 12th May 2008 05:11 AM


Current GMT-time: 02:52 (Thursday, 20-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat