Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pyrdp/convert/JSONEventHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#

from pyrdp.enum import CapabilityType, scancode
from pyrdp.pdu import PlayerPDU, FormatDataResponsePDU, FastPathUnicodeEvent
from pyrdp.pdu import FormatDataResponsePDU, FastPathUnicodeEvent

from pyrdp.pdu.player import PlayerPDU
from pyrdp.player.BaseEventHandler import BaseEventHandler
from pyrdp.parser import ClientInfoParser, ClientConnectionParser, ClipboardParser
from pyrdp.core import decodeUTF16LE
Expand Down
5 changes: 1 addition & 4 deletions pyrdp/parser/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ def write(self, pdu: GCCPDU) -> bytes:
stream = BytesIO()
stream.write(per.writeChoice(0))
stream.write(per.writeObjectIdentifier(GCCParser.T124_02_98_OID))

# Normally this should be len(pdu.payload) + 14, but Windows seems to always send 0x2a. This value is also
# accepted by Wireshark.
stream.write(per.writeLength(0x2a))
stream.write(per.writeLength(len(pdu.payload) + 14))
stream.write(per.writeChoice(pdu.header))

self.writers[pdu.header](stream, pdu)
Expand Down
4 changes: 4 additions & 0 deletions pyrdp/parser/rdp/slowpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ def parseCapabilitySets(self, capabilitySetsRaw, numberCapabilities):
lengthCapability = Uint16LE.unpack(stream.read(2))
capabilityData = stream.read(lengthCapability - 4)
capability = Capability(capabilitySetType, capabilityData)
if capabilitySetType == 6:
# Workaround for XRDP returning bad capability type
# ref https://github.com/GoSecure/pyrdp/issues/294
continue
capabilitySets[CapabilityType(capabilitySetType)] = capability

# Fully parse the General capability set
Expand Down