Merge pull request #699 from dadav/fix/add-lock-to-ohc
Add lock to onlinehashcrack plugin
This commit is contained in:
commit
56f7b67699
@ -2,20 +2,27 @@ import os
|
||||
import logging
|
||||
import re
|
||||
import requests
|
||||
from threading import Lock
|
||||
from pwnagotchi.utils import StatusFile
|
||||
import pwnagotchi.plugins as plugins
|
||||
from json.decoder import JSONDecodeError
|
||||
|
||||
|
||||
class OnlineHashCrack(plugins.Plugin):
|
||||
__author__ = '33197631+dadav@users.noreply.github.com'
|
||||
__version__ = '2.0.0'
|
||||
__version__ = '2.0.1'
|
||||
__license__ = 'GPL3'
|
||||
__description__ = 'This plugin automatically uploads handshakes to https://onlinehashcrack.com'
|
||||
|
||||
def __init__(self):
|
||||
self.ready = False
|
||||
try:
|
||||
self.report = StatusFile('/root/.ohc_uploads', data_format='json')
|
||||
except JSONDecodeError as json_err:
|
||||
os.remove('/root/.ohc_uploads')
|
||||
self.report = StatusFile('/root/.ohc_uploads', data_format='json')
|
||||
self.skip = list()
|
||||
self.lock = Lock()
|
||||
|
||||
def on_loaded(self):
|
||||
"""
|
||||
@ -68,6 +75,7 @@ class OnlineHashCrack(plugins.Plugin):
|
||||
"""
|
||||
Called in manual mode when there's internet connectivity
|
||||
"""
|
||||
with self.lock:
|
||||
if self.ready:
|
||||
display = agent.view()
|
||||
config = agent.config()
|
||||
|
@ -1,8 +1,8 @@
|
||||
import os
|
||||
import logging
|
||||
import threading
|
||||
import requests
|
||||
from datetime import datetime
|
||||
from threading import Lock
|
||||
from pwnagotchi.utils import StatusFile
|
||||
from pwnagotchi import plugins
|
||||
from json.decoder import JSONDecodeError
|
||||
@ -16,7 +16,7 @@ class WpaSec(plugins.Plugin):
|
||||
|
||||
def __init__(self):
|
||||
self.ready = False
|
||||
self.lock = threading.Lock()
|
||||
self.lock = Lock()
|
||||
try:
|
||||
self.report = StatusFile('/root/.wpa_sec_uploads', data_format='json')
|
||||
except JSONDecodeError as json_err:
|
||||
|
Loading…
x
Reference in New Issue
Block a user