Advertisement
ekasyahwan

Bypass Wifi@id - ekasyahwan.blogspot.com

Dec 3rd, 2016
1,078
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.65 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. /**
  4. * Eka Syahwan
  5. */
  6. class WifiController
  7. {
  8.     public function ngecurl($url , $post=null , $header=null){
  9.         unlink("cookies.txt");
  10.         $ch = curl_init($url);
  11.         if($post != null) {
  12.             curl_setopt($ch, CURLOPT_POST, true);
  13.             curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  14.         }
  15.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  16.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Linux; Android 4.4.2; GT-I9100 Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36");
  17.         curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd()."/cookies.txt");
  18.         curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd()."/cookies.txt");
  19.         curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
  20.         if($header != null) {
  21.             curl_setopt($ch, CURLOPT_HTTPHEADER,$header);
  22.         }
  23.         curl_setopt($ch, CURLOPT_COOKIESESSION, true);
  24.         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,0);
  25.         curl_setopt($ch, CURLOPT_TIMEOUT, 20);
  26.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  27.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  28.         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  29.         return curl_exec($ch) ;
  30.         curl_close($ch);
  31.     }
  32.     public function getData($data){
  33.         preg_match_all('/&client_mac=(.*?)&/', $data, $mac);
  34.         preg_match_all('/\?gw_id=(.*?)&/', $data, $gwid);
  35.         preg_match_all('/URL=(.*?)\?/', $data , $url);
  36.         $repons       = $this->ngecurl($url[1][0] ,null , null);
  37.         preg_match_all('/&ipc=(.*?)&/', $repons, $ipc);
  38.         return array('mac' => $mac[1][0],'gwid' => $gwid[1][0] ,'url' => $url[1][0] , 'ipc' => $ipc[1][0]);
  39.     }
  40.     public function login($mac,$gwid,$url,$ipc){
  41.         //$mac = "50:B7:C3:E2:C4:01";
  42.         $header = array(
  43.             'Host:welcome2.wifi.id',
  44.             'Origin:http://welcome2.wifi.id',
  45.             'X-Requested-With:XMLHttpRequest',
  46.             'Connection:keep-alive',
  47.             'Content-Type:application/x-www-form-urlencoded; charset=UTF-8'
  48.         );
  49.         $post = $this->ngecurl("http://welcome2.wifi.id/authnew/login-free/check_login.php?ipc=".$ipc."&gw_id=".$gwid."&mac=".$mac,"username_=mcent&username=mcent".time().".mcent%40event&password=mcent&landURL=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.mcent.app%26referrer%3Dutm_source%253Dwifi.id%2526utm_content%253DMEpKdGNaSW1XOFRZKzRIZi9MOUo1VHBqUlBGeDl5aVdZeWVyYU41SEpMYmpuMkJWZGFTeUt2MTVuYmpIUHJuNCtvRUZCZSsyZnJJaWxsaDhwUmdEaUI0K3kydy94QnIxL1FnVzFqdGhyc1k3TlVFTUNOVGZRa0JtdGs2T2h5N2VWUVhYdnN5WVEzY3U3RHNxOUY1QzRRPT0_" , $header);
  50.         $result = json_decode($post,true);
  51.  
  52.         $post1 = $this->ngecurl("http://welcome2.wifi.id/authnew/login-free/check_login.php?ipc=".$ipc."&gw_id=".$gwid."&mac=".$mac,"username=".$mac."@freeMS.pass&password=".time() , $header);
  53.         $result1 = json_decode($post,true);
  54.  
  55.         if($result[result]){
  56.             echo "[WIFI] Status Login : ".$result[message]."\r\n";
  57.             $this->ping();
  58.         }else{
  59.             echo "[WIFI] Status Login : ".$result[message]."\r\n";
  60.         }
  61.         if($result1[result]){
  62.             echo "[WIFI] Status Login : ".$result1[message]."\r\n";
  63.             $this->ping();
  64.         }else{
  65.             echo "[WIFI] Status Login : ".$result1[message]."\r\n";
  66.         }
  67.         $this->login($mac,$gwid,$url,$ipc);
  68.     }
  69.     function formatSizeUnits($bytes)
  70.     {
  71.         if ($bytes >= 1073741824)
  72.         {
  73.             $bytes = number_format($bytes / 1073741824, 2) . ' GB';
  74.         }
  75.         elseif ($bytes >= 1048576)
  76.         {
  77.             $bytes = number_format($bytes / 1048576, 2) . ' MB';
  78.         }
  79.         elseif ($bytes >= 1024)
  80.         {
  81.             $bytes = number_format($bytes / 1024, 2) . ' kB';
  82.         }
  83.         elseif ($bytes > 1)
  84.         {
  85.             $bytes = $bytes . ' bytes';
  86.         }
  87.         elseif ($bytes == 1)
  88.         {
  89.             $bytes = $bytes . ' byte';
  90.         }
  91.         else
  92.         {
  93.             $bytes = '0 bytes';
  94.         }
  95.  
  96.         return $bytes;
  97. }
  98.     public function mac(){
  99.         return implode(':',str_split(str_pad(base_convert(mt_rand(0,0xffffff),10,16).base_convert(mt_rand(0,0xffffff),10,16),12),2));
  100.     }
  101.     public function ping(){
  102.         $ch = curl_init("http://i.imgur.com/72udZx0.gif");
  103.         curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10);
  104.         curl_setopt($ch,CURLOPT_HEADER,0);
  105.         curl_setopt($ch,CURLOPT_NOBODY,true);
  106.         curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  107.         curl_setopt($ch, CURLOPT_TIMEOUT, 60);
  108.         $response   = curl_exec($ch);
  109.         $info       = curl_getinfo($ch);
  110.         if($info['http_code'] == "200"){
  111.             echo "[AutoLogin] Terhubung (".$this->formatSizeUnits($info[header_size]).")\r\n";
  112.             $this->ping();
  113.         }else{
  114.             echo "[AutoLogin] Terputus\r\n";
  115.             $this->login();
  116.         }
  117.     }
  118.     public function run(){
  119.         $repons        = $this->ngecurl("http://go.microsoft.com/fwlink/?LinkID=219472&clcid=0x409" ,null , null);
  120.         preg_match_all('/berita/', $repons, $res);
  121.         if($res[0][0]){
  122.             echo "[WIFI] Sudah terhubung\r\n";
  123.             $this->ping();
  124.         }else{
  125.             echo "[WIFI] Sedang mengambil data \r\n";
  126.             $data   = $this->getData($repons);
  127.             if($data[mac]){
  128.                 echo "[WIFI] MAC : ".$data[mac]." | GWID : ".$data[gwid]." | IPC : ".$data[ipc]."\r\n";
  129.                 $this->login($data[mac] , $data[gwid] , $data[url] , $data[ipc]);
  130.             }else{
  131.                 $this->run();
  132.             }
  133.         }
  134.     }
  135. }
  136. $wifi = new WifiController;
  137. $wifi->run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement