[Java] CrackHash 0.1

Iniciado por BigBear, Enero 12, 2013, 11:41:12 PM

Tema anterior - Siguiente tema

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

Un simple programa para crackear un hash md5 mediante una pagina online.

Código: java

//
//CrackHash 0.1
//Coded By Doddy H
//
//Test with 098f6bcd4621d373cade4e832627b4f6
//
//

import java.util.Scanner;
import java.io.*;
import java.net.*;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

    public static void main(String[] args) throws Exception {

        String hash;
        Scanner host = new Scanner(System.in);
        System.out.println("\n\n-- == CrackHash 0.1 == --\n\n");
        System.out.println("[+] Hash : ");
        hash = host.nextLine();

        String code;

        code = toma("http://md5.hashcracking.com/search.php?md5=" + hash);

        Pattern uno = null;
        Matcher dos = null;

        uno = Pattern.compile("Cleartext of (.*) is (.*)");
        dos = uno.matcher(code);

        if (!dos.find()) {
            System.out.println("\n[-] Not Found");
        } else {
            System.out.println("\n[+] Hash Cracked : " + dos.group(2));
        }

        System.out.println("\n\n-- == Coded By Doddy H == --");

    }

    private static String toma(String urla) throws Exception {

        String re;

        StringBuffer conte = new StringBuffer(40);

        URL url = new URL(urla);
        URLConnection hc = url.openConnection();
        hc.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");

        BufferedReader nave = new BufferedReader(
                new InputStreamReader(hc.getInputStream()));

        while ((re = nave.readLine()) != null) {
            conte.append(re);
        }

        nave.close();

        return conte.toString();

    }
}

//The End ?