fix: Prevent duplicate entries for uploaded pcaps

For the same reasons like described here https://github.com/evilsocket/pwnagotchi/issues/657 duplicated entries could be created in /root/.ohc_uploads

Signed-off-by: jakubmilkowski <jakub.milkowsky@gmail.com>
This commit is contained in:
jakubmilkowski 2019-11-30 22:44:03 +01:00
parent 9b594f7fb2
commit 6e57e131b3

@ -92,9 +92,10 @@ class OnlineHashCrack(plugins.Plugin):
display.update(force=True)
try:
self._upload_to_ohc(handshake)
reported.append(handshake)
self.report.update(data={'reported': reported})
logging.info(f"OHC: Successfully uploaded {handshake}")
if handshake not in reported:
reported.append(handshake)
self.report.update(data={'reported': reported})
logging.info(f"OHC: Successfully uploaded {handshake}")
except requests.exceptions.RequestException as req_e:
self.skip.append(handshake)
logging.error("OHC: %s", req_e)