Update match-creds.py

Works better
This commit is contained in:
Tomas Vanagas 2017-11-07 14:09:28 +02:00 committed by GitHub
parent 7dc2e3bfd1
commit e268a497fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -22,12 +22,12 @@ if __name__ == '__main__':
args = parse_args()
with open(args.accounts, 'r') as f:
hash_to_username = { hsh: username for username, hsh in \
[l.split(args.delimiter) for l in f.read().split('\n') \
if len(l.split(args.delimiter)) > 1] }
[l.split(args.delimiter,1) for l in f.read().split('\n') \
if len(l.split(args.delimiter,1)) > 1] }
# print(hash_to_username)
with open(args.potfile, 'r') as f:
hash_to_pw = { hsh: pw for hsh, pw in [l.split(':') for l in f.read().split('\n') \
if len(l.split(':')) > 1]}
hash_to_pw = { hsh: pw for hsh, pw in [l.split(':',1) for l in f.read().split('\n') \
if len(l.split(':',1)) > 1]}
for hsh, username in hash_to_username.items():
if hsh in hash_to_pw: