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) @mythic.route("/instantiate_c2profile/", methods=["GET"]) @inject_user() @scoped("auth:user") async def instantiate_c2profile(request, user): template = env.get_template("instantiate_c2profile.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) links["payloads_creation"] = mythic.url_for("payloads_creation") links["wrappers_creation"] = mythic.url_for("wrappers_creation") links["instantiate_c2profile"] = mythic.url_for("instantiate_c2profile")
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", admin=user['admin'], current_operation=user['current_operation'], config=user['ui_config'], view_utc_time=user['view_utc_time']) return response.html(content) # add links to these routes at the bottom links['callbacks'] = mythic.url_for('callbacks') links['payload_management'] = mythic.url_for('payload_management') links['payloadtype_management'] = mythic.url_for('payloadtype_management') links['analytics'] = mythic.url_for('analytics') links['c2profile_management'] = mythic.url_for('c2profile_management') links['operations_management'] = mythic.url_for('operations_management') links['screenshots'] = mythic.url_for('screenshots') links['keylogs'] = mythic.url_for('keylogs') links['files'] = mythic.url_for('files') links['credentials'] = mythic.url_for('credentials') links['view_tasks'] = mythic.url_for('view_tasks') links['artifacts_management'] = mythic.url_for('artifacts_management') links['reporting_artifacts'] = mythic.url_for('reporting_artifacts') links['manage_browser_scripts'] = mythic.url_for('manage_browser_scripts') links['web_log'] = mythic.url_for('web_log') links['live_feed'] = mythic.url_for('live_task_feed')
from app import mythic, links, use_ssl from sanic import response from jinja2 import Environment, PackageLoader from sanic_jwt.decorators import scoped, inject_user from app.routes.routes import respect_pivot env = Environment(loader=PackageLoader("app", "templates")) @mythic.route("/services/host_file", methods=["GET"]) @inject_user() @scoped("auth:user") async def services_host_file(request, user): template = env.get_template("services_host_file.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) # add links to the routes in this file at the bottom links["services_host_file"] = mythic.url_for("services_host_file")
config=user['ui_config'], view_utc_time=user['view_utc_time']) return response.html(content) @mythic.route("/instantiate_c2profile/", methods=['GET']) @inject_user() @scoped('auth:user') async def instantiate_c2profile(request, user): template = env.get_template('instantiate_c2profile.html') if use_ssl: content = template.render(links=await respect_pivot(links, request), name=user['username'], http="https", ws="wss", 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", config=user['ui_config'], view_utc_time=user['view_utc_time']) return response.html(content) links['payloads_creation'] = mythic.url_for('payloads_creation') links['wrappers_creation'] = mythic.url_for('wrappers_creation') links['instantiate_c2profile'] = mythic.url_for('instantiate_c2profile')
from sanic_jwt.decorators import scoped, inject_user from app.routes.routes import respect_pivot env = Environment(loader=PackageLoader('app', 'templates')) @mythic.route("/services/host_file", methods=['GET']) @inject_user() @scoped('auth:user') async def services_host_file(request, user): template = env.get_template('services_host_file.html') if use_ssl: content = template.render(links=await respect_pivot(links, request), name=user['username'], http="https", ws="wss", 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", config=user['ui_config'], view_utc_time=user['view_utc_time']) return response.html(content) # add links to the routes in this file at the bottom links['services_host_file'] = mythic.url_for('services_host_file')
print("parsed {}".format(base_file)) # await import_c2_profile_func(c2, admin) print("Created all C2 Profiles") print("Successfully finished initial setup") # /static serves out static images and files mythic.static("/static", "./app/static") mythic.static("/favicon.ico", "./app/static/favicon.ico") # / serves out the payloads we wish to host, make user supply a path they want to use, or just use file name mythic.static("/", "./app/payloads/operations/_hosting_dir") mythic.static("/strict_time.png", "./app/static/strict_time.png", name="strict_time") mythic.static("/grouped_output.png", "./app/static/grouped_output.png", name="grouped_output") mythic.static("/no_cmd_output.png", "./app/static/no_cmd_output.png", name="no_cmd_output") mythic.static("/add_comment.png", "./app/static/add_comment.png", name="add_comment") # add links to the routes in this file at the bottom links["index"] = mythic.url_for("index") links["login"] = links["WEB_BASE"] + "/login" links["logout"] = mythic.url_for("logout") links["register"] = links["WEB_BASE"] + "/register" links["settings"] = mythic.url_for("settings")
async def live_event_feed(request, user): template = env.get_template("live_event_feed.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) # add links to these routes at the bottom links["callbacks"] = mythic.url_for("callbacks") links["payload_management"] = mythic.url_for("payload_management") links["payloadtype_management"] = mythic.url_for("payloadtype_management") links["analytics"] = mythic.url_for("analytics") links["c2profile_management"] = mythic.url_for("c2profile_management") links["operations_management"] = mythic.url_for("operations_management") links["screenshots"] = mythic.url_for("screenshots") links["keylogs"] = mythic.url_for("keylogs") links["files"] = mythic.url_for("files") links["credentials"] = mythic.url_for("credentials") links["view_tasks"] = mythic.url_for("view_tasks") links["artifacts_management"] = mythic.url_for("artifacts_management") links["reporting_artifacts"] = mythic.url_for("reporting_artifacts") links["manage_browser_scripts"] = mythic.url_for("manage_browser_scripts") links["web_log"] = mythic.url_for("web_log") links["live_feed"] = mythic.url_for("live_task_feed")
file = open("./app/default_files/other_info/artifacts.json", "r") artifacts_file = js.load(file) for artifact in artifacts_file['artifacts']: await db_objects.get_or_create(Artifact, name=artifact['name'], description=artifact['description']) file.close() print("Created all base artifacts") for base_file in glob.iglob("./app/default_files/c2_profiles/*"): file = open(base_file, 'r') c2 = js.load(file) print("parsed {}".format(base_file)) #await import_c2_profile_func(c2, admin) print("Created all C2 Profiles") print("Successfully finished initial setup") # /static serves out static images and files mythic.static('/static', './app/static') mythic.static('/favicon.ico', './app/static/favicon.ico') # / serves out the payloads we wish to host, make user supply a path they want to use, or just use file name mythic.static('/', './app/payloads/operations/_hosting_dir') mythic.static('/strict_time.png', './app/static/strict_time.png', name='strict_time') mythic.static('/grouped_output.png', './app/static/grouped_output.png', name='grouped_output') mythic.static('/no_cmd_output.png', './app/static/no_cmd_output.png', name='no_cmd_output') mythic.static('/add_comment.png', './app/static/add_comment.png', name='add_comment') # add links to the routes in this file at the bottom links['index'] = mythic.url_for('index') links['login'] = links['WEB_BASE'] + "/login" links['logout'] = mythic.url_for('logout') links['register'] = links['WEB_BASE'] + "/register" links['settings'] = mythic.url_for('settings')
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) @mythic.route("/reporting/attack_mapping") @inject_user() @scoped("auth:user") async def attack_mappings(request, user): template = env.get_template("mitre_attack_mappings.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) links["full_timeline"] = mythic.url_for("ui_full_timeline") links["attack_mapping"] = mythic.url_for("attack_mappings")
http="http", ws="ws", config=user['ui_config'], view_utc_time=user['view_utc_time']) return response.html(content) @mythic.route("/reporting/attack_mapping") @inject_user() @scoped('auth:user') async def attack_mappings(request, user): template = env.get_template('mitre_attack_mappings.html') if use_ssl: content = template.render(links=await respect_pivot(links, request), name=user['username'], http="https", ws="wss", 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", config=user['ui_config'], view_utc_time=user['view_utc_time']) return response.html(content) links['full_timeline'] = mythic.url_for('ui_full_timeline') links['attack_mapping'] = mythic.url_for('attack_mappings')