ready for 1.2.0

This commit is contained in:
speyrefitte
2015-01-06 10:24:06 +01:00
parent 7ff5c5caa3
commit b378a1d15c
6 changed files with 30 additions and 22 deletions

View File

@@ -29,7 +29,7 @@ from rdpy.protocol.rdp import rdp
from rdpy.core.error import RDPSecurityNegoFail
import rdpy.core.log as log
#log._LOG_LEVEL = log.Level.INFO
log._LOG_LEVEL = log.Level.INFO
class RDPClientQtFactory(rdp.ClientFactory):
"""

View File

@@ -75,6 +75,7 @@ class ProxyServer(rdp.RDPServerObserver):
if self._client is None:
#try a connection
domain, username, password = self._controller.getCredentials()
log.info("Credentials dump : connection from %s with %s\\%s [%s]"%(self._controller.getHostname(), domain, username, password))
width, height = self._controller.getScreen()
reactor.connectTCP(self._target[0], int(self._target[1]), ProxyClientFactory(self, width, height,
@@ -223,6 +224,7 @@ class ProxyClientFactory(rdp.ClientFactory):
self._domain = domain
self._username = username
self._password = password
self._security = "ssl"
def buildObserver(self, controller, addr):
"""
@@ -238,7 +240,22 @@ class ProxyClientFactory(rdp.ClientFactory):
controller.setDomain(self._domain)
controller.setUsername(self._username)
controller.setPassword(self._password)
return ProxyClient(controller, self._server)
controller.setSecurityLevel(self._security)
return ProxyClient(controller, self._server)
def clientConnectionLost(self, connector, reason):
"""
@summary: Connection lost event
@param connector: twisted connector use for rdp connection (use reconnect to restart connection)
@param reason: str use to advertise reason of lost connection
"""
#try reconnect with basic RDP security
if reason.type == error.RDPSecurityNegoFail:
#stop nego
log.info("due to security nego error back to standard RDP security layer")
self._security = "rdp"
connector.connect()
return
class Shadow(rdp.RDPServerObserver):
"""

View File

@@ -101,19 +101,16 @@ class RDPScreenShotFactory(rdp.ClientFactory):
"""
@summary: observer that connect, cache every image received and save at deconnection
"""
def __init__(self, controller, width, height, security, path, timeout, reactor):
def __init__(self, controller, width, height, path, timeout, reactor):
"""
@param controller: {RDPClientController}
@param width: {integer} width of screen
@param height: {integer} height of screen
@param security: {str} (ssl | rdp) security level
@param path: {str} path of output screenshot
@param timeout: {float} close connection after timeout s without any updating
@param reactor: twisted reactor
"""
rdp.RDPClientObserver.__init__(self, controller)
controller.setScreen(width, height);
controller.setSecurityLevel(security)
self._buffer = QtGui.QImage(width, height, QtGui.QImage.Format_RGB32)
self._path = path
self._timeout = timeout
@@ -147,8 +144,10 @@ class RDPScreenShotFactory(rdp.ClientFactory):
def checkUpdate(self):
self._controller.close();
return ScreenShotObserver(controller, self._width, self._height, self._security, self._path, self._timeout, self._reactor)
controller.setScreen(width, height);
controller.setSecurityLevel(self._security)
return ScreenShotObserver(controller, self._width, self._height, self._path, self._timeout, self._reactor)
def main(width, height, path, timeout, hosts):
"""