def jitter(self, guid, max, min): try: session = self.get_session(guid) if min: session.jobs.add(Job(command=('Jitter', [int(max), int(min)]))) else: session.jobs.add(Job(command=('Jitter', [int(max)]))) except SessionNotFoundError: raise CmdError(f"No session named: {guid}")
def kill(self, guid): try: session = self.get_session(guid) session.jobs.add(Job(command=('Exit', []))) return {'guid': guid, 'status': 'Tasked to exit'} except SessionNotFoundError: raise CmdError(f"No session named: {guid}")
def __init__(self, session): self.session = session self.jobs = [] self.jobs.append(Job(command=('CheckIn', [])))
def run(self, guids): for guid in guids: ipc_server.publish_event(events.NEW_JOB, (guid, Job(module=self.selected)))
def __init__(self, session, pubkey): self.session = session self.crypto = ECDHE(pubkey) self.jobs = [] self.jobs.append(Job(command=('CheckIn', {})))
def checkin(self, guid): try: session = self.get_session(guid) session.jobs.add(Job(command=('CheckIn', []))) except SessionNotFoundError: raise CmdError(f"No session named: {guid}")
def sleep(self, guid, interval): try: session = self.get_session(guid) session.jobs.add(Job(command=('Sleep', [int(interval)]))) except SessionNotFoundError: raise CmdError(f"No session named: {guid}")