Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include"core.php";
- include"config.php";
- include "geoipcity.inc";
- header("Content-Type:text/plain");
- if (($_GET['id']=='')or($_GET['key']=='')) {
- echo'error 000000009';
- exit;
- }
- if (!empty($_GET['country']))
- $country = $_GET['country'];
- else
- $country = false;
- $id=$_GET[id]+0;
- $query = "SELECT * FROM `user` WHERE `id`='$id' ";
- $sql = do_query($query) or die(mysql_error());
- $num_rows = mysql_num_rows($sql);
- $row=mysql_fetch_array($sql);
- $login= $row['login'];
- $password= $row['password'];
- if ($_GET[key] == md5($login.$password)) {
- $GETonline = "";
- $GETonline .= parseSocks($ServerBC1, $country)."\r\n";
- $GETonline .= parseSocks($ServerBC2, $country)."\r\n";
- $GETonline .= parseSocks($ServerBC3, $country)."\r\n";
- $GETonline .= parseSocks($ServerBC4, $country)."\r\n";
- $GETonline .= parseSocks($ServerBC5, $country)."\r\n";
- $GETonline .= parseSocks($ServerBC6, $country)."\r\n";
- $ArrayIP=explode("\r\n",$GETonline);
- $sql = mysql_query("select * from `user` where `id`='$id' LIMIT 1 ") or die('<meta http-equiv="refresh" content="0; url=index.php">');
- $count=mysql_num_rows($sql);
- $row=mysql_fetch_array($sql);
- $MaxSocks = $row['counts'];
- $a=0;
- $b=0;
- $d=0;
- while (($a<(count($ArrayIP)))and($b<$MaxSocks)) {
- if ($ArrayIP[$a] != '') {
- $content.=$ArrayIP[$a]."\r\n";
- $b=$b+1;
- }
- $a=$a+1;
- }
- echo $content;
- } else {
- echo 'error 000000008';
- }
- function parseSocks($server, $country)
- {
- $server_ip = substr($server, 0, strpos($server, ":"));
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'http://'.$server.'/online?user=-1&socks5=get');
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
- $s = curl_exec($ch);
- $socks = explode("\r\n", $s);
- $res = array();
- foreach ($socks as $sock)
- {
- $sock_ip = substr($sock, 0, strpos($sock, ":"));
- if ($country)
- {
- $gi = geoip_open("GeoLiteCity.dat", GEOIP_STANDARD);
- $geo = GeoIP_record_by_addr($gi,$sock_ip);
- geoip_close($gi);
- if (strtolower($geo->country_code) == strtolower($country))
- $res[] = str_replace($sock_ip, $server_ip, $sock);
- }
- else
- {
- $res[] = str_replace($sock_ip, $server_ip, $sock);
- }
- }
- return implode("\r\n", $res);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement