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

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


  Mostrar Temas
Páginas: 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ... 43
11  Programación / Programación General / [Delphi] DH Downloader 2.0 en: 28 Octubre 2016, 22:21 pm
Un Downloader hecho en Delphi.

Tiene las siguientes opciones :

  • Principales :
  • Mezclar una imagen con un malware y que la imagen resultante se vea bien
  • Descargar manualmente o generar el stub para descargar la imagen infectada y ejecutar el malware
  • Secundarias :
[++] Ocultar rastros
[++] Persistencia
[++] UAC Tricky
[++] Extraccion de malware personalizado
[++] Editar la fecha de creacion del malware
[++] File Pumper
[++] Extension Spoofer
[++] Icon Changer

  • Antis :
[++] Virtual PC
[++] Virtual Box
[++] Debug
[++] Wireshark
[++] OllyDg
[++] Anubis
[++] Kaspersky
[++] VMWare

  • Disables :
[++] UAC
[++] Firewall
[++] CMD
[++] Run
[++] Taskmgr
[++] Regedit
[++] Updates
[++] MsConfig

Una imagen :



Un video con ejemplos de uso :



Si quieren bajar el programa y el proyecto con el codigo fuente lo pueden hacer desde aca :

SourceForge.
Github.

Eso seria todo.
12  Programación / Programación General / [Delphi] DH Virus Maker 2.0 en: 18 Octubre 2016, 15:16 pm
Un generador de virus hecho en Delphi.

Tiene las siguientes opciones :

  • Funciones
[++] Borrar archivos
[++] Matar procesos
[++] Ejecutar comandos
[++] Abrir CD
[++] Ocultar iconos y taskbar
[++] Messages Single & Bomber
[++] SendKeys
[++] Abrir word y escribir solo
[++] Crazy Mouse
[++] Crazy Hour
[++] Apagar,reiniciar y cerrar sesion
[++] Abrir URL
[++] Cargar Paint
[++] Cambiar texto del taskbar
[++] Apagar monitor
[++] Hacer que la computadora hable
[++] Beep Bomber
[++] Bloquear el teclado y el mouse
[++] Cambiar y bloquear el wallpaper
[++] Cambiar y bloquear el screensaver
[++] Printer Bomber
[++] Form Bomber
[++] HTML Bomber
[++] Windows Bomber
[++] Descargar y ejecutar malware con threads

  • Antidoto :
[++] Activar Firewall
[++] Activar Regedit
[++] Activar UAC
[++] Activar CMD
[++] Activar Run
[++] Restaurar y desbloquear wallpaper o screensaver
[++] Activar Taskmgr
[++] Activar Updates
[++] Restaurar texto de taskbar
[++] Mostrar de nuevo iconos o taskbar

  • Secundarias :
[++] Ocultar rastros
[++] Persistencia
[++] UAC Tricky
[++] Extraccion de malware personalizado
[++] Editar la fecha de creacion del malware
[++] File Pumper
[++] Extension Spoofer
[++] Icon Changer

  • Antis :
[++] Virtual PC
[++] Virtual Box
[++] Debug
[++] Wireshark
[++] OllyDg
[++] Anubis
[++] Kaspersky
[++] VMWare

  • Disables :
[++] UAC
[++] Firewall
[++] CMD
[++] Run
[++] Taskmgr
[++] Regedit
[++] Updates
[++] MsConfig

Unas imagen :



Un video con ejemplos de uso :



Si quieren bajar el programa y el proyecto con el codigo fuente lo pueden hacer desde aca :

SourceForge.
Github.

Eso seria todo.
13  Programación / Programación General / [Delphi] Project Spartacus 2.0 en: 16 Octubre 2016, 14:32 pm
Una IRC Botnet hecha en Delphi.

Tiene las siguientes opciones :

  • Principales :
[++] Conectar a cualquier servidor irc
[++] Permite servidor IRC secundario
[++] Establecer timeout por cada respuesta
[++] El infectado puede usar un nick configurado o la ip codificada

  • Funciones
[++] Listar directorio
[++] Leer archivos
[++] Borrar archivos
[++] Listar procesos
[++] Matar procesos por nombre
[++] Ejecutar y leer comandos
[++] Activar y desactivar regedit
[++] Activar y desactivar firewall
[++] Abrir y cerrar CD
[++] Mostrar y ocultar iconos
[++] Mostrar y ocultar taskbar
[++] Mostrar mensajes
[++] Message Bomber
[++] Enviar teclas
[++] Ejecutar Word y hacer que escriba solo
[++] Volver loco al mouse
[++] Volver loca la hora
[++] Apagar,reiniciar y cerrar sesion
[++] Abrir paginas
[++] Abrir paint
[++] Cambiar el texto del taskbar
[++] Apagar el monitor
[++] Hacer hablar a la computadora
[++] Beeps Bomber
[++] Listar drives,servicios y ventanas activas
[++] Descargar y ejecutar en segundo plano con threads
[++] Cambiar y bloquear el wallpaper
[++] Cambiar y bloquear el screensaver
[++] Printer Bomber
[++] Form Bomber
[++] HTML Bomber
[++] Windows Bomber
[++] Bloquear el mouse y el teclado
[++] Keylogger
[++] Desintalador

  • DoS :
[++] SQLI Dos
[++] HTTP Flood
[++] Socket Flood
[++] Slowloris
[++] UDP Flood

  • Secundarias :
[++] Ocultar rastros
[++] Persistencia
[++] UAC Tricky
[++] Extraccion de malware personalizado
[++] Editar la fecha de creacion del malware
[++] File Pumper
[++] Extension Spoofer
[++] Icon Changer

  • Antis :
[++] Virtual PC
[++] Virtual Box
[++] Debug
[++] Wireshark
[++] OllyDg
[++] Anubis
[++] Kaspersky
[++] VMWare

  • Disables :
[++] UAC
[++] Firewall
[++] CMD
[++] Run
[++] Taskmgr
[++] Regedit
[++] Updates
[++] MsConfig

Unas imagenes :





Un video con ejemplos de uso :



Si quieren bajar el programa y el proyecto con el codigo fuente lo pueden hacer desde aca :

SourceForge.
Github.

Eso seria todo.

MOD: Imagen adaptada a lo usado en el foro.
14  Programación / Programación General / [Delphi] DH Botnet 2.0 en: 14 Octubre 2016, 16:16 pm
Una Botnet hecha en Delphi.

Tiene las siguientes opciones :

  • Principales :
[++] Generar Key por cada infectado
[++] Generar App en PHP de la botnet desde la GUI principal

  • Funciones
[++] Listar directorio
[++] Leer archivos
[++] Borrar archivos
[++] Listar procesos
[++] Matar procesos por nombre
[++] Ejecutar y leer comandos
[++] Activar y desactivar regedit
[++] Activar y desactivar firewall
[++] Abrir y cerrar CD
[++] Mostrar y ocultar iconos
[++] Mostrar y ocultar taskbar
[++] Mostrar mensajes
[++] Message Bomber
[++] Enviar teclas
[++] Ejecutar Word y hacer que escriba solo
[++] Volver loco al mouse
[++] Volver loca la hora
[++] Apagar,reiniciar y cerrar sesion
[++] Abrir paginas
[++] Abrir paint
[++] Cambiar el texto del taskbar
[++] Apagar el monitor
[++] Hacer hablar a la computadora
[++] Beeps Bomber
[++] Listar drives,servicios y ventanas activas
[++] Descargar y ejecutar en segundo plano con threads
[++] Cambiar y bloquear el wallpaper
[++] Cambiar y bloquear el screensaver
[++] Printer Bomber
[++] Form Bomber
[++] HTML Bomber
[++] Windows Bomber
[++] Bloquear el mouse y el teclado
[++] Keylogger
[++] Desintalador

  • DoS :
[++] SQLI Dos
[++] HTTP Flood
[++] Socket Flood
[++] Slowloris
[++] UDP Flood

  • Secundarias :
[++] Ocultar rastros
[++] Persistencia
[++] UAC Tricky
[++] Extraccion de malware personalizado
[++] Editar la fecha de creacion del malware
[++] File Pumper
[++] Extension Spoofer
[++] Icon Changer

  • Antis :
[++] Virtual PC
[++] Virtual Box
[++] Debug
[++] Wireshark
[++] OllyDg
[++] Anubis
[++] Kaspersky
[++] VMWare

  • Disables :
[++] UAC
[++] Firewall
[++] CMD
[++] Run
[++] Taskmgr
[++] Regedit
[++] Updates
[++] MsConfig

Unas imagenes :





Un video con ejemplos de uso :



Si quieren bajar el programa y el proyecto con el codigo fuente lo pueden hacer desde aca :

SourceForge.
Github.

Eso seria todo.

MOD: Imagen adaptada a lo permitido en el foro.
15  Programación / Programación General / [Delphi] DH Rat 2.0 en: 12 Octubre 2016, 21:07 pm
Un Rat hecho en Delphi.

Tiene las siguientes opciones :

  • Principales :
[++] Conexion reversa
[++] Conexion codificada

  • Funciones
[++] Listar directorio
[++] Leer archivos
[++] Borrar archivos
[++] Listar procesos
[++] Matar procesos por nombre
[++] Ejecutar y leer comandos
[++] Activar y desactivar regedit
[++] Activar y desactivar firewall
[++] Abrir y cerrar CD
[++] Mostrar y ocultar iconos
[++] Mostrar y ocultar taskbar
[++] Mostrar mensajes
[++] Message Bomber
[++] Enviar teclas
[++] Ejecutar Word y hacer que escriba solo
[++] Volver loco al mouse
[++] Volver loca la hora
[++] Apagar,reiniciar y cerrar sesion
[++] Abrir paginas
[++] Abrir paint
[++] Cambiar el texto del taskbar
[++] Apagar el monitor
[++] Hacer hablar a la computadora
[++] Beeps Bomber
[++] Listar drives,servicios y ventanas activas
[++] Descargar y ejecutar en segundo plano con threads
[++] Cambiar y bloquear el wallpaper
[++] Cambiar y bloquear el screensaver
[++] Printer Bomber
[++] Form Bomber
[++] HTML Bomber
[++] Windows Bomber
[++] Bloquear el mouse y el teclado
[++] Capturar la webcam de forma remota
[++] Capturar el escritorio de forma remota
[++] Keylogger
[++] Desintalador

  • DoS :
