<?PHP
function mid($atext,$start,$olength){
$outx="";
for ($k=0;$k<$olength;$k++){
$outx=$outx.$atext[$start+$k-1];
}
return $outx;
}
function BaseShuffle($sStr, $ShuffleMap){
$mpmem = Explode(",",$ShuffleMap);
$baseout="";
For ($shfi=1;$shfi<21;$shfi++){
$baseout = $baseout . mid($sStr, $mpmem[$shfi - 1], 1);
}
return $baseout;
}
function MapShuffle($sStr,$sMap) {
$ccount = intval(strlen($sStr) / 20);
$Shuffleout="";
For ($ispf=1;$ispf<$ccount+1;$ispf++){
$Shuffleout = $Shuffleout . BaseShuffle(mid($sStr, ($ispf - 1) * 20 + 1, 20),$sMap);
}
$Shuffleout = $Shuffleout . mid($sStr, $ccount * 20 + 1, strlen($sStr) - $ccount * 20);
return $Shuffleout;
}
?>
<?php
if (getenv('HTTP_CLIENT_IP'))
$ip = getenv('HTTP_CLIENT_IP');
else if(getenv('HTTP_X_FORWARDED_FOR'))
$ip = getenv('HTTP_X_FORWARDED_FOR');
else if(getenv('HTTP_X_FORWARDED'))
$ip = getenv('HTTP_X_FORWARDED');
else if(getenv('HTTP_FORWARDED_FOR'))
$ip = getenv('HTTP_FORWARDED_FOR');
else if(getenv('HTTP_FORWARDED'))
$ip = getenv('HTTP_FORWARDED');
else if(getenv('REMOTE_ADDR'))
$ip = getenv('REMOTE_ADDR');
else
$ip = 'UNKNOWN';
$url = 'https://proxies-beinmena.portail.alphanetworks.be/proxy/login';
$username = $_GET['email'];
$password = $_GET['password'];
$data = array('email' => $username,'password' => $password);
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Host: proxies-beinmena.portail.alphanetworks.be\r\nConnection: keep-alive\r\nAccept: */*\r\nX-AN-WebService-IdentityKey: swezezavave3r5brujeWruchabuvejup\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36\r\nContent-Type: application/x-www-form-urlencoded; charset=UTF-8\r\nDNT: 1\r\nAccept-Encoding: gzip, deflate, br\r\nAccept-Language: en-US,en;q=0.9",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
echo 'Error in email or password';
exit;
}
//var_dump($result);
$json = json_decode($result, true);
$frsttk = $json['result']['newAuthToken'];
echo "First : ",$frsttk,"<br>" ;
$url = 'https://proxies-beinmena.portail.alphanetworks.be/proxy/casAvailableDevice';
$data = array('territory' => 'MENA', 'custToken' => $frsttk);
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Host: proxies-beinmena.portail.alphanetworks.be\r\nConnection: keep-alive\r\nAccept: */*\r\nX-AN-WebService-IdentityKey: swezezavave3r5brujeWruchabuvejup\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36\r\nContent-Type: application/x-www-form-urlencoded; charset=UTF-8\r\nDNT: 1\r\nAccept-Encoding: gzip, deflate, br\r\nAccept-Language: en-US,en;q=0.9\r\nX-AN-WebService-CustomerAuthToken:{$frsttk}",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
echo 'ERROR 2';
exit;
}
$json = json_decode($result, true);
$deviceID = $json['result']['device'][rand(0,count($json['result']['device'])-1)]['uniqueDeviceId'];
if($deviceID == ''){
echo 'This account not valid';
exit;
}else{
// cont
}
$url = 'https://proxies-beinmena.portail.alphanetworks.be/proxy/casAddDevice';
$data = array('deviceUniqueId' => "{$deviceID}");
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Host: proxies-beinmena.portail.alphanetworks.be\r\nConnection: keep-alive\r\nAccept: */*\r\nX-AN-WebService-IdentityKey: swezezavave3r5brujeWruchabuvejup\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36\r\nContent-Type: application/x-www-form-urlencoded; charset=UTF-8\r\nDNT: 1\r\nAccept-Encoding: gzip, deflate, br\r\nAccept-Language: en-US,en;q=0.9\r\nX-AN-WebService-CustomerAuthToken:{$frsttk}",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { echo 'Account not valid';
exit; }
$json = json_decode($result, true);
$deviceToken = $json['result']['deviceAuthToken'];
$url = 'https://proxies-beinmena.portail.alphanetworks.be/proxy/loginWebPlayer';
$data = array('{}');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Host: proxies-beinmena.portail.alphanetworks.be\r\nConnection: keep-alive\r\nAccept: */*\r\nX-AN-WebService-IdentityKey: swezezavave3r5brujeWruchabuvejup\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36\r\nContent-Type: application/x-www-form-urlencoded; charset=UTF-8\r\nDNT: 1\r\nAccept-Encoding: gzip, deflate, br\r\nAccept-Language: en-US,en;q=0.9\r\nX-AN-WebService-CustomerAuthToken:{$frsttk}\r\nX-AN-WebService-DeviceAuthToken:{$deviceToken}",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { echo 'ERROR 3';
exit; }
$json = json_decode($result, true);
$secttk = $json['result']['newAuthToken'];
echo "Second : ",$secttk;
?>