#!/usr/bin/perl #Th1z is one of blackhat way to play ads #Assume : y0u have compromised a hosting with many websites #It's better to search alexa rank of each website, then use #website with high alexa rank to publish ur ads. #Don't do defacing because that'z absolutely kiddie game :-) #Threading c0de is taken from cpan example : boss.pl #Combining with my c0de to find da alexa rank more faster! # #~eL d0nz # require LWP::UserAgent; use HTTP::Message; #use strict; #use warnings; use threads; use threads::shared; use Thread::Queue; #my $proxy='http://127.0.0.1:2121'; my (@weblist,@hasil); my $MAX_THREADS=50; my $TIMEOUT=10; my $TERM :shared=0; my $DETACHING :shared; $SIG{'INT'} = $SIG{'TERM'} = sub { print("terminating...\n"); $TERM=1; }; $SIG{'KILL'} = sub{ printf("%3d - killed\n",threads->tid()); lock($DETACHING); threads->detach() if ! threads->is_detached(); threads->exit(); }; MAIN: { if(!$ARGV[0]){ print "usage : perl $0 \n"; exit; } my $checkurl; my $queue = Thread::Queue->new(); threads->create('timer',$queue)->detach(); open(LIST,"<$ARGV[0]") or die(); chop(@weblist=); my $sz = @weblist; my $i=0; while(!$TERM){ for(my $needed = $MAX_THREADS - threads->list();$needed && !$TERM;$needed--){ if($sz-- >0){ threads->create('worker',$queue,$TIMEOUT,$weblist[$i]); $i++; } sleep(1); #Comment th1z line to speed up ur alexa checker but may cause some errorz exit(0) if (threads->list()==0) } } while((threads->list()>0)&& $TIMEOUT--){ sleep(1); } foreach my $thr (threads->list()){ lock($DETACHING); $thr->detach() if ! $thr->is_detached(); $thr->kill('KILL'); } close(LIST); } print("Done\n"); exit(0); sub worker { my($queue,$tmout,$url)=@_; my $tid = threads->tid(); my $ua = LWP::UserAgent->new; $ua->timeout(60); $ua->agent("MSIE/6.0 Windows"); #Enable th1z line if using proxy #$ua->proxy(http => $proxy) if defined($proxy); my $geturl="http://data.alexa.com/data/?cli=10&dat=ns&url=$url"; my $grabresponse = $ua->get($geturl); if (!($grabresponse->is_success)) { print ($grabresponse->status_line. " Failure\n"); }else { @hasil = $grabresponse->as_string; my $result="@hasil"; $result =~ m//; print $url . " alexa rank is " . $2 . "\n"; open(LOG,">>rank.log"); print LOG $url . " alexa rank is " . $2 . "\n"; close(LOG); } $queue->enqueue($tid,$tmout); my $sleep = 3+int(rand(10)); while(($sleep>0)&&!$TERM){ $sleep -= sleep($sleep); } $SIG{'KILL'} = sub{}; $queue->enqueue($tid,undef); lock($DETACHING); threads->detach() if ! threads->is_detached(); threads->exit(); } sub timer { my $queue = shift; my %timers; while(!$TERM){ while(my $tid = $queue->dequeue_nb()){ if(!($timers{$tid}{'timeout'} = $queue->dequeue())||!($timers{$tid}{'thread'} = threads->object($tid))){ delete($timers{$tid}); } } foreach my $tid (keys(%timers)){ if(--$timers{$tid}{'timeout'}<0){ $timers{$tid}{'thread'}->kill('KILL'); delete($timers{$tid}); } } sleep(1); } } #Don't sad with ur stupidity in perl c0ding #Thiz c0de is n0t kewl enough h0ney