|
21
|
Programación / .NET (C#, VB.NET, ASP) / [C#] Adf.ly Killer 0.5
|
en: 22 Julio 2016, 18:53 pm
|
Un programa en C# para decodificar una URL de Adf.ly , este programa esta basado en la funcion publicada en VB.Net por fudmario para lograr esta tarea. Tiene dos opciones , la primera es para decodificar una unica URL y la otra es para decodificar varias URLS en un archivo de texto. Una imagen : El codigo : // Adf.ly Killer 0.5 // (C) Doddy Hackman 2016 // Credits : Thanks to fudmario using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Text.RegularExpressions; using Microsoft.VisualBasic; using System.IO; namespace Adf.ly_Killer { public partial class FormHome : Form { public FormHome() { InitializeComponent(); } private void btnExit_Click(object sender, EventArgs e) { Application.Exit(); } public string base64_encode(string texto) { return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(texto)); } public string base64_decode(string texto) { return System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String(texto)); } private Boolean check_link(string link) { Match regex = Regex.Match(link, "adf.ly", RegexOptions.IgnoreCase); if (regex.Success) { return true; } else { return false; } } private string adfly_decode(string link_to_decode) { string link_decoded = ""; DH_Tools tools = new DH_Tools (); string code = tools.toma(link_to_decode); Match regex = Regex.Match(code, "var ysmm = '(.*?)';", RegexOptions.IgnoreCase); if (regex.Success) { string link = regex.Groups[1].Value; string left = ""; string right = ""; for (int i = 0; i < link.Length; i++) { if (i % 2 == 0) { left = left + Convert.ToString(link[i]); } else { right = Convert.ToString(link[i]) + right; } } string link_encoded = base64_decode(left + right); string link_ready = link_encoded.Substring(2); link_decoded = link_ready; } if (link_decoded == "") { link_decoded = "???"; } return link_decoded; } private void btnKill_Click(object sender, EventArgs e) { txtResult.Text = ""; if (txtEnterLink.Text != "") { if (check_link(txtEnterLink.Text)) { status.Text = "[+] Decoding ..."; this.Refresh(); string result = adfly_decode(txtEnterLink.Text); if (result != "???") { txtResult.Text = result; status.Text = "[+] Link Decoded"; this.Refresh(); } else { txtResult.Text = "Not Found"; status.Text = "[-] Not Found"; this.Refresh(); } } else { status.Text = "[-] Link Invalid"; this.Refresh(); } } else { status.Text = "[-] Enter Link to decode"; this.Refresh(); } } private void btnCopy_Click(object sender, EventArgs e) { try { Clipboard.Clear(); Clipboard.SetText(txtResult.Text); status.Text = "[+] Link copied to clipboard"; this.Refresh(); } catch { // } } private void miAddLink_Click(object sender, EventArgs e) { string link = Interaction.InputBox("Enter Link : ", "Adf.ly Killer 0.5", ""); if (link != "") { if (check_link(link)) { ListViewItem item = new ListViewItem (); item.Text = link; item.SubItems.Add("..."); lvLinks.Items.Add(item); status.Text = "[+] Link Added"; this.Refresh(); } else { status.Text = "[-] Link Invalid"; this.Refresh(); } } else { status.Text = "[-] Enter Link"; this.Refresh(); } } private void miAddWordlist_Click(object sender, EventArgs e) { odOpenFile.InitialDirectory = System.IO.Path.GetDirectoryName(Application.ExecutablePath); ; DialogResult resultado = odOpenFile.ShowDialog(); if (resultado == DialogResult.OK) { string filename = odOpenFile.FileName; int counter = 0; if (File.Exists(filename)) { var lines = File.ReadAllLines(filename); foreach (var line in lines) { if (check_link(line)) { ListViewItem item = new ListViewItem (); item.Text = line; item.SubItems.Add("..."); lvLinks.Items.Add(item); counter = counter + 1; } } if (counter > 0) { status.Text = "[+] Links Added : " + counter.ToString(); this.Refresh(); } else { status.Text = "[-] Links not found"; this.Refresh(); } } else { status.Text = "[-] Enter Valid Filename"; this.Refresh(); } } } private void miClearList_Click(object sender, EventArgs e) { lvLinks.Items.Clear(); } private void miKill_Click(object sender, EventArgs e) { if (lvLinks.Items.Count > 0) { for (int i = 0; i < lvLinks.Items.Count; i++) { ListViewItem item = lvLinks.Items[i]; string link_to_decode = item.Text; status.Text = "[+] Checking : " + link_to_decode + " ..."; this.Refresh(); string result = adfly_decode(link_to_decode); if (result != "???") { lvLinks.Items[i].SubItems[1].Text = result; status.Text = "[+] " + link_to_decode+" : "+result; this.Refresh(); } else { lvLinks.Items[i].SubItems[1].Text = "Not Found"; status.Text = "[-] " + link_to_decode + " : " + "Not Found"; this.Refresh(); } } status.Text = "[+] Finished"; this.Refresh(); } else { status.Text = "[-] Links not found"; this.Refresh(); } } private void miCopy_Click(object sender, EventArgs e) { if (lvLinks.SelectedIndices.Count > 0 && lvLinks.SelectedIndices[0] != -1) { string link = lvLinks.SelectedItems[0].SubItems[1].Text; if (link != "..." || link!="Not Found") { try { Clipboard.Clear(); Clipboard.SetText(link); status.Text = "[+] Link copied to clipboard"; this.Refresh(); } catch { // } } } } } } // The End ?
Si quieren bajar el programa lo pueden hacer de aca : SourceForge. Github. Eso seria todo.
|
|
|
22
|
Programación / Programación General / [Delphi] DH Junk Code Maker 0.4
|
en: 9 Julio 2016, 16:40 pm
|
Un programa en Delphi para generar codigo basura y lograr quitar algunas firmas de AV en un malware hecho en Delphi. Tiene las siguientes opciones : - Generar constantes
- Generar variables
- Generar varios for
- Generar funciones con variables
- Generar funciones con for
- Generar codigo con todas las funciones anteriores juntas
- Se puede establecer una lontigud para cada opcion
Una imagen : El codigo : // DH Junk Code Maker 0.4 // (C) Doddy Hackman 2016 unit junk; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.Styles.Utils.Menus, Vcl.Styles.Utils.SysStyleHook, Vcl.Styles.Utils.SysControls, Math, Vcl.Menus, Vcl.Imaging.pngimage, Vcl.ImgList; type TFormHome = class(TForm) imgLogo: TImage; gbOutput: TGroupBox; mmOutput: TMemo; gbEnterLength: TGroupBox; txtLength: TEdit; udLength: TUpDown; gbType: TGroupBox; cmbOptions: TComboBox; gbOptions: TGroupBox; btnGenerate: TButton; ppOptions: TPopupMenu; copy: TMenuItem; clear: TMenuItem; ilIconos: TImageList; procedure btnGenerateClick(Sender: TObject); procedure clearClick(Sender: TObject); procedure copyClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var FormHome: TFormHome; implementation {$R *.dfm} // Functions function dh_generate_string(option: string; length_string: integer): string; const letters1: array [1 .. 26] of string = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); const letters2: array [1 .. 26] of string = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); const numbers: array [1 .. 10] of string = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); const cyrillic: array [1 .. 44] of string = ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?'); const no_idea1: array [1 .. 13] of string = ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?'); const no_idea2: array [1 .. 28] of string = ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '??', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '??'); const no_idea3: array [1 .. 13] of string = ('??', '?', '?', '?', '?', '?', '?', '_', '?', '`', '?', '_', '?'); const no_idea4: array [1 .. 26] of string = ('?', '?', '€', '?', 'l', '?', '™', 'O', 'e', '?', '?', '?', '?', '?', '?', '?', '?', '-', '/', '·', 'v', '8', '?', '˜', '?', '='); const no_idea5: array [1 .. 33] of string = ('?', '?', '?', '?', 'n', '?', '?', '?', '?', '?', '?', 'G', '?', '?', '?', 'e', 'ß', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '8', 'S', '?'); const no_idea6: array [1 .. 32] of string = ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?'); var code: string; gen_now: string; i: integer; index: integer; begin gen_now := ''; for i := 1 to length_string do begin if (option = '1') then begin gen_now := gen_now + letters1[RandomRange(1, Length(letters1) + 1)]; end else if (option = '2') then begin gen_now := gen_now + letters2[RandomRange(1, Length(letters2) + 1)]; end else if (option = '3') then begin gen_now := gen_now + numbers[RandomRange(1, Length(numbers) + 1)]; end else if (option = '4') then begin gen_now := gen_now + cyrillic[RandomRange(1, Length(cyrillic) + 1)]; end else if (option = '5') then begin gen_now := gen_now + no_idea1[RandomRange(1, Length(no_idea1) + 1)]; end else if (option = '6') then begin gen_now := gen_now + no_idea2[RandomRange(1, Length(no_idea2) + 1)]; end else if (option = '7') then begin gen_now := gen_now + no_idea3[RandomRange(1, Length(no_idea3) + 1)]; end else if (option = '8') then begin gen_now := gen_now + no_idea4[RandomRange(1, Length(no_idea4) + 1)]; end else if (option = '9') then begin gen_now := gen_now + no_idea5[RandomRange(1, Length(no_idea5) + 1)]; end else if (option = '10') then begin gen_now := gen_now + no_idea6[RandomRange(1, Length(no_idea6) + 1)]; end else begin gen_now := gen_now + letters1[RandomRange(1, Length(letters1) + 1)]; end; end; code := gen_now; Result := code; end; function message_box(title, message_text, type_message: string): string; begin if not(title = '') and not(message_text = '') and not(type_message = '') then begin try begin if (type_message = 'Information') then begin MessageBox(FormHome.Handle, PChar(message_text), PChar(title), MB_ICONINFORMATION); end else if (type_message = 'Warning') then begin MessageBox(FormHome.Handle, PChar(message_text), PChar(title), MB_ICONWARNING); end else if (type_message = 'Question') then begin MessageBox(FormHome.Handle, PChar(message_text), PChar(title), MB_ICONQUESTION); end else if (type_message = 'Error') then begin MessageBox(FormHome.Handle, PChar(message_text), PChar(title), MB_ICONERROR); end else begin MessageBox(FormHome.Handle, PChar(message_text), PChar(title), MB_ICONINFORMATION); end; Result := '[+] MessageBox : OK'; end; except begin Result := '[-] Error'; end; end; end else begin Result := '[-] Error'; end; end; // procedure TFormHome.btnGenerateClick(Sender: TObject); var id: string; i, y: integer; vars, vars2, name, name2, value, value2: string; strings, strings2: string; functions, code: string; limit_random: integer; begin if (StrToInt(txtLength.Text) > 0) then begin if (cmbOptions.ItemIndex = 0) then begin for i := 1 to StrToInt(txtLength.Text) do begin name := dh_generate_string('1', 5); value := dh_generate_string('1', 20); mmOutput.Lines.Add('const ' + name + '=' + '''' + value + '''' + ';'); end; mmOutput.Lines.Add(''); end else if (cmbOptions.ItemIndex = 1) then begin vars := 'var '; strings := ''; for i := 1 to StrToInt(txtLength.Text) do begin name := dh_generate_string('1', 5); value := dh_generate_string('1', 20); if (i = StrToInt(txtLength.Text)) then begin vars := vars + name + ':string;'; end else begin vars := vars + name + ','; end; if (i = StrToInt(txtLength.Text)) then begin strings := strings + name + ':=' + '''' + value + '''' + ';'; end else begin strings := strings + name + ':=' + '''' + value + '''' + ';' + sLineBreak; end; end; id := dh_generate_string('1', 5); code := 'procedure gen_vars_' + id + ';' + sLineBreak + vars + sLineBreak + 'begin' + sLineBreak + strings + sLineBreak + 'end;'; mmOutput.Lines.Add(code); mmOutput.Lines.Add(''); end else if (cmbOptions.ItemIndex = 2) then begin vars := 'var i,y:integer;'; strings := ''; for i := 1 to StrToInt(txtLength.Text) do begin value := dh_generate_string('3', 2); if (i = StrToInt(txtLength.Text)) then begin strings := strings + 'i := 0;' + sLineBreak + 'y := 0;' + sLineBreak + sLineBreak; strings := strings + 'for i := 0 to ' + value + ' do' + sLineBreak + 'begin' + sLineBreak + 'inc(y);' + sLineBreak + 'end;'; end else begin strings := strings + 'i := 0;' + sLineBreak + 'y := 0;' + sLineBreak + sLineBreak; strings := strings + 'for i := 0 to ' + value + ' do' + sLineBreak + 'begin' + sLineBreak + 'inc(y);' + sLineBreak + 'end;' + sLineBreak + sLineBreak; end; end; id := dh_generate_string('1', 5); code := 'procedure gen_fors_' + id + ';' + sLineBreak + vars + sLineBreak + 'begin' + sLineBreak + strings + sLineBreak + 'end;'; mmOutput.Lines.Add(code); mmOutput.Lines.Add(''); end else if (cmbOptions.ItemIndex = 3) then begin code := ''; functions := ''; for i := 1 to StrToInt(txtLength.Text) do begin vars := 'var '; strings := ''; limit_random := StrToInt(dh_generate_string('3', 1)); if (limit_random = 0) then begin limit_random := 5; end; for y := 1 to limit_random do begin name := dh_generate_string('1', 5); value := dh_generate_string('1', 20); if (y = limit_random) then begin vars := vars + name + ':string;'; end else begin vars := vars + name + ','; end; if (y = limit_random) then begin strings := strings + name + ':=' + '''' + value + '''' + ';'; end else begin strings := strings + name + ':=' + '''' + value + '''' + ';' + sLineBreak; end; end; id := dh_generate_string('1', 5); if (i = StrToInt(txtLength.Text)) then begin functions := 'function gen_vars_' + id + '():string;' + sLineBreak + vars + sLineBreak + 'begin' + sLineBreak + strings + sLineBreak + 'Result :=' + '''' + id + '''' + ';' + sLineBreak + 'end;' + sLineBreak; end else begin functions := 'function gen_vars_' + id + '():string;' + sLineBreak + vars + sLineBreak + 'begin' + sLineBreak + strings + sLineBreak + 'Result :=' + '''' + id + '''' + ';' + sLineBreak + 'end;' + sLineBreak + sLineBreak; end; code := code + functions; end; mmOutput.Lines.Add(code); // mmOutput.Lines.Add(''); end else if (cmbOptions.ItemIndex = 4) then begin code := ''; for i := 1 to StrToInt(txtLength.Text) do begin vars := 'var i,y:integer;'; strings := ''; limit_random := StrToInt(dh_generate_string('3', 1)); if (limit_random = 0) then begin limit_random := 5; end; for y := 1 to limit_random do begin value := dh_generate_string('3', 2); if (i = limit_random) then begin strings := strings + 'i := 0;' + sLineBreak + 'y := 0;' + sLineBreak; strings := strings + 'for i := 0 to ' + value + ' do' + sLineBreak + 'begin' + sLineBreak + 'inc(y);' + sLineBreak + 'end;' + sLineBreak; end else begin strings := strings + 'i := 0;' + sLineBreak + 'y := 0;' + sLineBreak; strings := strings + 'for i := 0 to ' + value + ' do' + sLineBreak + 'begin' + sLineBreak + 'inc(y);' + sLineBreak + 'end;' + sLineBreak; end; end; id := dh_generate_string('3', 5); if (i = StrToInt(txtLength.Text)) then begin functions := 'function gen_fors_' + id + '():integer();' + sLineBreak + vars + sLineBreak + 'begin' + sLineBreak + strings + 'Result :=' + id + ';' + sLineBreak + 'end;' + sLineBreak; end else begin functions := 'function gen_fors_' + id + '():integer();' + sLineBreak + vars + sLineBreak + 'begin' + sLineBreak + strings + 'Result :=' + id + ';' + sLineBreak + 'end;' + sLineBreak + sLineBreak; end; code := code + functions; end; mmOutput.Lines.Add(code); // mmOutput.Lines.Add(''); end else if (cmbOptions.ItemIndex = 5) then begin code := ''; functions := ''; for i := 1 to StrToInt(txtLength.Text) do begin vars := 'var '; strings := ''; vars2 := 'var '; strings2 := ''; limit_random := StrToInt(dh_generate_string('3', 1)); if (limit_random = 0) then begin limit_random := 5; end; for y := 1 to limit_random do begin name := dh_generate_string('1', 20); name2 := dh_generate_string('1', 20); value := dh_generate_string('1', 20); value2 := dh_generate_string('3', 2); if (y = limit_random) then begin vars := vars + name + ':string;'; end else begin vars := vars + name + ','; end; if (y = limit_random) then begin strings := strings + name + ':=' + '''' + value + '''' + ';'; end else begin strings := strings + name + ':=' + '''' + value + '''' + ';' + sLineBreak; end; vars2 := 'var i,y:integer;'; if (y = limit_random) then begin strings2 := strings2 + 'i := 0;' + sLineBreak + 'y := 0;' + sLineBreak; strings2 := strings2 + 'for i := 0 to ' + value2 + ' do' + sLineBreak + 'begin' + sLineBreak + 'inc(y);' + sLineBreak + 'end;' + sLineBreak; end else begin strings2 := strings2 + 'i := 0;' + sLineBreak + 'y := 0;' + sLineBreak; strings2 := strings2 + 'for i := 0 to ' + value2 + ' do' + sLineBreak + 'begin' + sLineBreak + 'inc(y);' + sLineBreak + 'end;' + sLineBreak; end; end; id := dh_generate_string('1', 5); if (i = StrToInt(txtLength.Text)) then begin functions := 'function gen_functions_' + id + '():string;' + sLineBreak + vars + sLineBreak + vars2 + sLineBreak + 'begin' + sLineBreak + strings + sLineBreak + strings2 + 'Result :=' + '''' + id + '''' + ';' + sLineBreak + 'end;' + sLineBreak; end else begin functions := 'function gen_functions_' + id + '():string;' + sLineBreak + vars + sLineBreak + vars2 + sLineBreak + 'begin' + sLineBreak + strings + sLineBreak + strings2 + 'Result :=' + '''' + id + '''' + ';' + sLineBreak + 'end;' + sLineBreak + sLineBreak; end; code := code + functions; end; mmOutput.Lines.Add(code); end; message_box('DH Junk Code Maker 0.4', 'Enjoy the junk source', 'Information'); end else begin message_box('DH Junk Code Maker 0.4', 'The length should be greater than zero', 'Warning'); end; end; procedure TFormHome.clearClick(Sender: TObject); begin mmOutput.clear; message_box('DH Junk Code Maker 0.4', 'Output cleaned', 'Information'); end; procedure TFormHome.copyClick(Sender: TObject); begin mmOutput.SelectAll; mmOutput.CopyToClipboard; message_box('DH Junk Code Maker 0.4', 'Output copied to the clipboard', 'Information'); end; end. // The End ?
Si quieren bajar el programa lo pueden hacer de aca : SourceForge. Github. Eso seria todo.
|
|
|
23
|
Programación / Programación General / [Delphi] DH Form Effects 0.3
|
en: 25 Junio 2016, 02:44 am
|
Una clase en Delphi para darle efectos a los formularios. Tiene las siguientes opciones : - Animacion marquesina en los labels de izquierda a derecha y viceversa
- Animacion marquesina en los labels de arriba hacia abajo y viceversa
- Volver transparentes los formularios
- Volver transparente la consola del programa
- Varios efectos en la ventana de los formularios
El codigo : // Unit : DH Form Effects // Version : 0.3 // (C) Doddy Hackman 2016 unit DH_Form_Effects; interface uses Windows, SysUtils, Vcl.Forms, Vcl.StdCtrls, Vcl.ExtCtrls, Registry; type T_DH_Form_Effects = class private public constructor Create; destructor Destroy; override; procedure Effect_Marquee_Label_DownUp(Panel1: TPanel; Label1: TLabel; segundos: integer); procedure Effect_Marquee_Label_LeftRight(Label2: TLabel; opcion: string; segundos: integer); procedure Effect_Marquee_Form_Caption_LeftRight(Form1: TForm; opcion: string; segundos: integer); function Window_Effect(Form: HWND; opcion: string; velocidad: integer): bool; function Window_Transparent(Form: TForm; level: integer): bool; procedure Effect_Load_Another_Form(Form1_Load: TForm; Form2_Load: TForm; option: string; autosize: integer; space: integer; seconds: integer); function desktop_composition_control(option: string): bool; function Effect_Glass_in_Console(): bool; end; type TTimerEffect_Marquee_Label_DownUp = Class(TTimer) public procedure OnWork(Sender: TObject); end; TTimerEffect_Marquee_Label_LeftRight = Class(TTimer) public procedure OnWork(Sender: TObject); end; TTimerEffect_Marquee_Form_Caption_LeftRight = Class(TTimer) public procedure OnWork(Sender: TObject); end; var Timer_Effect_Marquee_Label_DownUp: TTimerEffect_Marquee_Label_DownUp; PanelToMove1: TPanel; LabelToMove1: TLabel; var TimerEffect_Marquee_Label_LeftRight: TTimerEffect_Marquee_Label_LeftRight; LabelToMove2: TLabel; Option_Marquee_Label_LeftRight: string; var TimerEffect_Marquee_Form_Caption_LeftRight : TTimerEffect_Marquee_Form_Caption_LeftRight; FormCaptionToMove: TForm; Option_Marquee_Form_Caption_LeftRight: string; implementation constructor T_DH_Form_Effects.Create; begin inherited Create; // end; destructor T_DH_Form_Effects.Destroy; begin inherited Destroy; end; // Timers procedure TTimerEffect_Marquee_Label_DownUp.OnWork(Sender: TObject); begin LabelToMove1.Top := LabelToMove1.Top - 10; if LabelToMove1.Top + LabelToMove1.Height < 0 then begin LabelToMove1.Top := PanelToMove1.Height; end; end; procedure TTimerEffect_Marquee_Form_Caption_LeftRight.OnWork(Sender: TObject); var code: string; opcion: string; begin code := FormCaptionToMove.Caption; opcion := Option_Marquee_Form_Caption_LeftRight; if opcion = 'left' then begin FormCaptionToMove.Caption := Copy(code, 2, Length(code) - 1) + Copy(code, 1, 1); end else if (opcion = 'right') then begin FormCaptionToMove.Caption := Copy(code, Length(code) - 1, 1) + Copy(code, 1, Length(code) - 1); end else begin FormCaptionToMove.Caption := Copy(code, 2, Length(code) - 1) + Copy(code, 1, 1); end; end; procedure TTimerEffect_Marquee_Label_LeftRight.OnWork(Sender: TObject); // Based on : http://delphi.about.com/od/vclusing/a/marquee.htm // Thanks to Zarko Gajic var code: string; opcion: string; begin code := LabelToMove2.Caption; opcion := Option_Marquee_Label_LeftRight; if opcion = 'left' then begin LabelToMove2.Caption := Copy(code, 2, Length(code) - 1) + Copy(code, 1, 1); end else if (opcion = 'right') then begin LabelToMove2.Caption := Copy(code, Length(code) - 1, 1) + Copy(code, 1, Length(code) - 1); end else begin LabelToMove2.Caption := Copy(code, 2, Length(code) - 1) + Copy(code, 1, 1); end; end; // // Functions procedure T_DH_Form_Effects.Effect_Load_Another_Form(Form1_Load: TForm; Form2_Load: TForm; option: string; autosize: integer; space: integer; seconds: integer); var width: integer; Height: integer; i: integer; begin if (autosize = 1) then begin width := Form2_Load.width; Height := Form1_Load.Height; end else begin width := Form2_Load.width; Height := Form2_Load.Height; end; if (option = 'effect1') then begin Form2_Load.width := 1; Form2_Load.Height := Form1_Load.Height; Form2_Load.Left := space + Form1_Load.Left + Form1_Load.width; Form2_Load.Top := Form1_Load.Top; Form2_Load.Show; for i := 1 to width do begin if (Form2_Load.width = width) then begin break; end else begin Form2_Load.width := i + seconds; Form2_Load.Update; end; end; end else if (option = 'effect2') then begin Form2_Load.Hide; Form2_Load.Height := Height; Form2_Load.Left := Form1_Load.Left + width; Form2_Load.Top := Form1_Load.Top; Form2_Load.Left := space + Form1_Load.Left + Form1_Load.width; Window_Effect(Form2_Load.Handle, 'effect1', seconds); Form2_Load.Show; end else begin Form2_Load.width := 1; Form2_Load.Height := Form1_Load.Height; Form2_Load.Left := space + Form1_Load.Left + Form1_Load.width; Form2_Load.Top := Form1_Load.Top; Form2_Load.Show; for i := 1 to width do begin if (Form2_Load.width = width) then begin break; end else begin Form2_Load.width := i + seconds; Form2_Load.Update; end; end; end; end; procedure T_DH_Form_Effects.Effect_Marquee_Label_DownUp(Panel1: TPanel; Label1: TLabel; segundos: integer); begin // To hide panel : BevelOuter = bvNone PanelToMove1 := Panel1; LabelToMove1 := Label1; Timer_Effect_Marquee_Label_DownUp := TTimerEffect_Marquee_Label_DownUp.Create(nil); Timer_Effect_Marquee_Label_DownUp.Interval := segundos * 1000; Timer_Effect_Marquee_Label_DownUp.OnTimer := Timer_Effect_Marquee_Label_DownUp.OnWork; Timer_Effect_Marquee_Label_DownUp.Enabled := True; end; procedure T_DH_Form_Effects.Effect_Marquee_Form_Caption_LeftRight(Form1: TForm; opcion: string; segundos: integer); begin if (opcion = 'left') then begin FormCaptionToMove := Form1; FormCaptionToMove.Caption := FormCaptionToMove.Caption + ' '; end else if (opcion = 'right') then begin FormCaptionToMove := Form1; FormCaptionToMove.Caption := FormCaptionToMove.Caption + ' '; end else begin FormCaptionToMove := Form1; FormCaptionToMove.Caption := FormCaptionToMove.Caption + ' '; end; Option_Marquee_Form_Caption_LeftRight := opcion; TimerEffect_Marquee_Form_Caption_LeftRight := TTimerEffect_Marquee_Form_Caption_LeftRight.Create(nil); TimerEffect_Marquee_Form_Caption_LeftRight.Interval := segundos * 1000; TimerEffect_Marquee_Form_Caption_LeftRight.OnTimer := TimerEffect_Marquee_Form_Caption_LeftRight.OnWork; TimerEffect_Marquee_Form_Caption_LeftRight.Enabled := True; end; procedure T_DH_Form_Effects.Effect_Marquee_Label_LeftRight(Label2: TLabel; opcion: string; segundos: integer); begin if (opcion = 'left') then begin LabelToMove2 := Label2; LabelToMove2.Caption := LabelToMove2.Caption + ' '; end else if (opcion = 'right') then begin LabelToMove2 := Label2; LabelToMove2.Caption := LabelToMove2.Caption + ' '; end else begin LabelToMove2 := Label2; LabelToMove2.Caption := LabelToMove2.Caption + ' '; end; Option_Marquee_Label_LeftRight := opcion; TimerEffect_Marquee_Label_LeftRight := TTimerEffect_Marquee_Label_LeftRight.Create(nil); TimerEffect_Marquee_Label_LeftRight.Interval := segundos * 1000; TimerEffect_Marquee_Label_LeftRight.OnTimer := TimerEffect_Marquee_Label_LeftRight.OnWork; TimerEffect_Marquee_Label_LeftRight.Enabled := True; end; function T_DH_Form_Effects.Window_Effect(Form: HWND; opcion: string; velocidad: integer): bool; begin try begin if (opcion = 'slide') then begin AnimateWindow(Form, velocidad, AW_SLIDE); end else if (opcion = 'blend') then begin AnimateWindow(Form, velocidad, AW_BLEND); end else if (opcion = 'hide') then begin AnimateWindow(Form, velocidad, AW_HIDE); end else if (opcion = 'center') then begin AnimateWindow(Form, velocidad, AW_CENTER); end else if (opcion = 'effect1') then begin AnimateWindow(Form, velocidad, AW_HOR_POSITIVE); end else if (opcion = 'effect2') then begin AnimateWindow(Form, velocidad, AW_HOR_NEGATIVE); end else if (opcion = 'effect3') then begin AnimateWindow(Form, velocidad, AW_VER_POSITIVE); end else if (opcion = 'effect4') then begin AnimateWindow(Form, velocidad, AW_VER_NEGATIVE); end else begin Result := False; end; Result := True; end; except begin Result := False; end; end; end; function T_DH_Form_Effects.Window_Transparent(Form: TForm; level: integer): bool; begin // Effect in Desktop Dark // Level : 240 // Level : 235 // Level : 230 // Effect in Desktop White // Level : 220 try begin Form.AlphaBlend := True; Form.AlphaBlendValue := level; Form.Visible := True; Result := True; end; except begin Result := False; end; end; end; function T_DH_Form_Effects.desktop_composition_control(option: string): bool; var Registry: TRegistry; begin if not(option = '') then begin try begin Registry := TRegistry.Create; Registry.RootKey := HKEY_CURRENT_USER; Registry.OpenKey('Software\Microsoft\Windows\DWM', True); if (option = 'on') then begin Registry.WriteString('CompositionPolicy', '0'); end; if (option = 'off') then begin Registry.WriteString('CompositionPolicy', '1'); end; Registry.Free; Result := True; end; except begin Result := False; end; end; end else begin Result := False; end; end; // Function for Effect Glass in Console // Credits : Based on http://www.delphibasics.info/home/delphibasicssnippets/glasseffectinadelphiconsoleapplication // Thanks to Rodrigo Ruz // Note : You need enable desktop composition to use this function , else use the function // desktop_composition_control() to enable type DWM_BLURBEHIND = record controls: DWORD; check: bool; color_now: HRGN; max_now: bool; end; procedure DwmEnableBlurBehindWindow(HWND: HWND; const pBlurBehind: DWM_BLURBEHIND); safecall; external 'dwmapi.dll' name 'DwmEnableBlurBehindWindow'; function GetConsoleWindow: HWND; stdcall; external kernel32 name 'GetConsoleWindow'; function check_console: Boolean; var Handle: THandle; begin Handle := GetStdHandle(Std_Output_Handle); Win32Check(Handle <> Invalid_Handle_Value); if (Handle <> 0) then begin Result := True; end else begin Result := False; end; end; procedure Effect_Glass(Handle: HWND; active: Boolean; rgn: HRGN = 0; max: Boolean = False; control: Cardinal = 1); var effect: DWM_BLURBEHIND; begin effect.controls := control; effect.check := active; effect.color_now := rgn; effect.max_now := max; DwmEnableBlurBehindWindow(Handle, effect); end; function T_DH_Form_Effects.Effect_Glass_in_Console(): bool; begin if (check_console) then begin try begin Effect_Glass(GetConsoleWindow(), True); Result := True; end; except begin // end; end; end else begin Result := False; end; end; // end. // The End ?
Ejemplos de uso : procedure TForm1.Form_EffectsClick(Sender: TObject); var effects_manager: T_DH_Form_Effects; begin effects_manager := T_DH_Form_Effects.Create(); effects_manager.window_transparent(Form1, 240); effects_manager.window_effect(Form1.Handle,'center',100); effects_manager.Effect_Marquee_Label_DownUp(Panel1, Label1, 1); effects_manager.Effect_Marquee_Label_LeftRight(Label2, 'left', 1); Effect_Marquee_Form_Caption_LeftRight(Form1, 'right', 1); Effect_Load_Another_Form(Form1, About, 'effect2', 1, 5, 300); Effect_Load_Another_Form(Form1, About, 'effect1', 1,10,200); effects_manager.Free; end;
Si quieren bajar el codigo lo pueden hacer de aca : SourceForge. Github. Eso seria todo.
|
|
|
24
|
Programación / Programación General / [Delphi] DH String Generator 0.3
|
en: 10 Junio 2016, 17:11 pm
|
Un programa en Delphi para generar strings de 10 tipos diferentes y longitudes especificas. Una imagen : El codigo : // DH String Generator 0.3 // (C) Doddy Hackman 2016 unit generator; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Math, Vcl.ExtCtrls, Vcl.ComCtrls, Vcl.Imaging.pngimage, Vcl.ImgList, FormAbout; type TFormHome = class(TForm) imgLogo: TImage; gbStrings: TGroupBox; txtString1: TEdit; btnGen1: TButton; btnCopy1: TButton; txtString2: TEdit; txtString3: TEdit; btnGen2: TButton; btnCopy2: TButton; btnGen3: TButton; btnCopy3: TButton; txtString4: TEdit; btnGen4: TButton; btnCopy4: TButton; txtString5: TEdit; btnGen5: TButton; btnCopy5: TButton; txtString6: TEdit; btnGen6: TButton; btnCopy6: TButton; txtString7: TEdit; btnGen7: TButton; btnCopy7: TButton; txtString8: TEdit; btnGen8: TButton; btnCopy8: TButton; txtString9: TEdit; btnGen9: TButton; btnCopy9: TButton; txtString10: TEdit; btnGen10: TButton; btnCopy10: TButton; gbEnterLength: TGroupBox; gbOptions: TGroupBox; btnAutomatic: TButton; btnAbout: TButton; btnExit: TButton; txtLength: TEdit; udLength: TUpDown; automatic_string: TTimer; ilIconos: TImageList; procedure btnGen1Click(Sender: TObject); procedure btnGen2Click(Sender: TObject); procedure btnGen3Click(Sender: TObject); procedure btnGen4Click(Sender: TObject); procedure btnGen5Click(Sender: TObject); procedure btnGen6Click(Sender: TObject); procedure btnGen7Click(Sender: TObject); procedure btnGen8Click(Sender: TObject); procedure btnGen9Click(Sender: TObject); procedure btnGen10Click(Sender: TObject); procedure btnCopy1Click(Sender: TObject); procedure btnCopy2Click(Sender: TObject); procedure btnCopy3Click(Sender: TObject); procedure btnCopy4Click(Sender: TObject); procedure btnCopy5Click(Sender: TObject); procedure btnCopy6Click(Sender: TObject); procedure btnCopy7Click(Sender: TObject); procedure btnCopy8Click(Sender: TObject); procedure btnCopy9Click(Sender: TObject); procedure btnCopy10Click(Sender: TObject); procedure automatic_stringTimer(Sender: TObject); procedure btnAutomaticClick(Sender: TObject); procedure btnAboutClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var FormHome: TFormHome; implementation {$R *.dfm} // Functions function dh_generate_string(option: string; length_string: integer): string; const letters1: array [1 .. 26] of string = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); const letters2: array [1 .. 26] of string = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); const numbers: array [1 .. 10] of string = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); const cyrillic: array [1 .. 44] of string = ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?'); const no_idea1: array [1 .. 13] of string = ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?'); const no_idea2: array [1 .. 28] of string = ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '??', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '??'); const no_idea3: array [1 .. 13] of string = ('??', '?', '?', '?', '?', '?', '?', '_', '?', '`', '?', '_', '?'); const no_idea4: array [1 .. 26] of string = ('?', '?', '€', '?', 'l', '?', '™', 'O', 'e', '?', '?', '?', '?', '?', '?', '?', '?', '-', '/', '·', 'v', '8', '?', '˜', '?', '='); const no_idea5: array [1 .. 33] of string = ('?', '?', '?', '?', 'n', '?', '?', '?', '?', '?', '?', 'G', '?', '?', '?', 'e', 'ß', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '8', 'S', '?'); const no_idea6: array [1 .. 32] of string = ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?'); var code: string; gen_now: string; i: integer; index: integer; begin gen_now := ''; for i := 1 to length_string do begin if (option = '1') then begin gen_now := gen_now + letters1[RandomRange(1, Length(letters1) + 1)]; end else if (option = '2') then begin gen_now := gen_now + letters2[RandomRange(1, Length(letters2) + 1)]; end else if (option = '3') then begin gen_now := gen_now + numbers[RandomRange(1, Length(numbers) + 1)]; end else if (option = '4') then begin gen_now := gen_now + cyrillic[RandomRange(1, Length(cyrillic) + 1)]; end else if (option = '5') then begin gen_now := gen_now + no_idea1[RandomRange(1, Length(no_idea1) + 1)]; end else if (option = '6') then begin gen_now := gen_now + no_idea2[RandomRange(1, Length(no_idea2) + 1)]; end else if (option = '7') then begin gen_now := gen_now + no_idea3[RandomRange(1, Length(no_idea3) + 1)]; end else if (option = '8') then begin gen_now := gen_now + no_idea4[RandomRange(1, Length(no_idea4) + 1)]; end else if (option = '9') then begin gen_now := gen_now + no_idea5[RandomRange(1, Length(no_idea5) + 1)]; end else if (option = '10') then begin gen_now := gen_now + no_idea6[RandomRange(1, Length(no_idea6) + 1)]; end else begin gen_now := gen_now + letters1[RandomRange(1, Length(letters1) + 1)]; end; end; code := gen_now; Result := code; end; function message_box(title, message_text, type_message: string): string; begin if not(title = '') and not(message_text = '') and not(type_message = '') then begin try begin if (type_message = 'Information') then begin MessageBox(FormHome.Handle, PChar(message_text), PChar(title), MB_ICONINFORMATION); end else if (type_message = 'Warning') then begin MessageBox(FormHome.Handle, PChar(message_text), PChar(title), MB_ICONWARNING); end else if (type_message = 'Question') then begin MessageBox(FormHome.Handle, PChar(message_text), PChar(title), MB_ICONQUESTION); end else if (type_message = 'Error') then begin MessageBox(FormHome.Handle, PChar(message_text), PChar(title), MB_ICONERROR); end else begin MessageBox(FormHome.Handle, PChar(message_text), PChar(title), MB_ICONINFORMATION); end; Result := '[+] MessageBox : OK'; end; except begin Result := '[-] Error'; end; end; end else begin Result := '[-] Error'; end; end; // procedure TFormHome.btnGen1Click(Sender: TObject); begin txtString1.Text := dh_generate_string('1', StrToInt(txtLength.Text)); end; procedure TFormHome.btnGen2Click(Sender: TObject); begin txtString2.Text := dh_generate_string('2', StrToInt(txtLength.Text)); end; procedure TFormHome.btnGen3Click(Sender: TObject); begin txtString3.Text := dh_generate_string('3', StrToInt(txtLength.Text)); end; procedure TFormHome.btnGen4Click(Sender: TObject); begin txtString4.Text := dh_generate_string('4', StrToInt(txtLength.Text)); end; procedure TFormHome.btnGen5Click(Sender: TObject); begin txtString5.Text := dh_generate_string('5', StrToInt(txtLength.Text)); end; procedure TFormHome.btnGen6Click(Sender: TObject); begin txtString6.Text := dh_generate_string('6', StrToInt(txtLength.Text)); end; procedure TFormHome.btnGen7Click(Sender: TObject); begin txtString7.Text := dh_generate_string('7', StrToInt(txtLength.Text)); end; procedure TFormHome.btnGen8Click(Sender: TObject); begin txtString8.Text := dh_generate_string('8', StrToInt(txtLength.Text)); end; procedure TFormHome.btnGen9Click(Sender: TObject); begin txtString9.Text := dh_generate_string('9', StrToInt(txtLength.Text)); end; procedure TFormHome.btnGen10Click(Sender: TObject); begin txtString10.Text := dh_generate_string('10', StrToInt(txtLength.Text)); end; procedure TFormHome.btnCopy1Click(Sender: TObject); begin if not(txtString1.Text = '') then begin txtString1.SelectAll; txtString1.CopyToClipboard; message_box('DH String Generator 0.3', 'String copied to the clipboard', 'Information'); end else begin message_box('DH String Generator 0.3', 'String is empty', 'Warning'); end; end; procedure TFormHome.btnCopy2Click(Sender: TObject); begin if not(txtString2.Text = '') then begin txtString2.SelectAll; txtString2.CopyToClipboard; message_box('DH String Generator 0.3', 'String copied to the clipboard', 'Information'); end else begin message_box('DH String Generator 0.3', 'String is empty', 'Warning'); end; end; procedure TFormHome.btnCopy3Click(Sender: TObject); begin if not(txtString3.Text = '') then begin txtString3.SelectAll; txtString3.CopyToClipboard; message_box('DH String Generator 0.3', 'String copied to the clipboard', 'Information'); end else begin message_box('DH String Generator 0.3', 'String is empty', 'Warning'); end; end; procedure TFormHome.btnCopy4Click(Sender: TObject); begin if not(txtString4.Text = '') then begin txtString4.SelectAll; txtString4.CopyToClipboard; message_box('DH String Generator 0.3', 'String copied to the clipboard', 'Information'); end else begin message_box('DH String Generator 0.3', 'String is empty', 'Warning'); end; end; procedure TFormHome.btnCopy5Click(Sender: TObject); begin if not(txtString5.Text = '') then begin txtString5.SelectAll; txtString5.CopyToClipboard; message_box('DH String Generator 0.3', 'String copied to the clipboard', 'Information'); end else begin message_box('DH String Generator 0.3', 'String is empty', 'Warning'); end; end; procedure TFormHome.btnCopy6Click(Sender: TObject); begin if not(txtString6.Text = '') then begin txtString6.SelectAll; txtString6.CopyToClipboard; message_box('DH String Generator 0.3', 'String copied to the clipboard', 'Information'); end else begin message_box('DH String Generator 0.3', 'String is empty', 'Warning'); end; end; procedure TFormHome.btnCopy7Click(Sender: TObject); begin if not(txtString7.Text = '') then begin txtString7.SelectAll; txtString7.CopyToClipboard; message_box('DH String Generator 0.3', 'String copied to the clipboard', 'Information'); end else begin message_box('DH String Generator 0.3', 'String is empty', 'Warning'); end; end; procedure TFormHome.btnCopy8Click(Sender: TObject); begin if not(txtString8.Text = '') then begin txtString8.SelectAll; txtString8.CopyToClipboard; message_box('DH String Generator 0.3', 'String copied to the clipboard', 'Information'); end else begin message_box('DH String Generator 0.3', 'String is empty', 'Warning'); end; end; procedure TFormHome.btnCopy9Click(Sender: TObject); begin if not(txtString9.Text = '') then begin txtString9.SelectAll; txtString9.CopyToClipboard; message_box('DH String Generator 0.3', 'String copied to the clipboard', 'Information'); end else begin message_box('DH String Generator 0.3', 'String is empty', 'Warning'); end; end; procedure TFormHome.btnCopy10Click(Sender: TObject); begin if not(txtString10.Text = '') then begin txtString10.SelectAll; txtString10.CopyToClipboard; message_box('DH String Generator 0.3', 'String copied to the clipboard', 'Information'); end else begin message_box('DH String Generator 0.3', 'String is empty', 'Warning'); end; end; procedure TFormHome.btnAboutClick(Sender: TObject); begin FormAbout.frmAbout.Show(); end; procedure TFormHome.btnAutomaticClick(Sender: TObject); begin if (automatic_string.Enabled = False) then begin btnAutomatic.Caption := 'Disable Automatic Generate'; automatic_string.Enabled := True; end else begin btnAutomatic.Caption := 'Enable Automatic Generate'; automatic_string.Enabled := False; end; end; procedure TFormHome.automatic_stringTimer(Sender: TObject); begin txtString1.Text := dh_generate_string('1', StrToInt(txtLength.Text)); txtString2.Text := dh_generate_string('2', StrToInt(txtLength.Text)); txtString3.Text := dh_generate_string('3', StrToInt(txtLength.Text)); txtString4.Text := dh_generate_string('4', StrToInt(txtLength.Text)); txtString5.Text := dh_generate_string('5', StrToInt(txtLength.Text)); txtString6.Text := dh_generate_string('6', StrToInt(txtLength.Text)); txtString7.Text := dh_generate_string('7', StrToInt(txtLength.Text)); txtString8.Text := dh_generate_string('8', StrToInt(txtLength.Text)); txtString9.Text := dh_generate_string('9', StrToInt(txtLength.Text)); txtString10.Text := dh_generate_string('10', StrToInt(txtLength.Text)); end; end. // The End ?
Si quieren bajar el programa lo pueden hacer de aca : SourceForge. Github. Eso seria todo.
|
|
|
25
|
Programación / .NET (C#, VB.NET, ASP) / [C#] ZIP Cracker 0.2
|
en: 28 Mayo 2016, 03:43 am
|
Un simple programa en C# para buscar el password de un comprimido ZIP usando un diccionario. El codigo : // ZIP Cracker 0.2 // (C) Doddy Hackman 2015 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Ionic.Zip; using System.IO; namespace ZIP_Cracker { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public bool check_password(string filename, string password) { try { using (ZipFile zip = ZipFile.Read(filename)) { zip.Password = password; var stream = new MemoryStream (); foreach (ZipEntry z in zip) { z.Extract(stream); } return true; } } catch { return false; } } private void exit_Click(object sender, EventArgs e) { Application.Exit(); } private void load_Click(object sender, EventArgs e) { open.InitialDirectory = Directory.GetCurrentDirectory(); open.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; open.Title = "Select File"; if (open.ShowDialog() == DialogResult.OK) { wordlist.Text = open.FileName; } } private void crack_Click(object sender, EventArgs e) { string zip_file = archivo_zip.Text; string wordlist_file = wordlist.Text; string password; console.Clear(); if (File.Exists(zip_file) && File.Exists(wordlist_file)) { console.AppendText("[+] Cracking ...\n\n"); System.IO.StreamReader leyendo = new System.IO.StreamReader(wordlist_file ); while ((password = leyendo.ReadLine()) != null) { if (check_password(zip_file,password)) { console.AppendText("[+] Password Found : " + password+"\n"); break; } else { console.AppendText("[-] Password : "+password+" FAIL"+"\n"); } } leyendo.Close(); console.AppendText("\n[+] Finished"); } else { console.AppendText("[-] File not found"); } } private void load_zip_Click(object sender, EventArgs e) { open.InitialDirectory = Directory.GetCurrentDirectory(); open.Filter = "zip files (*.zip)|*.zip|All files (*.*)|*.*"; open.Title = "Select ZIP"; if (open.ShowDialog() == DialogResult.OK) { archivo_zip.Text = open.FileName; } } } } // The End ?
Una imagen : Si quieren bajar el proyecto con el codigo fuente lo pueden hacer de aca : SourceForge. Eso seria todo.
|
|
|
26
|
Programación / Programación General / [Delphi] Unit DH Tools 0.2
|
en: 14 Mayo 2016, 18:45 pm
|
Hola les traigo una Unit en Delphi , se llama DH_Tools y tiene las siguientes funciones : - Realizar una peticion GET a una pagina y capturar la respuesta
- Realizar una peticion POST a una pagina y capturar la respuesta
- Crear o escribir en un archivo
- Leer un archivo
- Ejecutar comandos y recibir la respuesta
- HTTP FingerPrinting
- Recibir el codigo de respuesta HTTP de una pagina
- Limpiar repetidos en un array
- Limpiar URL en un array a partir de la "query"
- Split casero xD
- Descargar archivos de internet
- Capturar el nombre del archivo de una URL
- URI Split
- MD5 Encode
- Capturar el MD5 de un archivo
- Resolve IP
El codigo : // Unit : DH Tools // Version : 0.2 // (C) Doddy Hackman 2015 unit DH_Tools; interface uses SysUtils, Windows, WinInet, Classes, IdHTTP, Generics.Collections, URLMon, IdURI, IdHashMessageDigest, WinSock; function toma(const pagina: string): UTF8String; function tomar(pagina: string; postdata: AnsiString): string; procedure savefile(filename, texto: string); function read_file(const archivo: TFileName): String; function console(cmd: string): string; function http_finger(page: string): string; function response_code(page: string): string; function clean_list(const list: TList<String>): TList<String>; function cut_list(const list: TList<String>): TList<String>; function regex(text: String; deaca: String; hastaaca: String): String; function download_file(page, save: string): bool; function get_url_file(Url: string): string; function uri_split(Url, opcion: string): string; function md5_encode(text: string): string; function md5_file(const filename: string): string; function resolve_ip(const target: string): string; implementation function toma(const pagina: string): UTF8String; // Credits : Based on http://www.scalabium.com/faq/dct0080.htm // Thanks to www.scalabium.com var nave1: HINTERNET; nave2: HINTERNET; tou: DWORD; codez: UTF8String; codee: array [0 .. 1023] of byte; finalfinal: string; begin try begin finalfinal := ''; Result := ''; nave1 := InternetOpen ('Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0); nave2 := InternetOpenUrl(nave1, PChar(pagina), nil, 0, INTERNET_FLAG_RELOAD, 0); repeat begin InternetReadFile(nave2, @codee, SizeOf(codee), tou); SetString(codez, PAnsiChar(@codee[0]), tou); finalfinal := finalfinal + codez; end; until tou = 0; InternetCloseHandle(nave2); InternetCloseHandle(nave1); Result := finalfinal; end; except // end; end; 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 tomar(pagina: string; postdata: AnsiString): string; // Credits : Based on : http://tulisanlain.blogspot.com.ar/2012/10/how-to-send-http-post-request-in-delphi.html // Thanks to Tulisan Lain const accept: packed array [0 .. 1] of LPWSTR = (PChar('*/*'), nil); var nave3: HINTERNET; nave4: HINTERNET; nave5: HINTERNET; todod: array [0 .. 1023] of AnsiChar; numberz: Cardinal; numberzzz: Cardinal; finalfinalfinalfinal: string; begin try begin finalfinalfinalfinal := ''; Result := ''; nave3 := InternetOpen (PChar('Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0'), INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0); nave4 := InternetConnect(nave3, PChar(regex(pagina, '://', '/')), INTERNET_DEFAULT_HTTP_PORT, nil, nil, INTERNET_SERVICE_HTTP, 0, 1); nave5 := HttpOpenRequest(nave4, PChar('POST'), PChar(get_url_file(pagina) ), nil, nil, @accept, 0, 1); HttpSendRequest(nave5, PChar('Content-Type: application/x-www-form-urlencoded'), Length('Content-Type: application/x-www-form-urlencoded'), PChar(postdata), Length(postdata)); repeat begin InternetReadFile(nave5, @todod, SizeOf(todod), numberzzz); if numberzzz = SizeOf(todod) then begin Result := Result + AnsiString(todod); end; if numberzzz > 0 then for numberz := 0 to numberzzz - 1 do begin finalfinalfinalfinal := finalfinalfinalfinal + todod[numberz]; end; end; until numberzzz = 0; InternetCloseHandle(nave3); InternetCloseHandle(nave4); InternetCloseHandle(nave5); Result := finalfinalfinalfinal; end; except // end; end; procedure savefile(filename, texto: string); var ar: TextFile; begin AssignFile(ar, filename); FileMode := fmOpenWrite; if FileExists(filename) then Append(ar) else Rewrite(ar); Write(ar, texto); CloseFile(ar); end; function read_file(const archivo: TFileName): String; var lista: TStringList; begin if (FileExists(archivo)) then begin lista := TStringList.Create; lista.Loadfromfile(archivo); Result := lista.text; lista.Free; end; end; function console(cmd: string): string; // Credits : Function ejecutar() based in : http://www.delphidabbler.com/tips/61 // Thanks to www.delphidabbler.com var parte1: TSecurityAttributes; parte2: TStartupInfo; parte3: TProcessInformation; parte4: THandle; parte5: THandle; control2: Boolean; contez: array [0 .. 255] of AnsiChar; notengoidea: Cardinal; fix: Boolean; code: string; begin code := ''; with parte1 do begin nLength := SizeOf(parte1); bInheritHandle := True; lpSecurityDescriptor := nil; end; CreatePipe(parte4, parte5, @parte1, 0); with parte2 do begin FillChar(parte2, SizeOf(parte2), 0); cb := SizeOf(parte2); dwFlags := STARTF_USESHOWWINDOW or STARTF_USESTDHANDLES; wShowWindow := SW_HIDE; hStdInput := GetStdHandle(STD_INPUT_HANDLE); hStdOutput := parte5; hStdError := parte5; end; fix := CreateProcess(nil, PChar('cmd.exe /C ' + cmd), nil, nil, True, 0, nil, PChar('c:/'), parte2, parte3); CloseHandle(parte5); if fix then repeat begin control2 := ReadFile(parte4, contez, 255, notengoidea, nil); end; if notengoidea > 0 then begin contez[notengoidea] := #0; code := code + contez; end; until not(control2) or (notengoidea = 0); Result := code; end; function http_finger(page: string): string; var nave: TIdHTTP; resultado: string; begin nave := TIdHTTP.Create(nil); nave.Request.UserAgent := 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0'; nave.Get(page); resultado := '[+] ' + nave.Response.ResponseText + sLineBreak + '[+] Date : ' + DateTimeToStr(nave.Response.Date) + sLineBreak + '[+] Server : ' + nave.Response.Server + sLineBreak + '[+] Last-Modified : ' + DateTimeToStr(nave.Response.LastModified) + sLineBreak + '[+] ETag : ' + nave.Response.ETag + sLineBreak + '[+] Accept-Ranges : ' + nave.Response.AcceptRanges + sLineBreak + '[+] Content-Length : ' + IntToStr(nave.Response.ContentLength) + sLineBreak + '[+] Connection : ' + nave.Response.Connection + sLineBreak + '[+] Content-Type : ' + nave.Response.ContentType; Result := resultado; end; function response_code(page: string): string; var nave: TIdHTTP; code: string; begin nave := TIdHTTP.Create(nil); nave.Request.UserAgent := 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0'; try begin nave.Head(page); code := IntToStr(nave.ResponseCode); end; except begin code := '404'; end; end; Result := code; end; function clean_list(const list: TList<String>): TList<String>; var lista: TList<String>; elemento: string; begin lista := TList<String>.Create; for elemento in list do begin if not lista.Contains(elemento) then begin lista.Add(elemento); end; end; Result := lista; end; function cut_list(const list: TList<String>): TList<String>; var lista: TList<String>; elemento: string; otralista: TStrings; begin lista := TList<String>.Create; for elemento in list do begin if (Pos('=', elemento) > 0) then begin otralista := TStringList.Create; ExtractStrings(['='], [], PChar(elemento), otralista); lista.Add(otralista[0] + '='); end; end; Result := lista; end; function download_file(page, save: string): bool; begin UrlDownloadToFile(nil, PChar(page), PChar(save), 0, nil); if FileExists(save) then begin Result := True; end else begin Result := False; end; end; function get_url_file(Url: string): string; var URI: TIdURI; begin URI := TIdURI.Create(Url); Result := URI.Document; end; function uri_split(Url, opcion: string): string; var URI: TIdURI; begin URI := TIdURI.Create(Url); if opcion = 'host' then begin Result := URI.Host; end; if opcion = 'port' then begin Result := URI.Port; end; if opcion = 'path' then begin Result := URI.Path; end; if opcion = 'file' then begin Result := URI.Document; end; if opcion = 'query' then begin Result := URI.Params; end; if opcion = '' then begin Result := 'Error'; end; end; function md5_encode(text: string): string; var md5: TIdHashMessageDigest5; begin md5 := TIdHashMessageDigest5.Create; Result := LowerCase(md5.HashStringAsHex(text)); end; function md5_file(const filename: string): string; var md5: TIdHashMessageDigest5; stream: TFileStream; begin if (FileExists(filename)) then begin md5 := TIdHashMessageDigest5.Create; stream := TFileStream.Create(filename, fmOpenRead or fmShareDenyWrite); Result := LowerCase(md5.HashStreamAsHex(stream)); end else begin Result := 'Error'; end; end; function resolve_ip(const target: string): string; var socket: TWSAData; uno: PHostEnt; dos: TInAddr; ip: string; begin try begin WSAStartup($101, socket); uno := WinSock.GetHostByName(PAnsiChar(AnsiString(target))); dos := PInAddr(uno^.h_Addr_List^)^; ip := WinSock.inet_ntoa(dos); if ip = '' then begin Result := 'Error'; end else begin Result := ip; end; end; except Result := 'Error'; end; end; end. // The End ?
Ejemplos de uso : unit dh; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, DH_Tools, Generics.Collections; type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var paginas: TList<String>; pagina: string; lista: TList<String>; code: string; begin // code := toma('http://localhost/login.php'); // ShowMessage(code); // code := tomar('http://localhost/login.php','usuario=test&password=test&control=Login'); // ShowMessage(code); // savefile('logs.txt','test'); // code := read_file('logs.txt'); // ShowMessage(code); // code := console('ver'); // ShowMessage(code); // code := http_finger('http://www.petardas.com'); // ShowMessage(code); // code := response_code('http://www.petardas.com'); // ShowMessage(code); { paginas := TList<String>.Create; paginas.AddRange(['test1', 'test1', 'test3', 'test4', 'test5']); lista := clean_list(paginas); for pagina in lista do begin Memo1.Lines.Add('Value : ' + pagina); end; } { paginas := TList<String>.Create; paginas.AddRange(['http://localhost/sql1.php?id=dsadasad', 'http://localhost/sql2.php?id=dsadasad', 'http://localhost/sql3.php?id=dsadasad', 'http://localhost/sql3.php?id=dsadasad']); lista := cut_list(clean_list(paginas)); for pagina in lista do begin Memo1.Lines.Add('Value : ' + pagina); end; } { if (download_file('http://localhost/test.rar', 'test.rar')) then begin ShowMessage('Yeah'); end else begin ShowMessage('Error'); end; } // ShowMessage(get_url_file('http://localhost/sql.php?id=dsadsadsa')); // ShowMessage(uri_split('http://localhost/sql.php?id=dsadsadd','query')); // ShowMessage(md5_encode('123')); // ShowMessage(md5_file('c:/xampp/xampp-control.exe')); // ShowMessage(resolve_ip('www.petardas.com')); end; end.
Eso seria todo.
|
|
|
28
|
Programación / Java / [Java] ClapTrap IRC Bot 0.5
|
en: 15 Abril 2016, 21:26 pm
|
Traduccion a Java de mi IRC Bot , tiene las siguientes opciones : - Scanner SQLI
- Scanner LFI
- Buscador de panel de administracion
- Localizador de IP
- Buscador de DNS
- Buscador de SQLI y RFI en google
- Crack para hashes MD5
- Cortador de URL usando tinyurl
- HTTP FingerPrinting
- Codificador base64,hex y ASCII
Unas imagenes : El codigo : // ClapTrap IRC Bot 0.5 // (C) Doddy Hackman 2015 package claptrap.irc.bot; import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.io.*; import java.net.*; import java.util.Scanner; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Doddy */ public class ClapTrapIRCBot { /** * @param args the command line arguments */ public static String servidor ; public static int puerto; public static int tiempo; public static Socket conexion ; public static void responder (String contenido ) { try { String[] textos = contenido. split("\n"); if (!"".equals(texto)) { escribir.write("PRIVMSG " + admin + " : " + texto + "\r\n"); escribir.flush(); try { Logger.getLogger(ClapTrapIRCBot.class.getName()).log(Level.SEVERE, null, ex); } } } // } } public static void main (String[] args ) { Scanner input = new Scanner (System. in); System. out. println("\n-- == ClapTrap IRC Bot 0.5 == --\n\n"); System. out. println("[+] Hostname : "); String hostname_value = input. nextLine(); System. out. println("\n[+] Port : "); System. out. println("\n[+] Channel : "); String channel_value = input. nextLine(); System. out. println("\n[+] Nickname Admin : "); String admin_value = input. nextLine(); servidor = hostname_value; puerto = port_value; nick = "ClapTrap"; admin = admin_value; canal = channel_value; tiempo = 3; try { conexion = new Socket(servidor, puerto ); escribir.write("NICK " + nick + "\r\n"); escribir.write("USER " + nick + " 1 1 1 1\r\n"); escribir.flush(); escribir.write("JOIN " + canal + "\r\n"); escribir.flush(); System. out. println("\n[+] Online"); funciones funcion = new funciones(); while ((contenido = leer.readLine()) != null) { Pattern search = null; Matcher regex = null; search = Pattern.compile("^PING(.*)$"); regex = search.matcher(contenido); if (regex.find()) { escribir.write("PONG " + regex.group(1) + "\r\n"); escribir.flush(); } search = Pattern.compile(":(.*)!(.*) PRIVMSG (.*) :(.*)"); regex = search.matcher(contenido); if (regex.find()) { String control_admin = regex. group(1); if (control_admin.equals(admin)) { // search = Pattern.compile("!sqli (.*)$"); regex = search.matcher(text); if (regex.find()) { String target = regex. group(1); String code = funcion. SQLI_Scanner(target ); responder(code); } search = Pattern.compile("!lfi (.*)$"); regex = search.matcher(text); if (regex.find()) { String target = regex. group(1); String code = funcion. scan_lfi(target ); responder(code); } search = Pattern.compile("!panel (.*)$"); regex = search.matcher(text); if (regex.find()) { String target = regex. group(1); String code = funcion. panel_finder(target ); responder(code); } search = Pattern.compile("!fuzzdns (.*)$"); regex = search.matcher(text); if (regex.find()) { String target = regex. group(1); String code = funcion. fuzz_dns(target ); responder(code); } search = Pattern.compile("!locateip (.*)$"); regex = search.matcher(text); if (regex.find()) { String target = regex. group(1); String code = funcion. locate_ip(target ); responder(code); } search = Pattern.compile("!sqlifinder (.*) (.*) (.*)$"); regex = search.matcher(text); if (regex.find()) { int cantidad = Integer. parseInt(regex. group(2)); String buscador = regex. group(3); String code = funcion. find_sqli(dork, cantidad, buscador ); responder(code); } search = Pattern.compile("!rfifinder (.*) (.*) (.*)$"); regex = search.matcher(text); if (regex.find()) { int cantidad = Integer. parseInt(regex. group(2)); String buscador = regex. group(3); String code = funcion. find_rfi(dork, cantidad, buscador ); responder(code); } search = Pattern.compile("!crackit (.*)$"); regex = search.matcher(text); if (regex.find()) { String code = funcion. crack_md5(md5 ); responder(code); } search = Pattern.compile("!tinyurl (.*)$"); regex = search.matcher(text); if (regex.find()) { String code = funcion. tiny_url(url ); responder(code); } search = Pattern.compile("!httpfinger (.*)$"); regex = search.matcher(text); if (regex.find()) { String code = funcion. http_finger(page ); responder(code); } search = Pattern.compile("!md5 (.*)$"); regex = search.matcher(text); if (regex.find()) { String texto = regex. group(1); String code = "[+] MD5 : " + funcion. md5_encode(texto ); responder(code); } search = Pattern.compile("!base64 (.*) (.*)$"); regex = search.matcher(text); if (regex.find()) { String option = regex. group(1); String texto = regex. group(2); if ("encode".equals(option)) { code = "[+] Base64 : " + funcion.encode_base64(texto); } if ("decode".equals(option)) { code = "[+] Text : " + funcion.decode_base64(texto); } responder(code); } search = Pattern.compile("!ascii (.*) (.*)$"); regex = search.matcher(text); if (regex.find()) { String option = regex. group(1); String texto = regex. group(2); if ("encode".equals(option)) { code = "[+] ASCII : " + funcion.encode_ascii(texto); } if ("decode".equals(option)) { code = "[+] Text : " + funcion.decode_ascii(texto); } responder(code); } search = Pattern.compile("!hex (.*) (.*)$"); regex = search.matcher(text); if (regex.find()) { String option = regex. group(1); String texto = regex. group(2); if ("encode".equals(option)) { code = "[+] Hex : " + funcion.encode_hex(texto); } if ("decode".equals(option)) { code = "[+] Text : " + funcion.decode_hex(texto); } responder(code); } search = Pattern.compile("!help"); regex = search.matcher(text); if (regex.find()) { code = code + "Hi , I am ClapTrap an assistant robot programmed by Doddy Hackman in the year 2015" + "\n"; code = code + "[++] Commands" + "\n"; code = code + "[+] !help" + "\n"; code = code + "[+] !locateip <web>" + "\n"; code = code + "[+] !sqlifinder <dork> <count pages> <google/bing>" + "\n"; code = code + "[+] !rfifinder <dork> <count pages> <google/bing>" + "\n"; code = code + "[+] !panel <page>" + "\n"; code = code + "[+] !fuzzdns <domain>" + "\n"; code = code + "[+] !sqli <page>" + "\n"; code = code + "[+] !lfi <page>" + "\n"; code = code + "[+] !crackit <hash>" + "\n"; code = code + "[+] !tinyurl <page>" + "\n"; code = code + "[+] !httpfinger <page>" + "\n"; code = code + "[+] !md5 <text>" + "\n"; code = code + "[+] !base64 <encode/decode> <text>" + "\n"; code = code + "[+] !ascii <encode/decode> <text>" + "\n"; code = code + "[+] !hex <encode/decode> <text>" + "\n"; code = code + "[++] Enjoy this IRC Bot" + "\n"; responder(code); } // } } } System. out. println("\n[-] Error connecting"); } } } // The End ?
Si quieren bajar el programa lo pueden hacer de aca : SourceForge. Github. Eso seria todo.
|
|
|
29
|
Programación / Java / [Java] K0bra 1.0
|
en: 1 Abril 2016, 15:19 pm
|
Un simple scanner SQLI hecho en Java , tiene las siguientes funciones : - Comprobar vulnerabilidad
- Buscar numero de columnas
- Buscar automaticamente el numero para mostrar datos
- Mostras tablas
- Mostrar columnas
- Mostrar bases de datos
- Mostrar tablas de otra DB
- Mostrar columnas de una tabla de otra DB
- Mostrar usuarios de mysql.user
- Buscar archivos usando load_file
- Mostrar un archivo usando load_file
- Mostrar valores
- Mostrar informacion sobre la DB
- Crear una shell usando outfile
- Todo se guarda en logs ordenados
Unas imagenes : Si quieren bajar el proyecto con el codigo fuente lo pueden hacer desde aca.
|
|
|
30
|
Programación / Java / [Java] PanelFinder 0.3
|
en: 18 Marzo 2016, 14:22 pm
|
Traduccion a Java de este programa para buscar el panel de administracion de una pagina. Una imagen : Si quieren bajar el proyecto lo pueden hacer desde aca.
|
|
|
|
|
|
|