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

 

 


Tema destacado: Tutorial básico de Quickjs


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Delphi] LocateIP 0.5
« en: 4 Abril 2014, 20:16 pm »

Version final de este programa para localizar la IP y DNS de una pagina.

Una imagen :



El codigo :

Código
  1. // LocateIP 0.5
  2. // (C) Doddy Hackman 2014
  3. // Credits :
  4. // Based on the services :
  5. // To get IP -- http://whatismyipaddress.com/
  6. // To locate IP -- http://www.melissadata.com/
  7. // To get DNS -- http://www.ip-adress.com/
  8. // Thanks to whatismyipaddress.com , www.melissadata.com , www.ip-adress.com
  9.  
  10. unit locate;
  11.  
  12. interface
  13.  
  14. uses
  15.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  16.  System.Classes, Vcl.Graphics,
  17.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls,
  18.  IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, PerlRegEx,
  19.  IdMultipartFormData, Vcl.Imaging.pngimage, Vcl.ExtCtrls;
  20.  
  21. type
  22.  TForm1 = class(TForm)
  23.    GroupBox1: TGroupBox;
  24.    Edit1: TEdit;
  25.    Button1: TButton;
  26.    GroupBox2: TGroupBox;
  27.    Edit2: TEdit;
  28.    Edit3: TEdit;
  29.    Edit4: TEdit;
  30.    StatusBar1: TStatusBar;
  31.    Label1: TLabel;
  32.    Label2: TLabel;
  33.    Label3: TLabel;
  34.    IdHTTP1: TIdHTTP;
  35.    Image1: TImage;
  36.    GroupBox3: TGroupBox;
  37.    ListBox1: TListBox;
  38.    procedure Button1Click(Sender: TObject);
  39.  private
  40.    { Private declarations }
  41.  public
  42.    { Public declarations }
  43.  end;
  44.  
  45. var
  46.  Form1: TForm1;
  47.  
  48. implementation
  49.  
  50. {$R *.dfm}
  51.  
  52. procedure TForm1.Button1Click(Sender: TObject);
  53. var
  54.  regex: TPerlRegEx;
  55.  par: TIdMultiPartFormDataStream;
  56.  rta: string;
  57.  z: integer;
  58.  
  59. begin
  60.  
  61.  regex := TPerlRegEx.Create();
  62.  
  63.  par := TIdMultiPartFormDataStream.Create;
  64.  par.AddFormField('DOMAINNAME', Edit1.text);
  65.  
  66.  StatusBar1.Panels[0].text := '[+] Getting IP ...';
  67.  Form1.StatusBar1.Update;
  68.  
  69.  rta := IdHTTP1.Post('http://whatismyipaddress.com/hostname-ip', par);
  70.  
  71.  regex.regex := 'Lookup IP Address: <a href=(.*)>(.*)<\/a>';
  72.  regex.Subject := rta;
  73.  
  74.  if regex.Match then
  75.  begin
  76.    Edit1.text := regex.Groups[2];
  77.  
  78.    StatusBar1.Panels[0].text := '[+] Locating ...';
  79.    Form1.StatusBar1.Update;
  80.  
  81.    rta := IdHTTP1.Get
  82.      ('http://www.melissadata.com/lookups/iplocation.asp?ipaddress=' +
  83.      Edit1.text);
  84.  
  85.    regex.regex := 'City<\/td><td align=(.*)><b>(.*)<\/b><\/td>';
  86.    regex.Subject := rta;
  87.  
  88.    if regex.Match then
  89.    begin
  90.      Edit2.text := regex.Groups[2];
  91.    end
  92.    else
  93.    begin
  94.      Edit2.text := 'Not Found';
  95.    end;
  96.  
  97.    regex.regex := 'Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>';
  98.    regex.Subject := rta;
  99.  
  100.    if regex.Match then
  101.    begin
  102.      Edit3.text := regex.Groups[2];
  103.    end
  104.    else
  105.    begin
  106.      Edit3.text := 'Not Found';
  107.    end;
  108.  
  109.    regex.regex := 'State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>';
  110.    regex.Subject := rta;
  111.  
  112.    if regex.Match then
  113.    begin
  114.      Edit4.text := regex.Groups[2];
  115.    end
  116.    else
  117.    begin
  118.      Edit4.text := 'Not Found';
  119.    end;
  120.  
  121.    StatusBar1.Panels[0].text := '[+] Getting DNS ...';
  122.    Form1.StatusBar1.Update;
  123.  
  124.    ListBox1.Items.Clear;
  125.  
  126.    rta := IdHTTP1.Get('http://www.ip-adress.com/reverse_ip/' + Edit1.text);
  127.  
  128.    regex.regex := 'whois\/(.*?)\">Whois';
  129.    regex.Subject := rta;
  130.  
  131.    while regex.MatchAgain do
  132.    begin
  133.      for z := 1 to regex.GroupCount do
  134.        ListBox1.Items.Add(regex.Groups[z]);
  135.    end;
  136.  
  137.  end
  138.  else
  139.  begin
  140.    StatusBar1.Panels[0].text := '[-] Error';
  141.    Form1.StatusBar1.Update;
  142.  end;
  143.  
  144.  StatusBar1.Panels[0].text := '[+] Finished';
  145.  Form1.StatusBar1.Update;
  146.  
  147.  regex.Free;
  148.  
  149. end;
  150.  
  151. end.
  152.  
  153. // The End ?
  154.  

Si lo quieren bajar lo pueden hacer de aca.


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,576 Último mensaje 19 Enero 2012, 20:35 pm
por BigBear
[Perl Tk] LocateIP 0.4
Scripting
BigBear 6 3,116 Último mensaje 1 Abril 2012, 01:02 am
por BigBear
[PyQT4] LocateIP 0.1
Scripting
BigBear 4 3,092 Último mensaje 29 Agosto 2012, 01:48 am
por -- KiLiaN --
[Java] LocateIP 0.1
Java
BigBear 0 1,455 Último mensaje 13 Enero 2013, 03:39 am
por BigBear
[Delphi] LocateIP 0.1
Programación General
BigBear 5 2,832 Último mensaje 12 Mayo 2013, 21:35 pm
por 0xFer
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines