Advertisement
Papadopolis

Untitled

Jul 10th, 2011
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.53 KB | None | 0 0
  1. <link rel="stylesheet" type="text/css" href="clientscript/vbulletin_important.css?v=383" />
  2. <link rel="stylesheet" type="text/css" href="estilo.css" />
  3.  
  4. <center>
  5. <h3>The Rebels acesso remoto 1.0</h3>
  6. <?php
  7. /********************************************************************************************************
  8. ***  Comunidade BUGS 83 no orkut                                                                      ***
  9. ***  http://www.orkut.com.br/Community?cmm=83                                                         ***
  10. ***                                                                                                   ***
  11. ***  Criado por Papadópolis e colaboradores                                                          ***
  12. ***  Se copiar, mantenha os créditos                                                                 ***
  13. ***  Contato via msn: papadopolis_@live.com                                                           ***
  14. ***  Todas as funções da classe estão explicadas no próprio source                                    ***
  15. ***  Para usar em modo simples, basta editar as variáveis $login e $senha da classe TheRebels        ***
  16. ***  Não se esqueça de editar também a varíavel constante 'BOT' que é definida no início da página    ***
  17. ***  ex: TheRebels::$login = "meu login"; TheRebels::$senha = "minha senha";                          ***
  18. ***                                                                                                   ***
  19. *********************************************************************************************************/
  20.  
  21. ob_start();
  22. session_start("TheRebels"); //inicia a sessão TheRebels com suas respectivas variáveis
  23. define("TR","http://therebels.biz/",true);
  24.  
  25. class TheRebels {
  26.     public static $login;
  27.     public static $senha;
  28.     public static $cookie;
  29.     private static $regexp = array(
  30.             "/set-cookie: (bbsessionhash=.*?);/i" //0
  31.         );
  32.     /*
  33.     $regexp[0]: primeira regexp da função estática 'login' da classe TheRebels
  34.     $regexp[1]: regexp para capturar todos os fóruns da index
  35.     */
  36.    
  37.     private static function curl(array $parametros) {
  38.         $ch = curl_init();
  39.         curl_setopt_array($ch,
  40.             array (
  41.                 CURLOPT_REFERER => "http://www.google.com.br",
  42.                 CURLOPT_URL => $parametros[0],
  43.                 CURLOPT_RETURNTRANSFER => $parametros[1],
  44.                 CURLOPT_COOKIE =>  $parametros[2],
  45.                 CURLOPT_HEADER => $parametros[3],
  46.                 CURLOPT_NOBODY => $parametros[3],
  47.                 CURLOPT_COOKIESESSION => 0,
  48.                 CURLOPT_CUSTOMREQUEST => ($parametros[4])?"POST":"GET",
  49.                 CURLOPT_POSTFIELDS => $parametros[4],
  50.             )
  51.         );
  52.         (string) $g = curl_exec($ch);
  53.         return $g;
  54.         curl_close($ch);
  55.     }
  56.     public static function login() {
  57.         (string) $var = null;
  58.         $var .= "do=login";
  59.         $var .= "&s=";
  60.         $var .= "&securitytoken=guest";
  61.         $var .= "&vb_login_username=".self::$login;
  62.         $var .= "&vb_login_md5password=".md5(self::$senha);
  63.         $var .= "&vb_login_md5password_utf=";
  64.         $var .= "&vb_login_password=".md5(self::$senha);
  65.         (string) $login = self::curl(array(TR."login.php?do=login",1,null,1,$var));
  66.         return array($login);
  67.     }
  68.     public static function sessao(array $parametros) {
  69.         preg_match(self::$regexp[0],$parametros[0],$cookie);
  70.         $_SESSION["cookie"] = $cookie[1];
  71.         self::$cookie = $cookie[1];
  72.         return (string) $cookie[1];
  73.     }
  74.     public static function local(array $parametros) {
  75.         (string) $local = null;
  76.         (string) $html  = null;
  77.         if($parametros[1]) $parametros[0].="?{$parametros[1]}";
  78.         $request = self::curl(array(TR.$parametros[0],1,self::$cookie,($parametros[2])?1:0,null));
  79.         $request = preg_replace("/\n/","",$request);
  80.         preg_match_all("/(<table class=\"tborder\".*?>.*?)<table class=\"tborder\"/i",$request,$tables);
  81.         for($i=0;$i<count($tables[1]);$i++) {
  82.             $html.=$tables[1][$i]."</table><br>\n";
  83.         }
  84.         return $html;
  85.     }
  86. }
  87.  
  88. /*
  89. class DOM extends TheRebels {
  90.     public static $resultado;
  91.    
  92.     public function novo() {return new DOMDocument();}
  93.    
  94.     public static function GetHTML($elemento) {
  95.         foreach($elemento->childNodes as $elementoTAG) {
  96.             $elementoDOM    = self::novo();
  97.             $elemento       = $elementoDOM->createElement($elementoTAG->tagName);
  98.             for($i=0;$i<$elementoTAG->attributes->length;$i++)
  99.                 $elemento->setAttribute($elementoTAG->attributes->item($i)->name,$elementoTAG->attributes->item($i)->value);
  100.             $elemento->nodeValue = $elementoTAG->nodeValue;
  101.             echo $elemento->nodeValue;
  102.             $elementoDOM->appendChild($elemento);
  103.             self::$resultado .= $elementoDOM->saveHTML();
  104.         }
  105.         return self::$resultado;
  106.     }
  107. }
  108. */
  109. //definindo login e senha
  110. TheRebels::$login = "muda";
  111. TheRebels::$senha = "muda";
  112.  
  113. //if(isset($_SESSION["cookie"]) && $_SESSION["cookie"]!==null) {//verifica se a variável de sessão 'cookie' ainda está viva.
  114.     //se estiver, ele apenas seta a variável estática 'cookie' com o valor igual a variável 'cookie' da sessão
  115.     //isso evita de fazer login toda vez que o usuário entrar na página
  116.     TheRebels::$cookie = $_SESSION["cookie"];
  117. //} else { //caso não esteja, ele faz login no site
  118.     //efetuando login
  119.     $login = TheRebels::login();
  120.  
  121.     //definindo cookies de sessão
  122.     TheRebels::sessao($login);
  123. //}
  124.  
  125. /*
  126. A função 'local' da classe TheRebels (que pode ser chamada como TheRebels::local()) tem como parâmetro uma array contento alguns valores, estes valores são:
  127.  
  128. array('parametro1','parametro2',parametro3)
  129.  
  130. parametro1 - [TIPO STRING] url do TheRebels, ex: http://therebels.biz/index.php
  131. parametro2 - [TIPO STRING] são as variáveis do tipo GET da url, ex: f=1&t=220
  132. parametro3 - [TIPO BOLEANO] caso o valor seja true, a função irá retornar apenas os headers da página, caso false, irá retornar o código fonte HTML da página
  133.  
  134. exemplo de chamado:
  135. echo TheRebels::local(array("http://therebels.biz/showthread.php","t=221163",null));
  136. */
  137. echo TheRebels::local(array("index.php",null,null));
  138.  
  139. ob_flush();
  140. flush();
  141. ?>
  142. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement