Exemplo n.º 1
0
async def files(request, user):
    template = env.get_template("files.html")
    content = template.render(
        links=await respect_pivot(links, request),
        name=user["username"],
        http="https" if use_ssl else "http",
        ws="wss" if use_ssl else "ws",
        config=user["ui_config"],
        view_utc_time=user["view_utc_time"],
        view_mode=user["view_mode"],
    )
    return response.html(content)
Exemplo n.º 2
0
async def callbacks(request, user):
    template = env.get_template('callbacks.html')
    if use_ssl:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="https",
                                  ws="wss")
    else:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="http",
                                  ws="ws")
    return response.html(content)
Exemplo n.º 3
0
async def payload_management(request, user):
    template = env.get_template('payload_management.html')
    if use_ssl:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="https",
                                  ws="wss")
    else:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="http",
                                  ws="ws")
    return response.html(content)
Exemplo n.º 4
0
async def manage_browser_scripts(request, user):
    template = env.get_template("browser_scripts.html")
    content = template.render(
        links=await respect_pivot(links, request),
        name=user["username"],
        http="https" if use_ssl else "http",
        ws="wss" if use_ssl else "ws",
        config=user["ui_config"],
        view_utc_time=user["view_utc_time"],
        view_mode=user["view_mode"],
        current_operation=user["current_operation"]
    )
    return response.html(content)
Exemplo n.º 5
0
async def db_management(request, user):
    template = env.get_template('database_management.html')
    if use_ssl:
        content = template.render(links=links,
                                  name=user.name,
                                  http="https",
                                  ws="wss")
    else:
        content = template.render(links=links,
                                  name=user.name,
                                  http="http",
                                  ws="ws")
    return response.html(content)
Exemplo n.º 6
0
async def callbacks(request, user):
    template = env.get_template('callbacks.html')
    scripts_to_add = {}
    browser_scripts = ""
    final_support_scripts = ""
    query = await db_model.operator_query()
    operator = await db_objects.get(query, username=user['username'])
    query = await db_model.operation_query()
    operation = await db_objects.get(query, name=user['current_operation'])
    query = await db_model.browserscript_query()
    operator_scripts = await db_objects.execute(
        query.where((db_model.BrowserScript.operator == operator)
                    & (db_model.BrowserScript.active == True)))
    for s in operator_scripts:
        if s.command is not None:
            scripts_to_add[s.command.id] = s.script
    operation_scripts = await db_objects.execute(
        query.where((db_model.BrowserScript.operation == operation)
                    & (db_model.BrowserScript.active == True)))
    for s in operation_scripts:
        if s.command is not None:
            scripts_to_add[
                s.command.
                id] = s.script  # will overwrite a user script if it existed, which is what we want
    for s, v in scripts_to_add.items():
        browser_scripts += str(s) + ":" + base64.b64decode(v).decode(
            'utf-8') + ","
    support_scripts = await db_objects.execute(
        query.where((db_model.BrowserScript.command == None)
                    & (db_model.BrowserScript.active == True)))
    for s in support_scripts:
        final_support_scripts += s.name + ":" + base64.b64decode(
            s.script).decode('utf-8') + ","
    if use_ssl:
        content = template.render(links=await respect_pivot(links, request),
                                  name=user['username'],
                                  http="https",
                                  ws="wss",
                                  config=user['ui_config'],
                                  browser_scripts=browser_scripts,
                                  support_scripts=final_support_scripts)
    else:
        content = template.render(links=await respect_pivot(links, request),
                                  name=user['username'],
                                  http="http",
                                  ws="ws",
                                  config=user['ui_config'],
                                  browser_scripts=browser_scripts,
                                  support_scripts=final_support_scripts)
    return response.html(content)
Exemplo n.º 7
0
async def callbacks(request, user):
    template = env.get_template("callbacks.html")
    browser_scripts, final_support_scripts = await get_scripts(user)
    content = template.render(
        links=await respect_pivot(links, request),
        name=user["username"],
        http="https" if use_ssl else "http",
        ws="wss" if use_ssl else "ws",
        config=user["ui_config"],
        browser_scripts=browser_scripts,
        support_scripts=final_support_scripts,
        view_utc_time=user["view_utc_time"],
    )
    return response.html(content)
