Changed filename generation to a regex

This commit is contained in:
Jacopo Tediosi 2020-02-17 12:15:26 +01:00 committed by GitHub
parent b3bdb34e3f
commit 0e1a1f4c79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,7 +153,7 @@ class OnlineHashCrack(plugins.Plugin):
with open(cracked_file, 'r') as cracked_list:
for row in csv.DictReader(cracked_list):
if row['password']:
filename = row['ESSID'].replace('-','').replace(' ','') + '_' + row['BSSID'].replace(':','')
filename = re.sub(r'[^a-zA-Z0-9]', '', row['ESSID']) + '_' + row['BSSID'].replace(':','')
if os.path.exists( os.path.join(handshake_dir, filename+'.pcap') ):
with open(os.path.join(handshake_dir, filename+'.pcap.cracked'), 'w') as f:
f.write(row['password'])