LookupError: unknown encoding: idna

See original GitHub issue

I get an exception when scanning some targets using targets file. When scanning these targets manually, it works fine.

I’m using the ssh-audit.exe in Version 2.5 on a Windows 10 VM. For me it looks like to be an issue of missing import: import encodings.idna

An exception occurred while scanning 10.2xx.xx.xx:22: Traceback (most recent call last): File “ssh-audit.py”, line 1017, in target_worker_thread File “ssh-audit.py”, line 842, in audit File “ssh_socket.py”, line 155, in connect File “ssh_socket.py”, line 85, in _resolve File “socket.py”, line 953, in getaddrinfo LookupError: unknown encoding: idna


An exception occurred while scanning 10.2xx.xxx.xx:22: Traceback (most recent call last): File “ssh-audit.py”, line 1017, in target_worker_thread File “ssh-audit.py”, line 842, in audit File “ssh_socket.py”, line 155, in connect File “ssh_socket.py”, line 85, in _resolve File “socket.py”, line 953, in getaddrinfo LookupError: unknown encoding: idna


An exception occurred while scanning 10.2xx.xxx.xx:22: Traceback (most recent call last): File “ssh-audit.py”, line 1017, in target_worker_thread File “ssh-audit.py”, line 842, in audit File “ssh_socket.py”, line 155, in connect File “ssh_socket.py”, line 85, in _resolve File “socket.py”, line 953, in getaddrinfo LookupError: unknown encoding: idna


An exception occurred while scanning 10.2xx.xx.xx:22: Traceback (most recent call last): File “ssh-audit.py”, line 1017, in target_worker_thread File “ssh-audit.py”, line 842, in audit File “ssh_socket.py”, line 155, in connect File “ssh_socket.py”, line 85, in _resolve File “socket.py”, line 953, in getaddrinfo LookupError: unknown encoding: idna


An exception occurred while scanning 10.2xx.xxx.xx:22: Traceback (most recent call last): File “ssh-audit.py”, line 1017, in target_worker_thread File “ssh-audit.py”, line 842, in audit File “ssh_socket.py”, line 155, in connect File “ssh_socket.py”, line 85, in _resolve File “socket.py”, line 953, in getaddrinfo LookupError: unknown encoding: idna

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
thecliguycommented, Oct 14, 2022

@kastahl Thanks for testing, much appreciated.

This confirms my suspicion that the problem relates to multithreading and appears only to affect the Windows executable version of ssh-audit.

Please leave this ticket open because although we now have a workaround (which is to avoid multiple threads), there is still a bug that needs to be fixed properly.

0reactions
jtestacommented, Oct 15, 2022

Thanks for helping with this, @thecliguy. I’ll investigate this further next time I do testing on my Windows machine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unknown encoding: idna in Python Requests - Stack Overflow
Try adding: import encodings.idna. in various places to sift out other errors. I ran into this same problem working on a port of...
Read more >
LookupError: unknown encoding: idna in child process when ...
I do not understand why you need to import encodings.idna in the main module. There is no encoding/decoding done here. Have you tried...
Read more >
Lookup Error while importing idna from a worker thread
3-embed-amd64> .\python.exe .\repro.py FAIL: unknown encoding: idna FAIL: unknown encoding: idna Exception in thread Thread-5: Traceback ( ...
Read more >
'unknown encoding: idna' on socket.connect() - Digi Forum
Hi, On a CP X4 I am running a Python routine that attempts to open a socket to port 502 on localhost (to...
Read more >
pymongo - LookupError: unknown encoding: idna - Super User
I'm having an error with pymongo (version 3.6.0) when I try to instantiate a MongoClient. My python version is 3.7.4, running on OS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found