-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add authenticator2john.py to extract authenticator app passwords. Closes
- Loading branch information
1 parent
b8fa784
commit 0c0531f
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python | ||
|
||
# This software is Copyright (c) 2021 Mark Silinio <mark.silinio-at-gmail.com>, | ||
# and it is hereby released under GPL v2 license. | ||
# | ||
# Extract and format https://github.com/JeNeSuisPasDave/authenticator app password for cracking with JtR | ||
# Usage: ./authenticator2john.py <authenticator.data file> | ||
|
||
import os | ||
import sys | ||
from binascii import hexlify | ||
|
||
if len(sys.argv) < 2: | ||
print('Usage: ./authenticator2john.py <authenticator.data files>') | ||
exit(1) | ||
|
||
filenames = sys.argv[1:] | ||
|
||
for filename in filenames: | ||
bname = os.path.basename(filename) | ||
try: | ||
f = open(filename, "rb") | ||
data = f.read() | ||
except IOError: | ||
e = sys.exc_info()[1] | ||
sys.stderr.write("%s\n" % str(e)) | ||
exit(1) | ||
|
||
iv = data[:16] | ||
encrypted_data = data[16:32] | ||
iv = hexlify(iv).decode("ascii") | ||
encrypted_data = hexlify(encrypted_data).decode("ascii") | ||
sys.stdout.write("%s:$authenticator$0$%s$%s\n" % (bname, iv, encrypted_data)) |