sibson / vncdotool

A command line VNC client and python library
Other
453 stars 121 forks source link

vncdo crashes when connection with password #246

Closed Meteorus closed 1 year ago

Meteorus commented 1 year ago

Please include the following information:

vncdotool version vncdotool 0.12.0 with Python 3.10

VNC server and version UltraVNC Server 1.3.8.1

Steps to reproduce Try to connect to a password pretected VNC Server `PS C:\Users\username> C:\Users\username\AppData\Roaming\Python\Python310\Scripts\vncdo -s localhost capture "screenshot2.png" VNC password:

Expected result a screenshot

Which erroneous result did you get instead `PS C:\Users\username> C:\Users\username\AppData\Roaming\Python\Python310\Scripts\vncdo -s localhost capture "screenshot2.png" VNC password: Unhandled Error Traceback (most recent call last): File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\python\log.py", line 96, in callWithLogger return callWithContext({"system": lp}, func, *args, kw) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\python\log.py", line 80, in callWithContext return context.call({ILogContext: newCtx}, func, *args, *kw) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\python\context.py", line 117, in callWithContext return self.currentContext().callWithContext(ctx, func, args, kw) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\python\context.py", line 82, in callWithContext return func(*args, *kw) --- --- File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\internet\selectreactor.py", line 148, in _doReadOrWrite why = getattr(selectable, method)() File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\internet\tcp.py", line 248, in doRead return self._dataReceived(data) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\internet\tcp.py", line 253, in _dataReceived rval = self.protocol.dataReceived(data) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\rfb.py", line 685, in dataReceived self._handler() File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\rfb.py", line 694, in _handleExpected self._expected_handler(block, self._expected_args, **self._expected_kwargs) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\rfb.py", line 255, in _handleVNCAuth self.vncRequestPassword() File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\command.py", line 52, in vncRequestPassword self.sendPassword(self.factory.password) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\rfb.py", line 261, in sendPassword des = RFBDes(pw) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\pyDes.py", line 410, in init self.setKey(key) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\rfb.py", line 835, in setKey if bsrc & (1 << i): builtins.TypeError: unsupported operand type(s) for &: 'str' and 'int'

CRITICAL:twisted:Unhandled Error Traceback (most recent call last): File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\python\log.py", line 96, in callWithLogger return callWithContext({"system": lp}, func, *args, kw) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\python\log.py", line 80, in callWithContext return context.call({ILogContext: newCtx}, func, *args, *kw) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\python\context.py", line 117, in callWithContext return self.currentContext().callWithContext(ctx, func, args, kw) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\python\context.py", line 82, in callWithContext return func(*args, *kw) --- --- File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\internet\selectreactor.py", line 148, in _doReadOrWrite why = getattr(selectable, method)() File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\internet\tcp.py", line 248, in doRead return self._dataReceived(data) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\twisted\internet\tcp.py", line 253, in _dataReceived rval = self.protocol.dataReceived(data) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\rfb.py", line 685, in dataReceived self._handler() File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\rfb.py", line 694, in _handleExpected self._expected_handler(block, self._expected_args, **self._expected_kwargs) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\rfb.py", line 255, in _handleVNCAuth self.vncRequestPassword() File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\command.py", line 52, in vncRequestPassword self.sendPassword(self.factory.password) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\rfb.py", line 261, in sendPassword des = RFBDes(pw) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\pyDes.py", line 410, in init self.setKey(key) File "C:\Users\username\AppData\Roaming\Python\Python310\site-packages\vncdotool\rfb.py", line 835, in setKey if bsrc & (1 << i): builtins.TypeError: unsupported operand type(s) for &: 'str' and 'int'

CRITICAL:root:unsupported operand type(s) for &: 'str' and 'int' PS C:\Users\username>`

Additional information Same Problem under Windows 11 and Debian 11. After disabling the password, the screenshot was saved.

pmhahn commented 1 year ago

0.12.0 is way to old, especially with any Python 3.x.

Please give the current version from the git main brancha try, which might get releases as v1.1.0 this week. #203

pip install git+https://github.com/sibson/vncdotool.git@main

Meteorus commented 1 year ago

Thank you very much. I followed the instructions on the documentation. But this helped.