Commit 9c0390f4 by fwkz

Feeding exploit with targets from text file

parent 34e33e1e
...@@ -288,8 +288,30 @@ class RoutersploitInterpreter(BaseInterpreter): ...@@ -288,8 +288,30 @@ class RoutersploitInterpreter(BaseInterpreter):
@utils.module_required @utils.module_required
def command_run(self, *args, **kwargs): def command_run(self, *args, **kwargs):
utils.print_status("Running module...") utils.print_status("Running module...")
if self.current_module.target.startswith("file://"):
self.__multiple_run()
return
try:
self.current_module.run()
except:
utils.print_error(traceback.format_exc(sys.exc_info()))
def __multiple_run(self):
_, _, path = self.current_module.target.partition('file://')
with open(path, 'r') as file_handler:
for target in file_handler:
target = target.strip()
if not target:
continue
print()
utils.print_status("Running module against following target: {}".format(target))
self.current_module.target = target
try: try:
self.current_module.run() self.current_module.run()
except KeyboardInterrupt:
utils.print_status("Module has been stopped.")
break
except: except:
utils.print_error(traceback.format_exc(sys.exc_info())) utils.print_error(traceback.format_exc(sys.exc_info()))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment