def active_sessions(con, args, target, loggers): x = RpcCon(args, loggers, target) x.get_netsessions() for user, data in x.sessions.items(): loggers['console'].info([ con.host, con.ip, "SESSIONS", user, "Host: {}".format(data['host']) ])
def run(self, target, args, smb_con, loggers, config_obj): logger = loggers['console'] x = RpcCon(args, loggers, target) try: x.get_netsessions() except Exception as e: logger.debug("{} Error: {}".format(self.name, str(e))) logger.debug("{}: Identified {} active sessions on {}".format(self.name, str(len(x.sessions.keys())), target)) for user, data in x.sessions.items(): if self.args['USER']['Value'].lower() == data['user'].lower(): logger.success([smb_con.host, smb_con.ip, self.name.upper(), "{:<15} User: {}".format(data['host'], user)])