views:

679

answers:

4

Is it possible to retrieve the CPUID and MAC address of a client machine from a Ruby on Rails application?. Are there any plugins available for this?

A: 

The easiest solution should be to parse the contents of /proc/cpuinfo, and the output of /sbin/ifconfig (although you didn't mention what operating system you are using).

Martin v. Löwis
+4  A: 

I'm pretty sure it is not possible to parse the /proc filesystem of a client computer through a Rails applications (and thank God for that).

What you could do is make use of Javascript to some extent. There are quite some sites on the internet (mainly privacy scanners) which make use of Javascript to show extensive information about a client system. This might even work for the type of CPU of the client uses (assuming that is what you mean by 'CPUID').

What neither Javascript nor Rails can do for you though, is show you the MAC address of a client (assuming with 'macid' you mean a MAC address). If you take a deeper look into the way TCP/IP networking is done, you'll notice that this is by design. A computer in another network segment (say, the internet) is never intended to know your MAC address, nor does it need to.

If you really want to know someone's MAC, you'll need to use something like a Java applet or an ActiveX control (though that limits you to a certain platform). Those things should prompt your user for confirmation / permission before sending out privacy sensitive information like MAC addresses, which is a Good Thing.

wzzrd
+3  A: 

Ruby on Rails is for writing web applications. Web browsers aren't just going to hand you their computer's MAC address and CPUIDs.

R. Bemrose
A: 

If the are computers on the localhost network (intranet) you could use ruby to call some command line admin tools. For example you could do a reverse lookup on the ip address to get the computers name. Not sure about Mac Address... You might be able to call a vbscript to do that.

Kevin Kaske