Exemplo n.º 1
0
 def do_load(self, module):
     tokens = module.split("/")
     while tokens:  # That'll do pig.
         module = tokens.pop(0)
         if module in self.modules:  # Basic idea if first word is exploits, scanners etc. go to REXT root
             self.do_unload(None)
         if isinstance(
                 self.active_module, set
         ):  # If you are in the last layer and only .py files load them
             core.globals.active_script = module
             module_path = core.globals.active_module_path + module
             self.active_module_import_name = interface.utils.make_import_name(
                 module_path)
             loader.load_module(self.active_module_import_name
                                )  # Module is loaded and executed
             try:
                 loader.delete_module(
                     self.active_module_import_name
                 )  # Module is unloaded so it can be used again
             except ValueError:
                 pass
             core.globals.active_module_import_name = ""
         elif isinstance(self.active_module,
                         dict):  # Else change directory depth
             if module in self.active_module.keys():
                 self.active_module = self.active_module.get(module)
                 core.globals.active_module_path += module + "/"
                 interface.utils.change_prompt(
                     self, core.globals.active_module_path)
             else:
                 print_error(
                     module + " not found"
                 )  # If error occurred then print error and break parsing
                 break
Exemplo n.º 2
0
 def do_load(self, module):
     if isinstance(self.active_module, set):
         core.globals.active_script = module
         module_path = core.globals.active_module_path + module
         self.active_module_import_name = interface.utils.make_import_name(module_path)
         loader.load_module(self.active_module_import_name)  # Module is loaded and executed
         try:
             loader.delete_module(self.active_module_import_name)  # Module is unloaded so it can be used again
         except ValueError:
             pass
         core.globals.active_module_import_name = ""
     elif isinstance(self.active_module, dict):
         if module in self.active_module.keys():
             self.active_module = self.active_module.get(module)
             core.globals.active_module_path += module + "/"
             interface.utils.change_prompt(self, core.globals.active_module_path)
         else:
             print_error(module + " not found")
Exemplo n.º 3
0
Arquivo: cmdui.py Projeto: bmaia/rext
 def do_load(self, module):
     if isinstance(self.active_module, set):
         core.globals.active_script = module
         module_path = core.globals.active_module_path + module
         self.active_module_import_name = interface.utils.make_import_name(
             module_path)
         loader.load_module(self.active_module_import_name
                            )  # Module is loaded and executed
         try:
             loader.delete_module(
                 self.active_module_import_name
             )  # Module is unloaded so it can be used again
         except ValueError:
             pass
         core.globals.active_module_import_name = ""
     elif isinstance(self.active_module, dict):
         if module in self.active_module.keys():
             self.active_module = self.active_module.get(module)
             core.globals.active_module_path += module + "/"
             interface.utils.change_prompt(self,
                                           core.globals.active_module_path)
         else:
             print_error(module + " not found")
Exemplo n.º 4
0
Arquivo: cmdui.py Projeto: helit2/rext
 def do_load(self, module):
     tokens = module.split("/")
     while tokens:  # That'll do pig.
         module = tokens.pop(0)
         if module in self.modules:  # Basic idea if first word is exploits, scanners etc. go to REXT root
             self.do_unload(None)
         if isinstance(self.active_module, set):  # If you are in the last layer and only .py files load them
             core.globals.active_script = module
             module_path = core.globals.active_module_path + module
             self.active_module_import_name = interface.utils.make_import_name(module_path)
             loader.load_module(self.active_module_import_name)  # Module is loaded and executed
             try:
                 loader.delete_module(self.active_module_import_name)  # Module is unloaded so it can be used again
             except ValueError:
                 pass
             core.globals.active_module_import_name = ""
         elif isinstance(self.active_module, dict):  # Else change directory depth
             if module in self.active_module.keys():
                 self.active_module = self.active_module.get(module)
                 core.globals.active_module_path += module + "/"
                 interface.utils.change_prompt(self, core.globals.active_module_path)
             else:
                 print_error(module + " not found")  # If error occurred then print error and break parsing
                 break