#!usr/bin/perl
#DH ViewBot 0.2
#(C) Doddy Hackman 2015
use Getopt::Long;
use LWP::UserAgent;
use URI
::Split qw(uri_split
); use IO::Socket;
my @agents = (
'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0',
'Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14',
'Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36',
'Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0',
'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 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))',
'Mozilla/5.0 (Windows NT 6.0; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 12.14',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; tr-TR) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27'
);
GetOptions(
"single=s" => \$single_opt,
"file=s" => \$file_opt,
"randomfile=s" => \$randomfile_opt,
"timeout=i" => \$timeout_opt,
"count=i" => \$count_opt
);
head();
if ( $single_opt or $file_opt or $randomfile_opt ) {
my $page = $single_opt;
my $timeout = "";
if ( $timeout_opt eq "" ) {
$timeout = "5";
}
else {
$timeout = $timeout_opt;
}
my $count = "";
if ( $count_opt eq "" ) {
$count = "10";
}
else {
$count = $count_opt;
}
if ( $single_opt ne "" ) {
my $page = $single_opt;
print "\n[+] Configuration\n";
print "\n--------------------------------------------------"; print "\n[+] Page : " . $page . "\n"; print "[+] Timeout : " . $timeout . "\n"; print "[+] Visit Count : " . $count . "\n"; print "--------------------------------------------------";
visitar( $page, $timeout, $count, "single" );
}
elsif ( $randomfile_opt ne "" ) {
visitar_random( $randomfile_opt, $timeout, $count );
}
elsif ( $file_opt ne "" ) {
if ( $file_opt ne "" ) {
unless ( -f $file_opt ) {
print "\n[-] File not exist\n"; copyright();
}
print "\n" . toma_fecha_y_hora
("Started");
my @paginas = repes( leer_archivo($file_opt) );
for my $page (@paginas) {
print "\n--------------------------------------------------"; print "\n[+] Page : " . $page . "\n"; print "[+] Timeout : " . $timeout . "\n"; print "[+] Visit Count : " . $count . "\n"; print "--------------------------------------------------";
visitar( $page, $timeout, $count, "file" );
}
print "\n" . toma_fecha_y_hora
("Finished");
}
else {
print "\n[-] Option not selected\n"; }
}
}
else {
[+] Options :
-single : Page to visit
-file : File with pages to visit
-randomfile : File with pages to visit as random
-timeout : Time for visit
-count : Count to visist
);
"[+] Example : perl $0 -single http://www.supertangas.com/index.php -timeout 5 -count 50\n";
}
copyright();
# Functions
sub head {
print "\n-- == DH ViewBot 0.2 == --\n"; }
sub copyright {
print "\n-- == (C) Doddy Hackman 2015 == --\n"; }
sub visitar_random {
my ( $file, $timeout, $count ) = @_;
my @paginas = repes( leer_archivo($file) );
my $total_bueno = "";
my $total_malo = "";
print "\n" . toma_fecha_y_hora
("Started");
for ( 1 .. $count ) {
my $target = $paginas[ rand(@paginas) ]; print "\n--------------------------------------------------"; print "\n[+] Page : " . $target . "\n"; print "[+] Timeout : " . $timeout . "\n"; print "--------------------------------------------------";
print "\n\n[+] Getting information ...\n\n";
print toma_banner
($target) . "\n";
my ( $status, $control ) = toma_response($target);
if ( $control eq "1" ) {
$total_bueno++;
}
else {
$total_malo++;
}
print "\n[+] Visit $_ : $target : " . $status . "\n";
}
print "\n[+] Successful Visits : " . $total_bueno . "\n";
print "\n" . toma_fecha_y_hora
("Finished");
}
sub visitar {
my ( $page, $timeout, $count, $type ) = @_;
print "\n\n[+] Getting information ...\n\n";
print toma_banner
($page);
if ( $type eq "single" ) {
print "\n\n" . toma_fecha_y_hora
("Started") . "\n"; }
else {
print "\n\n" . "[+] Working ..." . "\n\n"; }
my $total_bueno = "";
my $total_malo = "";
for ( 1 .. $count ) {
my ( $status, $control ) = toma_response($page);
if ( $control eq "1" ) {
$total_bueno++;
}
else {
$total_malo++;
}
syswrite STDOUT, "[+] Visit $_ : $page : " . $status . "\r";
}
"[+] Successful Visits : " . $total_bueno . "\t\t\t\t\t\t\t\t\t\t\r";
if ( $type eq "single" ) {
print "\n" . toma_fecha_y_hora
("Finished"); }
else {
print "\n" . "[+] Finished\n"; }
}
sub toma_response {
my $control = "";
my $nave = LWP::UserAgent->new();
$nave->agent( $agents[ rand @agents ] ); $nave->timeout(5);
my $code = $nave->get( $_[0] );
if ( $code->is_success ) {
$control = "1";
}
else {
$control = "0";
}
my $status = $code->status_line();
}
sub toma_banner {
my $resultado = "";
my $nave = LWP::UserAgent->new();
$nave->agent( $agents[ rand @agents ] ); $nave->timeout(5);
my $code = $nave->get( $_[0] );
$resultado = $resultado
. "--------------------------------------------------------------------------";
$resultado = $resultado . "\n[+] IP : " . get_ip( $_[0] );
$resultado = $resultado . "\n[+] Date : " . $code->header('date');
$resultado = $resultado . "\n[+] Server : " . $code->header('server');
$resultado =
$resultado . "\n[+] Connection : " . $code->header('connection');
$resultado =
$resultado . "\n[+] Content-Type : " . $code->header('content-type');
if ( $code->header("Set-Cookie") ne "" ) {
$resultado =
$resultado . "\n[+] Cookie : " . $code->header("Set-Cookie");
}
$resultado = $resultado
. "\n--------------------------------------------------------------------------";
}
sub get_ip {
my ( $nomesirve1, $host, $nomesirve2, $nomesirve3, $nomesirve4 ) =
uri_split( $_[0] );
}
sub toma_fecha_y_hora {
my (
$segundos, $minutos, $hora, $dia, $mes,
$año, $nomesirve1, $nomesirve2, $nomesirve3
$año += 1900;
$mes++;
return "[+] $_[0] Time : " . "$dia/$mes/$año $hora:$minutos:$segundos\n";
}
sub repes {
my @limpio;
foreach $test (@_) {
push @limpio, $test unless $repe{$test}++; }
}
sub leer_archivo {
my @r;
my @words;
@words = <FILE>;
for (@words) {
}
}
#The End ?