allow socket creation monkeypatchs

This commit is contained in:
Maximilian Hils 2016-09-27 00:46:54 -07:00
parent ebccc103d8
commit 24ceb0f7ac

View File

@ -727,9 +727,13 @@ class TCPClient(_Connection):
self.rfile.set_descriptor(self.connection) self.rfile.set_descriptor(self.connection)
self.wfile.set_descriptor(self.connection) self.wfile.set_descriptor(self.connection)
def makesocket(self):
# some parties (cuckoo sandbox) need to hook this
return socket.socket(self.address.family, socket.SOCK_STREAM)
def connect(self): def connect(self):
try: try:
connection = socket.socket(self.address.family, socket.SOCK_STREAM) connection = self.makesocket()
if self.spoof_source_address: if self.spoof_source_address:
try: try: