async def enable(services): app = services.get('app_svc').application file_svc = services.get('file_svc') await file_svc.add_special_payload( 'sandcat.go', SandService(services).dynamically_compile_executable) await file_svc.add_special_payload( 'shared.go', SandService(services).dynamically_compile_library) cat_gui_api = SandGuiApi(services=services) app.router.add_static('/sandcat', 'plugins/sandcat/static/', append_version=True) app.router.add_route('GET', '/plugin/sandcat/gui', cat_gui_api.splash)
async def enable(services): app = services.get('app_svc').application file_svc = services.get('file_svc') sand_svc = SandService(services) await file_svc.add_special_payload('sandcat.go', sand_svc.dynamically_compile_executable) await file_svc.add_special_payload('shared.go', sand_svc.dynamically_compile_library) cat_gui_api = SandGuiApi(services=services) app.router.add_route('GET', '/plugin/sandcat/gui', cat_gui_api.splash) await sand_svc.install_gocat_extensions()
async def enable(services): popular_process_names = [ a for a in services.get('data_svc').strip_yml( 'plugins/sandcat/conf/default.yml') ] app = services.get('app_svc').application file_svc = services.get('file_svc') sand_svc = SandService(services, popular_process_names[0]) await file_svc.add_special_payload('sandcat.go', sand_svc.dynamically_compile_executable) await file_svc.add_special_payload('shared.go', sand_svc.dynamically_compile_library) cat_gui_api = SandGuiApi(services=services) app.router.add_static('/sandcat', 'plugins/sandcat/static/', append_version=True) app.router.add_route('GET', '/plugin/sandcat/gui', cat_gui_api.splash) await sand_svc.install_gocat_extensions()
async def initialize(app, services): file_svc = services.get('file_svc') await file_svc.add_special_payload( 'sandcat.go', SandService(file_svc).dynamically_compile) cat_api = SandApi(services=services) cat_gui_api = SandGuiApi(services=services) app.router.add_static('/sandcat', 'plugins/sandcat/static/', append_version=True) app.router.add_static('/malicious', 'plugins/sandcat/static/malicious', append_version=True) # cat app.router.add_route('POST', '/sand/ping', cat_api.ping) app.router.add_route('POST', '/sand/instructions', cat_api.instructions) app.router.add_route('POST', '/sand/results', cat_api.results) # gui app.router.add_route('GET', '/plugin/sandcat/gui', cat_gui_api.splash) app.router.add_route('GET', '/plugin/sandcat/clone', cat_gui_api.clone_new_site) app.router.add_route('GET', '/plugin/sandcat/malicious', cat_gui_api.malicious)
def __init__(self, services): self.sand_svc = SandService(services) self.utility_svc = services.get('utility_svc') self.file_svc = services.get('file_svc')