def potfile_upload(): disable_usercheck = False disable_passwordcheck = False file_to_upload = connexion.request.files['file_to_upload'] db = current_app.db creds = JackDawCredentials(None, db_session=db.session) gen = HashEntry.from_potfile_stream(file_to_upload.stream) creds.add_cracked_passwords_gen(gen, disable_usercheck, disable_passwordcheck) return {}
def passwords_upload(passwords): def pwit(passwords): for pw in passwords: nt_hash = NT(pw).hex() print(pw) print(nt_hash) yield HashEntry(pw, nt_hash=nt_hash) db = current_app.db disable_usercheck = False disable_passwordcheck = False gen = pwit(passwords) creds = JackDawCredentials(None, db_session = db.session) creds.add_cracked_passwords_gen(gen, disable_usercheck, disable_passwordcheck) return {}
def passwords_upload_file(): def pwit(fs): for line in fs: line = line.decode() line = line.strip() nt_hash = NT(line).hex() yield HashEntry(line, nt_hash=nt_hash) file_to_upload = connexion.request.files['file_to_upload'] db = current_app.db disable_usercheck = False disable_passwordcheck = False gen = pwit(file_to_upload.stream) creds = JackDawCredentials(None, db_session = db.session) creds.add_cracked_passwords_gen(gen, disable_usercheck, disable_passwordcheck) return {}