Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "../includes/dbcon.php"; //Database connect duh.
- include "ips.php";
- include "useragents.php";
- date_default_timezone_set('America/Chicago');
- $proxyInfo = '62.122.102.170:8080';
- $curl = curl_init();//Init cURL :D
- function output($message,$title='System') {
- $time = date("H:i:s", time());
- echo "[$title] $message\r\n";
- }
- function get($url, $ref, $ip)
- {
- //output($url, 'GET');
- //Retrieves the $page with $ref as a refering page, via GET request
- global $curl, $useragent;
- //Extra headers being sent to make script look like a normal browser.
- $headers = array("Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
- "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",
- "Accept-Language: en-us,en;q=0.5", 'X-Forwarded-For: '.$ip ,"Connection: close");
- $done = false;
- while ($done == false) {
- //curl options
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl, CURLOPT_REFERER, $ref);
- curl_setopt($curl, CURLOPT_PUT, false);
- curl_setopt($curl, CURLOPT_USERAGENT, $useragent[array_rand($useragent)]);//Random useragent
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($curl, CURLOPT_PROXY, $GLOBALS['proxyInfo']);
- curl_setopt($curl, CURLOPT_POST, 0); //Explicitly saying not to post information, incase prior execution had it posting.
- $res = curl_exec($curl); //Execute curl
- $http_result = curl_getInfo($curl, CURLINFO_HTTP_CODE);
- if (!($http_result >= "200" || $http_result <= "299")) {
- return false;
- } else {
- $done = true;
- } //end else
- } //wend
- //output($url,"Get");
- return $res; //return the page output.
- } //end get($url,$ref)
- $last = array();
- while(true) {
- foreach($ips as $ip) {
- //If this IP has been successful in the last hour don't bother
- if(@$last[$ip]['time'] > (time() - 3600)) continue;
- if(@$last[$ip]['trials'] >= 2) {
- @$last[$ip]['time'] = time(); //try agian in an hour
- @$last[$ip]['trials'] = 0; //reset trials so it doesn't false-positive
- }
- $res = get("http://xat.com/web_gear/chat/auser3.php","http://xat.com/",$ip);
- if($res===FALSE) continue;
- if(strpos($res,'k2=0')!==FALSE) {
- @$last[$ip]['trials']++;
- continue;
- }
- $res = ltrim($res,'&');
- output($res,$ip);
- $info = array();
- parse_str($res,$info);
- if($info['UserId']==@$last[$ip]['u']) {
- @$last[$ip]['trials']++;
- continue;
- } else {
- @$last[$ip]['u'] = $info['UserId'];
- }
- //Add to DB
- $db = Database::getInstance();
- $ins['UserID'] = $info['UserId'];
- $ins['k1'] = $info['k1'];
- $ins['k2'] = $info['k2'];
- $ins['ip'] = $ip;
- try { //Will fail on unique id
- $db->insert('ids',$ins);
- @$last[$ip]['time'] = time();
- @$last[$ip]['trials'] = 0;
- } catch(Exception $e) {
- @$last[$ip]['trials']++;
- }
- }
- sleep(1);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment