def __init__(self, answers, APP, dryrun = False, debug = False, **kwargs): self.debug = debug self.dryrun = dryrun self.kwargs = kwargs if "answers_output" in kwargs: self.answers_output = kwargs["answers_output"] if os.environ and "IMAGE" in os.environ: self.app_path = APP APP = os.environ["IMAGE"] del os.environ["IMAGE"] if APP and os.path.exists(APP): self.app_path = APP else: self.app_path = os.getcwd() install = Install(answers, APP, dryrun = dryrun, target_path = self.app_path) install.install() self.params = Params(target_path=self.app_path) if "ask" in kwargs: self.params.ask = kwargs["ask"] self.utils = Utils(self.params) self.answers_file = answers self.plugin = Plugin() self.plugin.load_plugins()
def __init__(self, answers, APP, dryrun=False, debug=False, stop=False, answers_format=ANSWERS_FILE_SAMPLE_FORMAT, **kwargs): self.debug = debug self.dryrun = dryrun self.stop = stop self.kwargs = kwargs if "answers_output" in kwargs: self.answers_output = kwargs["answers_output"] if os.environ and "IMAGE" in os.environ: self.app_path = APP APP = os.environ["IMAGE"] del os.environ["IMAGE"] elif "image" in kwargs: logger.warning("Setting image to %s" % kwargs["image"]) self.app_path = APP APP = kwargs["image"] del kwargs["image"] self.kwargs = kwargs if APP and os.path.exists(APP): self.app_path = APP else: if not self.app_path: self.app_path = os.getcwd() install = Install(answers, APP, dryrun=dryrun, target_path=self.app_path, answers_format=answers_format) install.install() printStatus("Install Successful.") self.nulecule_base = Nulecule_Base(target_path=self.app_path, dryrun=dryrun, file_format=answers_format) if "ask" in kwargs: self.nulecule_base.ask = kwargs["ask"] workdir = None if "workdir" in kwargs: workdir = kwargs["workdir"] self.utils = Utils(self.app_path, workdir) if "workdir" not in kwargs: kwargs["workdir"] = self.utils.workdir self.answers_file = answers self.plugin = Plugin() self.plugin.load_plugins()
def __init__( self, answers, APP, dryrun=False, debug=False, stop=False, answers_format=ANSWERS_FILE_SAMPLE_FORMAT, **kwargs): self.debug = debug self.dryrun = dryrun self.stop = stop self.kwargs = kwargs self.cli_provider = None if "answers_output" in kwargs: self.answers_output = kwargs["answers_output"] if "cli_provider" in kwargs: self.cli_provider = kwargs["cli_provider"] if os.environ and "IMAGE" in os.environ: self.app_path = APP APP = os.environ["IMAGE"] del os.environ["IMAGE"] elif "image" in kwargs: logger.warning("Setting image to %s" % kwargs["image"]) self.app_path = APP APP = kwargs["image"] del kwargs["image"] self.kwargs = kwargs if APP and os.path.exists(APP): self.app_path = APP else: if not self.app_path: self.app_path = os.getcwd() install = Install( answers, APP, dryrun=dryrun, target_path=self.app_path, answers_format=answers_format) install.install() printStatus("Install Successful.") self.nulecule_base = Nulecule_Base( target_path=self.app_path, dryrun=dryrun, file_format=answers_format, cli_provider=self.cli_provider) if "ask" in kwargs: self.nulecule_base.ask = kwargs["ask"] workdir = None if "workdir" in kwargs: workdir = kwargs["workdir"] self.utils = Utils(self.app_path, workdir) if "workdir" not in kwargs: kwargs["workdir"] = self.utils.workdir self.answers_file = answers self.plugin = Plugin() self.plugin.load_plugins()
def main(self): if self.a.install: i = Install() i.install() if self.a.uninstall: i = Install() i.uninstall() exit("Uninstall Complete") if not self.a.filename: self.a.filename = "passwords.txt" if self.a.ssid or self.a.password: self.add_to_list(self.a.filename, self.a.ssid, self.a.password) w = Wifi()
def __init__(self, answers, APP, dryrun = False, debug = False, stop = False, **kwargs): self.debug = debug self.dryrun = dryrun self.stop = stop self.kwargs = kwargs if "answers_output" in kwargs: self.answers_output = kwargs["answers_output"] if os.environ and "IMAGE" in os.environ: self.app_path = APP APP = os.environ["IMAGE"] del os.environ["IMAGE"] elif "image" in kwargs: logger.warning("Setting image to %s" % kwargs["image"]) self.app_path = APP APP = kwargs["image"] del kwargs["image"] self.kwargs = kwargs if APP and os.path.exists(APP): self.app_path = APP else: if not self.app_path: self.app_path = os.getcwd() install = Install(answers, APP, dryrun = dryrun, target_path = self.app_path) install.install() self.nulecule_base = Nulecule_Base(target_path=self.app_path) if "ask" in kwargs: self.nulecule_base.ask = kwargs["ask"] workdir = None if "workdir" in kwargs: workdir = kwargs["workdir"] self.utils = Utils(self.app_path, workdir) if not "workdir" in kwargs: kwargs["workdir"] = self.utils.workdir self.answers_file = answers self.plugin = Plugin() self.plugin.load_plugins()
# -------------------------------- Procedural -------------------------------- args = processArguments() if args.version: # prints program legal / dev / version info print("Current Version: " + VERSION) print("Author: K4YT3X") print("License: GNU GPL v3") print("Github Page: https://github.com/K4YT3X/DefenseMatrix") print("Contact: [email protected]") print() exit(0) if os.getuid() != 0: avalon.error("This app requires root privilege to run!") exit(0) try: if args.install: installer = Install() installer.install() elif args.uninstall: uninstaller = Install() uninstaller.uninstall() elif args.audit: securityAudit.audit() except KeyboardInterrupt: avalon.warning("Aborting")