diff --git a/certipy/commands/parsers/template.py b/certipy/commands/parsers/template.py old mode 100755 new mode 100644 index d48441d..009aa2c --- a/certipy/commands/parsers/template.py +++ b/certipy/commands/parsers/template.py @@ -32,7 +32,11 @@ def add_subparser(subparsers: argparse._SubParsersAction) -> Tuple[str, Callable action="store_true", help="Save the old configuration", ) - + group.add_argument( + "-write-template", + action="store_true", + help="Write vulnerable properties to existing template or applies specified configuration to existing template", + ) group = subparser.add_argument_group("connection options") group.add_argument( "-scheme", diff --git a/certipy/commands/template.py b/certipy/commands/template.py old mode 100755 new mode 100644 index 7ecb365..77e6027 --- a/certipy/commands/template.py +++ b/certipy/commands/template.py @@ -60,6 +60,7 @@ def __init__( template: str = None, configuration: str = None, save_old: bool = False, + write_template: bool = False, scheme: str = "ldaps", connection: LDAPConnection = None, **kwargs, @@ -70,7 +71,7 @@ def __init__( self.save_old = save_old self.scheme = scheme self.kwargs = kwargs - + self.write_template = write_template self._connection = connection @property @@ -173,7 +174,8 @@ def set_configuration(self) -> bool: "Saved old configuration for %s to %s" % (repr(self.template_name), repr(out_file)) ) - + if self.write_template == False: + exit() changes = {} for key in old_configuration["raw_attributes"].keys(): if key in PROTECTED_ATTRIBUTES: