citronneur / rdpy

Remote Desktop Protocol in Twisted Python
GNU General Public License v3.0
1.67k stars 545 forks source link

ISSUE with RDPY3 -1.4.0 #130

Open this-is-dimpi opened 12 months ago

this-is-dimpi commented 12 months ago

I recently cloned the RDPY3 (1.4.0) to use rdpy3-rdpclient file to do remote login on the windows machine and while initiating the connection facing below error: Traceback (most recent call last): File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/twisted/python/log.py”, line 96, in callWithLogger return callWithContext({“system”: lp}, func, *args, kw) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/twisted/python/log.py”, line 80, in callWithContext return context.call({ILogContext: newCtx}, func, *args, *kw) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/twisted/python/context.py”, line 117, in callWithContext return self.currentContext().callWithContext(ctx, func, args, kw) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/twisted/python/context.py”, line 82, in callWithContext return func(*args, *kw) --- --- File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/twisted/internet/posixbase.py”, line 487, in _doReadOrWrite why = selectable.doRead() File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/twisted/internet/tcp.py”, line 248, in doRead return self._dataReceived(data) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/twisted/internet/tcp.py”, line 253, in _dataReceived rval = self.protocol.dataReceived(data) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/rdpy3/protocol/rdp/nla/cssp.py”, line 208, in dataReceived self._layer.dataReceived(data) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/rdpy3/core/layer.py”, line 210, in dataReceived self.recv(expectedData) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/rdpy3/protocol/rdp/tpkt.py”, line 195, in readData self._presentation.recv(data) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/rdpy3/protocol/rdp/x224.py”, line 196, in recvConnectionConfirm data.readType(message) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/rdpy3/core/type.py”, line 905, in readType value.read(self) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/rdpy3/core/type.py”, line 97, in read self.read(s) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/rdpy3/core/type.py”, line 480, in read raise e File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/rdpy3/core/type.py”, line 462, in read s.readType(self.dict[name]) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/rdpy3/core/type.py”, line 905, in readType value.read(self) File “/home/dimple.goyal/ADUI/nutest-py3-tests/my_nutest_virtual_env/lib/python3.9/site-packages/rdpy3/core/type.py”, line 108, in read raise InvalidExpectedDataException(“%s const value expected %s != %s”%(self.class, old.value, self.value)) rdpy3.core.error.InvalidExpectedDataException: <class ‘rdpy3.core.type.UInt8’> const value expected 208 != 208 DATA LEN: 2 || TYPE SIZE: 1 DATA LEN: 2 || TYPE SIZE: 1 DATA LEN: 2 || TYPE SIZE: 2 DATA LEN: 15 || TYPE SIZE: 1 DATA LEN: 15 || TYPE SIZE: 1 [] ERROR: Error during read <class ‘rdpy3.protocol.rdp.x224.ServerConnectionConfirm’>::code 2023-08-08 12:57:14,111Z INFO rdp_client_cli.py:167 (TB) Lost connection : [Failure instance: Traceback: <class ‘rdpy3.core.error.InvalidExpectedDataException’>: <class ‘rdpy3.core.type.UInt8’> const value expected 208 != 208 Could you please help me to resolve this issue or redirect to the appropriate person? It would be great help for my organization.

James4Ever0 commented 12 months ago

This repo has "python3" branch. Checkout that. I know nothing about this library, so my name-only replacements do not work as expected, as you have observed from my fork rdpy3. I have been trying to find alternatives. You may check comments in my repo agi_computer_control for help. Also issues in this library have filled with alternative suggestions since the author doesn't respond for a long time.

Though I manage to fix bugs for this deserted library, the chance of getting it fixed is pretty slim. The major burden is to get datastructure right and there are lots of changes in between Py2 and Py3, including different builtin classes like "str", different ways of handling unicode strings and class methods, the "print" statement and memory representation/size of objects. You could indeed try to fix that anyway. I do not guarantee it will be fixed by anyone. I am not responsible for this project in any way. It is kind of nostalgia I cannot give away. I know this project since the first time I installed Kali Linux, and it may still play important roles in your/my current Py3 projects if it can be fixed/ported to Py3 using lib2to3 or python-future. Good luck then!