Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paramiko.auth_handler.AuthHandler._handler_table[paramiko.common.MSG_SERVICE_ACCEPT] TypeError: 'property' object has no attribute '__getitem__' #1314

Closed
w0rmh013 opened this issue Oct 8, 2018 · 4 comments

Comments

@w0rmh013
Copy link

w0rmh013 commented Oct 8, 2018

executed line:
paramiko.auth_handler.AuthHandler._handler_table[paramiko.common.MSG_SERVICE_ACCEPT]

error given:

TypeError: 'property' object has no attribute '__getitem__'

error occured when executing this openssh exploit script:
https://www.exploit-db.com/exploits/45233/

@doantranhoang
Copy link

doantranhoang commented Oct 17, 2018

I think the update from issue #1283 lead to this issue, by replacing static dicts _handler_table with a dict-returning @property
Ref:

@property
def _handler_table(self):
if self.transport.server_mode:
return self._server_handler_table
else:
return self._client_handler_table

So you can't call the _handler_table dict directly

The fastest solution for your testing is downgrade to older version, using pip

pip install paramiko==2.0.8

@w0rmh013
Copy link
Author

Yes, thank you. However they mentioned in the issue that this fix is backwards compatible, yet it seems to cause trouble.

@pstch
Copy link

pstch commented Oct 19, 2018

The fix is backwards compatible, but you are using an internal attribute of AuthHandler that is not part of the public interface.

The handler tables were separated for server and client code, so you'll have to use one of the two specific tables instead of the property.

For example, if you are running client code, you'd change _handler_table by _client_handler_table.

@w0rmh013
Copy link
Author

Alright, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants