pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

routersploit: Sync patches with the ones in the pull request



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Thu Apr 11 20:59:32 2019 +0200
Changeset:	c0e0327c250261c5f458f8670b119f950a961e39

Modified Files:
	routersploit/distinfo
	routersploit/patches/patch-routersploit_core_exploit_payloads.py
	routersploit/patches/patch-routersploit_core_exploit_shell.py

Log Message:
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!

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c0e0327c250261c5f458f8670b119f950a961e39

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 routersploit/distinfo                                            | 4 ++--
 routersploit/patches/patch-routersploit_core_exploit_payloads.py | 2 +-
 routersploit/patches/patch-routersploit_core_exploit_shell.py    | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diffs:
diff --git a/routersploit/distinfo b/routersploit/distinfo
index 2cf6d51dff..8c765775ea 100644
--- a/routersploit/distinfo
+++ b/routersploit/distinfo
@@ -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
diff --git a/routersploit/patches/patch-routersploit_core_exploit_payloads.py b/routersploit/patches/patch-routersploit_core_exploit_payloads.py
index d99d37235f..9378bf1bf9 100644
--- a/routersploit/patches/patch-routersploit_core_exploit_payloads.py
+++ b/routersploit/patches/patch-routersploit_core_exploit_payloads.py
@@ -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"],
diff --git a/routersploit/patches/patch-routersploit_core_exploit_shell.py b/routersploit/patches/patch-routersploit_core_exploit_shell.py
index 0c258b7bf6..86ab8085fe 100644
--- a/routersploit/patches/patch-routersploit_core_exploit_shell.py
+++ b/routersploit/patches/patch-routersploit_core_exploit_shell.py
@@ -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":


Home | Main Index | Thread Index | Old Index