1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-25 09:28:20 +00:00

Update metamask2hashcat to use new format and add test vault JSON

This commit is contained in:
its5Q 2024-02-24 16:42:08 +10:00
parent 5f9caed13d
commit 9a14c99bb1
2 changed files with 4 additions and 2 deletions

View File

@ -0,0 +1 @@
{"data":"G2Qsp8BtQNz9E1vFlSebykcGkps5iJ53fBjJV8GIE7eolAQpz5m25MTZv0b0t2tpqXvfgEYKYZKsoLvuWWRHqj2ommt+U0l6fEGPY6lTn5PYzDtMKNpPWHKCIS/QYhwEA9/X5RtyIwDL6VqcRp6owV+/icmRlQa+TI5buHWZ+99Z1kBbpTDVYLBwhMRsODM1vYizQDg0vFIo3cQDtpRWUqpAKXhFcpgRD+9grS3pP/zdlIUn//87DZ3ue6Sn6WFOe08EvuY8sYZqTiN3GxcfESOltNbZJGcedMubt/jGsk+qIwUWC/f456UgeX9DN7i2pQBBI+L7qkY5v1WT5Y0i8uho1c2M2G8M9miO8HSm/j4bpMN1J6lPtjFhfAzEPS1go1w2vTmOtr1y+2A4M6HEOcxIrPJ8lUUH9pcN7Xpd+u/tQv8BYFxd6RlNYKLyA6OChbF+TD5Zz6oFZQtkprXqzZUFOlxeWJ373kHMISZtXOx44YGaiT2178fXgHFXavw=","iv":"N1aDRjt2ZD5x15Q1X9zVUw==","keyMetadata":{"algorithm":"PBKDF2","params":{"iterations":600000}},"salt":"MBdUsmTcBHGCASECYr3gmD8XaJROwjhOegSWweCFhco="}

View File

@ -58,6 +58,7 @@ def metamask_parser(file, shortdata):
iter_count = j['keyMetadata']['params']['iterations']
except KeyError:
iter_count = 10_000
if((len(j['data']) > 3000) or shortdata):
data_bin = base64.b64decode(j['data'])
# TODO limit data to 16 bytes, we only check the first block of data, so we don't need more data.
@ -66,12 +67,12 @@ def metamask_parser(file, shortdata):
j['data'] = base64.b64encode(data_bin[0:64]).decode("ascii")
if iter_count != 10000:
print('$metamask-short$' + str(iter_count) + '$' + j['salt'] + '$' + j['iv'] + '$' + j['data'])
print('$metamask-short$rounds=' + str(iter_count) + '$' + j['salt'] + '$' + j['iv'] + '$' + j['data'])
else:
print('$metamask-short$' + j['salt'] + '$' + j['iv'] + '$' + j['data'])
else:
if iter_count != 10000:
print('$metamask$' + str(iter_count) + '$' + j['salt'] + '$' + j['iv'] + '$' + j['data'])
print('$metamask$rounds=' + str(iter_count) + '$' + j['salt'] + '$' + j['iv'] + '$' + j['data'])
else:
print('$metamask$' + j['salt'] + '$' + j['iv'] + '$' + j['data'])