[++] SQLI Dos
[++] HTTP Flood
[++] Socket Flood
[++] Slowloris
[++] UDP Flood

  • Secundarias :
[++] Ocultar rastros
[++] Persistencia
[++] UAC Tricky
[++] Extraccion de malware personalizado
[++] Editar la fecha de creacion del malware
[++] File Pumper
[++] Extension Spoofer
[++] Icon Changer

  • Antis :
[++] Virtual PC
[++] Virtual Box
[++] Debug
[++] Wireshark
[++] OllyDg
[++] Anubis
[++] Kaspersky
[++] VMWare

  • Disables :
[++] UAC
[++] Firewall
[++] CMD
[++] Run
[++] Taskmgr
[++] Regedit
[++] Updates
[++] MsConfig

Una imagen :



Un video con ejemplos de uso :



Si quieren bajar el programa y el proyecto con el codigo fuente lo pueden hacer desde aca :

SourceForge.
Github.

Eso seria todo.
16  Programación / Programación General / [Delphi] DH Auto Clicker 0.6 en: 2 Octubre 2016, 20:02 pm
Un programa en Delphi para usar un clicker automatico para juegos o lo que sea.

Opciones :

  • Capturar posicion del mouse para usar en el programa
  • Timeout para cada click
  • Teclas de acceso rapido para empezar y terminar el clicker
  • Clicks en posiciones aleatorias
  • Los Clicks que permite son izquierda,medio,derecha y doble click

Una imagen :



El codigo :

Código
  1. // DH Auto Clicker 0.6
  2. // (C) Doddy Hackman 2016
  3.  
  4. unit auto_clicker;
  5.  
  6. interface
  7.  
  8. uses
  9.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  10.  System.Classes, Vcl.Graphics,
  11.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls,
  12.  Vcl.ComCtrls, Math, Vcl.ImgList, Vcl.Imaging.pngimage;
  13.  
  14. type
  15.  TFormHome = class(TForm)
  16.    logo: TImage;
  17.    gbMousePosition: TGroupBox;
  18.    lblXPosition: TLabel;
  19.    txt_X_Now: TEdit;
  20.    lblYPosition: TLabel;
  21.    txt_Y_Now: TEdit;
  22.    gbOptions: TGroupBox;
  23.    lblType: TLabel;
  24.    cmbType: TComboBox;
  25.    lblSleep: TLabel;
  26.    txtSleep: TEdit;
  27.    lblXSelect: TLabel;
  28.    txt_X_Select: TEdit;
  29.    lblYSelect: TLabel;
  30.    txt_Y_Select: TEdit;
  31.    lblSeconds: TLabel;
  32.    btnGetPosition: TButton;
  33.    cbUseRandomClicks: TCheckBox;
  34.    btnStart: TButton;
  35.    btnStop: TButton;
  36.    status: TStatusBar;
  37.    tmGetMousePosition: TTimer;
  38.    tmClicker: TTimer;
  39.    notificar: TTrayIcon;
  40.    tmHookKeys: TTimer;
  41.    ilIconos: TImageList;
  42.    procedure tmGetMousePositionTimer(Sender: TObject);
  43.    procedure btnGetPositionClick(Sender: TObject);
  44.    procedure tmClickerTimer(Sender: TObject);
  45.    procedure notificarClick(Sender: TObject);
  46.    procedure tmHookKeysTimer(Sender: TObject);
  47.    procedure btnStartClick(Sender: TObject);
  48.    procedure btnStopClick(Sender: TObject);
  49.  private
  50.    { Private declarations }
  51.  public
  52.    procedure capturar_posicion_mouse();
  53.    procedure iniciar_clicker();
  54.    procedure desactivar_clicker();
  55.  end;
  56.  
  57. var
  58.  FormHome: TFormHome;
  59.  
  60. implementation
  61.  
  62. {$R *.dfm}
  63.  
  64. function message_box(title, message_text, type_message: string): string;
  65. begin
  66.  if not(title = '') and not(message_text = '') and not(type_message = '') then
  67.  begin
  68.    try
  69.      begin
  70.        if (type_message = 'Information') then
  71.        begin
  72.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  73.            MB_ICONINFORMATION);
  74.        end
  75.        else if (type_message = 'Warning') then
  76.        begin
  77.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  78.            MB_ICONWARNING);
  79.        end
  80.        else if (type_message = 'Question') then
  81.        begin
  82.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  83.            MB_ICONQUESTION);
  84.        end
  85.        else if (type_message = 'Error') then
  86.        begin
  87.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  88.            MB_ICONERROR);
  89.        end
  90.        else
  91.        begin
  92.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  93.            MB_ICONINFORMATION);
  94.        end;
  95.        Result := '[+] MessageBox : OK';
  96.      end;
  97.    except
  98.      begin
  99.        Result := '[-] Error';
  100.      end;
  101.    end;
  102.  end
  103.  else
  104.  begin
  105.    Result := '[-] Error';
  106.  end;
  107. end;
  108.  
  109. procedure mouse_click(option: string);
  110. // Function based in : http://www.swissdelphicenter.ch/torry/showcode.php?id=360
  111. // Thanks to Thomas Stutz
  112. begin
  113.  if (option = 'left') then
  114.  begin
  115.    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
  116.    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  117.  end
  118.  else if (option = 'right') then
  119.  begin
  120.    mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
  121.    mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
  122.  end
  123.  else if (option = 'middle') then
  124.  begin
  125.    mouse_event(MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0);
  126.    mouse_event(MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0);
  127.  end
  128.  else if (option = 'double') then
  129.  begin
  130.    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
  131.    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  132.    GetDoubleClickTime;
  133.    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
  134.    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  135.  end
  136.  else
  137.  begin
  138.    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
  139.    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  140.  end;
  141. end;
  142.  
  143. procedure TFormHome.iniciar_clicker();
  144. begin
  145.  if (cmbType.ItemIndex <> -1) and not(txt_X_Select.Text = '') and
  146.    not(txt_Y_Select.Text = '') and not(txtSleep.Text = '') then
  147.  begin
  148.    tmClicker.Interval := StrToInt(txtSleep.Text) * 1000;
  149.    tmClicker.Enabled := True;
  150.    status.Panels[0].Text := '[+] Working ...';
  151.    FormHome.Update;
  152.    notificar.BalloonTitle := 'DH Auto Clicker';
  153.    notificar.BalloonHint := 'Clicker Started';
  154.    notificar.ShowBalloonHint;
  155.  end
  156.  else
  157.  begin
  158.    message_box('DH Auto Clicker 0.6', 'Complete the options', 'Warning');
  159.  end;
  160. end;
  161.  
  162. procedure TFormHome.desactivar_clicker();
  163. begin
  164.  tmClicker.Enabled := False;
  165.  status.Panels[0].Text := '[+] Stopped';
  166.  FormHome.Update;
  167.  notificar.BalloonTitle := 'DH Auto Clicker';
  168.  notificar.BalloonHint := 'Clicker Stopped';
  169.  notificar.ShowBalloonHint;
  170. end;
  171.  
  172. procedure TFormHome.btnStartClick(Sender: TObject);
  173. begin
  174.  iniciar_clicker();
  175. end;
  176.  
  177. procedure TFormHome.btnStopClick(Sender: TObject);
  178. begin
  179.  desactivar_clicker();
  180. end;
  181.  
  182. procedure TFormHome.capturar_posicion_mouse();
  183. begin
  184.  txt_X_Select.Text := txt_X_Now.Text;
  185.  txt_Y_Select.Text := txt_Y_Now.Text;
  186.  status.Panels[0].Text := '[+] Position updated';
  187.  FormHome.Update;
  188.  notificar.BalloonTitle := 'DH Auto Clicker';
  189.  notificar.BalloonHint := 'Position updated';
  190.  notificar.ShowBalloonHint;
  191. end;
  192.  
  193. procedure TFormHome.notificarClick(Sender: TObject);
  194. begin
  195.  Show();
  196.  WindowState := wsNormal;
  197.  Application.BringToFront();
  198. end;
  199.  
  200. procedure TFormHome.btnGetPositionClick(Sender: TObject);
  201. begin
  202.  capturar_posicion_mouse();
  203. end;
  204.  
  205. procedure TFormHome.tmGetMousePositionTimer(Sender: TObject);
  206. var
  207.  ubicacion: tPoint;
  208. begin
  209.  ubicacion := Mouse.CursorPos;
  210.  txt_X_Now.Text := IntToStr(ubicacion.X);
  211.  txt_Y_Now.Text := IntToStr(ubicacion.Y);
  212. end;
  213.  
  214. procedure TFormHome.tmHookKeysTimer(Sender: TObject);
  215. var
  216.  i: integer;
  217.  re: Longint;
  218. begin
  219.  for i := 119 to 124 do
  220.  begin
  221.    re := GetAsyncKeyState(i);
  222.    If re = -32767 then
  223.    Begin
  224.      if (i = 120) then
  225.      begin
  226.        capturar_posicion_mouse();
  227.      end
  228.      else if (i = 122) then
  229.      begin
  230.        iniciar_clicker();
  231.      end
  232.      else if (i = 123) then
  233.      begin
  234.        desactivar_clicker();
  235.      end
  236.      else
  237.      begin
  238.        // ?
  239.      end;
  240.    End;
  241.  End;
  242. end;
  243.  
  244. procedure TFormHome.tmClickerTimer(Sender: TObject);
  245. var
  246.  tipo: integer;
  247.  nombre_tipo: string;
  248.  X: integer;
  249.  Y: integer;
  250.  time_sleep: integer;
  251. begin
  252.  
  253.  tipo := cmbType.ItemIndex;
  254.  nombre_tipo := '';
  255.  
  256.  if (tipo = 0) then
  257.  begin
  258.    nombre_tipo := 'left';
  259.  end
  260.  else if (tipo = 1) then
  261.  begin
  262.    nombre_tipo := 'middle';
  263.  end
  264.  else if (tipo = 2) then
  265.  begin
  266.    nombre_tipo := 'right';
  267.  end
  268.  else if (tipo = 3) then
  269.  begin
  270.    nombre_tipo := 'double';
  271.  end
  272.  else
  273.  begin
  274.    nombre_tipo := 'left';
  275.  end;
  276.  
  277.  X := 0;
  278.  Y := 0;
  279.  
  280.  if (cbUseRandomClicks.Checked) then
  281.  begin
  282.    X := RandomRange(1, 2000);
  283.    Y := RandomRange(1, 1000);
  284.  end
  285.  else
  286.  begin
  287.    X := StrToInt(txt_X_Select.Text);
  288.    Y := StrToInt(txt_Y_Select.Text);
  289.  end;
  290.  
  291.  time_sleep := StrToInt(txtSleep.Text) * 1000;
  292.  
  293.  SetCursorPos(X, Y);
  294.  
  295.  mouse_click(nombre_tipo);
  296.  
  297. end;
  298.  
  299. end.
  300.  
  301. // The End ?
  302.  

