[Perl] Counter Strike 1.6 Servers List

Iniciado por BigBear, Noviembre 12, 2012, 07:32:11 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Noviembre 12, 2012, 07:32:11 PM Ultima modificación: Noviembre 12, 2012, 07:36:26 PM por Doddy
Lo mismo que el otro buscador pero esta vez para CS 1.6

El codigo

Código: perl

#!usr/bin/perl
#Counter Strike 1.6 Servers List
#Version 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 "[+] Pages (1-899) : ";
chomp( my $pag = <stdin> );

print "\n\n[+] Searching Servers ....\n";

for my $count ( 1 .. $pag ) {

    my $code =
      toma( "http://www.gametracker.com/search/cs/?searchipp=50&searchpge="
          . $count );

    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() . "/" . "cs_servers.txt";

if ( -f $ruta_logs ) {
    unlink($ruta_logs);
}

open( LOGS, ">>cs_servers.txt" );

for (@founds_final) {
    print LOGS $_ . "\n";
}

close LOGS;

print "\n\n[+] All results are stored in : $ruta_logs\n";

if ( -f $ruta_logs ) {
    system($ruta_logs);
}

copyright();

sub head {

    my @logo = (
        "#=============================================#", "\n",
        "#       Counter Strike 1.6 Servers List       #", "\n",
        "#---------------------------------------------#", "\n",
        "# Written By Doddy H                          #", "\n",
        "# Email: lepuke[at]hotmail[com]               #", "\n",
        "# Website: doddyhackman.webcindario.com       #", "\n",
        "#---------------------------------------------#", "\n",
        "# The End ?                                   #", "\n",
        "#=============================================#", "\n"
    );

    print "\n";

    marquesina(@logo);

    print "\n\n";

}

sub copyright {

    my @fin = ("-- == (C) Doddy Hackman 2012 == --");

    print "\n\n";
    marquesina(@fin);
    print "\n\n";

    <stdin>;

    exit(1);

}

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);
        }
        print "\b ";
    }

    sub mostrar {
        print $_[0];
        $car = $_[1];
    }

}

sub repes {
    my @limpio;
    foreach $test (@_) {
        push @limpio, $test unless $repe{$test}++;
    }
    return @limpio;
}

sub toma {
    return $nave->get( $_[0] )->content;
}

#The End ?