def session_termination(session_id): auth = ApiAuth() base = ApiBase() sessions = ApiSession() if not auth.auth(True): return base.send_access_denied_response() elif not sessions.can_access(current_user, session_id): return base.send_access_denied_response() return sessions.termination(current_user.id, session_id)
def rule_set(session_id): auth = ApiAuth() base = ApiBase() sessions = ApiSession() rules = ApiRules() if not auth.auth(True): return base.send_access_denied_response() elif not sessions.can_access(current_user, session_id): return base.send_access_denied_response() return rules.set(current_user.id, session_id)
def wordlist_set_cracked(session_id): auth = ApiAuth() base = ApiBase() sessions = ApiSession() wordlists = ApiWordlists() if not auth.auth(True): return base.send_access_denied_response() elif not sessions.can_access(current_user, session_id): return base.send_access_denied_response() return wordlists.set_cracked(current_user.id, session_id)
def mask_increment_set(session_id): auth = ApiAuth() base = ApiBase() sessions = ApiSession() mask = ApiMask() if not auth.auth(True): return base.send_access_denied_response() elif not sessions.can_access(current_user, session_id): return base.send_access_denied_response() return mask.set_increment(current_user.id, session_id)
def hashcat_set_mode(session_id): auth = ApiAuth() base = ApiBase() sessions = ApiSession() hashcat = ApiHashcat() if not auth.auth(True): return base.send_access_denied_response() elif not sessions.can_access(current_user, session_id): return base.send_access_denied_response() return hashcat.set_mode(current_user.id, session_id)
def hashes_download(session_id): auth = ApiAuth() base = ApiBase() sessions = ApiSession() hashes = ApiHashes() if not auth.auth(True): return base.send_access_denied_response() elif not sessions.can_access(current_user, session_id): return base.send_access_denied_response() return hashes.download(current_user.id, session_id)