Si quieren bajar el programa y el proyecto con el codigo fuente lo pueden hacer desde aca :

SourceForge.

Eso seria todo.
17  Programación / Programación General / [Delphi] Base64 Image Encoder 0.2 en: 17 Septiembre 2016, 23:19 pm
Un programa en Delphi para codificar cualquier imagen a Base64 para usar en HTML , se puede copiar el codigo en el portapapeles o guardar en un archivo desde el programa mismo.

Una imagen :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.

Eso seria todo.
18  Programación / Programación General / [Delphi] DH Browser 1.0 en: 5 Septiembre 2016, 02:33 am
Un navegador web en Delphi con las siguientes opciones :

  • Podes ver el codigo fuente de la pagina cargado
  • Se puede modificar los headers para HTTP Header Injection
  • Se puede buscar palabras en el codigo fuente
  • SQLI Scanner incorporado
  • Admin Finder incorporado
  • Crack MD5 incorporado

Una imagen :



El codigo :

Código
  1. // DH Browser 1.0
  2. // (C) Doddy Hackman 2016
  3. // Credits :
  4. // Navigate based on : http://www.swissdelphicenter.ch/torry/showcode.php?id=2242
  5. // FindText based on : http://delphi.cjcsoft.net/viewthread.php?tid=47143
  6. // Get HTML based on : http://delphi.about.com/od/adptips2005/qt/webbrowserhtml.htm
  7.  
  8. unit dh;
  9.  
  10. interface
  11.  
  12. uses
  13.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  14.  System.Classes, Vcl.Graphics,
  15.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.OleCtrls, SHDocVw,
  16.  Vcl.Imaging.pngimage, Vcl.ExtCtrls, Vcl.ComCtrls, mshtml, Vcl.Menus,
  17.  IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, PerlRegEx,
  18.  IdMultipartFormData, Vcl.ImgList, Vcl.Styles.Utils.ComCtrls,
  19.  Vcl.Styles.Utils.Menus,
  20.  Vcl.Styles.Utils.SysStyleHook,
  21.  Vcl.Styles.Utils.SysControls, Vcl.Styles.Utils.Forms,
  22.  Vcl.Styles.Utils.StdCtrls, Vcl.Styles.Utils.ScreenTips;
  23.  
  24. type
  25.  TFormHome = class(TForm)
  26.    gbEnterPage: TGroupBox;
  27.    btnEnter: TButton;
  28.    gbHeaders: TGroupBox;
  29.    mmHeaders: TMemo;
  30.    GroupBox3: TGroupBox;
  31.    GroupBox4: TGroupBox;
  32.    gbAbout: TGroupBox;
  33.    txtURL: TEdit;
  34.    imgLogo: TImage;
  35.    imgAbout: TImage;
  36.    btnSQLI_Scanner: TButton;
  37.    btnAdminFinder: TButton;
  38.    btnCrack_MD5: TButton;
  39.    btnSearch_for_text: TButton;
  40.    cbUse_This_Headers: TCheckBox;
  41.    browser: TWebBrowser;
  42.    status: TStatusBar;
  43.    progreso: TProgressBar;
  44.    mmSource: TMemo;
  45.    menu: TPopupMenu;
  46.    ShowSourceHTML1: TMenuItem;
  47.    ShowBrowser1: TMenuItem;
  48.    nave: TIdHTTP;
  49.    buscar_codigo: TFindDialog;
  50.    ilIconos: TImageList;
  51.    lblAbout: TLabel;
  52.    procedure btnEnterClick(Sender: TObject);
  53.    procedure browserDownloadComplete(Sender: TObject);
  54.    procedure browserProgressChange(ASender: TObject;
  55.      Progress, ProgressMax: Integer);
  56.    procedure ShowSourceHTML1Click(Sender: TObject);
  57.    procedure ShowBrowser1Click(Sender: TObject);
  58.    procedure btnSQLI_ScannerClick(Sender: TObject);
  59.    procedure btnAdminFinderClick(Sender: TObject);
  60.    procedure btnCrack_MD5Click(Sender: TObject);
  61.    procedure btnSearch_for_textClick(Sender: TObject);
  62.    procedure buscar_codigoFind(Sender: TObject);
  63.    procedure FormCreate(Sender: TObject);
  64.  
  65.  private
  66.    { Private declarations }
  67.  public
  68.    { Public declarations }
  69.  end;
  70.  
  71. var
  72.  FormHome: TFormHome;
  73.  
  74. implementation
  75.  
  76. {$R *.dfm}
  77.  
  78. procedure TFormHome.btnAdminFinderClick(Sender: TObject);
  79. const
  80.  paginas: array [1 .. 250] of string = ('admin/admin.asp', 'admin/login.asp',
  81.    'admin/index.asp', 'admin/admin.aspx', 'admin/login.aspx',
  82.    'admin/index.aspx', 'admin/webmaster.asp', 'admin/webmaster.aspx',
  83.    'asp/admin/index.asp', 'asp/admin/index.aspx', 'asp/admin/admin.asp',
  84.    'asp/admin/admin.aspx', 'asp/admin/webmaster.asp',
  85.    'asp/admin/webmaster.aspx', 'admin/', 'login.asp', 'login.aspx',
  86.    'admin.asp', 'admin.aspx', 'webmaster.aspx', 'webmaster.asp',
  87.    'login/index.asp', 'login/index.aspx', 'login/login.asp',
  88.    'login/login.aspx', 'login/admin.asp', 'login/admin.aspx',
  89.    'administracion/index.asp', 'administracion/index.aspx',
  90.    'administracion/login.asp', 'administracion/login.aspx',
  91.    'administracion/webmaster.asp', 'administracion/webmaster.aspx',
  92.    'administracion/admin.asp', 'administracion/admin.aspx', 'php/admin/',
  93.    'admin/admin.php', 'admin/index.php', 'admin/login.php', 'admin/system.php',
  94.    'admin/ingresar.php', 'admin/administrador.php', 'admin/default.php',
  95.    'administracion/', 'administracion/index.php', 'administracion/login.php',
  96.    'administracion/ingresar.php', 'administracion/admin.php',
  97.    'administration/', 'administration/index.php', 'administration/login.php',
  98.    'administrator/index.php', 'administrator/login.php',
  99.    'administrator/system.php', 'system/', 'system/login.php', 'admin.php',
  100.    'login.php', 'administrador.php', 'administration.php', 'administrator.php',
  101.    'admin1.html', 'admin1.php', 'admin2.php', 'admin2.html', 'yonetim.php',
  102.    'yonetim.html', 'yonetici.php', 'yonetici.html', 'adm/',
  103.    'admin/account.php', 'admin/account.html', 'admin/index.html',
  104.    'admin/login.html', 'admin/home.php', 'admin/controlpanel.html',
  105.    'admin/controlpanel.php', 'admin.html', 'admin/cp.php', 'admin/cp.html',
  106.    'cp.php', 'cp.html', 'administrator/', 'administrator/index.html',
  107.    'administrator/login.html', 'administrator/account.html',
  108.    'administrator/account.php', 'administrator.html', 'login.html',
  109.    'modelsearch/login.php', 'moderator.php', 'moderator.html',
  110.    'moderator/login.php', 'moderator/login.html', 'moderator/admin.php',
  111.    'moderator/admin.html', 'moderator/', 'account.php', 'account.html',
  112.    'controlpanel/', 'controlpanel.php', 'controlpanel.html',
  113.    'admincontrol.php', 'admincontrol.html', 'adminpanel.php',
  114.    'adminpanel.html', 'admin1.asp', 'admin2.asp', 'yonetim.asp',
  115.    'yonetici.asp', 'admin/account.asp', 'admin/home.asp',
  116.    'admin/controlpanel.asp', 'admin/cp.asp', 'cp.asp',
  117.    'administrator/index.asp', 'administrator/login.asp',
  118.    'administrator/account.asp', 'administrator.asp', 'modelsearch/login.asp',
  119.    'moderator.asp', 'moderator/login.asp', 'moderator/admin.asp',
  120.    'account.asp', 'controlpanel.asp', 'admincontrol.asp', 'adminpanel.asp',
  121.    'fileadmin/', 'fileadmin.php', 'fileadmin.asp', 'fileadmin.html',
  122.    'administration.html', 'sysadmin.php', 'sysadmin.html', 'phpmyadmin/',
  123.    'myadmin/', 'sysadmin.asp', 'sysadmin/', 'ur-admin.asp', 'ur-admin.php',
  124.    'ur-admin.html', 'ur-admin/', 'Server.php', 'Server.html', 'Server.asp',
  125.    'Server/', 'wpadmin/', 'administr8.php', 'administr8.html', 'administr8/',
  126.    'administr8.asp', 'webadmin/', 'webadmin.php', 'webadmin.asp',
  127.    'webadmin.html', 'administratie/', 'admins/', 'admins.php', 'admins.asp',
  128.    'admins.html', 'administrivia/', 'Database_Administration/', 'WebAdmin/',
  129.    'useradmin/', 'sysadmins/', 'admin1/', 'systemadministration/',
  130.    'administrators/', 'pgadmin/', 'directadmin/', 'staradmin/',
  131.    'ServerAdministrator/', 'SysAdmin/', 'administer/', 'LiveUser_Admin/',
  132.    'sysadmin/', 'typo3/', 'panel/', 'cpanel/', 'cPanel/', 'cpanel_file/',
  133.    'platz_login/', 'rcLogin/', 'blogindex/', 'formslogin/', 'autologin/',
  134.    'support_login/', 'meta_login/', 'manuallogin/', 'simpleLogin/',
  135.    'loginflat/', 'utility_login/', 'showlogin/', 'memlogin/', 'members/',
  136.    'login-redirect/', 'sublogin/', 'wplogin/', 'login1/', 'dirlogin/',
  137.    'login_db/', 'xlogin/', 'smblogin/', 'customer_login/', 'UserLogin/',
  138.    'loginus/', 'acct_login/', 'admin_area/', 'bigadmin/', 'project-admins/',
  139.    'phppgadmin/', 'pureadmin/', 'sqladmin/', 'radmind/', 'openvpnadmin/',
  140.    'wizmysqladmin/', 'vadmind/', 'ezsqliteadmin/', 'hpwebjetadmin/',
  141.    'newsadmin/', 'adminpro/', 'Lotus_Domino_Admin/', 'bbadmin/', 'vmailadmin/',
  142.    'Indy_admin/', 'ccp14admin/', 'irc-macadmin/', 'banneradmin/', 'sshadmin/',
  143.    'phpldapadmin/', 'macadmin/', 'administratoraccounts/', 'admin4_account/',
  144.    'admin4_colon/', 'radmind1/', 'SuperAdmin/', 'AdminTools/', 'cmsadmin/',
  145.    'SysAdmin2/', 'globes_admin/', 'cadmins/', 'phpSQLiteAdmin/',
  146.    'navSiteAdmin/', 'server_admin_small/', 'logo_sysadmin/', 'server/',
  147.    'database_administration/', 'power_user/', 'system_administration/',
  148.    'ss_vms_admin_sm/');
  149. var
  150.  i: Integer;
  151.  control: Integer;
  152.  
  153. var
  154.  cabeceras: OLEVariant;
  155.  uno: OLEVariant;
  156.  dos: OLEVariant;
  157.  tres: OLEVariant;
  158.  
  159. begin
  160.  
  161.  if not(txtURL.Text = '') then
  162.  begin
  163.    control := 0;
  164.  
  165.    status.Panels[0].Text := '[+] Finding Panel ....';
  166.    FormHome.status.Update;
  167.  
  168.    for i := Low(paginas) to High(paginas) do
  169.  
  170.      if (control = 1) then
  171.      begin
  172.        Abort;
  173.      end
  174.      else
  175.      begin
  176.  
  177.        try
  178.  
  179.          status.Panels[0].Text := '[+] Testing : ' + paginas[i];
  180.          FormHome.status.Update;
  181.  
  182.          nave.Get(txtURL.Text + '/' + paginas[i]);
  183.          if nave.ResponseCode = 200 then
  184.          begin
  185.  
  186.            txtURL.Text := txtURL.Text + '/' + paginas[i];
  187.  
  188.            uno := navNoReadFromCache or navNoWriteToCache;
  189.            dos := '';
  190.            tres := '';
  191.  
  192.            if (cbUse_This_Headers.Checked) then
  193.            begin
  194.              cabeceras := mmHeaders.Text;
  195.              browser.Navigate(txtURL.Text, uno, dos, tres, cabeceras);
  196.            end
  197.            else
  198.            begin
  199.              cabeceras := '';
  200.              browser.Navigate(txtURL.Text, uno, dos, tres, cabeceras);
  201.            end;
  202.            control := 1;
  203.            status.Panels[0].Text := '[+] Panel Found';
  204.            FormHome.status.Update;
  205.            MessageBox(0, 'Panel Found', 'DH Browser 1.0', MB_ICONINFORMATION);
  206.            Abort;
  207.          end;
  208.        except
  209.          on E: EIdHttpProtocolException do;
  210.          on E: Exception do;
  211.        end;
  212.  
  213.      end;
  214.  
  215.    status.Panels[0].Text := '[-] Panel not found';
  216.    FormHome.status.Update;
  217.    MessageBox(0, 'Panel not found', 'DH Browser 1.0', MB_ICONERROR);
  218.  end
  219.  else
  220.  begin
  221.    MessageBox(0, 'Enter URL', 'DH Browser 1.0', MB_ICONINFORMATION);
  222.  end;
  223.  
  224. end;
  225.  
  226. procedure TFormHome.browserDownloadComplete(Sender: TObject);
  227. var
  228.  buscador: IHTMLElement;
  229. begin
  230.  
  231.  progreso.Position := 0;
  232.  
  233.  status.Panels[0].Text := '[+] Page loaded';
  234.  FormHome.status.Update;
  235.  
  236.  // Get HTML based on : http://delphi.about.com/od/adptips2005/qt/webbrowserhtml.htm
  237.  
  238.  begin
  239.  
  240.    try
  241.      begin
  242.  
  243.        mmSource.Clear;
  244.  
  245.        buscador := (browser.Document AS IHTMLDocument2).body;
  246.  
  247.        while not(buscador.parentElement = nil) do
  248.        begin
  249.          buscador := buscador.parentElement;
  250.        end;
  251.        mmSource.Lines.Add(buscador.outerHTML);
  252.      end;
  253.    except
  254.      // ??
  255.    end;
  256.  end;
  257. end;
  258.  
  259. procedure TFormHome.browserProgressChange(ASender: TObject;
  260.  Progress, ProgressMax: Integer);
  261. begin
  262.  progreso.Max := ProgressMax;
  263.  progreso.Position := Progress;
  264. end;
  265.  
  266. procedure TFormHome.buscar_codigoFind(Sender: TObject);
  267. // FindText based on : http://delphi.cjcsoft.net/viewthread.php?tid=47143
  268.  
  269. var
  270.  aca: PChar;
  271.  aca2: PChar;
  272.  acatoy: PChar;
  273.  acatoy2: Word;
  274.  
  275. begin
  276.  
  277.  With Sender as TFindDialog do
  278.  
  279.  begin
  280.  
  281.    GetMem(aca2, Length(FindText) + 1);
  282.    StrPCopy(aca2, FindText);
  283.  
  284.    acatoy2 := mmSource.GetTextLen + 1;
  285.    GetMem(aca, acatoy2);
  286.  
  287.    mmSource.GetTextBuf(aca, acatoy2);
  288.  
  289.    acatoy := aca + mmSource.SelStart + mmSource.SelLength;
  290.    acatoy := StrPos(acatoy, aca2);
  291.  
  292.    if not(acatoy = NIL) then
  293.    begin
  294.      mmSource.SelStart := acatoy - aca;
  295.      mmSource.SelLength := Length(FindText);
  296.    end;
  297.  
  298.    mmSource.SetFocus;
  299.  
  300.  end;
  301.  
  302. end;
  303.  
  304. procedure TFormHome.btnCrack_MD5Click(Sender: TObject);
  305. var
  306.  md5: string;
  307.  datos: TIdMultiPartFormDataStream;
  308.  code: string;
  309.  regex_check: TPerlRegEx;
  310.  cracked: string;
  311. begin
  312.  
  313.  md5 := InputBox('DH Browser 1.0', 'MD5 : ', '');
  314.  
  315.  if not(md5 = '') then
  316.  begin
  317.    regex_check := TPerlRegEx.Create();
  318.    datos := TIdMultiPartFormDataStream.Create;
  319.    datos.AddFormField('pass', md5);
  320.    datos.AddFormField('option', 'hash2text');
  321.    datos.AddFormField('send', 'Submit');
  322.  
  323.    status.Panels[0].Text := '[+] Cracking ...';
  324.    FormHome.status.Update;
  325.  
  326.    code := nave.Post('http://md5online.net/index.php', datos);
  327.  
  328.    regex_check.regex :=
  329.      '<center><p>md5 :<b>(.*?)</b> <br>pass : <b>(.*?)</b></p>';
  330.    regex_check.Subject := code;
  331.  
  332.    if regex_check.Match then
  333.    begin
  334.      cracked := regex_check.Groups[2];
  335.      status.Panels[0].Text := '[+] MD5 Cracked : ' + cracked;
  336.      FormHome.status.Update;
  337.      MessageBox(0, PChar('MD5 Cracked : ' + cracked), 'DH Browser 1.0',
  338.        MB_ICONINFORMATION);
  339.  
  340.    end
  341.    else
  342.    begin
  343.      status.Panels[0].Text := '[-] Not found';
  344.      FormHome.status.Update;
  345.      MessageBox(0, 'Not found', 'DH Browser 1.0', MB_ICONERROR);
  346.    end;
  347.  end;
  348.  
  349. end;
  350.  
  351. procedure TFormHome.btnEnterClick(Sender: TObject);
  352. // Navigate based on : http://www.swissdelphicenter.ch/torry/showcode.php?id=2242
  353.  
  354. var
  355.  
  356.  cabeceras: OLEVariant;
  357.  uno: OLEVariant;
  358.  dos: OLEVariant;
  359.  tres: OLEVariant;
  360.  
  361. begin
  362.  
  363.  uno := navNoReadFromCache or navNoWriteToCache;
  364.  dos := '';
  365.  tres := '';
  366.  
  367.  if (cbUse_This_Headers.Checked) then
  368.  begin
  369.    cabeceras := mmHeaders.Text;
  370.    browser.Navigate(txtURL.Text, uno, dos, tres, cabeceras);
  371.  end
  372.  else
  373.  begin
  374.    cabeceras := '';
  375.    browser.Navigate(txtURL.Text, uno, dos, tres, cabeceras);
  376.  end;
  377.  
  378. end;
  379.  
  380. procedure TFormHome.FormCreate(Sender: TObject);
  381. begin
  382.  UseLatestCommonDialogs := False;
  383. end;
  384.  
  385. procedure TFormHome.btnSearch_for_textClick(Sender: TObject);
  386. begin
  387.  buscar_codigo.Execute;
  388. end;
  389.  
  390. procedure TFormHome.ShowBrowser1Click(Sender: TObject);
  391. begin
  392.  browser.Visible := True;
  393.  mmSource.Visible := False;
  394. end;
  395.  
  396. procedure TFormHome.ShowSourceHTML1Click(Sender: TObject);
  397. begin
  398.  browser.Visible := False;
  399.  mmSource.Visible := True;
  400. end;
  401.  
  402. procedure TFormHome.btnSQLI_ScannerClick(Sender: TObject);
  403. var
  404.  pass1: string;
  405.  pass2: string;
  406.  code: string;
  407.  urltest: string;
  408.  urlgen: string;
  409.  full: string;
  410.  codedos: string;
  411.  i: Integer;
  412.  regex_check: TPerlRegEx;
  413.  
  414. var
  415.  
  416.  cabeceras: OLEVariant;
  417.  uno: OLEVariant;
  418.  dos: OLEVariant;
  419.  tres: OLEVariant;
  420.  
  421. begin
  422.  
  423.  if not(txtURL.Text = '') then
  424.  begin
  425.    regex_check := TPerlRegEx.Create();
  426.  
  427.    status.Panels[0].Text := '[+] SQLI Scanning ...';
  428.    FormHome.status.Update;
  429.  
  430.    pass1 := '+';
  431.    pass2 := '--';
  432.  
  433.    urltest := 'concat(0x4b30425241,1,0x4b30425241)';
  434.  
  435.    status.Panels[0].Text := '[+] Checking ...';
  436.    FormHome.status.Update;
  437.  
  438.    code := nave.Get(txtURL.Text + '1' + pass1 + 'and' + pass1 + '1=1' + pass2);
  439.  
  440.    codedos := nave.Get(txtURL.Text + '1' + pass1 + 'and' + pass1 +
  441.      '1=0' + pass2);
  442.  
  443.    if not(code = codedos) then
  444.    begin
  445.  
  446.      status.Panels[0].Text := '[+] Finding columns number';
  447.      FormHome.status.Update;
  448.  
  449.      urltest := '1' + pass1 + 'and' + pass1 + '1=0' + pass1 + 'union' + pass1 +
  450.        'select' + pass1 + 'concat(0x4b30425241,1,0x4b30425241)';
  451.      urlgen := '1';
  452.      for i := 2 to 36 do
  453.      begin
  454.  
  455.        status.Panels[0].Text := '[+] Columns Length : ' + IntToStr(i);
  456.        FormHome.status.Update;
  457.        urltest := urltest + ',concat(0x4b30425241,' + IntToStr(i) +
  458.          ',0x4b30425241)';
  459.        urlgen := urlgen + ',' + IntToStr(i);
  460.        code := nave.Get(txtURL.Text + urltest + pass2);
  461.  
  462.        regex_check.regex := 'K0BRA(.*?)K0BRA';
  463.        regex_check.Subject := code;
  464.  
  465.        if regex_check.Match then
  466.        begin
  467.  
  468.          urlgen := StringReplace(urlgen, regex_check.Groups[1], 'hackman', []);
  469.          full := txtURL.Text + '1' + pass1 + 'and' + pass1 + '1=0' + pass1 +
  470.            'union' + pass1 + 'select' + pass1 + urlgen;
  471.  
  472.          txtURL.Text := full;
  473.  
  474.          uno := navNoReadFromCache or navNoWriteToCache;
  475.          dos := '';
  476.          tres := '';
  477.  
  478.          if (cbUse_This_Headers.Checked) then
  479.          begin
  480.            cabeceras := mmHeaders.Text;
  481.            browser.Navigate(txtURL.Text, uno, dos, tres, cabeceras);
  482.          end
  483.          else
  484.          begin
  485.            cabeceras := '';
  486.            browser.Navigate(txtURL.Text, uno, dos, tres, cabeceras);
  487.          end;
  488.          status.Panels[0].Text := '[+] SQI Scanner Finished';
  489.          FormHome.status.Update;
  490.          MessageBox(0, 'SQI Scanner Finished', 'DH Browser 1.0',
  491.            MB_ICONINFORMATION);
  492.  
  493.          Abort;
  494.  
  495.        end;
  496.  
  497.      end;
  498.      status.Panels[0].Text := '[-] Columns length not found';
  499.      FormHome.status.Update;
  500.      MessageBox(0, 'Columns length not found', 'DH Browser 1.0', MB_ICONERROR);
  501.    end
  502.    else
  503.    begin
  504.      status.Panels[0].Text := '[-] Not vulnerable';
  505.      FormHome.status.Update;
  506.      MessageBox(0, 'Not vulnerable', 'DH Browser 1.0', MB_ICONERROR);
  507.    end;
  508.  
  509.    status.Panels[0].Text := '[+] Done';
  510.    FormHome.status.Update;
  511.  end
  512.  else
  513.  begin
  514.    MessageBox(0, 'Enter URL', 'DH Browser 1.0', MB_ICONINFORMATION);
  515.  end;
  516.  
  517. end;
  518.  
  519. end.
  520.  
  521. // The End ?
  522.  

Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
Github.

