Este script se encarga de buscar servers del juego Half Life para entrar y jugar , los resultados se guardan en un archivo de texto.
El codigo
#!usr/bin/perl
#Half Life Servers List 0.1
#Coded By Doddy H
use LWP::UserAgent;
use Cwd;
use Time::HiRes "usleep";
my $nave = LWP::UserAgent->new;
$nave->agent(
"Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
);
$nave->timeout(5);
my @founds;
my @founds_final;
head();
print "[+] Searching Servers ....\n";
for my $count ( 1 .. 2 ) {
my $code =
toma( "http://www.game-monitor.com/search.php?game=valve&pg="
. $count
. "&num=100" );
my @found = $code =~ m/(\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3}:\d+)/g;
for (@found) {
push( @founds_final, $_ ); }
}
my @founds_final = repes(@founds_final);
print "\n[+] Servers Found : " . int(@founds_final);
my $ruta_logs = getcwd() . "/" . "hl_servers.txt";
if ( -f $ruta_logs ) {
}
open( LOGS
, ">>hl_servers.txt" );
for (@founds_final) {
}
print "\n\n[+] All results are stored in : $ruta_logs\n";
if ( -f $ruta_logs ) {
}
copyright();
sub head {
my @logo = (
"#=============================================#", "\n",
"# Half Life Servers List 0.1 #", "\n",
"#---------------------------------------------#", "\n",
"# Written By Doddy H #", "\n",
"# Email: lepuke[at]hotmail[com] #", "\n",
"# Website: doddyhackman.webcindario.com #", "\n",
"#---------------------------------------------#", "\n",
"# The End ? #", "\n",
"#=============================================#", "\n"
);
marquesina(@logo);
}
sub copyright {
my @fin = ("-- == (C) Doddy Hackman 2012 == --");
marquesina(@fin);
<stdin>;
}
sub marquesina {
#Effect based in the exploits by Jafer Al Zidjali
my @logo = @_;
my $car = "|";
for my $uno (@logo) {
for my $dos ( split //, $uno ) {
$|++;
if ( $car eq "|" ) {
mostrar( "\b" . $dos . $car, "/" );
}
elsif ( $car eq "/" ) {
mostrar( "\b" . $dos . $car, "-" );
}
elsif ( $car eq "-" ) {
mostrar( "\b" . $dos . $car, "\\" );
}
else {
mostrar( "\b" . $dos . $car, "|" );
}
usleep(40_000);
}
}
sub mostrar {
$car = $_[1];
}
}
sub repes {
my @limpio;
foreach $test (@_) {
push @limpio, $test unless $repe{$test}++; }
}
sub toma {
return $nave->get( $_[0] )->content; }
#The End ?