[module name] Run a module. Run 'help run' to view the available modules
(self, line)
| 1204 | |
| 1205 | @session_operation(current=True) |
| 1206 | def do_run(self, line): |
| 1207 | """ |
| 1208 | [module name] |
| 1209 | Run a module. Run 'help run' to view the available modules |
| 1210 | """ |
| 1211 | try: |
| 1212 | parts = line.split(" ", 1) |
| 1213 | module_name = parts[0] |
| 1214 | except AttributeError: |
| 1215 | module_name = None |
| 1216 | print() |
| 1217 | cmdlogger.warning(paint("Select a module").YELLOW_white) |
| 1218 | |
| 1219 | if module_name: |
| 1220 | module = modules().get(module_name) |
| 1221 | if module: |
| 1222 | args = parts[1] if len(parts) == 2 else '' |
| 1223 | if module.enabled: |
| 1224 | module.run(core.sessions[self.sid], args) |
| 1225 | else: |
| 1226 | cmdlogger.warning(f"Module '{module_name}' is disabled") |
| 1227 | else: |
| 1228 | cmdlogger.warning(f"Module '{module_name}' does not exist") |
| 1229 | else: |
| 1230 | self.show_modules() |
| 1231 | |
| 1232 | @session_operation(current=True) |
| 1233 | def do_spawn(self, line): |