コード例 #1
0
ファイル: server.py プロジェクト: Nan3r/caldera
    args = parser.parse_args()
    with open('conf/%s.yml' % args.environment) as c:
        cfg = yaml.load(c)
        logging.getLogger('aiohttp.access').setLevel(logging.FATAL)
        logging.getLogger('aiohttp_session').setLevel(logging.FATAL)
        logging.getLogger('aiohttp.server').setLevel(logging.FATAL)
        logging.getLogger('asyncio').setLevel(logging.FATAL)
        logging.getLogger().setLevel(logging.DEBUG)
        sys.path.append('')

        plugin_modules = build_plugins(cfg['plugins'])
        utility_svc = UtilityService()
        data_svc = DataService(CoreDao('core.db'), utility_svc)
        planning_svc = PlanningService(data_svc, utility_svc)
        operation_svc = OperationService(data_svc=data_svc,
                                         utility_svc=utility_svc,
                                         planning_svc=planning_svc,
                                         planner=cfg['planner'])
        auth_svc = AuthService(utility_svc=utility_svc)
        logging.debug('Uploaded files will be put in %s' % cfg['exfil_dir'])
        logging.debug('Downloaded payloads will come from %s' %
                      cfg['payloads'])
        file_svc = FileSvc(cfg['payloads'], cfg['exfil_dir'])
        services = dict(data_svc=data_svc,
                        auth_svc=auth_svc,
                        utility_svc=utility_svc,
                        operation_svc=operation_svc,
                        file_svc=file_svc,
                        planning_svc=planning_svc,
                        plugins=plugin_modules)
        logging.debug('Serving at http://%s:%s' % (cfg['host'], cfg['port']))
        main(services=services,
コード例 #2
0
ファイル: server.py プロジェクト: kiwings/caldera
                        required=False,
                        default='local',
                        help='Select an env. file to use')
    args = parser.parse_args()
    with open('conf/%s.yml' % args.environment) as c:
        cfg = yaml.load(c, Loader=yaml.FullLoader)
        set_logging_state()
        sys.path.append('')

        plugin_modules = build_plugins(cfg['plugins'])
        plugin_svc = PluginService(plugin_modules)
        data_svc = DataService(CoreDao('core.db', memory=cfg['memory']))
        logging.debug('Using an in-memory database: %s' % cfg['memory'])
        planning_svc = PlanningService()
        parsing_svc = ParsingService()
        operation_svc = OperationService()
        auth_svc = AuthService(cfg['api_key'])

        logging.debug('Uploaded files will be put in %s' % cfg['exfil_dir'])
        file_svc = FileSvc([p.name.lower() for p in plugin_modules],
                           cfg['exfil_dir'])
        agent_svc = AgentService(untrusted_timer=cfg['untrusted_timer'])
        logging.debug(
            'Agents will be considered untrusted after %s seconds of silence' %
            cfg['untrusted_timer'])

        logging.debug('Serving at http://%s:%s' % (cfg['host'], cfg['port']))
        main(services=data_svc.get_services(),
             host=cfg['host'],
             port=cfg['port'],
             users=cfg['users'])
コード例 #3
0
ファイル: server.py プロジェクト: Luuol/caldera
                        required=True,
                        default='local',
                        help='Select an env. file to use')
    args = parser.parse_args()
    with open('conf/%s.yml' % args.environment) as c:
        config = yaml.load(c)
        logging.getLogger('aiohttp.access').setLevel(logging.WARNING)
        logging.getLogger('asyncio').setLevel(logging.FATAL)
        logging.getLogger().setLevel(config['debug_level'])
        sys.path.append('')

        plugin_modules = build_plugins(config['plugins'])
        utility_svc = UtilityService()
        data_svc = DataService(CoreDao('core.db'))
        operation_svc = OperationService(data_svc=data_svc,
                                         utility_svc=utility_svc,
                                         planner=config['planner'])
        auth_svc = AuthService(data_svc=data_svc, ssl_cert=SSL_CERT)
        file_svc = FileSvc(config['stores'])
        services = dict(data_svc=data_svc,
                        auth_svc=auth_svc,
                        utility_svc=utility_svc,
                        operation_svc=operation_svc,
                        file_svc=file_svc,
                        logger=Logger('plugin'),
                        plugins=plugin_modules)
        main(services=services,
             host=config['host'],
             port=config['port'],
             terminal_host=config['terminal_host'],
             terminal_port=config['terminal_port'],
コード例 #4
0
        logging.getLogger('aiohttp.access').setLevel(logging.FATAL)
        logging.getLogger('aiohttp_session').setLevel(logging.FATAL)
        logging.getLogger('aiohttp.server').setLevel(logging.FATAL)
        logging.getLogger('asyncio').setLevel(logging.FATAL)
        logging.getLogger().setLevel(logging.DEBUG)
        sys.path.append('')

        plugin_modules = build_plugins(cfg['plugins'])
        utility_svc = UtilityService()
        data_svc = DataService(CoreDao('core.db', memory=cfg['memory']),
                               utility_svc)
        logging.debug('Using an in-memory database: %s' % cfg['memory'])
        planning_svc = PlanningService(data_svc, utility_svc)
        parsing_svc = ParsingService(data_svc)
        operation_svc = OperationService(data_svc=data_svc,
                                         utility_svc=utility_svc,
                                         planning_svc=planning_svc,
                                         parsing_svc=parsing_svc)
        auth_svc = AuthService(utility_svc=utility_svc)
        logging.debug('Uploaded files will be put in %s' % cfg['exfil_dir'])
        file_svc = FileSvc(
            ['plugins/%s/payloads' % p.name.lower() for p in plugin_modules],
            cfg['exfil_dir'])
        services = dict(data_svc=data_svc,
                        auth_svc=auth_svc,
                        utility_svc=utility_svc,
                        operation_svc=operation_svc,
                        file_svc=file_svc,
                        planning_svc=planning_svc,
                        plugins=plugin_modules)
        logging.debug('Serving at http://%s:%s' % (cfg['host'], cfg['port']))
        main(services=services,