Exemplo n.º 8
0
async def payload_management(request, user):
    template = env.get_template('payload_management.html')
    if use_ssl:
        content = template.render(links=await respect_pivot(links, request),
                                  name=user['username'],
                                  http="https",
                                  ws="wss",
                                  config=user['ui_config'])
    else:
        content = template.render(links=await respect_pivot(links, request),
                                  name=user['username'],
                                  http="http",
                                  ws="ws",
                                  config=user['ui_config'])
    return response.html(content)
Exemplo n.º 9
0
async def analytics(request, user):
    template = env.get_template('analytics.html')
    if use_ssl:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="https",
                                  ws="wss",
                                  config=user['ui_config'])
    else:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="http",
                                  ws="ws",
                                  config=user['ui_config'])
    return response.html(content)
Exemplo n.º 10
0
async def operations_management(request, user):
    template = env.get_template('operations_management.html')
    if use_ssl:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="https",
                                  ws="wss",
                                  admin=user['admin'],
                                  current_operation=user['current_operation'])
    else:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="http",
                                  ws="ws",
                                  admin=user['admin'],
                                  current_operation=user['current_operation'])
    return response.html(content)
Exemplo n.º 11
0
async def operations_management(request, user):
    template = env.get_template('operations_management.html')
    if use_ssl:
        content = template.render(links=await respect_pivot(links, request),
                                  name=user['username'],
                                  http="https",
                                  ws="wss",
                                  current_operation=user['current_operation'],
                                  config=user['ui_config'],
                                  view_utc_time=user['view_utc_time'])
    else:
        content = template.render(links=await respect_pivot(links, request),
                                  name=user['username'],
                                  http="http",
                                  ws="ws",
                                  current_operation=user['current_operation'],
                                  config=user['ui_config'],
                                  view_utc_time=user['view_utc_time'])
    return response.html(content)
Exemplo n.º 12
0
async def manage_browser_scripts(request, user):
    template = env.get_template('browser_scripts.html')
    if use_ssl:
        content = template.render(links=await respect_pivot(links, request),
                                  name=user['username'],
                                  http="https",
                                  ws="wss",
                                  admin=user['admin'],
                                  current_operation=user['current_operation'],
                                  config=user['ui_config'])
    else:
        content = template.render(links=await respect_pivot(links, request),
                                  name=user['username'],
                                  http="http",
                                  ws="ws",
                                  admin=user['admin'],
                                  current_operation=user['current_operation'],
                                  config=user['ui_config'])
    return response.html(content)
Exemplo n.º 13
0
async def reporting_artifacts(request, user):
    template = env.get_template('reporting_artifacts.html')
    if use_ssl:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="https",
                                  ws="wss",
                                  admin=user['admin'],
                                  current_operation=user['current_operation'],
                                  config=user['ui_config'])
    else:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="http",
                                  ws="ws",
                                  admin=user['admin'],
                                  current_operation=user['current_operation'],
                                  config=user['ui_config'])
    return response.html(content)
Exemplo n.º 14
0
async def view_shared_task(request, user, tid):
    template = env.get_template('share_task.html')

    if use_ssl:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="https",
                                  ws="wss",
                                  admin=user['admin'],
                                  current_operation=user['current_operation'],
                                  tid=tid)
    else:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="http",
                                  ws="ws",
                                  admin=user['admin'],
                                  current_operation=user['current_operation'],
                                  tid=tid)
    return response.html(content)
Exemplo n.º 15
0
async def view_split_callbacks(request, user, cid):
    template = env.get_template('split_callback.html')
    if use_ssl:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="https",
                                  ws="wss",
                                  admin=user['admin'],
                                  current_operation=user['current_operation'],
                                  cid=cid,
                                  config=user['ui_config'])
    else:
        content = template.render(links=links,
                                  name=user['username'],
                                  http="http",
                                  ws="ws",
                                  admin=user['admin'],
                                  current_operation=user['current_operation'],
                                  cid=cid,
                                  config=user['ui_config'])
    return response.html(content)
Exemplo n.º 16
0
async def callbacks(request, user):
    template = env.get_template('callbacks.html')
    content = template.render(links=links, name=user.name)
    return response.html(content)