enable autologin only when password is present
This commit is contained in:
@@ -89,11 +89,9 @@ class MyRDPFactory(rdp.ClientFactory):
|
|||||||
|
|
||||||
def clientConnectionLost(self, connector, reason):
|
def clientConnectionLost(self, connector, reason):
|
||||||
reactor.stop()
|
reactor.stop()
|
||||||
app.exit()
|
|
||||||
|
|
||||||
def clientConnectionFailed(self, connector, reason):
|
def clientConnectionFailed(self, connector, reason):
|
||||||
reactor.stop()
|
reactor.stop()
|
||||||
app.exit()
|
|
||||||
|
|
||||||
def buildObserver(self, controller, addr):
|
def buildObserver(self, controller, addr):
|
||||||
class MyObserver(rdp.RDPClientObserver)
|
class MyObserver(rdp.RDPClientObserver)
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ class RDPInfo(CompositeType):
|
|||||||
#code page
|
#code page
|
||||||
self.codePage = UInt32Le()
|
self.codePage = UInt32Le()
|
||||||
#support flag
|
#support flag
|
||||||
self.flag = UInt32Le(InfoFlag.INFO_MOUSE | InfoFlag.INFO_UNICODE | InfoFlag.INFO_AUTOLOGON | InfoFlag.INFO_LOGONNOTIFY | InfoFlag.INFO_LOGONERRORS)
|
self.flag = UInt32Le(InfoFlag.INFO_MOUSE | InfoFlag.INFO_UNICODE | InfoFlag.INFO_LOGONNOTIFY | InfoFlag.INFO_LOGONERRORS)
|
||||||
self.cbDomain = UInt16Le(lambda:sizeof(self.domain) - 2)
|
self.cbDomain = UInt16Le(lambda:sizeof(self.domain) - 2)
|
||||||
self.cbUserName = UInt16Le(lambda:sizeof(self.userName) - 2)
|
self.cbUserName = UInt16Le(lambda:sizeof(self.userName) - 2)
|
||||||
self.cbPassword = UInt16Le(lambda:sizeof(self.password) - 2)
|
self.cbPassword = UInt16Le(lambda:sizeof(self.password) - 2)
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ class RDPClientController(pdu.layer.PDUClientListener):
|
|||||||
Set password for session
|
Set password for session
|
||||||
@param password: password of session
|
@param password: password of session
|
||||||
"""
|
"""
|
||||||
|
self.setAutologon()
|
||||||
self._pduLayer._info.password.value = password
|
self._pduLayer._info.password.value = password
|
||||||
|
|
||||||
def setDomain(self, domain):
|
def setDomain(self, domain):
|
||||||
@@ -104,6 +105,12 @@ class RDPClientController(pdu.layer.PDUClientListener):
|
|||||||
"""
|
"""
|
||||||
self._pduLayer._info.domain.value = domain
|
self._pduLayer._info.domain.value = domain
|
||||||
|
|
||||||
|
def setAutologon(self):
|
||||||
|
"""
|
||||||
|
@summary: enable autologon
|
||||||
|
"""
|
||||||
|
self._pduLayer._info.flag |= pdu.data.InfoFlag.INFO_AUTOLOGON
|
||||||
|
|
||||||
def addClientObserver(self, observer):
|
def addClientObserver(self, observer):
|
||||||
"""
|
"""
|
||||||
Add observer to RDP protocol
|
Add observer to RDP protocol
|
||||||
|
|||||||
Reference in New Issue
Block a user