Onlinehashcrack should create .pcap.cracked files

This commit is contained in:
Jacopo Tediosi 2020-02-17 10:55:35 +01:00 committed by GitHub
parent 23616095ba
commit b3bdb34e3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
import os
import csv
import logging
import re
import requests
@ -148,3 +149,11 @@ class OnlineHashCrack(plugins.Plugin):
except OSError as os_e:
logging.debug("OHC: %s", os_e)
if 'single_files' in self.options and self.options['single_files']:
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(':','')
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'])