Ejemplo n.º 1
0
 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}")
Ejemplo n.º 2
0
 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}")
Ejemplo n.º 3
0
 def __init__(self, session):
     self.session = session
     self.jobs = []
     self.jobs.append(Job(command=('CheckIn', [])))
Ejemplo n.º 4
0
 def run(self, guids):
     for guid in guids:
         ipc_server.publish_event(events.NEW_JOB, (guid, Job(module=self.selected)))
Ejemplo n.º 5
0
    def __init__(self, session, pubkey):
        self.session = session
        self.crypto = ECDHE(pubkey)
        self.jobs = []

        self.jobs.append(Job(command=('CheckIn', {})))
Ejemplo n.º 6
0
 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}")
Ejemplo n.º 7
0
 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}")