Eso seria todo.
19  Programación / Programación General / [Delphi] IRC Manager 0.3 en: 20 Agosto 2016, 00:29 am
Un simple cliente para chatear en el IRC.

Una imagen :



El codigo :

Código
  1. // IRC Manager 0.3
  2. // (C) Doddy Hackman 2016
  3.  
  4. unit irc;
  5.  
  6. interface
  7.  
  8. uses
  9.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  10.  System.Classes, Vcl.Graphics,
  11.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.Menus,
  12.  Vcl.Imaging.pngimage, Vcl.ExtCtrls, IdContext, IdBaseComponent, IdComponent,
  13.  IdTCPConnection, IdTCPClient, IdCmdTCPClient, IdIRC, PerlRegex, MMSystem,
  14.  Vcl.ImgList, Vcl.Styles.Utils.ComCtrls, Vcl.Styles.Utils.Menus,
  15.  Vcl.Styles.Utils.SysStyleHook,
  16.  Vcl.Styles.Utils.SysControls, Vcl.Styles.Utils.Forms,
  17.  Vcl.Styles.Utils.StdCtrls, Vcl.Styles.Utils.ScreenTips;
  18.  
  19. type
  20.  TFormHome = class(TForm)
  21.    status: TStatusBar;
  22.    gbIRC_Config: TGroupBox;
  23.    lblHost: TLabel;
  24.    txtHost: TEdit;
  25.    lblPort: TLabel;
  26.    txtPort: TEdit;
  27.    lblChannel: TLabel;
  28.    txtChannel: TEdit;
  29.    lblNick: TLabel;
  30.    gbChat: TGroupBox;
  31.    gbNicks: TGroupBox;
  32.    lbNicks: TListBox;
  33.    txtNickname: TEdit;
  34.    btnConnect: TButton;
  35.    gbEnterText: TGroupBox;
  36.    txtText: TEdit;
  37.    btnSend: TButton;
  38.    logo: TImage;
  39.    mmChat: TRichEdit;
  40.    irc: TIdIRC;
  41.    ilIconos: TImageList;
  42.    procedure btnConnectClick(Sender: TObject);
  43.    procedure ircRaw(ASender: TIdContext; AIn: Boolean; const AMessage: string);
  44.    procedure btnSendClick(Sender: TObject);
  45.    procedure ircPrivateMessage(ASender: TIdContext;
  46.      const ANickname, AHost, ATarget, AMessage: string);
  47.    procedure ircNotice(ASender: TIdContext; const ANickname, AHost, ATarget,
  48.      ANotice: string);
  49.    procedure ircJoin(ASender: TIdContext;
  50.      const ANickname, AHost, AChannel: string);
  51.    procedure ircPart(ASender: TIdContext; const ANickname, AHost, AChannel,
  52.      APartMessage: string);
  53.    procedure ircQuit(ASender: TIdContext;
  54.      const ANickname, AHost, AReason: string);
  55.    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  56.    procedure FormCreate(Sender: TObject);
  57.  private
  58.    { Private declarations }
  59.  public
  60.    { Public declarations }
  61.    logs_messages: Boolean;
  62.  end;
  63.  
  64. var
  65.  FormHome: TFormHome;
  66.  
  67. implementation
  68.  
  69. {$R *.dfm}
  70.  
  71. procedure TFormHome.btnConnectClick(Sender: TObject);
  72. begin
  73.  if (btnConnect.Caption = 'Connect') then
  74.  begin
  75.  
  76.    irc.nickname := txtNickname.text;
  77.    irc.AltNickname := txtNickname.text + '123';
  78.    irc.Username := txtNickname.text;
  79.    irc.RealName := txtNickname.text;
  80.    irc.Password := '';
  81.    irc.host := txtHost.text;
  82.    irc.port := StrToInt(txtPort.text);
  83.  
  84.    mmChat.Lines.Clear;
  85.    lbNicks.Items.Clear;
  86.    logs_messages := False;
  87.  
  88.    try
  89.      begin
  90.        mmChat.Lines.Add('Connecting ...');
  91.        irc.connect;
  92.        irc.Join(txtChannel.text);
  93.        btnConnect.Caption := 'Disconnect';
  94.        status.Panels[0].text := '[+] Connected';
  95.        FormHome.status.Update;
  96.        mmChat.Lines.Add('Connected !');
  97.      end;
  98.    except
  99.      begin
  100.        status.Panels[0].text := '[-] Error connecting to server';
  101.        FormHome.status.Update;
  102.        mmChat.Lines.Add('Error connecting to server !');
  103.        MessageBox(0, 'Error connecting to server', 'IRC Manager 1.0',
  104.          MB_ICONERROR);
  105.      end;
  106.    end;
  107.  end
  108.  else
  109.  begin
  110.    if (btnConnect.Caption = 'Disconnect') then
  111.    begin
  112.      irc.Part('');
  113.      irc.Disconnect('');
  114.      btnConnect.Caption := 'Connect';
  115.      status.Panels[0].text := '[+] Disconnected';
  116.      FormHome.status.Update;
  117.      mmChat.Lines.Add('Disconnected !');
  118.    end;
  119.  end;
  120.  
  121. end;
  122.  
  123. procedure TFormHome.btnSendClick(Sender: TObject);
  124. begin
  125.  if not(txtText.text = '') then
  126.  begin
  127.    irc.Say(txtChannel.text, txtText.text);
  128.    mmChat.Lines.Add('<' + txtNickname.text + '> ' + txtText.text);
  129.    txtText.text := '';
  130.  end;
  131. end;
  132.  
  133. procedure TFormHome.FormClose(Sender: TObject; var Action: TCloseAction);
  134. begin
  135.  if mrYes = MessageDlg('Close program ?', mtwarning, [mbYes, mbNo], 0) then
  136.  begin
  137.    Exit;
  138.  end
  139.  else
  140.  begin
  141.    Action := caNone;
  142.  end;
  143. end;
  144.  
  145. procedure TFormHome.FormCreate(Sender: TObject);
  146. begin
  147.  UseLatestCommonDialogs := False;
  148. end;
  149.  
  150. procedure TFormHome.ircJoin(ASender: TIdContext;
  151.  const ANickname, AHost, AChannel: string);
  152. begin
  153.  lbNicks.Items.Add(ANickname);
  154.  mmChat.Lines.Add(ANickname + ' has joined');
  155. end;
  156.  
  157. procedure TFormHome.ircNotice(ASender: TIdContext;
  158.  const ANickname, AHost, ATarget, ANotice: string);
  159. begin
  160.  // chat.Lines.Add('<' + ANickname + '> ' + ANotice);
  161. end;
  162.  
  163. procedure TFormHome.ircPart(ASender: TIdContext;
  164.  const ANickname, AHost, AChannel, APartMessage: string);
  165. begin
  166.  lbNicks.Items.Delete(lbNicks.Items.IndexOf(ANickname));
  167.  mmChat.Lines.Add(ANickname + ' part');
  168. end;
  169.  
  170. procedure TFormHome.ircPrivateMessage(ASender: TIdContext;
  171.  const ANickname, AHost, ATarget, AMessage: string);
  172. var
  173.  check_regex: TPerlRegex;
  174. begin
  175.  
  176.  check_regex := TPerlRegex.Create();
  177.  
  178.  check_regex.regex := txtNickname.text;
  179.  check_regex.Subject := AMessage;
  180.  check_regex.Options := [preCaseLess];
  181.  
  182.  if check_regex.Match then
  183.  begin
  184.    mmChat.SelAttributes.Color := clRed;
  185.    mmChat.SelAttributes.Style := [fsBold];
  186.    mmChat.Lines.Add('* <' + ANickname + '> ' + AMessage);
  187.    sndPlaySound(Pchar(GetCurrentDir + '/Data/click.wav'), SND_NODEFAULT);
  188.  end
  189.  else
  190.  begin
  191.    mmChat.Lines.Add('<' + ANickname + '> ' + AMessage);
  192.  end;
  193.  
  194.  check_regex.Free;
  195.  
  196. end;
  197.  
  198. procedure TFormHome.ircQuit(ASender: TIdContext;
  199.  const ANickname, AHost, AReason: string);
  200. begin
  201.  lbNicks.Items.Delete(lbNicks.Items.IndexOf(ANickname));
  202.  mmChat.Lines.Add(ANickname + ' quit');
  203. end;
  204.  
  205. procedure TFormHome.ircRaw(ASender: TIdContext; AIn: Boolean;
  206.  const AMessage: string);
  207. var
  208.  i: integer;
  209.  code: string;
  210.  renicks: string;
  211.  listanow: TStringList;
  212.  regex: TPerlRegex;
  213.  otroregex: TPerlRegex;
  214.  nick: string;
  215.  texto: string;
  216. begin
  217.  
  218.  code := AMessage;
  219.  
  220.  if (logs_messages = True) then
  221.  begin
  222.    mmChat.Lines.Add(code);
  223.  end;
  224.  
  225.  regex := TPerlRegex.Create();
  226.  otroregex := TPerlRegex.Create();
  227.  
  228.  regex.regex := '353 (.*) = #(.*) :(.*)';
  229.  regex.Subject := code;
  230.  
  231.  if regex.Match then
  232.  begin
  233.  
  234.    lbNicks.Clear;
  235.  
  236.    renicks := regex.Groups[3];
  237.  
  238.    renicks := StringReplace(renicks, txtNickname.text, '', []);
  239.  
  240.    listanow := TStringList.Create;
  241.    listanow.Delimiter := ' ';
  242.    listanow.DelimitedText := renicks;
  243.  
  244.    for i := 0 to listanow.Count - 1 do
  245.    begin
  246.      if not(listanow[i] = '@') then
  247.      begin
  248.        lbNicks.Items.Add(listanow[i]);
  249.      end;
  250.    end;
  251.  
  252.    lbNicks.Items.Add(txtNickname.text);
  253.  
  254.    logs_messages := False;
  255.  
  256.  end;
  257.  
  258.  otroregex.regex := 'PRIVMSG (.*) :ACTION (.*)';
  259.  otroregex.Subject := code;
  260.  
  261.  if otroregex.Match then
  262.  begin
  263.    nick := otroregex.Groups[1];
  264.    texto := otroregex.Groups[2];
  265.    mmChat.Lines.Add('* ' + texto);
  266.  end;
  267.  
  268.  regex.Free;
  269.  otroregex.Free;
  270.  
  271. end;
  272.  
  273. end.
  274.  
  275. // The End ?
  276.  

