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

TypeError: 'property' object is not subscriptable #15

Open
r3k2 opened this issue Nov 16, 2018 · 7 comments
Open

TypeError: 'property' object is not subscriptable #15

r3k2 opened this issue Nov 16, 2018 · 7 comments

Comments

@r3k2
Copy link

r3k2 commented Nov 16, 2018

python3.7 sshUsernameEnumExploit.py
Traceback (most recent call last):
  File "sshUsernameEnumExploit.py", line 33, in <module>
    old_parse_service_accept = paramiko.auth_handler.AuthHandler._handler_table[paramiko.common.MSG_SERVICE_ACCEPT]
TypeError: 'property' object is not subscriptable
@harsxv
Copy link

harsxv commented Nov 23, 2018

What version of your paramiko package ?

I solved this by installing paramiko to version 2.4.1

Take a look at this commit. f8dc16b

@agentgoblin
Copy link

In paramiko since 2.4.2_handler_table is a property object, not dictionary. It changes after fixing paramiko/paramiko#1283 in paramiko/paramiko@56c96a6

Because in this test paramiko used in client mode, I just changed _handler_table to _client_handler_table. Then test works properly.

old_parse_service_accept = paramiko.auth_handler.AuthHandler._client_handler_table[paramiko.common.MSG_SERVICE_ACCEPT]
...
paramiko.auth_handler.AuthHandler._client_handler_table[paramiko.common.MSG_SERVICE_ACCEPT] = malform_packet
paramiko.auth_handler.AuthHandler._client_handler_table[paramiko.common.MSG_USERAUTH_FAILURE] = call_error

agentgoblin pushed a commit to agentgoblin/CVE-2018-15473-Exploit that referenced this issue Dec 28, 2018
…ty object, used _client_handler_table instead.
@Walidhossain010
Copy link

What version of your paramiko package ?

I solved this by installing paramiko to version 4.2.1

Take a look at this commit. f8dc16b
change it to 2.4.1

@0xsunil
Copy link

0xsunil commented May 12, 2020

I solved this by installing paramiko to version 4.2.1

change it to 2.4.1

I installed paramiko using three commands:

pip.exe install paramiko
pip3.exe install paramiko
pip3.7.exe install paramiko

It installs the latest release 2.7.1 but I still face the same issue:
Error:
ss

Is version2.4.1 required specifically?

Kindly help me. Thanks.

@519seven
Copy link

519seven commented Jul 6, 2020

@0xsunil

I'm running Python 3.6.8 and Paramiko 2.7.1. The pull request above has not been rolled in, yet.

$ python3 ./sshUsernameEnumExploit.py -h
Traceback (most recent call last):
  File "./sshUsernameEnumExploit.py", line 33, in <module>
    old_parse_service_accept = paramiko.auth_handler.AuthHandler._handler_table[paramiko.common.MSG_SERVICE_ACCEPT]
TypeError: 'property' object is not subscriptable

Make the changes above (see 93607da)

And your script will run:

$ python3 ./sshUsernameEnumExploit.py -h
usage: sshUsernameEnumExploit.py [-h] [--port PORT] [--threads THREADS]
                                 [--outputFile OUTPUTFILE]
                                 [--outputFormat {list,json,csv}]
                                 (--username USERNAME | --userList USERLIST)
                                 hostname

positional arguments:
  hostname              The target hostname or ip address

optional arguments:
  -h, --help            show this help message and exit
  --port PORT           The target port
  --threads THREADS     The number of threads to be used
  --outputFile OUTPUTFILE
                        The output file location
  --outputFormat {list,json,csv}
                        The output file location
  --username USERNAME   The single username to validate
  --userList USERLIST   The list of usernames (one per line) to enumerate
                        through

@Daviey
Copy link

Daviey commented Mar 5, 2021

sed -i 's/_handler_table/_client_handler_table/g' sshUsernameEnumExploit.py

@jithesh82
Copy link

I used the suggestion of @519seven above (93607da) and installed paramiko 2.12.0 (@harsxv) and fixed the issue. Only doing one of them, didn't solve the problem.

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

8 participants