mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Small changes to wpa-sec.py
Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
@ -36,16 +36,15 @@ class WpaSec(plugins.Plugin):
|
|||||||
"""
|
"""
|
||||||
with open(path, 'rb') as file_to_upload:
|
with open(path, 'rb') as file_to_upload:
|
||||||
cookie = {'key': self.options['api_key']}
|
cookie = {'key': self.options['api_key']}
|
||||||
payload = {'file': file_to_upload}
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = requests.post(self.options['api_url'],
|
result = requests.post(self.options['api_url'],
|
||||||
cookies=cookie,
|
cookies=cookie,
|
||||||
files=payload,
|
files=file_to_upload,
|
||||||
timeout=timeout)
|
timeout=timeout)
|
||||||
if result.status_code == 200:
|
if result.status_code == 200:
|
||||||
if 'already submitted' in result.text:
|
if ' already submitted' in result.text:
|
||||||
logging.debug("%s was already submitted.", path)
|
logging.info("%s was already submitted.", path)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
elif result.status_code != 200:
|
elif result.status_code != 200:
|
||||||
@ -108,7 +107,11 @@ class WpaSec(plugins.Plugin):
|
|||||||
display = agent.view()
|
display = agent.view()
|
||||||
reported = self.report.data_field_or('reported', default=list())
|
reported = self.report.data_field_or('reported', default=list())
|
||||||
handshake_dir = config['bettercap']['handshakes']
|
handshake_dir = config['bettercap']['handshakes']
|
||||||
|
try:
|
||||||
handshake_filenames = os.listdir(handshake_dir)
|
handshake_filenames = os.listdir(handshake_dir)
|
||||||
|
except FileNotFoundError:
|
||||||
|
logging.info("WPA_SEC: Handshake directory doesn't exist.")
|
||||||
|
return
|
||||||
handshake_paths = [os.path.join(handshake_dir, filename) for filename in handshake_filenames if filename.endswith('.pcap')]
|
handshake_paths = [os.path.join(handshake_dir, filename) for filename in handshake_filenames if filename.endswith('.pcap')]
|
||||||
handshake_paths = remove_whitelisted(handshake_paths, config['main']['whitelist'])
|
handshake_paths = remove_whitelisted(handshake_paths, config['main']['whitelist'])
|
||||||
handshake_new = set(handshake_paths) - set(reported) - set(self.skip)
|
handshake_new = set(handshake_paths) - set(reported) - set(self.skip)
|
||||||
|
Reference in New Issue
Block a user