Advertisement
KiberInfinity

vk.com auth

Nov 6th, 2012
304
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $user_agent = 'Opera/9.80 (Windows NT 6.1; U; ru) Presto/2.10.289 Version/12.00';
  3. $cookie = '';
  4. $login = 'login';
  5. $password = 'pass';
  6. $ch = curl_init();
  7. curl_setopt($ch, CURLOPT_POST, true);
  8. curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
  9. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  10. curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  11. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  12. curl_setopt($ch, CURLOPT_URL, 'http://login.vk.com/?act=login');
  13. $post = array(
  14. 'act' => 'login',
  15. 'q' => '',
  16. 'al_frame' => '1',
  17. 'expire' => '',
  18. 'captcha_sid' => '',
  19. 'captcha_key' => '',
  20. 'from_host' => 'vkontakte.ru',
  21. 'email' => $login,
  22. 'pass' => $password
  23. );
  24. curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
  25. $answer = curl_exec($ch);
  26. $sid = substr($answer, strpos($answer, "setCookieEx('sid', '") + 20, 60);
  27. $cookie = 'remixsid=' . $sid;
  28. curl_setopt($ch, CURLOPT_POST, false);
  29. curl_setopt($ch, CURLOPT_COOKIE, $cookie);
  30. curl_setopt($ch, CURLOPT_URL, 'http://vkontakte.ru/');
  31. $answer = curl_exec($ch);
  32. curl_close($ch);
  33. ?>
Advertisement
RAW Paste Data Copied
Advertisement