Exemplo n.º 1
0
    def __init__(self, teamserver):
        self.teamserver = teamserver
        self.listeners = []
        self.selected = None

        ipc_server.attach(Events.GET_LISTENERS, self._get_listeners)
        super().__init__(type="listener", paths=[get_path_in_package("core/teamserver/listeners/")])
Exemplo n.º 2
0
    def __init__(self, teamserver):
        self.teamserver = teamserver
        self.selected = None

        ipc_server.attach(Events.GET_STAGERS, self._get_stagers)
        super().__init__(
            type="stager",
            paths=[get_path_in_package("core/teamserver/stagers/")])
Exemplo n.º 3
0
    def __init__(self, teamserver):
        self.teamserver = teamserver
        self.selected = None
        self.sessions = set()

        ipc_server.attach(Events.KEX, self.kex)
        ipc_server.attach(Events.ENCRYPT_STAGE, self.gen_encrypted_stage)
        ipc_server.attach(Events.SESSION_STAGED, self.notify_session_staged)
        ipc_server.attach(Events.SESSION_REGISTER, self._register)
        ipc_server.attach(Events.SESSION_CHECKIN, self.session_checked_in)
        ipc_server.attach(Events.NEW_JOB, self.add_job)
        ipc_server.attach(Events.JOB_RESULT, self.job_result)

        with STDatabase() as db:
            for registered_session in db.get_sessions():
                _, guid, psk = registered_session
                self._register(guid, psk)
Exemplo n.º 4
0
def register_subscriptions(cls):
    for methodname in dir(cls):
        method = getattr(cls, methodname)
        if hasattr(method, '_event_subscription'):
            ipc_server.attach(method._event_subscription, method)
    return cls