Autor
|
Tema: Obtener la MAC (Leído 10,351 veces)
|
lipman
|
Hay alguna forma de obtener la MAC del visitante? Saludoss
|
|
|
En línea
|
|
|
|
Spider-Net
Desconectado
Mensajes: 1.165
Un gran poder conlleva una gran responsabilidad
|
PHP se ejecuta del lado del servidor, no creo que puedas acceder a los datos del PC visitante como puede ser la MAC, a parte sería una vulneración de los derechos de privacidad del visitante.
|
|
|
En línea
|
|
|
|
lipman
|
Era por saber si hay alguna funcion, parecida a la de obtener la IP, para la MAC xD pero ya veo que no ^^
Gracias saludos
|
|
|
En línea
|
|
|
|
дٳŦ٭
GNU/Linux Infrastructure Specialist
Ex-Staff
Desconectado
Mensajes: 5.110
|
mmm sí... php es de lado server. Busca algo hecho en java (no js), seguro hay pero es violar la privacidad...
|
|
|
En línea
|
|
|
|
|
[u]nsigned
Desconectado
Mensajes: 2.397
JS/Node developer
|
Bueno buscando encontre esto: <? function returnMacAddress() { // This code is under the GNU Public Licence // Written by michael_stankiewicz {don't spam} at yahoo {no spam} dot com // Tested only on linux, please report bugs // WARNING: the commands 'which' and 'arp' should be executable // by the apache user; on most linux boxes the default configuration // should work fine // Get the arp executable path $location = `which arp`; // Execute the arp command and store the output in $arpTable $arpTable = `$location`; // Split the output so every line is an entry of the $arpSplitted array $arpSplitted = split("\n",$arpTable); // Get the remote ip address (the ip address of the client, the browser) $remoteIp = $GLOBALS['REMOTE_ADDR']; // Cicle the array to find the match with the remote ip address foreach ($arpSplitted as $value) { // Split every arp line, this is done in case the format of the arp // command output is a bit different than expected $valueSplitted = split(" ",$value); foreach ($valueSplitted as $spLine) { $ipFound = true; } // The ip address has been found, now rescan all the string // to get the mac address if ($ipFound) { // Rescan all the string, in case the mac address, in the string // returned by arp, comes before the ip address // (you know, Murphy's laws) foreach ($valueSplitted as $spLine) { "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f]/i",$spLine)) { return $spLine; } } } $ipFound = false; } } return false; } ?>
Pero necesitas tener un servidor dedicado donde puedas activar shell_exec(). Creo que lo mismo pasa para otros scripts... Saludos
|
|
|
En línea
|
No hay atajo ante la duda, el misterio se hace aquí... Se hace carne en cada uno, el misterio es existir!
|
|
|
дٳŦ٭
GNU/Linux Infrastructure Specialist
Ex-Staff
Desconectado
Mensajes: 5.110
|
Bueno buscando encontre esto: <? function returnMacAddress() { // This code is under the GNU Public Licence // Written by michael_stankiewicz {don't spam} at yahoo {no spam} dot com // Tested only on linux, please report bugs // WARNING: the commands 'which' and 'arp' should be executable // by the apache user; on most linux boxes the default configuration // should work fine // Get the arp executable path $location = `which arp`; // Execute the arp command and store the output in $arpTable $arpTable = `$location`; // Split the output so every line is an entry of the $arpSplitted array $arpSplitted = split("\n",$arpTable); // Get the remote ip address (the ip address of the client, the browser) $remoteIp = $GLOBALS['REMOTE_ADDR']; // Cicle the array to find the match with the remote ip address foreach ($arpSplitted as $value) { // Split every arp line, this is done in case the format of the arp // command output is a bit different than expected $valueSplitted = split(" ",$value); foreach ($valueSplitted as $spLine) { $ipFound = true; } // The ip address has been found, now rescan all the string // to get the mac address if ($ipFound) { // Rescan all the string, in case the mac address, in the string // returned by arp, comes before the ip address // (you know, Murphy's laws) foreach ($valueSplitted as $spLine) { "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f]/i",$spLine)) { return $spLine; } } } $ipFound = false; } } return false; } ?>
Pero necesitas tener un servidor dedicado donde puedas activar shell_exec(). Creo que lo mismo pasa para otros scripts... Saludos Donde usas shell_exec???
|
|
|
En línea
|
|
|
|
|
[u]nsigned
Desconectado
Mensajes: 2.397
JS/Node developer
|
Donde usas shell_exec???
Bueno, yo mismo me puse a probar el script en mi cuenta de free hosting antes de postear: http://fakx.comyr.com/prueba/mac.phpIgual en el foro de donde saque ese codigo, aclararon ROTUNDAMENTE eso. Ojo! no pretendo desafiar al MOD ni nada que se le paresca , si estoy en un error gracias por corregirme Saludos
|
|
|
En línea
|
No hay atajo ante la duda, el misterio se hace aquí... Se hace carne en cada uno, el misterio es existir!
|
|
|
Spider-Net
Desconectado
Mensajes: 1.165
Un gran poder conlleva una gran responsabilidad
|
Lo que yo no me explico es como en el code pretende sacar la MAC a través de la IP Pero si funciona la verdad es que está muy bien, yo la verdad es que no lo probé... Saludos!
|
|
« Última modificación: 4 Junio 2009, 21:59 pm por Spider-Net »
|
En línea
|
|
|
|
|
|