HashCat just doesn't crack my MD5 hash with brute force
#1
Hello,
    I have a very simple university project that involves creating a MD5 4-char long string hash and then cracking it using brute force/masked attack, very simple premise, did the code in java for hashing and used hashcat 4.2 for brute forcing but the second one just won't work... obviously a mistake on my end since the example templates works fine. 
The hash i'm using is supposed to be MD5, 128-bit long, using ?l?d for charset since the passwords only use those characters and they are 4 char long, so should be very easy to do.
    So lets see: the code for hashcat I used is :
               ./hashcat -m 0 -a 3 -1 ?l?d -O -o=crackedHashes.txt (hash dir) ?1?1?1?1 --potfile-disable
Got this output:
[Image: 9oigyXZ.png]

Also I did try to run it with ?h?h?h?h mask
the crackedHashes.txt just isn't generated! and I disabled potfile and enabled it, deleted it, cleaned it, nothing!

These are the hashes, for what I researched, they are supposed to be regular MD5.

5259ee4a034fdeddd1b65be92debe731
4e40beaf133b47b8b0020881b20ad713
58d17e8b3add72032cf54a2f865e3dc4
d39336da4df51fae43b4ecd5848c1356

This is the java function used to hash the strings:

   public static String MD5(String txt) throws NoSuchAlgorithmException {
       MessageDigest m=MessageDigest.getInstance("MD5");
       m.update(txt.getBytes(),0,txt.length());
       return new BigInteger(1,m.digest()).toString(16);
    }

They are just test hashes so their meaning is useless...
Any clue as to why this is happening? Feels like a rookie mistake and I'm just noobing it out Tongue
#2
Your hashes seem to be double MD5, so not just md5("abcd") but md5(md5("abcd")). 5259ee4a034fdeddd1b65be92debe731 is "asdf" for example.

If you look at https://hashcat.net/wiki/doku.php?id=hashcat you will see that hashcat supports this method as "-m 2600".
#3
(10-23-2018, 05:16 PM)DanielG Wrote: Your hashes seem to be double MD5, so not just md5("abcd") but md5(md5("abcd")). 5259ee4a034fdeddd1b65be92debe731 is "asdf" for example.

If you look at https://hashcat.net/wiki/doku.php?id=hashcat you will see that hashcat supports this method as "-m 2600".

Yep, that's it! Sorry to bother and thank you very much DanielG!