Client to Server MAC address transfer.

How can we transfer the client MAC address to server without using any session or HTTP concept ?

I don’t understand the last part of your question, but anyway: for security reasons, it is not possible to get the MAC address of the computer from JavaScript without using native code running in the browser (WMI = Windows Management Instrumentation? Flash plug-in? other?).

The MAC address is by definition for the local segment of the network and nothing outside the segment should care about it. It is a bad idea to try to use it e.g. for authentication as it can be configured on the client.

If the server and the client are physically on the same network segment, some low-level APIs on the server or running some utilities might give you the MAC address of a client.

       We try to authenticate the user based on the MAC address. So we would like to run small program in client system that can return MAC address to the server whenever client try to connect the server on the same network.

      Can you please suggest small program that will return the MAC address to the server system?

I would still maintain that this is not a good idea for several reasons:

  • anything sent by the client can be forged
  • MAC address of a network interface can be changed
  • it is tricky at best to get the MAC address
  • a computer can have multiple network interfaces and multiple MAC addresses

I don’t have an answer in mind for how to get it (perhaps on the server for the client IP if you really, really want to do it) and it also depends on the OS - Google is your friend.

However, for authentication, e.g. SSL/TLS with client certificates is a much more secure alternative that does not require dirty or unreliable hacks.