This commit is contained in:
Jeroen Oudshoorn
2024-01-05 14:07:18 +01:00
parent 2f4b05db85
commit 0931a8c10a

View File

@ -14,12 +14,12 @@ from pwnagotchi.automata import Automata
from pwnagotchi.log import LastSession from pwnagotchi.log import LastSession
from pwnagotchi.bettercap import Client from pwnagotchi.bettercap import Client
from pwnagotchi.mesh.utils import AsyncAdvertiser from pwnagotchi.mesh.utils import AsyncAdvertiser
# from pwnagotchi.ai.train import AsyncTrainer from pwnagotchi.ai.train import AsyncTrainer
RECOVERY_DATA_FILE = '/root/.pwnagotchi-recovery' RECOVERY_DATA_FILE = '/root/.pwnagotchi-recovery'
class Agent(Client, Automata, AsyncAdvertiser): class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer):
def __init__(self, view, config, keypair): def __init__(self, view, config, keypair):
Client.__init__(self, config['bettercap']['hostname'], Client.__init__(self, config['bettercap']['hostname'],
config['bettercap']['scheme'], config['bettercap']['scheme'],
@ -28,7 +28,7 @@ class Agent(Client, Automata, AsyncAdvertiser):
config['bettercap']['password']) config['bettercap']['password'])
Automata.__init__(self, config, view) Automata.__init__(self, config, view)
AsyncAdvertiser.__init__(self, config, view, keypair) AsyncAdvertiser.__init__(self, config, view, keypair)
# AsyncTrainer.__init__(self, config) AsyncTrainer.__init__(self, config)
self._started_at = time.time() self._started_at = time.time()
self._filter = None if not config['main']['filter'] else re.compile(config['main']['filter']) self._filter = None if not config['main']['filter'] else re.compile(config['main']['filter'])
@ -129,7 +129,7 @@ class Agent(Client, Automata, AsyncAdvertiser):
time.sleep(1) time.sleep(1)
def start(self): def start(self):
# self.start_ai() self.start_ai()
self._wait_bettercap() self._wait_bettercap()
self.setup_events() self.setup_events()
self.set_starting() self.set_starting()