Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Barbars extends Curl
- {
- private $arrData = [
- 'set_cookie' => true,
- ];
- public function __construct ($arrData = [])
- {
- $this->data = $arrData;
- }
- public function auth($login, $password)
- {
- $response = false;
- if (!empty($login) && !empty($password))
- {
- $authForm = parent::query('http://barbars.ru/login', false);
- if($authForm)
- {
- preg_match('/<form action="login\/(?<url>.+)" id="(.+)" method="post">/', $authForm[0], $interface);
- preg_match('/<input type="hidden" name="(?<id>.+)" id="(.+)" \/>/', $authForm[0], $matches);
- $params = [
- $matches['id'] => '',
- 'login' => $login,
- 'password' => $password
- ];
- $paramsLine = http_build_query($params, '', '&');
- $response = parent::query('http://barbars.ru/login/?'>,.$interface['url'], false, 'post', $paramsLine);
- }
- }
- return $response;
- }
- public function attackGames($result)
- {
- $response = false;
- if (!empty($result))
- {
- preg_match_all('/wicket:interface=:(.+)::/', $result, $interface);
- preg_match('/action=(?<action>\d+)">/', $result, $action);
- $attacks = $interface[0];
- if (!empty($attacks))
- {
- for ($i = 0; $i < 4; $i++)
- {
- $response = parent::query('http://barbars.ru/?'.$attacks[$i].'&action='.$action['action'], false);
- sleep(5);
- }
- }
- }
- return $response;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement