SHARE
TWEET

ok.php

pereginecv Apr 28th, 2015 306 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?
  2. error_reporting(E_ALL);
  3. ini_set("display_errors", 1);
  4.  $start = microtime(true);
  5. define('PROTECTOR', 1);
  6.  
  7.         $login = htmlspecialchars(stripslashes(addslashes($_POST['log'])));
  8. $textl='Герой-Бот';
  9.    $url = "http://m.ok.ru/";  
  10.   $ch = curl_init();      
  11.    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
  12. curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie/$login.txt");
  13. curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie/$login.txt");
  14.    curl_setopt($ch, CURLOPT_URL, $url)  ;    
  15.     $html = curl_exec($ch);
  16.    curl_close($ch);  
  17.    //echo $html;
  18.    
  19.   preg_match("/tkn=(\d+)/", $html, $act);
  20.   $a=$act[1];
  21.  
  22.  
  23.  
  24. $user_agent = $_SERVER['HTTP_USER_AGENT'] ;
  25.  
  26.         $login = htmlspecialchars(stripslashes(addslashes($_POST['log'])));
  27.         $password = htmlspecialchars(stripslashes(addslashes($_POST['pas'])));
  28.  
  29.         $r=rand(1111, 9999);
  30.        
  31. $ch = curl_init();
  32.  
  33. curl_setopt($ch, CURLOPT_POST, true);
  34. curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
  35. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  36. curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie/$login.txt");
  37. curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie/$login.txt");
  38. curl_setopt($ch, CURLOPT_HEADER, 0);
  39. curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  40. //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  41. curl_setopt($ch, CURLOPT_URL, "http://m.ok.ru/dk?bk=GuestMain&st.cmd=main&_prevCmd=main&tkn={$a}");
  42.  
  43. $post = array(
  44.            'fr.posted' => 'set',
  45.            'fr.login' => $login,
  46.            'fr.password' => $password,
  47.            'fr.needCaptcha' => ''
  48.        );
  49. curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
  50. $answer = curl_exec($ch);
  51. // в ответ получили главную страницу
  52.         $login = htmlspecialchars(stripslashes(addslashes($_POST['log'])));
  53.         $password = htmlspecialchars(stripslashes(addslashes($_POST['pas'])));
  54. setcookie('okl', $login, time()+86400, '/bes/');       
  55. setcookie('okp', $password, time()+86400, '/bes/');
  56.  
  57. curl_close($ch);
  58.    $poss = StrPos($answer,"Настройки");
  59.   if ( $poss === false ) {
  60. include('files/path.php');
  61. include($path.'files/head.php');
  62.     echo '<br><center>Ошибка<br><a href="log.php">Назад</a></center><br>';
  63.        
  64. echo $answer;  
  65.  
  66.     }  
  67.  else {
  68.  
  69.  
  70. include('files/path.php');
  71. include($path.'files/head.php');
  72.     echo '<center>Отлично</center>';
  73.  
  74. echo $answer;  
  75.  
  76.         $boss = 1;
  77.         $energy = 70;
  78.        
  79.   $config = parse_ini_file( "set/$login.ini" );
  80.   $activation=$config['activation'];
  81.   $date=$config['date'];
  82.         $sboss="boss=$boss";
  83.         $date="date=$date";
  84.         $senergy="energy=$energy";
  85.         $activation="activation=$activation";
  86.         $openn = fopen ( "set/$login.ini", "w" );
  87.         fwrite ( $openn, $activation."\n".$date."\n".$sboss."\n".$senergy );
  88.         fclose ( $openn );
  89.         echo'<META HTTP-EQUIV="REFRESH" CONTENT="1; URL=config.php">';
  90.     }
  91.  
  92.  
  93. echo $answer;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top