Merge pull request #821 from jacopotediosi/patch-1

Onlinehashcrack should create .pcap.cracked files
This commit is contained in:
Simone Margaritelli 2020-04-03 14:48:54 +02:00 committed by GitHub
commit 9ca8aacdf6
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 = 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'])