routersploit: Sync patches with the ones in the pull request

- patch-routersploit_core_exploit_payloads.py was missing a `.' in
  import_module() leading to not able to find installed encoders
- the payload semantic was accidentally changed (from `<architecture>/<payload>'
  to `payloads.<architecture>.<payload>'), readjust it as it was originally

Thanks to Marcin Bury for the review!
This commit is contained in:
Leonardo Taccari 2019-04-11 20:59:32 +02:00
parent 2292c81627
commit c0e0327c25
3 changed files with 5 additions and 5 deletions

View File

@ -4,8 +4,8 @@ SHA1 (routersploit-3.4.0.tar.gz) = a614706c1367fa576e55642d4696faec205d66d8
RMD160 (routersploit-3.4.0.tar.gz) = a568e886b85896d574065c9b04b96471253606b0
SHA512 (routersploit-3.4.0.tar.gz) = 9182598105c4d1c971dc63ac24059469dd1862af204f59994cfc85012091663a85faee4c7c04cce573eef1fa91525b44a3963b8c24460d3b31595c4ef6a6c4e5
Size (routersploit-3.4.0.tar.gz) = 465082 bytes
SHA1 (patch-routersploit_core_exploit_payloads.py) = 7c2a76451355e69509df94bf3f102b3b88742d48
SHA1 (patch-routersploit_core_exploit_shell.py) = bb3d8138abde0d2f8661ce79e3145310b4ce1253
SHA1 (patch-routersploit_core_exploit_payloads.py) = 538ef02915d61a9630d6321aad6b2ba13f21dc5f
SHA1 (patch-routersploit_core_exploit_shell.py) = 66f6e497570fac38daad2e9b7fd395bb2ffbed93
SHA1 (patch-routersploit_core_exploit_utils.py) = 99631397a08220e9054eb976a85a752ccdb7772b
SHA1 (patch-routersploit_modules_exploits_generic_ssh__auth__keys.py) = 3865470d9613bd66487a53c72b3e6cbdbe9dbb83
SHA1 (patch-routersploit_modules_scanners_autopwn.py) = 5824b6fbad2523d08caf6d615aeb9a040310296f

View File

@ -50,7 +50,7 @@ Patch shared upstream via:
+
+ for e in all_encoders:
+ encoder = e.replace("encoders.{}.".format(self.architecture), "").replace(".", "/")
+ module = getattr(importlib.import_module('routersploit.modules' + e), "Encoder")
+ module = getattr(importlib.import_module('routersploit.modules.' + e), "Encoder")
+ encoders.append((
+ "{}/{}".format(self.architecture, encoder),
+ module._Encoder__info__["name"],

View File

@ -34,12 +34,12 @@ Patch shared upstream via:
-
# get all payloads for given architecture
- all_payloads = [f.split(".")[0] for f in listdir(path) if isfile(join(path, f)) and f.endswith(".py") and f != "__init__.py"]
+ all_payloads = [p for p in index_modules() if "payloads.{}".format(architecture) in p]
+ all_payloads = [p.lstrip('payloads.').replace('.', '/') for p in index_modules() if "payloads.{}".format(architecture) in p]
- payload_path = path.replace("/", ".")
for p in all_payloads:
- module = getattr(importlib.import_module("{}{}".format(payload_path, p)), 'Payload')
+ module = getattr(importlib.import_module('routersploit.modules.' + p), 'Payload')
+ module = getattr(importlib.import_module('routersploit.modules.payloads.' + p.replace('/', '.')), 'Payload')
# if method/arch is cmd then filter out payloads
if method is "cmd":