I need to modify this script to have also an external txt file with urls instead of having only one url from the form that is created by the script. Just like the proxy.txt and agents.txt.
Please help me... :confused:
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request::Common;
####Proxy addresses#####
$proxy="proxy.txt";
####How many proxies are in this file####
$number='350';
##################################################DO NOT EDIT BELOW THIS LINE!#############################
print "Content-type: text/html\n\n";
$agents="agents.txt";
$nagents='21';
$buffer = $ENV{'QUERY_STRING'};
if ($buffer eq 'new'){
&newinfo();
}
sub newinfo{
print <<ENDHTML;
<form action=bot.cgi?hitsnow method=post>
URL to send hits to:<input type=text name=url><br>
Refferring URL:<input type=text name=refer><br>
How many hits to send:<input type=text name=howmany><br>
<input type=submit value=Submit></form>
ENDHTML
;
exit;
}
if ($buffer eq 'hitsnow'){
&sendthemhits();
}
sub sendthemhits{
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
} else {
$buffer = $ENV{'QUERY_STRING'};
}
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
for($count=1;$count<$FORM{howmany};$count++){
open(QQ,"$proxy");
@proxies=<QQ>;
close(QQ);
open(WE,"$agents");
@agents=<WE>;
close(WE);
srand;
@run = (0..$number);
$run = rand(@run);
@ug = (0..$nagent);
$ug = rand(@ug);
my $ua = LWP::UserAgent->new(agent => "@agents[$ug[$ug]]" , keep_alive => 1 , timeout => 10);
$ua->proxy('http',"http://@proxies[$run[$run]]");
my $res = HTTP::Request->new( GET => "$FORM{url}");
$res->referer("$FORM{refer}");
my $response= $ua->request($res);
if ($response->is_success){
print "Connection: $count - @proxies[$run[$run]] - Success<br>\n";
}
}
}