Skip to content

Commit

Permalink
Merge pull request hashcat#54 from mubix/patch-2
Browse files Browse the repository at this point in the history
Create export_potfile.py
  • Loading branch information
jsteube authored Sep 25, 2021
2 parents 5a4cb6e + 0be447d commit 6a00fde
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/export_potfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python

import sys
import re


for line in sys.stdin:
if ':' in line:
passw = line.split(':')[1].rstrip()
if passw.startswith('$HEX['):
hexpassw = re.search('\$HEX\[([a-zA-Z0-9]+)\]', passw).group(1)
passw = bytearray.fromhex(hexpassw).decode('latin-1')
rep = repr(passw)
if rep.startswith('u'):
print(rep[2:][:-1])
else:
print(rep[1:][:-1])

0 comments on commit 6a00fde

Please sign in to comment.