Best Blackhat Forum

Full Version: [GET] GEO cloaking script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
here is a quick GEO cloaking script to redirect users based on IP location.
thought maybe someone here has a use for it.
nothing special, but has its use:

Code:
<?php
/* quick and dirty GEO cloaking script
   by styx @ argo-content.com 2014 */

   $geo[0][0]='DE';
   $geo[0][1]='http://google.com';
   $geo[1][0]='US';
   $geo[1][1]='http://aol.com';

   $cnt=sizeof($geo);
   $ip=$_SERVER['REMOTE_ADDR'];
   if(isset($ip)and&ip2long($ip) !== false) {
      $fp=fsockopen("asn.shadowserver.org",43,$ern,$ers,20);
      if(!$fp) { die("$ern:$ers\n"); }
      $data="begin origin\n$ip\nend\n";
      fwrite($fp,$data);
      while(!feof($fp)) {
         $output.=fgets($fp,255);
      }
      fclose($fp);
      $out=explode('|',$output);
      $match=trim($out[4]);
      for($i=0;$i<$cnt;$i++) {
         if($match===$geo[$i][0]) {
            $u=$geo[$i][1];
            header("Location: $u");
         }
      }
   }
?>

cheers :)
nice share:)
thank you :)
thanks for this,
but got 1 question

if i want to add 3 and 4th country, i have to add this??

Code:
$geo[2][0]='US';
   $geo[2][1]='http://aol.com';

$geo[3][0]='US';
   $geo[3][1]='http://aol.com';
almost :) you need to add it like this:

Code:
$geo[2][0]='XX';
$geo[2][1]='http://aol.com';

$geo[3][0]='XY';
$geo[3][1]='http://aol.com';

as you can't have 2 times the same country :)
please post "all countries preloaded" script.

or at least tell "how to add more countries" with example.

thanks in advance.
(09-09-2015 04:50 AM)styx Wrote: [ -> ]almost :) you need to add it like this:

Code:
$geo[2][0]='XX';
$geo[2][1]='http://aol.com';

$geo[3][0]='XY';
$geo[3][1]='http://aol.com';

as you can't have 2 times the same country :)

yeah thanks man got it :)
rep added..
@star79 np :)

@gumdaj just read the previous posts, its explained there ;)
hey bro, where to edit that,
the reset of the traffic goes to what link?

it didnt mention that?
i tried making a file redirect.php

and put this code in that, it didnt work,

any suggestions??
Pages: 1 2
Reference URL's