Refactored few more files to use config value path array, rather than hardcoded in-place value

This commit is contained in:
VakarisZ 2020-10-01 15:08:45 +03:00
parent 17d91766df
commit 841f542c6b
2 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,8 @@ from monkey_island.cc.services.config import ConfigService
__author__ = "VakarisZ"
from monkey_island.cc.services.config_schema.config_value_paths import CURRENT_SERVER_PATH
class T1065(AttackTechnique):
tech_id = "T1065"
@ -14,6 +16,6 @@ class T1065(AttackTechnique):
@staticmethod
def get_report_data():
port = ConfigService.get_config_value(['internal', 'island_server', 'current_server']).split(':')[1]
port = ConfigService.get_config_value(CURRENT_SERVER_PATH).split(':')[1]
T1065.used_msg = T1065.message % port
return T1065.get_base_data_by_status(ScanStatus.USED.value)

View File

@ -1,5 +1,6 @@
from monkey_island.cc.services.config import ConfigService
from monkey_island.cc.services.config_schema.config_value_paths import INACCESSIBLE_SUBNETS_PATH
def get_config_network_segments_as_subnet_groups():
return [ConfigService.get_config_value(['basic_network', 'network_analysis', 'inaccessible_subnets'])]
return [ConfigService.get_config_value(INACCESSIBLE_SUBNETS_PATH)]