h0rnet

Xat ID Grabber

Apr 13th, 2013
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. <?php
  2. include "../includes/dbcon.php"; //Database connect duh.
  3. include "ips.php";
  4. include "useragents.php";
  5. date_default_timezone_set('America/Chicago');
  6. $proxyInfo = '62.122.102.170:8080';
  7. $curl = curl_init();//Init cURL :D
  8.  
  9. function output($message,$title='System') {
  10. $time = date("H:i:s", time());
  11. echo "[$title] $message\r\n";
  12. }
  13.  
  14. function get($url, $ref, $ip)
  15. {
  16. //output($url, 'GET');
  17. //Retrieves the $page with $ref as a refering page, via GET request
  18. global $curl, $useragent;
  19. //Extra headers being sent to make script look like a normal browser.
  20. $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",
  21. "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",
  22. "Accept-Language: en-us,en;q=0.5", 'X-Forwarded-For: '.$ip ,"Connection: close");
  23. $done = false;
  24. while ($done == false) {
  25. //curl options
  26. curl_setopt($curl, CURLOPT_URL, $url);
  27. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  28. curl_setopt($curl, CURLOPT_REFERER, $ref);
  29. curl_setopt($curl, CURLOPT_PUT, false);
  30. curl_setopt($curl, CURLOPT_USERAGENT, $useragent[array_rand($useragent)]);//Random useragent
  31. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  32. curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  33. curl_setopt($curl, CURLOPT_PROXY, $GLOBALS['proxyInfo']);
  34. curl_setopt($curl, CURLOPT_POST, 0); //Explicitly saying not to post information, incase prior execution had it posting.
  35. $res = curl_exec($curl); //Execute curl
  36. $http_result = curl_getInfo($curl, CURLINFO_HTTP_CODE);
  37. if (!($http_result >= "200" || $http_result <= "299")) {
  38. return false;
  39. } else {
  40. $done = true;
  41. } //end else
  42. } //wend
  43. //output($url,"Get");
  44. return $res; //return the page output.
  45. } //end get($url,$ref)
  46.  
  47. $last = array();
  48. while(true) {
  49. foreach($ips as $ip) {
  50. //If this IP has been successful in the last hour don't bother
  51. if(@$last[$ip]['time'] > (time() - 3600)) continue;
  52. if(@$last[$ip]['trials'] >= 2) {
  53. @$last[$ip]['time'] = time(); //try agian in an hour
  54. @$last[$ip]['trials'] = 0; //reset trials so it doesn't false-positive
  55. }
  56.  
  57.  
  58. $res = get("http://xat.com/web_gear/chat/auser3.php","http://xat.com/",$ip);
  59. if($res===FALSE) continue;
  60. if(strpos($res,'k2=0')!==FALSE) {
  61. @$last[$ip]['trials']++;
  62. continue;
  63. }
  64. $res = ltrim($res,'&');
  65. output($res,$ip);
  66. $info = array();
  67. parse_str($res,$info);
  68. if($info['UserId']==@$last[$ip]['u']) {
  69. @$last[$ip]['trials']++;
  70. continue;
  71. } else {
  72. @$last[$ip]['u'] = $info['UserId'];
  73. }
  74. //Add to DB
  75. $db = Database::getInstance();
  76. $ins['UserID'] = $info['UserId'];
  77. $ins['k1'] = $info['k1'];
  78. $ins['k2'] = $info['k2'];
  79. $ins['ip'] = $ip;
  80.  
  81.  
  82. try { //Will fail on unique id
  83. $db->insert('ids',$ins);
  84. @$last[$ip]['time'] = time();
  85. @$last[$ip]['trials'] = 0;
  86. } catch(Exception $e) {
  87. @$last[$ip]['trials']++;
  88. }
  89. }
  90. sleep(1);
  91. }
  92.  
  93. ?>
Advertisement
Add Comment
Please, Sign In to add comment