def __init__(self): LayerAutomata.__init__(self, None) #server capabilities self._serverCapabilities = { caps.CapsType.CAPSTYPE_GENERAL : caps.Capability(caps.GeneralCapability()), caps.CapsType.CAPSTYPE_BITMAP : caps.Capability(caps.BitmapCapability()), caps.CapsType.CAPSTYPE_ORDER : caps.Capability(caps.OrderCapability()), caps.CapsType.CAPSTYPE_POINTER : caps.Capability(caps.PointerCapability(isServer = True)), caps.CapsType.CAPSTYPE_INPUT : caps.Capability(caps.InputCapability()), caps.CapsType.CAPSTYPE_VIRTUALCHANNEL : caps.Capability(caps.VirtualChannelCapability()), caps.CapsType.CAPSTYPE_FONT : caps.Capability(caps.FontCapability()), caps.CapsType.CAPSTYPE_COLORCACHE : caps.Capability(caps.ColorCacheCapability()), caps.CapsType.CAPSTYPE_SHARE : caps.Capability(caps.ShareCapability()) } #client capabilities self._clientCapabilities = { caps.CapsType.CAPSTYPE_GENERAL : caps.Capability(caps.GeneralCapability()), caps.CapsType.CAPSTYPE_BITMAP : caps.Capability(caps.BitmapCapability()), caps.CapsType.CAPSTYPE_ORDER : caps.Capability(caps.OrderCapability()), caps.CapsType.CAPSTYPE_BITMAPCACHE : caps.Capability(caps.BitmapCacheCapability()), caps.CapsType.CAPSTYPE_POINTER : caps.Capability(caps.PointerCapability()), caps.CapsType.CAPSTYPE_INPUT : caps.Capability(caps.InputCapability()), caps.CapsType.CAPSTYPE_BRUSH : caps.Capability(caps.BrushCapability()), caps.CapsType.CAPSTYPE_GLYPHCACHE : caps.Capability(caps.GlyphCapability()), caps.CapsType.CAPSTYPE_OFFSCREENCACHE : caps.Capability(caps.OffscreenBitmapCacheCapability()), caps.CapsType.CAPSTYPE_VIRTUALCHANNEL : caps.Capability(caps.VirtualChannelCapability()), caps.CapsType.CAPSTYPE_SOUND : caps.Capability(caps.SoundCapability()), caps.CapsType.CAPSETTYPE_MULTIFRAGMENTUPDATE : caps.Capability(caps.MultiFragmentUpdate()) } #share id between client and server self._shareId = 0x103EA #enable or not fast path self._fastPathSender = None
def __init__(self, presentation): """ @param presentation: Layer (generally pdu layer) """ LayerAutomata.__init__(self, presentation) #thios layer is like a fastpath proxy self._fastPathTransport = None self._fastPathPresentation = None #credentials self._info = RDPInfo(extendedInfoConditional = lambda:(self.getGCCServerSettings().SC_CORE.rdpVersion.value == gcc.Version.RDP_VERSION_5_PLUS)) #True if classic encryption is enable self._enableEncryption = False #Enable Secure Mac generation self._enableSecureCheckSum = False #initialise decrypt and encrypt keys self._macKey = None self._initialDecrytKey = None self._initialEncryptKey = None self._currentDecrytKey = None self._currentEncryptKey = None #counter before update self._nbEncryptedPacket = 0 self._nbDecryptedPacket = 0 #current rc4 tab self._decryptRc4 = None self._encryptRc4 = None
def __init__(self, presentation): """ @param presentation: upper layer, MCS layer in RDP case """ LayerAutomata.__init__(self, presentation) #client requested selectedProtocol self._requestedProtocol = Protocols.PROTOCOL_SSL | Protocols.PROTOCOL_HYBRID #server selected selectedProtocol self._selectedProtocol = Protocols.PROTOCOL_SSL
def __init__(self, presentation, receiveOpcode, sendOpcode, virtualChannels = []): """ @param presentation: {Layer} presentation layer @param virtualChannels: {Array(Layer]} list additional channels like rdpsnd... [tuple(mcs.ChannelDef, layer)] @param receiveOpcode: {integer} opcode check when receive data @param sendOpcode: {integer} opcode use when send data """ LayerAutomata.__init__(self, presentation) self._clientSettings = gcc.clientSettings() self._serverSettings = gcc.serverSettings() #default user Id self._userId = 1 + Channel.MCS_USERCHANNEL_BASE #list of channel use in this layer and connection state self._channels = {Channel.MCS_GLOBAL_CHANNEL: presentation} #virtual channels self._virtualChannels = virtualChannels #send opcode self._sendOpcode = sendOpcode #receive opcode self._receiveOpcode = receiveOpcode
def __init__(self, presentation, receiveOpcode, sendOpcode, virtualChannels=[]): """ @param presentation: {Layer} presentation layer @param virtualChannels: {Array(Layer]} list additional channels like rdpsnd... [tuple(mcs.ChannelDef, layer)] @param receiveOpcode: {integer} opcode check when receive data @param sendOpcode: {integer} opcode use when send data """ LayerAutomata.__init__(self, presentation) self._clientSettings = gcc.clientSettings() self._serverSettings = gcc.serverSettings() #default user Id self._userId = 1 + Channel.MCS_USERCHANNEL_BASE #list of channel use in this layer and connection state self._channels = {Channel.MCS_GLOBAL_CHANNEL: presentation} #virtual channels self._virtualChannels = virtualChannels #send opcode self._sendOpcode = sendOpcode #receive opcode self._receiveOpcode = receiveOpcode