[Python] Split LM hashes
#1
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 !
Reply
#2
Code:
sed -rn 's/(.{16})(.{16})/\1\n\2/p' hashfile
Reply
#3
Code:
fold -w 16 < hashfie
Reply
#4
nice, very clever use of fold.
Reply
#5
Nice, now I can put my python script to /dev/null :]
Reply
#6
nice one, from ~13 lines of code to half of line Big Grin
Reply