Advertisement
Guest User

Untitled

a guest
Mar 4th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. <?php
  2. include"core.php";
  3. include"config.php";
  4. include "geoipcity.inc";
  5. header("Content-Type:text/plain");
  6. if (($_GET['id']=='')or($_GET['key']=='')) {
  7. echo'error 000000009';
  8. exit;
  9. }
  10. if (!empty($_GET['country']))
  11. $country = $_GET['country'];
  12. else
  13. $country = false;
  14. $id=$_GET[id]+0;
  15. $query = "SELECT * FROM `user` WHERE `id`='$id' ";
  16. $sql = do_query($query) or die(mysql_error());
  17. $num_rows = mysql_num_rows($sql);
  18. $row=mysql_fetch_array($sql);
  19. $login= $row['login'];
  20. $password= $row['password'];
  21. if ($_GET[key] == md5($login.$password)) {
  22. $GETonline = "";
  23. $GETonline .= parseSocks($ServerBC1, $country)."\r\n";
  24. $GETonline .= parseSocks($ServerBC2, $country)."\r\n";
  25. $GETonline .= parseSocks($ServerBC3, $country)."\r\n";
  26. $GETonline .= parseSocks($ServerBC4, $country)."\r\n";
  27. $GETonline .= parseSocks($ServerBC5, $country)."\r\n";
  28. $GETonline .= parseSocks($ServerBC6, $country)."\r\n";
  29. $ArrayIP=explode("\r\n",$GETonline);
  30.  
  31. $sql = mysql_query("select * from `user` where `id`='$id' LIMIT 1 ") or die('<meta http-equiv="refresh" content="0; url=index.php">');
  32. $count=mysql_num_rows($sql);
  33. $row=mysql_fetch_array($sql);
  34. $MaxSocks = $row['counts'];
  35.  
  36. $a=0;
  37. $b=0;
  38. $d=0;
  39. while (($a<(count($ArrayIP)))and($b<$MaxSocks)) {
  40. if ($ArrayIP[$a] != '') {
  41. $content.=$ArrayIP[$a]."\r\n";
  42. $b=$b+1;
  43. }
  44. $a=$a+1;
  45. }
  46. echo $content;
  47. } else {
  48. echo 'error 000000008';
  49. }
  50.  
  51. function parseSocks($server, $country)
  52. {
  53. $server_ip = substr($server, 0, strpos($server, ":"));
  54. $ch = curl_init();
  55. curl_setopt($ch, CURLOPT_URL, 'http://'.$server.'/online?user=-1&socks5=get');
  56. curl_setopt($ch, CURLOPT_HEADER, 0);
  57. curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  58. $s = curl_exec($ch);
  59. $socks = explode("\r\n", $s);
  60. $res = array();
  61. foreach ($socks as $sock)
  62. {
  63. $sock_ip = substr($sock, 0, strpos($sock, ":"));
  64. if ($country)
  65. {
  66. $gi = geoip_open("GeoLiteCity.dat", GEOIP_STANDARD);
  67. $geo = GeoIP_record_by_addr($gi,$sock_ip);
  68. geoip_close($gi);
  69. if (strtolower($geo->country_code) == strtolower($country))
  70. $res[] = str_replace($sock_ip, $server_ip, $sock);
  71. }
  72. else
  73. {
  74. $res[] = str_replace($sock_ip, $server_ip, $sock);
  75. }
  76. }
  77. return implode("\r\n", $res);
  78. }
  79. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement