Ver Mensaje Individual
  #5 (permalink)  
Antiguo 15/05/2020, 09:46
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 19 años, 10 meses
Puntos: 834
Respuesta: Conocer datos de usuario

Lo de obtener un identificador único del equipo es algo que ha desvelado a muchos desde hace tiempo. Una técnica vía javascript llamada Canvas Fingerprint se describe aquí: https://browserleaks.com/canvas#how-does-it-work Se basa en las sutiles diferencias o entropía que se dan en la salida de una imagen generada por el elemento canvas de html5. Aunque el resultado no es totalmente exclusivo, como mencionan aquí: https://en.wikipedia.org/wiki/Canvas_fingerprinting, sumado a la ip y/o a otras técnicas existentes similares (AudioContext fingerprint, webGL fingerprint) puede brindar un identificador bastante confiable.
Dejo un ejemplo en javascript:
Código:
<script>
"use strict";
function bin2hex (s) {
  // From: http://phpjs.org/functions
  // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  // +   bugfixed by: Onno Marsman
  // +   bugfixed by: Linuxworld
  // +   improved by: ntoniazzi (http://phpjs.org/functions/bin2hex:361#comment_177616)
  // *     example 1: bin2hex('Kev');
  // *     returns 1: '4b6576'
  // *     example 2: bin2hex(String.fromCharCode(0x00));
  // *     returns 2: '00'

  var i, l, o = "", n;

  s += "";

  for (i = 0, l = s.length; i < l; i++) {
    n = s.charCodeAt(i).toString(16)
    o += n.length < 2 ? "0" + n : n;
  }

  return o;
}
var canvas=document.createElement('canvas');
var txt = "BrowserLeaks,com <canvas> 1.0";
var ctx = canvas.getContext('2d');
ctx.textBaseline = "top";
ctx.font = "14px 'Arial'";
ctx.textBaseline = "alphabetic";
ctx.fillStyle = "#f60";
ctx.fillRect(125,1,62,20);
ctx.fillStyle = "#069";
ctx.fillText(txt, 2, 15);
ctx.fillStyle = "rgba(102, 204, 0, 0.7)";
ctx.fillText(txt, 4, 17);
var b64 = canvas.toDataURL().replace("data:image/png;base64,","");
var bin = atob(b64);
var myDeviceId = bin2hex(bin.slice(-16,-12));
alert(myDeviceId);
</script>
De obtención de IP hay varios códigos por ahí en php. Este es de https://stackoverflow.com/questions/...-from-visitor:
Código PHP:
<?PHP

function getUserIP()
{
    
// Get real visitor IP behind CloudFlare network
    
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
              
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
              
$_SERVER['HTTP_CLIENT_IP'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
    }
    
$client  = @$_SERVER['HTTP_CLIENT_IP'];
    
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
    
$remote  $_SERVER['REMOTE_ADDR'];

    if(
filter_var($clientFILTER_VALIDATE_IP))
    {
        
$ip $client;
    }
    elseif(
filter_var($forwardFILTER_VALIDATE_IP))
    {
        
$ip $forward;
    }
    else
    {
        
$ip $remote;
    }

    return 
$ip;
}


$user_ip getUserIP();

echo 
$user_ip// Output IP address [Ex: 177.87.193.134]


?>

Última edición por Panino5001; 15/05/2020 a las 09:52