elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Perl] Whois Online 0.1
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Perl] Whois Online 0.1  (Leído 1,492 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl] Whois Online 0.1
« en: 23 Abril 2012, 17:21 pm »

Debido a problemas con el modulo Net::Whois::Raw me vi obligado a realizar un whois mediante una pagina online.

Código
  1. #!usr/bin/perl
  2. #Whois Online 0.1
  3. #Coded By Doddy H
  4.  
  5. use LWP::UserAgent;
  6.  
  7. my $nave = LWP::UserAgent->new;
  8. $nave->agent(
  9. "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
  10. );
  11. $nave->timeout(5);
  12.  
  13. head();
  14. if ( $ARGV[0] ) {
  15.    print whois( $ARGV[0] );
  16. }
  17. else {
  18.    sintax();
  19. }
  20. copyright();
  21.  
  22. sub sintax {
  23.    print "\n[+] Sintax : $0 <domain>\n";
  24. }
  25.  
  26. sub head {
  27.    print "\n-- == Whois Online 0.1 == --\n\n";
  28. }
  29.  
  30. sub copyright {
  31.    print "\n\n(C) Doddy Hackman 2012\n\n";
  32.    exit(1);
  33. }
  34.  
  35. sub whois {
  36.  
  37.    my $ob   = shift;
  38.    my $code = tomar(
  39.        "http://networking.ringofsaturn.com/Tools/whois.php",
  40.        { "domain" => $ob, "submit" => "submit" }
  41.    );
  42.  
  43.    my @chau = ( "&quot;", "&gt;&gt;&gt;", "&lt;&lt;&lt;" );
  44.  
  45.    if ( $code =~ /<pre>(.*?)<\/pre>/sig ) {
  46.        my $resul = $1;
  47.        chomp $resul;
  48.  
  49.        for my $cha (@chau) {
  50.            $resul =~ s/$cha//ig;
  51.        }
  52.  
  53.        if ( $resul =~ /Whois Server Version/ ) {
  54.            return $resul;
  55.        }
  56.        else {
  57.            return "Not Found";
  58.        }
  59.    }
  60. }
  61.  
  62. sub toma {
  63.    return $nave->get( $_[0] )->content;
  64. }
  65.  
  66. sub tomar {
  67.    my ( $web, $var ) = @_;
  68.    return $nave->post( $web, [ %{$var} ] )->content;
  69. }
  70.  
  71. # The End ?
  72.  
  73.  


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Perl Tk] Whois Client 0.2
Scripting
BigBear 0 1,439 Último mensaje 1 Abril 2012, 03:20 am
por BigBear
[Ruby] Whois Online 0.1
Scripting
BigBear 3 3,265 Último mensaje 27 Abril 2012, 16:30 pm
por 0xDani
[Python] Whois Online 0.1
Scripting
BigBear 2 2,031 Último mensaje 23 Abril 2012, 19:44 pm
por BigBear
[Perl Tk] Whois Online 0.1
Scripting
BigBear 0 1,386 Último mensaje 23 Abril 2012, 17:21 pm
por BigBear
[PyQT4] Whois Online 0.2
Scripting
BigBear 0 1,443 Último mensaje 27 Agosto 2012, 00:24 am
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines