RockYou error
0dayCTF opened this issue · 7 comments
shreder 192.168.1.66 -u admin -l /usr/share/wordlists/rockyou.txt
Traceback (most recent call last):
File "/usr/local/bin/shreder", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/shreder/cli.py", line 73, in main
cli.start()
File "/usr/local/lib/python3.9/dist-packages/shreder/cli.py", line 54, in start
password = self.brute(
File "/usr/local/lib/python3.9/dist-packages/shreder/main.py", line 51, in brute
lines = f.read().split('\n')
File "/usr/lib/python3.9/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 5079963: invalid continuation byte
Also, during the scan when I specified a port -- (It still got the correct password):
[*] Processing... | | Passwords tried: 192/198Exception: Error reading SSH protocol banner
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/paramiko/transport.py", line 2211, in _check_banner
buf = self.packetizer.readline(timeout)
File "/usr/local/lib/python3.9/dist-packages/paramiko/packet.py", line 380, in readline
buf += self._read_timeout(timeout)
File "/usr/local/lib/python3.9/dist-packages/paramiko/packet.py", line 609, in _read_timeout
raise EOFError()
EOFError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/paramiko/transport.py", line 2039, in run
self._check_banner()
File "/usr/local/lib/python3.9/dist-packages/paramiko/transport.py", line 2215, in _check_banner
raise SSHException(
paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
Hi, @0dayCTF
I fixed this problem, but everything I can do about it is just catch this exception.
This error occurs because of many retries, or because the host is down.
Regards,
Ivan Nikolsky (@enty8080)
P.S.: This error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 5079963: invalid continuation byte
occurred because your passwords list has some unreadable by python3 symbols.
I am still experiencing the issue, I converted the standard rockyou that ships with Kali linux to UTF-8, and it works.
Im experiencing the same issue - there is a way around it - im pretty sure some of rock you is in latin-1 encoding, so if you open the file in read binary mode and then try decoding each line as utf8, and if it fails then decode as latin 1 to build the list it should be fine
wordlist= []
with open(filename, 'rb') as f:
wordlist = f.read()
for w in wordlist:
try:
word = w.decode('utf-8').strip('\n')
except Exception:
try:
word = w.decode('latin-1').strip('\n')
except Exception:
pass
ssh_attempt(username, word, ip)
Nice solution, thank you @watchdog2000
@watchdog2000 You are welcome to contribute, if you want, you can open Pull Request at this repository to add this type of action (decoding, or something).