def autoruns(self): if "C#" in self.Pivot: new_task("loadmodule Stage2-Core.exe", "autoruns", self.RandomURI) new_task("loadmodule PwrStatusTracker.dll", "autoruns", self.RandomURI) new_task("loadpowerstatus", "autoruns", self.RandomURI) update_mods("Stage2-Core.exe PwrStatusTracker.dll", self.RandomURI) update_label("PSM", self.RandomURI) if "PS" in self.Pivot: new_task("loadmodule Stage2-Core.ps1", "autoruns", self.RandomURI) update_mods("Stage2-Core.ps1", self.RandomURI) if "PBind Pivot" in self.Pivot: update_label("Parent: %s" % self.IPAddress, self.RandomURI) #new_task("pbind-pivot-loadmodule Stage2-Core.exe", "autoruns", self.IPAddress) update_mods("Stage2-Core.exe", self.RandomURI) elif "PB" in self.Pivot: update_label("Parent: %s" % self.IPAddress, self.RandomURI) #new_task("pbind-loadmodule Stage2-Core.exe", "autoruns", self.IPAddress) update_mods("Stage2-Core.exe", self.RandomURI) if "FC" in self.Pivot: update_label("Parent: %s" % self.IPAddress, self.RandomURI) new_task("fcomm-loadmodule Stage2-Core.exe", "autoruns", self.RandomURI) update_mods("Stage2-Core.exe", self.RandomURI) result = get_autoruns() if result: for autorun in result: run_autoloads(autorun[1], self.RandomURI, "autoruns") new_task(autorun[1], "autoruns", self.RandomURI)
def check_module_loaded(module_name, randomuri, user, force=False, isPBind=False): if isPBind: loadmodule_command = "pbind-loadmodule" else: loadmodule_command = "loadmodule" try: modules_loaded = select_mods(randomuri) if force: for modname in os.listdir(ModulesDirectory): if modname.lower() == module_name.lower(): module_name = modname new_task(f"{loadmodule_command} {module_name}", user, randomuri) update_mods(module_name, randomuri) if modules_loaded: new_modules_loaded = "%s %s" % (modules_loaded, module_name) if module_name not in modules_loaded: for modname in os.listdir(ModulesDirectory): if modname.lower() == module_name.lower(): module_name = modname new_task(f"{loadmodule_command} {module_name}", user, randomuri) update_mods(new_modules_loaded, randomuri) else: new_modules_loaded = "%s" % (module_name) new_task(f"{loadmodule_command} {module_name}", user, randomuri) update_mods(new_modules_loaded, randomuri) except Exception as e: print(f"Error: {loadmodule_command} {module_name}: {e}")