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

 

 


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl Tk] LocateIP 0.4
« en: 24 Marzo 2012, 22:53 pm »

Un simple programa en Perl que sirve para buscar informacion sobre una IP , primero busca la localizacion y despues busca las DNS relacionadas.

Les dejo una imagen del programa


El codigo (formateado con perltidy) es

Código
  1. #!usr/bin/perl
  2. #Locate IP 0.4
  3. #Version Tk
  4. #Coded By Doddy H
  5.  
  6. use Tk;
  7. use LWP::UserAgent;
  8. use IO::Socket;
  9.  
  10. my $background_color = "black";
  11. my $texto_color      = "green";
  12.  
  13. if ( $^O eq 'MSWin32' ) {
  14.    use Win32::Console;
  15.    Win32::Console::Free();
  16. }
  17.  
  18. installer();
  19.  
  20. my $nave = LWP::UserAgent->new;
  21. $nave->agent(
  22. "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
  23. );
  24. $nave->timeout(5);
  25.  
  26. $p = MainWindow->new(
  27.    -background => $background_color,
  28.    -foreground => $texto_color
  29. );
  30. $p->title("Locate IP 0.4 || Coded By Doddy H");
  31. $p->geometry("440x300+20+20");
  32. $p->resizable( 0, 0 );
  33.  
  34. $p->Label(
  35.    -text       => "Target : ",
  36.    -font       => "Impact",
  37.    -background => $background_color,
  38.    -foreground => $texto_color
  39. )->place( -x => 20, -y => 20 );
  40. my $tar = $p->Entry(
  41.    -width      => 30,
  42.    -background => $background_color,
  43.    -foreground => $texto_color
  44. )->place( -y => 24, -x => 80 );
  45. $p->Button(
  46.    -text             => "Find",
  47.    -width            => 10,
  48.    -background       => $background_color,
  49.    -foreground       => $texto_color,
  50.    -activebackground => $texto_color,
  51.    -command          => \&st
  52. )->place( -y => 23, -x => 272 );
  53. $p->Button(
  54.    -text       => "Logs",
  55.    -width      => 10,
  56.    -background => $background_color,
  57.    -foreground => $texto_color,
  58.    ,
  59.    -activebackground => $texto_color,
  60.    -command          => \&openlogs
  61. )->place( -y => 23, -x => 350 );
  62.  
  63. $p->Label(
  64.    -text       => "Information",
  65.    -font       => "Impact",
  66.    -background => $background_color,
  67.    -foreground => $texto_color
  68. )->place( -x => 80, -y => 80 );
  69.  
  70. $p->Label(
  71.    -text       => "City : ",
  72.    -font       => "Impact1",
  73.    -background => $background_color,
  74.    -foreground => $texto_color
  75. )->place( -y => 140, -x => 23 );
  76. my $city = $p->Entry(
  77.    -width      => 21,
  78.    -background => $background_color,
  79.    -foreground => $texto_color
  80. )->place( -y => 143, -x => 65 );
  81.  
  82. $p->Label(
  83.    -text       => "Country : ",
  84.    -font       => "Country",
  85.    -background => $background_color,
  86.    -foreground => $texto_color
  87. )->place( -y => 170, -x => 23 );
  88. my $country = $p->Entry(
  89.    -width      => 17,
  90.    -background => $background_color,
  91.    -foreground => $texto_color
  92. )->place( -y => 173, -x => 90 );
  93.  
  94. $p->Label(
  95.    -text       => "State : ",
  96.    -font       => "Impact1",
  97.    -background => $background_color,
  98.    -foreground => $texto_color
  99. )->place( -y => 200, -x => 23 );
  100. my $state = $p->Entry(
  101.    -width      => 20,
  102.    -background => $background_color,
  103.    -foreground => $texto_color
  104. )->place( -y => 203, -x => 75 );
  105.  
  106. $p->Label(
  107.    -text       => "DNS Found",
  108.    -font       => "Impact",
  109.    -background => $background_color,
  110.    -foreground => $texto_color
  111. )->place( -y => 80, -x => 285 );
  112. my $dns = $p->Listbox(
  113.    -width      => 30,
  114.    -background => $background_color,
  115.    -foreground => $texto_color
  116. )->place( -x => 230, -y => 130 );
  117.  
  118. MainLoop;
  119.  
  120. sub st {
  121.  
  122.    $city->configure( -text => " " );
  123.    $country->configure( -text => " " );
  124.    $state->configure( -text => " " );
  125.    $dns->delete( "0.0", "end" );
  126.  
  127.    my $target = $tar->get;
  128.  
  129.    savefile( "info-logs.txt", "[+] Target : $target" );
  130.  
  131.    my $get    = gethostbyname($target);
  132.    my $target = inet_ntoa($get);
  133.  
  134.    savefile( "info-logs.txt", "[+] IP : $target\n" );
  135.  
  136.    $total =
  137.      "http://www.melissadata.com/lookups/iplocation.asp?ipaddress=$target";
  138.  
  139.    $re = toma($total);
  140.  
  141.    if ( $re =~ /City<\/td><td align=(.*)><b>(.*)<\/b><\/td>/ ) {
  142.        savefile( "info-logs.txt", "[+] City : $2" );
  143.        $city->configure( -text => $2 );
  144.    }
  145.    else {
  146.        $city->configure( -text => "Not Found" );
  147.    }
  148.    if ( $re =~ /Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>/ ) {
  149.        savefile( "info-logs.txt", "[+] Country : $2" );
  150.        $country->configure( -text => $2 );
  151.        print "[+] Country : $2\n";
  152.    }
  153.    else {
  154.        $country->configure( -text => "Not Found" );
  155.    }
  156.    if ( $re =~ /State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>/ ) {
  157.        savefile( "info-logs.txt", "[+] State of Region : $2" );
  158.        $state->configure( -text => $2 );
  159.    }
  160.    else {
  161.        $state->configure( -text => "Not Found" );
  162.    }
  163.  
  164.    my $code = toma( "http://www.ip-adress.com/reverse_ip/" . $target );
  165.  
  166.    savefile( "info-logs.txt", "" );
  167.  
  168.    while ( $code =~ /whois\/(.*?)\">Whois/g ) {
  169.        my $dnsa = $1;
  170.        chomp $dnsa;
  171.        savefile( "info-logs.txt", "[+] DNS Found : $dnsa" );
  172.        $dns->insert( "end", $dnsa );
  173.    }
  174.    savefile( "info-logs.txt", "\n######################\n" );
  175. }
  176.  
  177. sub openlogs {
  178.    system("start logs/info-logs.txt");
  179. }
  180.  
  181. sub installer {
  182.    unless ( -d "/logs" ) {
  183.        mkdir( "logs/", 777 );
  184.    }
  185. }
  186.  
  187. sub savefile {
  188.    open( SAVE, ">>logs/" . $_[0] );
  189.    print SAVE $_[1] . "\n";
  190.    close SAVE;
  191. }
  192.  
  193. sub toma {
  194.    return $nave->get( $_[0] )->content;
  195. }
  196.  
  197. #The End ?
  198.  


