Пример #1
0
def swagger():
    base = ApiBase()
    contents = base.get_swagger_file('v1')

    response = Response(mimetype='text/plain')
    response.data = contents
    return response
Пример #2
0
def swagger():
    base = ApiBase()
    data = base.get_swagger_file('v1')

    response = Response()
    response.headers.add('Content-Type', 'text/plain')
    response.data = data
    return response
Пример #3
0
def session_get_all():
    auth = ApiAuth()
    base = ApiBase()
    sessions = ApiSession()

    if not auth.auth(True):
        return base.send_access_denied_response()

    return sessions.get_all(current_user.id)
Пример #4
0
def rules():
    auth = ApiAuth()
    base = ApiBase()
    rules = ApiRules()

    if not auth.auth(True):
        return base.send_access_denied_response()

    return rules.get()
Пример #5
0
def wordlists():
    auth = ApiAuth()
    base = ApiBase()
    wordlists = ApiWordlists()

    if not auth.auth(True):
        return base.send_access_denied_response()

    return wordlists.get()
Пример #6
0
def session_create():
    auth = ApiAuth()
    base = ApiBase()
    sessions = ApiSession()

    if not auth.auth(True):
        return base.send_access_denied_response()

    return sessions.create(current_user.id, current_user.username)
Пример #7
0
def hashcat_types():
    auth = ApiAuth()
    base = ApiBase()
    hashcat = ApiHashcat()

    if not auth.auth(True):
        return base.send_access_denied_response()

    return hashcat.get_types()
Пример #8
0
def hashes_remote():
    auth = ApiAuth()
    base = ApiBase()
    hashes = ApiHashes()

    if not auth.auth(True):
        return base.send_access_denied_response()

    return hashes.get_remote()
Пример #9
0
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)
Пример #10
0
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)
Пример #11
0
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)
Пример #12
0
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)
Пример #13
0
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)
Пример #14
0
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)
Пример #15
0
 def wrapped_view(**kwargs):
     from app.lib.api.auth import ApiAuth
     from app.lib.api.base import ApiBase
     if not ApiAuth().auth(True):
         return ApiBase().send_access_denied_response()
     return f(**kwargs)