mirror of https://github.com/n1nj4sec/pupy.git
small fixes + fix issue #58
This commit is contained in:
parent
8738cda0e8
commit
bcf3e78ca2
|
@ -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"]
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
@ -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)
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
],
|
||||
|
||||
|
|
Loading…
Reference in New Issue