Commit dd210558 by fwkz

Refactoring scanners/autopwn so it can be used as BaseScanner.

parent 7352d5f0
from os import path
from routersploit import ( from routersploit import (
exploits, exploits,
print_error, print_error,
...@@ -26,16 +28,21 @@ class Exploit(exploits.Exploit): ...@@ -26,16 +28,21 @@ class Exploit(exploits.Exploit):
'Multi', 'Multi',
), ),
} }
vendor = ''
target = exploits.Option('', 'Target IP address e.g. 192.168.1.1') # target address target = exploits.Option('', 'Target IP address e.g. 192.168.1.1') # target address
port = exploits.Option(80, 'Target port') # default port port = exploits.Option(80, 'Target port') # default port
threads = exploits.Option(8, "Number of threads") threads = exploits.Option(8, "Number of threads")
def __init__(self):
self.vulnerabilities = []
self._exploits_directory = path.join(utils.EXPLOITS_DIR, self.vendor)
def run(self): def run(self):
self.vulnerabilities = [] self.vulnerabilities = []
with threads.ThreadPoolExecutor(self.threads) as executor: with threads.ThreadPoolExecutor(self.threads) as executor:
for exploit in utils.iter_modules(utils.EXPLOITS_DIR): for exploit in utils.iter_modules(self._exploits_directory):
executor.submit(self.target_function, exploit) executor.submit(self.target_function, exploit)
print_info() print_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