hashcat Forum
[Python] Split LM hashes - Printable Version

+- hashcat Forum (https://hashcat.net/forum)
+-- Forum: Misc (https://hashcat.net/forum/forum-15.html)
+--- Forum: User Contributions (https://hashcat.net/forum/forum-25.html)
+--- Thread: [Python] Split LM hashes (/thread-1596.html)



[Python] Split LM hashes - Mem5 - 09-24-2012

A simple script to split a list of 32-chars hashes into 16-chars for LM cracking in oclhashcat.

Code:
import sys
from sys import argv

if len(argv) == 2:
    filename = argv[1] + "_lm.txt"
    file_lm = open(filename, "w+")
    for lin in open(argv[1]):
        line = lin.strip()
        if(len(line)==32):
            file_lm.write(line[:16] + "\n" + line[16:] + "\n")

    file_lm.close()
    print('[+] LM hashes successfully written to '+filename+'.')

else:
    print('Usage: ', argv[0],' hashfile_to_split.txt')
    sys.exit(1)

Improve it if needed thanks !


RE: [Python] Split LM hashes - epixoip - 09-25-2012

Code:
sed -rn 's/(.{16})(.{16})/\1\n\2/p' hashfile



RE: [Python] Split LM hashes - james123 - 09-25-2012

Code:
fold -w 16 < hashfie



RE: [Python] Split LM hashes - epixoip - 09-25-2012

nice, very clever use of fold.


RE: [Python] Split LM hashes - Mem5 - 09-25-2012

Nice, now I can put my python script to /dev/null :]


RE: [Python] Split LM hashes - KT819GM - 09-25-2012

nice one, from ~13 lines of code to half of line Big Grin