hashcat Forum

Full Version: [Python] Split LM hashes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 !
Code:
sed -rn 's/(.{16})(.{16})/\1\n\2/p' hashfile
Code:
fold -w 16 < hashfie
nice, very clever use of fold.
Nice, now I can put my python script to /dev/null :]
nice one, from ~13 lines of code to half of line Big Grin