Ran black on config generation script

This commit is contained in:
VakarisZ 2021-03-09 10:23:35 +02:00
parent c234891330
commit a4aee364b4
1 changed files with 16 additions and 9 deletions

View File

@ -18,15 +18,22 @@ from envs.monkey_zoo.blackbox.config_templates.weblogic import Weblogic
from envs.monkey_zoo.blackbox.config_templates.wmi_mimikatz import WmiMimikatz from envs.monkey_zoo.blackbox.config_templates.wmi_mimikatz import WmiMimikatz
from envs.monkey_zoo.blackbox.config_templates.wmi_pth import WmiPth from envs.monkey_zoo.blackbox.config_templates.wmi_pth import WmiPth
from envs.monkey_zoo.blackbox.config_templates.zerologon import Zerologon from envs.monkey_zoo.blackbox.config_templates.zerologon import Zerologon
from envs.monkey_zoo.blackbox.island_client.island_config_parser import IslandConfigParser from envs.monkey_zoo.blackbox.island_client.island_config_parser import (
from envs.monkey_zoo.blackbox.island_client.monkey_island_client import MonkeyIslandClient IslandConfigParser,
)
from envs.monkey_zoo.blackbox.island_client.monkey_island_client import (
MonkeyIslandClient,
)
DST_DIR_NAME = 'generated_configs' DST_DIR_NAME = "generated_configs"
DST_DIR_PATH = pathlib.Path(pathlib.Path(__file__).parent.absolute(), DST_DIR_NAME) DST_DIR_PATH = pathlib.Path(pathlib.Path(__file__).parent.absolute(), DST_DIR_NAME)
parser = argparse.ArgumentParser(description='Generate config files.') parser = argparse.ArgumentParser(description="Generate config files.")
parser.add_argument('island_ip', metavar='IP:PORT', parser.add_argument(
help='Island endpoint. Example: 123.123.123.123:5000') "island_ip",
metavar="IP:PORT",
help="Island endpoint. Example: 123.123.123.123:5000",
)
args = parser.parse_args() args = parser.parse_args()
island_client = MonkeyIslandClient(args.island_ip) island_client = MonkeyIslandClient(args.island_ip)
@ -47,7 +54,7 @@ CONFIG_TEMPLATES = [
WmiMimikatz, WmiMimikatz,
WmiPth, WmiPth,
Zerologon, Zerologon,
Drupal Drupal,
] ]
@ -63,9 +70,9 @@ def save_template_as_config(template: Type[ConfigTemplate]):
def save_to_file(file_path, contents): def save_to_file(file_path, contents):
with open(file_path, 'w') as file: with open(file_path, "w") as file:
file.write(contents) file.write(contents)
if __name__ == '__main__': if __name__ == "__main__":
generate_templates() generate_templates()