Exemplo n.º 1
0
 def get_config_ips():
     if ConfigService.get_config_value(
         ['basic_network', 'network_range', 'range_class'],
             True) != 'FixedRange':
         return []
     return ConfigService.get_config_value(
         ['basic_network', 'network_range', 'range_fixed'], True)
Exemplo n.º 2
0
    def update_aws_auth_params():
        """
        Updates the AWS authentication parameters according to config
        :return: True if new params allow successful authentication. False otherwise
        """
        access_key_id = ConfigService.get_config_value(
            ['cnc', 'aws_config', 'aws_access_key_id'], False, True)
        secret_access_key = ConfigService.get_config_value(
            ['cnc', 'aws_config', 'aws_secret_access_key'], False, True)

        if (access_key_id != AwsService.access_key_id) or (
                secret_access_key != AwsService.secret_access_key):
            AwsService.set_auth_params(access_key_id, secret_access_key)
            RemoteRunAwsService.is_auth = AwsService.test_client()

        AwsService.set_region(RemoteRunAwsService.aws_instance.region)

        return RemoteRunAwsService.is_auth
Exemplo n.º 3
0
    def get_config_exploits():
        exploits_config_value = ['exploits', 'general', 'exploiter_classes']
        default_exploits = ConfigService.get_default_config()
        for namespace in exploits_config_value:
            default_exploits = default_exploits[namespace]
        exploits = ConfigService.get_config_value(exploits_config_value, True)

        if exploits == default_exploits:
            return ['default']

        return [ReportService.EXPLOIT_DISPLAY_DICT[exploit] for exploit in
                exploits]
Exemplo n.º 4
0
    def get_config_exploits():
        exploits_config_value = ['exploits', 'general', 'exploiter_classes']
        default_exploits = ConfigService.get_default_config()
        for namespace in exploits_config_value:
            default_exploits = default_exploits[namespace]
        exploits = ConfigService.get_config_value(exploits_config_value, True)

        if exploits == default_exploits:
            return ['default']

        return [
            ReportService.EXPLOIT_DISPLAY_DICT[exploit] for exploit in exploits
        ]
Exemplo n.º 5
0
    def get_cross_segment_issues():
        scans = mongo.db.telemetry.find({'telem_type': 'scan'}, {
            'monkey_guid': 1,
            'data.machine.ip_addr': 1,
            'data.machine.services': 1
        })

        cross_segment_issues = []

        # For now the feature is limited to 1 group.
        subnet_groups = [
            ConfigService.get_config_value(
                ['basic_network', 'network_analysis', 'inaccessible_subnets'])
        ]

        for subnet_group in subnet_groups:
            cross_segment_issues += ReportService.get_cross_segment_issues_per_subnet_group(
                scans, subnet_group)

        return cross_segment_issues
Exemplo n.º 6
0
    def _get_aws_keys():
        creds_dict = {}
        for key in AWS_CRED_CONFIG_KEYS:
            creds_dict[key[2]] = str(ConfigService.get_config_value(key))

        return creds_dict
Exemplo n.º 7
0
 def get_config_scan():
     return ConfigService.get_config_value(
         ['basic_network', 'general', 'local_network_scan'], True)
Exemplo n.º 8
0
 def get_config_passwords():
     return ConfigService.get_config_value(
         ['basic', 'credentials', 'exploit_password_list'], True)
Exemplo n.º 9
0
 def get_config_users():
     return ConfigService.get_config_value(
         ['basic', 'credentials', 'exploit_user_list'], True)
Exemplo n.º 10
0
 def get_config_ips():
     return ConfigService.get_config_value(
         ['basic_network', 'general', 'subnet_scan_list'], True, True)
Exemplo n.º 11
0
 def get_config_scan():
     return ConfigService.get_config_value(['basic_network', 'general', 'local_network_scan'], True)
Exemplo n.º 12
0
 def get_config_ips():
     if ConfigService.get_config_value(['basic_network', 'network_range', 'range_class'], True) != 'FixedRange':
         return []
     return ConfigService.get_config_value(['basic_network', 'network_range', 'range_fixed'], True)
Exemplo n.º 13
0
 def get_config_passwords():
     return ConfigService.get_config_value(['basic', 'credentials', 'exploit_password_list'], True)
Exemplo n.º 14
0
 def get_config_users():
     return ConfigService.get_config_value(['basic', 'credentials', 'exploit_user_list'], True)