2019-09-05 20:03:30 +08:00
|
|
|
import json
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
class IslandConfigParser(object):
|
|
|
|
|
|
|
|
def __init__(self, config_filename):
|
|
|
|
self.config_raw = open(IslandConfigParser.get_conf_file_path(config_filename), 'r').read()
|
|
|
|
self.config_json = json.loads(self.config_raw)
|
|
|
|
|
|
|
|
def get_ips_of_targets(self):
|
2020-07-30 20:56:49 +08:00
|
|
|
return self.config_json['basic_network']['scope']['subnet_scan_list']
|
2019-09-05 20:03:30 +08:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def get_conf_file_path(conf_file_name):
|
2019-09-11 17:39:28 +08:00
|
|
|
return os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
|
|
|
|
"island_configs",
|
|
|
|
conf_file_name)
|