En línea

H20-X

Desconectado Desconectado

Mensajes: 83


Ver Perfil
Re: [Perl Tk] LocateIP 0.4
« Respuesta #1 en: 25 Marzo 2012, 21:58 pm »

yo con ubuntu no consigo arrancarlo .........no se debe ser el cansancio. :-\


En línea

BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
Re: [Perl Tk] LocateIP 0.4
« Respuesta #2 en: 25 Marzo 2012, 22:21 pm »

yo solo lo eh probado en Window Seven , podrias mostrar el error que te aparece para ver si te puedo ayudar.
En línea

H20-X

Desconectado Desconectado

Mensajes: 83


Ver Perfil
Re: [Perl Tk] LocateIP 0.4
« Respuesta #3 en: 27 Marzo 2012, 21:31 pm »

Es realmente estraño el perl que has hecho como link decoder va muy bien y encambio este nada!!!! :-\
En línea

BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
Re: [Perl Tk] LocateIP 0.4
« Respuesta #4 en: 27 Marzo 2012, 21:52 pm »

eso es porque este programa esta hecho solo para Windows.

edito : si queres que te ande borra estas lineas del codigo

Código
  1. if ( $^O eq 'MSWin32' ) {
  2.    use Win32::Console;
  3.    Win32::Console::Free();
  4. }
  5.  

Ese es el error que te aparece , pero como ya te dije el programa solo esta hecho para Windows porque se te va a ver todo el texto movido.
« Última modificación: 27 Marzo 2012, 22:02 pm por Doddy » En línea

H20-X

Desconectado Desconectado

Mensajes: 83


Ver Perfil
Re: [Perl Tk] LocateIP 0.4
« Respuesta #5 en: 1 Abril 2012, 00:33 am »

nada le he quitado la linea esa que me  has dicho y ahora me sale esto :

   Can't locate Tk.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at LocateIP.pl line 6.
BEGIN failed--compilation aborted at LocateIP.pl line 6.
En línea

BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
Re: [Perl Tk] LocateIP 0.4
« Respuesta #6 en: 1 Abril 2012, 01:02 am »

Es porque te hace falta instalar Tk.

Si estas usando ubuntu podes instalarlo con Synaptic.
« Última modificación: 1 Abril 2012, 01:05 am por Doddy » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Perl] LocateIP 0.3
Scripting
BigBear 0 1,572 Último mensaje 19 Enero 2012, 20:35 pm
por BigBear
[PyQT4] LocateIP 0.1
Scripting
BigBear 4 3,081 Último mensaje 29 Agosto 2012, 01:48 am
por -- KiLiaN --
[Java] LocateIP 0.1
Java
BigBear 0 1,449 Último mensaje 13 Enero 2013, 03:39 am
por BigBear
[Delphi] LocateIP 0.1
Programación General
BigBear 5 2,820 Último mensaje 12 Mayo 2013, 21:35 pm
por 0xFer
[Python-Android] LocateIP 0.1
Scripting
BigBear 0 1,774 Último mensaje 19 Agosto 2013, 20:19 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines