[C#] ZIP Cracker 0.2

Iniciado por BigBear, Mayo 27, 2016, 10:43:59 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Un simple programa en C# para buscar el password de un comprimido ZIP usando un diccionario.

El codigo :

Código: csharp

// 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 programa lo pueden hacer de aca :

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

Eso seria todo.

Interesante el codigo, Gracias.

Gracias por compartir, sera de utilidad.