Si quieren bajar el programa lo pueden hacer de aca.
20  Programación / Programación General / [Delphi] FTP Manager 1.0 en: 6 Agosto 2016, 04:01 am
Un cliente FTP en Delphi con las siguientes opciones :

  • Se puede conectar a cualquier servidor FTP
  • Navegar y listar los directorios de nuestra computadora
  • Navegar y listar los directorios del servidor FTP
  • Se puede crear,renombrar,eliminar archivos y directorios de nuestra computadora
  • Se puede crear,renombrar,eliminar archivos y directorios del servidor FTP
  • Se puede bajar y subir archivos del servidor FTP comodamente

Una imagen :



El codigo :

Código
  1. // FTP Manager 1.0
  2. // (C) Doddy Hackman 2016
  3.  
  4. unit ftp;
  5.  
  6. interface
  7.  
  8. uses
  9.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  10.  System.Classes, Vcl.Graphics,
  11.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls,
  12.  IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
  13.  IdExplicitTLSClientServerBase, IdFTP, Shellapi, Vcl.ImgList, IdFTPList,
  14.  Vcl.Imaging.pngimage, Vcl.ExtCtrls, Vcl.Menus, Vcl.Styles.Utils.ComCtrls,
  15.  Vcl.Styles.Utils.Menus,
  16.  Vcl.Styles.Utils.SysStyleHook,
  17.  Vcl.Styles.Utils.SysControls, Vcl.Styles.Utils.Forms,
  18.  Vcl.Styles.Utils.StdCtrls, Vcl.Styles.Utils.ScreenTips;
  19.  
  20. type
  21.  TFormHome = class(TForm)
  22.    gbFTP_Data: TGroupBox;
  23.    lblHost: TLabel;
  24.    txtHost: TEdit;
  25.    lblUsername: TLabel;
  26.    txtUsername: TEdit;
  27.    lblPassword: TLabel;
  28.    txtPassword: TEdit;
  29.    btnConnect: TButton;
  30.    gbMyFiles: TGroupBox;
  31.    lblDirectory1: TLabel;
  32.    txtMe_Directory: TEdit;
  33.    btnListMe: TButton;
  34.    lvLocalFiles: TListView;
  35.    gbFTP_Files: TGroupBox;
  36.    lblDirectory2: TLabel;
  37.    txt_FTP_Directory: TEdit;
  38.    btnList_FTP: TButton;
  39.    lv_FTP_Files: TListView;
  40.    btnUpload: TButton;
  41.    btnDownload: TButton;
  42.    directorios: TListBox;
  43.    archivos: TListBox;
  44.    status: TStatusBar;
  45.    local_iconos: TImageList;
  46.    ftp_client: TIdFTP;
  47.    ftp_iconos: TImageList;
  48.    progreso: TProgressBar;
  49.    imgLogo: TImage;
  50.    menu_local: TPopupMenu;
  51.    MakeDirectory1: TMenuItem;
  52.    Rename1: TMenuItem;
  53.    Delete1: TMenuItem;
  54.    Refresh1: TMenuItem;
  55.    menu_ftp: TPopupMenu;
  56.    MakeDirectory2: TMenuItem;
  57.    Rename2: TMenuItem;
  58.    Delete2: TMenuItem;
  59.    Refresh2: TMenuItem;
  60.    ilIconos: TImageList;
  61.    procedure btnConnectClick(Sender: TObject);
  62.    procedure btnListMeClick(Sender: TObject);
  63.    procedure btnList_FTPClick(Sender: TObject);
  64.    procedure btnUploadClick(Sender: TObject);
  65.    procedure ftp_clientWork(ASender: TObject; AWorkMode: TWorkMode;
  66.      AWorkCount: Int64);
  67.    procedure ftp_clientWorkBegin(ASender: TObject; AWorkMode: TWorkMode;
  68.      AWorkCountMax: Int64);
  69.    procedure ftp_clientWorkEnd(ASender: TObject; AWorkMode: TWorkMode);
  70.    procedure btnDownloadClick(Sender: TObject);
  71.    procedure lvLocalFilesDblClick(Sender: TObject);
  72.    procedure lv_FTP_FilesDblClick(Sender: TObject);
  73.    procedure MakeDirectory1Click(Sender: TObject);
  74.    procedure Rename1Click(Sender: TObject);
  75.    procedure Delete1Click(Sender: TObject);
  76.    procedure Refresh1Click(Sender: TObject);
  77.    procedure FormCreate(Sender: TObject);
  78.    procedure MakeDirectory2Click(Sender: TObject);
  79.    procedure Rename2Click(Sender: TObject);
  80.    procedure Delete2Click(Sender: TObject);
  81.    procedure Refresh2Click(Sender: TObject);
  82.  
  83.  private
  84.    { Private declarations }
  85.  public
  86.    { Public declarations }
  87.  end;
  88.  
  89. var
  90.  FormHome: TFormHome;
  91.  
  92. implementation
  93.  
  94. {$R *.dfm}
  95.  
  96. procedure listar(dirnownow: string; ListaDeArchivos: TListView;
  97.  ListaDeIconos: TImageList);
  98. var
  99.  buscar: TSearchRec;
  100.  Icon: TIcon;
  101.  listate: TListItem;
  102.  getdata: SHFILEINFO;
  103.  dirnow: string;
  104.  
  105. begin
  106.  
  107.  if (DirectoryExists(dirnownow)) then
  108.  begin
  109.    ListaDeIconos.Clear;
  110.  
  111.    dirnow := StringReplace(dirnownow, '/', '\', [rfReplaceAll, rfIgnoreCase]);
  112.  
  113.    ListaDeArchivos.Items.Clear;
  114.    Icon := TIcon.Create;
  115.    ListaDeArchivos.Items.BeginUpdate;
  116.  
  117.    if FindFirst(dirnow + '*.*', faAnyFile, buscar) = 0 then
  118.    begin
  119.      repeat
  120.        if (buscar.Attr = faDirectory) then
  121.        begin
  122.  
  123.          with ListaDeArchivos do
  124.          begin
  125.  
  126.            if not(buscar.Name = '.') and not(buscar.Name = '..') then
  127.            begin
  128.  
  129.              listate := ListaDeArchivos.Items.Add;
  130.  
  131.              SHGetFileInfo(PChar(dirnow + buscar.Name), 0, getdata,
  132.                SizeOf(getdata), SHGFI_DISPLAYNAME);
  133.              listate.Caption := getdata.szDisplayName;
  134.  
  135.              SHGetFileInfo(PChar(dirnow + buscar.Name), 0, getdata,
  136.                SizeOf(getdata), SHGFI_TYPENAME);
  137.              listate.SubItems.Add(getdata.szTypeName);
  138.  
  139.              SHGetFileInfo(PChar(dirnow + buscar.Name), 0, getdata,
  140.                SizeOf(getdata), SHGFI_ICON or SHGFI_SMALLICON);
  141.              Icon.Handle := getdata.hIcon;
  142.              listate.ImageIndex := ListaDeIconos.AddIcon(Icon);
  143.  
  144.              DestroyIcon(getdata.hIcon);
  145.  
  146.            end;
  147.          end;
  148.  
  149.        end;
  150.      until FindNext(buscar) <> 0;
  151.      FindClose(buscar);
  152.    end;
  153.  
  154.    if FindFirst(dirnow + '*.*', faAnyFile, buscar) = 0 then
  155.    begin
  156.      repeat
  157.        if (buscar.Attr <> faDirectory) then
  158.        begin
  159.  
  160.          with ListaDeArchivos do
  161.          begin
  162.  
  163.            listate := ListaDeArchivos.Items.Add;
  164.  
  165.            SHGetFileInfo(PChar(dirnow + buscar.Name), 0, getdata,
  166.              SizeOf(getdata), SHGFI_DISPLAYNAME);
  167.            listate.Caption := buscar.Name;
  168.  
  169.            SHGetFileInfo(PChar(dirnow + buscar.Name), 0, getdata,
  170.              SizeOf(getdata), SHGFI_TYPENAME);
  171.            listate.SubItems.Add(getdata.szTypeName);
  172.  
  173.            SHGetFileInfo(PChar(dirnow + buscar.Name), 0, getdata,
  174.              SizeOf(getdata), SHGFI_ICON or SHGFI_SMALLICON);
  175.            Icon.Handle := getdata.hIcon;
  176.            listate.ImageIndex := ListaDeIconos.AddIcon(Icon);
  177.  
  178.            DestroyIcon(getdata.hIcon);
  179.  
  180.          end;
  181.  
  182.        end
  183.  
  184.        until FindNext(buscar) <> 0;
  185.        FindClose(buscar);
  186.      end;
  187.  
  188.      ListaDeArchivos.Items.EndUpdate;
  189.    end;
  190.  
  191.  end;
  192.  
  193.  procedure listarftp(dirnownow2: string; ListaDeArchivosFTP: TListView;
  194.    ftp: TIdFTP; DirectoriosEncontrados: TListBox;
  195.    ArchivosEncontrados: TListBox);
  196.  var
  197.    i: integer;
  198.    Item: TIdFTPListItem;
  199.    listate2: TListItem;
  200.  
  201.  begin
  202.  
  203.    ListaDeArchivosFTP.Items.Clear;
  204.    DirectoriosEncontrados.Clear;
  205.    ArchivosEncontrados.Clear;
  206.  
  207.    listate2 := ListaDeArchivosFTP.Items.Add;
  208.  
  209.    ftp.ChangeDir(dirnownow2);
  210.    ftp.List('*.*', True);
  211.  
  212.    for i := 0 to ftp.DirectoryListing.Count - 1 do
  213.    begin
  214.  
  215.      Item := ftp.DirectoryListing.Items[i];
  216.      if Item.ItemType = ditFile then
  217.      begin
  218.        DirectoriosEncontrados.Items.Add(ftp.DirectoryListing.Items[i]
  219.          .FileName);
  220.      end
  221.      else
  222.      begin
  223.        ArchivosEncontrados.Items.Add(ftp.DirectoryListing.Items[i].FileName);
  224.      end;
  225.  
  226.    end;
  227.  
  228.    ListaDeArchivosFTP.Items.Clear;
  229.  
  230.    for i := 0 to ArchivosEncontrados.Count - 1 do
  231.    begin
  232.  
  233.      with ListaDeArchivosFTP do
  234.  
  235.      begin
  236.  
  237.        listate2 := ListaDeArchivosFTP.Items.Add;
  238.        listate2.Caption := ArchivosEncontrados.Items[i];
  239.        listate2.SubItems.Add('Directory');
  240.        listate2.ImageIndex := 0;
  241.  
  242.      end;
  243.    end;
  244.  
  245.    for i := 0 to DirectoriosEncontrados.Count - 1 do
  246.    begin
  247.  
  248.      with ListaDeArchivosFTP do
  249.  
  250.      begin
  251.  
  252.        listate2 := ListaDeArchivosFTP.Items.Add;
  253.        listate2.Caption := DirectoriosEncontrados.Items[i];
  254.        listate2.SubItems.Add('File');
  255.        listate2.ImageIndex := 1;
  256.  
  257.      end;
  258.    end;
  259.  
  260.  end;
  261.  
  262.  procedure TFormHome.btnConnectClick(Sender: TObject);
  263.  begin
  264.  
  265.    lv_FTP_Files.Items.Clear;
  266.  
  267.    directorios.Clear;
  268.    archivos.Clear;
  269.  
  270.    if (btnConnect.Caption = 'Disconnect') then
  271.    begin
  272.      ftp_client.Disconnect;
  273.      btnConnect.Caption := 'Connect';
  274.      status.Panels[0].Text := '[+] Disconnected';
  275.      FormHome.status.Update;
  276.      txt_FTP_Directory.Text := '';
  277.      MessageBox(0, 'Disconnected', 'FTP Manager 1.0', MB_ICONINFORMATION);
  278.    end
  279.    else
  280.    begin
  281.  
  282.      ftp_client.host := txtHost.Text;
  283.      ftp_client.username := txtUsername.Text;
  284.      ftp_client.password := txtPassword.Text;
  285.  
  286.      try
  287.        ftp_client.connect;
  288.        btnConnect.Caption := 'Disconnect';
  289.        status.Panels[0].Text := '[+] Connected';
  290.        FormHome.status.Update;
  291.  
  292.        txt_FTP_Directory.Text := '/';
  293.        listarftp(txt_FTP_Directory.Text, lv_FTP_Files, ftp_client, directorios,
  294.          archivos);
  295.  
  296.        MessageBox(0, 'Connected', 'FTP Manager 1.0', MB_ICONINFORMATION);
  297.      except
  298.        status.Panels[0].Text := '[-] Error connecting to server';
  299.        FormHome.status.Update;
  300.        MessageBox(0, 'Error connecting to server', 'FTP Manager 1.0',
  301.          MB_ICONERROR);
  302.      end;
  303.    end;
  304.  
  305.  end;
  306.  
  307.  procedure TFormHome.Delete1Click(Sender: TObject);
  308.  var
  309.    archivo: string;
  310.  begin
  311.    if Assigned(lvLocalFiles.Selected) then
  312.    begin
  313.      archivo := lvLocalFiles.Selected.Caption;
  314.      if DeleteFile(txtMe_Directory.Text + '/' + archivo) then
  315.      begin
  316.        if not(txtMe_Directory.Text = '') then
  317.        begin
  318.          listar(txtMe_Directory.Text, lvLocalFiles, local_iconos);
  319.        end;
  320.        MessageBox(0, 'Deleted', 'FTP Manager 1.0', MB_ICONINFORMATION);
  321.      end
  322.      else
  323.      begin
  324.        MessageBox(0, 'Error', 'FTP Manager 1.0', MB_ICONERROR);
  325.      end;
  326.    end;
  327.  end;
  328.  
  329.  procedure TFormHome.Delete2Click(Sender: TObject);
  330.  var
  331.    archivo: string;
  332.  begin
  333.    if Assigned(lv_FTP_Files.Selected) then
  334.    begin
  335.      archivo := lv_FTP_Files.Selected.Caption;
  336.      ftp_client.ChangeDir(txt_FTP_Directory.Text);
  337.      try
  338.        begin
  339.          ftp_client.Delete(archivo);
  340.          if not(txt_FTP_Directory.Text = '') then
  341.          begin
  342.            listarftp(txt_FTP_Directory.Text, lv_FTP_Files, ftp_client,
  343.              directorios, archivos);
  344.          end;
  345.          MessageBox(0, 'Deleted', 'FTP Manager 1.0', MB_ICONINFORMATION);
  346.        end;
  347.      except
  348.        MessageBox(0, 'Error', 'FTP Manager 1.0', MB_ICONERROR);
  349.      end;
  350.    end;
  351.  end;
  352.  
  353.  procedure TFormHome.btnDownloadClick(Sender: TObject);
  354.  var
  355.    fileabajar: string;
  356.  begin
  357.  
  358.    if Assigned(lv_FTP_Files.Selected) then
  359.    begin
  360.      try
  361.        begin
  362.          fileabajar := lv_FTP_Files.Selected.Caption;;
  363.          ftp_client.OnWork := ftp_clientWork;
  364.          ftp_client.ChangeDir(txt_FTP_Directory.Text);
  365.  
  366.          progreso.Max := ftp_client.Size(ExtractFileName(fileabajar)) div 1024;
  367.  
  368.          ftp_client.Get(fileabajar, txtMe_Directory.Text + '/' + fileabajar,
  369.            False, False);
  370.  
  371.          if not(txtMe_Directory.Text = '') then
  372.          begin
  373.            listar(txtMe_Directory.Text, lvLocalFiles, local_iconos);
  374.          end;
  375.  
  376.          MessageBox(0, 'Action completed successfully', 'FTP Manager 1.0',
  377.            MB_ICONINFORMATION);
  378.        end;
  379.      except
  380.        MessageBox(0, 'Error', 'FTP Manager 1.0', MB_ICONERROR);
  381.      end;
  382.    end
  383.    else
  384.    begin
  385.      MessageBox(0, 'Select File to download', 'FTP Manager 1.0',
  386.        MB_ICONINFORMATION);
  387.    end;
  388.  end;
  389.  
  390.  procedure TFormHome.FormCreate(Sender: TObject);
  391.  begin
  392.    UseLatestCommonDialogs := False;
  393.    txtMe_Directory.Text := GetCurrentDir + '\';
  394.    listar(txtMe_Directory.Text, lvLocalFiles, local_iconos);
  395.  end;
  396.  
  397.  procedure TFormHome.ftp_clientWork(ASender: TObject; AWorkMode: TWorkMode;
  398.    AWorkCount: Int64);
  399.  begin
  400.    status.Panels[0].Text := '[+] Working ...';
  401.    FormHome.status.Update;
  402.  
  403.    progreso.Position := AWorkCount div 1024;
  404.  end;
  405.  
  406.  procedure TFormHome.ftp_clientWorkBegin(ASender: TObject;
  407.    AWorkMode: TWorkMode; AWorkCountMax: Int64);
  408.  begin
  409.    status.Panels[0].Text := '[+] Working ..';
  410.    FormHome.status.Update;
  411.  end;
  412.  
  413.  procedure TFormHome.ftp_clientWorkEnd(ASender: TObject; AWorkMode: TWorkMode);
  414.  begin
  415.    status.Panels[0].Text := '[+] Finished';
  416.    FormHome.status.Update;
  417.    progreso.Max := 0;
  418.  end;
  419.  
  420.  procedure TFormHome.lv_FTP_FilesDblClick(Sender: TObject);
  421.  begin
  422.    if Assigned(lv_FTP_Files.Selected) then
  423.    begin
  424.      if (lv_FTP_Files.Selected.SubItems.Strings[0] = 'Directory') then
  425.      begin
  426.        ftp_client.ChangeDir(txt_FTP_Directory.Text +
  427.          lv_FTP_Files.Selected.Caption + '/');
  428.        listarftp(txt_FTP_Directory.Text + lv_FTP_Files.Selected.Caption + '/',
  429.          lv_FTP_Files, ftp_client, directorios, archivos);
  430.        txt_FTP_Directory.Text := ftp_client.RetrieveCurrentDir + '/';
  431.      end;
  432.    end
  433.    else
  434.    begin
  435.      MessageBox(0, 'Write path', 'FTP Manager 1.0', MB_ICONINFORMATION);
  436.    end;
  437.  end;
  438.  
  439.  procedure TFormHome.btnList_FTPClick(Sender: TObject);
  440.  begin
  441.    if not(txt_FTP_Directory.Text = '') then
  442.    begin
  443.      listarftp(txt_FTP_Directory.Text, lv_FTP_Files, ftp_client, directorios,
  444.        archivos);
  445.    end
  446.    else
  447.    begin
  448.      MessageBox(0, 'Write path', 'FTP Manager 1.0', MB_ICONINFORMATION);
  449.    end;
  450.  end;
  451.  
  452.  procedure TFormHome.btnListMeClick(Sender: TObject);
  453.  begin
  454.    if not(txtMe_Directory.Text = '') then
  455.    begin
  456.      listar(txtMe_Directory.Text, lvLocalFiles, local_iconos);
  457.    end
  458.    else
  459.    begin
  460.      MessageBox(0, 'Write path', 'FTP Manager 1.0', MB_ICONINFORMATION);
  461.    end;
  462.  end;
  463.  
  464.  procedure TFormHome.lvLocalFilesDblClick(Sender: TObject);
  465.  begin
  466.    if Assigned(lvLocalFiles.Selected) then
  467.    begin
  468.      if (DirectoryExists(txtMe_Directory.Text + lvLocalFiles.Selected.Caption +
  469.        '/')) then
  470.      begin
  471.        Chdir(txtMe_Directory.Text + lvLocalFiles.Selected.Caption + '/');
  472.        listar(txtMe_Directory.Text + lvLocalFiles.Selected.Caption + '/',
  473.          lvLocalFiles, local_iconos);
  474.        txtMe_Directory.Text := GetCurrentDir + '\';
  475.      end;
  476.    end
  477.    else
  478.    begin
  479.      MessageBox(0, 'Select Path', 'FTP Manager 1.0', MB_ICONINFORMATION);
  480.    end;
  481.  end;
  482.  
  483.  procedure TFormHome.MakeDirectory1Click(Sender: TObject);
  484.  var
  485.    directorio: string;
  486.  begin
  487.    directorio := InputBox('FTP Manager 1.0', 'Directory : ', '');
  488.    try
  489.      begin
  490.        MkDir(txtMe_Directory.Text + '/' + directorio);
  491.        if not(txtMe_Directory.Text = '') then
  492.        begin
  493.          listar(txtMe_Directory.Text, lvLocalFiles, local_iconos);
  494.        end;
  495.        MessageBox(0, 'Directory created', 'FTP Manager 1.0',
  496.          MB_ICONINFORMATION);
  497.      end;
  498.    except
  499.      MessageBox(0, 'Error', 'FTP Manager 1.0', MB_ICONERROR);
  500.    end;
  501.  end;
  502.  
  503.  procedure TFormHome.MakeDirectory2Click(Sender: TObject);
  504.  var
  505.    directorio: string;
  506.  begin
  507.    directorio := InputBox('FTP Manager 1.0', 'Directory : ', '');
  508.    try
  509.      begin
  510.        ftp_client.ChangeDir(txt_FTP_Directory.Text);
  511.        ftp_client.MakeDir(directorio);
  512.        if not(txt_FTP_Directory.Text = '') then
  513.        begin
  514.          listarftp(txt_FTP_Directory.Text, lv_FTP_Files, ftp_client,
  515.            directorios, archivos);
  516.        end;
  517.        MessageBox(0, 'Directory created', 'FTP Manager 1.0',
  518.          MB_ICONINFORMATION);
  519.      end;
  520.    except
  521.      MessageBox(0, 'Error', 'FTP Manager 1.0', MB_ICONERROR);
  522.    end;
  523.  end;
  524.  
  525.  procedure TFormHome.Refresh1Click(Sender: TObject);
  526.  begin
  527.    if not(txtMe_Directory.Text = '') then
  528.    begin
  529.      listar(txtMe_Directory.Text, lvLocalFiles, local_iconos);
  530.    end
  531.    else
  532.    begin
  533.      MessageBox(0, 'Write path', 'FTP Manager 1.0', MB_ICONINFORMATION);
  534.    end;
  535.  end;
  536.  
  537.  procedure TFormHome.Refresh2Click(Sender: TObject);
  538.  begin
  539.    if not(txt_FTP_Directory.Text = '') then
  540.    begin
  541.      listarftp(txt_FTP_Directory.Text, lv_FTP_Files, ftp_client, directorios,
  542.        archivos);
  543.    end;
  544.  end;
  545.  
  546.  procedure TFormHome.Rename1Click(Sender: TObject);
  547.  var
  548.    original, new_name: string;
  549.  begin
  550.    if Assigned(lvLocalFiles.Selected) then
  551.    begin
  552.      original := lvLocalFiles.Selected.Caption;
  553.      new_name := InputBox('FTP Manager 1.0', 'New name : ', '');
  554.      if RenameFile(txtMe_Directory.Text + '/' + original,
  555.        txtMe_Directory.Text + '/' + new_name) then
  556.      begin
  557.        if not(txtMe_Directory.Text = '') then
  558.        begin
  559.          listar(txtMe_Directory.Text, lvLocalFiles, local_iconos);
  560.        end;
  561.        MessageBox(0, 'Changed', 'FTP Manager 1.0', MB_ICONINFORMATION);
  562.      end
  563.      else
  564.      begin
  565.        MessageBox(0, 'Error', 'FTP Manager 1.0', MB_ICONERROR);
  566.      end;
  567.    end;
  568.  end;
  569.  
  570.  procedure TFormHome.Rename2Click(Sender: TObject);
  571.  var
  572.    original, new_name: string;
  573.  begin
  574.    if Assigned(lv_FTP_Files.Selected) then
  575.    begin
  576.      original := lv_FTP_Files.Selected.Caption;
  577.      new_name := InputBox('FTP Manager 1.0', 'New name : ', '');
  578.      try
  579.        begin
  580.          ftp_client.ChangeDir(txt_FTP_Directory.Text);
  581.          ftp_client.Rename(original, new_name);
  582.          if not(txt_FTP_Directory.Text = '') then
  583.          begin
  584.            listarftp(txt_FTP_Directory.Text, lv_FTP_Files, ftp_client,
  585.              directorios, archivos);
  586.          end;
  587.          MessageBox(0, 'Changed', 'FTP Manager 1.0', MB_ICONINFORMATION);
  588.        end;
  589.      except
  590.        MessageBox(0, 'Error', 'FTP Manager 1.0', MB_ICONERROR);
  591.      end;
  592.    end;
  593.  
  594.  end;
  595.  
  596.  procedure TFormHome.btnUploadClick(Sender: TObject);
  597.  var
  598.    fileasubir: string;
  599.    dirasubir: string;
  600.    cantidad: File of byte;
  601.  begin
  602.  
  603.    if Assigned(lvLocalFiles.Selected) then
  604.    begin
  605.      try
  606.        begin
  607.          fileasubir := txtMe_Directory.Text + lvLocalFiles.Selected.Caption;
  608.          dirasubir := txt_FTP_Directory.Text;
  609.  
  610.          ftp_client.OnWork := ftp_clientWork;
  611.  
  612.          AssignFile(cantidad, fileasubir);
  613.          Reset(cantidad);
  614.          progreso.Max := FileSize(cantidad) div 1024;
  615.          CloseFile(cantidad);
  616.  
  617.          ftp_client.ChangeDir(dirasubir);
  618.          ftp_client.Put(fileasubir, lvLocalFiles.Selected.Caption, False);
  619.  
  620.          if not(txt_FTP_Directory.Text = '') then
  621.          begin
  622.            listarftp(txt_FTP_Directory.Text, lv_FTP_Files, ftp_client,
  623.              directorios, archivos);
  624.          end;
  625.  
  626.          MessageBox(0, 'Action completed successfully', 'FTP Manager 1.0',
  627.            MB_ICONINFORMATION);
  628.        end;
  629.      except
  630.        MessageBox(0, 'Error', 'FTP Manager 1.0', MB_ICONERROR);
  631.      end;
  632.    end
  633.    else
  634.    begin
  635.      MessageBox(0, 'Select File to upload', 'FTP Manager 1.0',
  636.        MB_ICONINFORMATION);
  637.    end;
  638.  end;
  639.  
  640. end.
  641.  
  642. // The End ?
  643.  

Si quieren bajar el programa lo pueden hacer de aca.
Páginas: 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ... 43
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines