Advertisement
Guest User

Barbars

a guest
Jan 17th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. <?php
  2.  
  3. class Barbars extends Curl
  4. {
  5.     private $arrData = [
  6.         'set_cookie' => true,
  7.     ];
  8.    
  9.     public function __construct ($arrData = [])
  10.     {
  11.         $this->data = $arrData;
  12.     }
  13.    
  14.     public function auth($login, $password)
  15.     {
  16.         $response = false;
  17.        
  18.         if (!empty($login) && !empty($password))
  19.         {
  20.             $authForm = parent::query('http://barbars.ru/login', false);
  21.            
  22.             if($authForm)
  23.             {
  24.                 preg_match('/<form action="login\/(?<url>.+)" id="(.+)" method="post">/', $authForm[0], $interface);
  25.                 preg_match('/<input type="hidden" name="(?<id>.+)" id="(.+)" \/>/', $authForm[0], $matches);
  26.                
  27.                 $params = [
  28.                     $matches['id'] => '',
  29.                     'login' => $login,
  30.                     'password' => $password
  31.                 ];
  32.                 $paramsLine = http_build_query($params, '', '&');
  33.                
  34.                 $response = parent::query('http://barbars.ru/login/?'>,.$interface['url'], false, 'post', $paramsLine);
  35.                
  36.             }
  37.         }
  38.         return $response;
  39.     }
  40.    
  41.     public function attackGames($result)
  42.     {
  43.         $response = false;
  44.        
  45.         if (!empty($result))
  46.         {
  47.             preg_match_all('/wicket:interface=:(.+)::/', $result, $interface);
  48.             preg_match('/action=(?<action>\d+)">/', $result, $action);
  49.             $attacks = $interface[0];
  50.            
  51.             if (!empty($attacks))
  52.             {
  53.                 for ($i = 0; $i < 4; $i++)
  54.                 {
  55.                     $response = parent::query('http://barbars.ru/?'.$attacks[$i].'&action='.$action['action'], false);
  56.                     sleep(5);
  57.                 }
  58.             }
  59.         }
  60.         return $response;
  61.     }
  62.    
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement