|
| 1 | +diff --git a/routersploit/core/exploit/utils.py b/routersploit/core/exploit/utils.py |
| 2 | +index 420db6d..e75cb14 100644 |
| 3 | +--- a/routersploit/core/exploit/utils.py |
| 4 | ++++ b/routersploit/core/exploit/utils.py |
| 5 | +@@ -92,7 +92,7 @@ def index_modules(modules_directory: str = MODULES_DIR) -> list: |
| 6 | + for root, dirs, files in os.walk(modules_directory): |
| 7 | + _, package, root = root.rpartition("routersploit/modules/".replace("/", os.sep)) |
| 8 | + root = root.replace(os.sep, ".") |
| 9 | +- files = filter(lambda x: not x.startswith("__") and x.endswith(".py"), files) |
| 10 | ++ files = filter(lambda x: not x.startswith("__") and x.endswith(".pyc"), files) |
| 11 | + modules.extend(map(lambda x: ".".join((root, os.path.splitext(x)[0])), files)) |
| 12 | + |
| 13 | + return modules |
| 14 | +diff --git a/routersploit/interpreter.py b/routersploit/interpreter.py |
| 15 | +index d65f981..cf037b4 100644 |
| 16 | +--- a/routersploit/interpreter.py |
| 17 | ++++ b/routersploit/interpreter.py |
| 18 | +@@ -229,7 +229,7 @@ class RoutersploitInterpreter(BaseInterpreter): |
| 19 | + self.module_commands.extend(self.global_commands) |
| 20 | + self.module_commands.sort() |
| 21 | + |
| 22 | +- self.modules = index_modules() |
| 23 | ++ self.modules = index_modules("/usr/lib/python3.12/site-packages/routersploit") |
| 24 | + self.modules_count = Counter() |
| 25 | + self.modules_count.update([module.split('.')[0] for module in self.modules]) |
| 26 | + self.main_modules_dirs = [module for module in os.listdir(MODULES_DIR) if not module.startswith("__")] |
0 commit comments