DedSecInside / TorBot

Dark Web OSINT Tool
Other
2.73k stars 509 forks source link

[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1006) #328

Closed johala09 closed 8 months ago

johala09 commented 8 months ago

Describe the bug The script crashes at the same point, always because of the same error : httpx.ConnectError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1006)

To Reproduce Steps to reproduce the behavior:

  1. Command : python3.11 torbot -u http://domain.onion
  2. Click on 'enter'
  3. Scroll down to traceback
  4. See error

Expected behavior The script might have run against the multiple URL on Tor I submitted.

Screenshots Traceback I obtain everytime `Traceback (most recent call last): File "/usr/lib/python3/dist-packages/httpcore/_exceptions.py", line 8, in map_exceptions yield File "/usr/lib/python3/dist-packages/httpcore/backends/sync.py", line 57, in start_tls raise exc File "/usr/lib/python3/dist-packages/httpcore/backends/sync.py", line 52, in start_tls sock = ssl_context.wrap_socket( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket return self.sslsocket_class._create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/ssl.py", line 1108, in _create self.do_handshake() File "/usr/lib/python3.11/ssl.py", line 1379, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1006)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions yield File "/usr/lib/python3/dist-packages/httpx/_transports/default.py", line 218, in handle_request resp = self._pool.handle_request(req) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/httpcore/_sync/connection_pool.py", line 244, in handle_request raise exc File "/usr/lib/python3/dist-packages/httpcore/_sync/connection_pool.py", line 228, in handle_request response = connection.handle_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/httpcore/_sync/socks_proxy.py", line 285, in handle_request raise exc File "/usr/lib/python3/dist-packages/httpcore/_sync/socks_proxy.py", line 256, in handle_request stream = stream.start_tls(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/httpcore/backends/sync.py", line 49, in start_tls with map_exceptions(exc_map): File "/usr/lib/python3.11/contextlib.py", line 155, in exit self.gen.throw(typ, value, traceback) File "/usr/lib/python3/dist-packages/httpcore/_exceptions.py", line 12, in map_exceptions raise to_exc(exc) httpcore.ConnectError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1006)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/home/dockali/Tools/TorBot/torbot/main.py", line 144, in run(arg_parser, version) File "/home/dockali/Tools/TorBot/torbot/main.py", line 92, in run tree.load() File "/home/dockali/Tools/TorBot/torbot/modules/linktree.py", line 43, in load self._append_node(id=self._url, parent_id=None) File "/home/dockali/Tools/TorBot/torbot/modules/linktree.py", line 51, in _append_node resp = self._client.get(id) ^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/httpx/_client.py", line 1025, in get return self.request( ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/httpx/_client.py", line 802, in request return self.send(request, auth=auth, follow_redirects=follow_redirects) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/httpx/_client.py", line 889, in send response = self._send_handling_auth( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/httpx/_client.py", line 917, in _send_handling_auth response = self._send_handling_redirects( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/httpx/_client.py", line 954, in _send_handling_redirects response = self._send_single_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/httpx/_client.py", line 990, in _send_single_request response = transport.handle_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/httpx/_transports/default.py", line 217, in handle_request with map_httpcore_exceptions(): File "/usr/lib/python3.11/contextlib.py", line 155, in exit self.gen.throw(typ, value, traceback) File "/usr/lib/python3/dist-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ConnectError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1006)`

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

KingAkeem commented 8 months ago

You're not running the application correctly, please read the README. https://github.com/DedSecInside/TorBot?tab=readme-ov-file#installation

johala09 commented 8 months ago

I always have the same error. With poetry, venv or direct with python3.11 torbot -u

KingAkeem commented 8 months ago

This may be a bug within urllib3, try changing http to https. https://stackoverflow.com/questions/65516325/ssl-wrong-version-number-on-python-request

johala09 commented 8 months ago

I already did that, try another version for urllib3 but always the same crash... And the test I made are on Tor, so only http, not https

KingAkeem commented 8 months ago

There seems to be an issue with SSL in reference to httpx. I'll check it out.

johala09 commented 8 months ago

That's exactly what I think, I check too and I let you know if I find something useful

KingAkeem commented 8 months ago

Just had some time to test. http://domain.onion is not a valid site. I can't reach it from a Tor Browser either. Try using something like http://juhanurmihxlp77nkq76byazcldy2hlmovfu2epvl5ankdibsot4csyd.onion/ which is a valid site.

KingAkeem commented 8 months ago

Works with valid Tor sites, closing for now.

johala09 commented 8 months ago

Lol I tested the script with severel valid onion domains, none was correctly exploited by the script. I'll test with your onion but not sure it's the solution. There's clearly an issue with SSL in reference to httpx. I don't thing this issue is completed, I hope but I don't think.

EDIT : After some tests, I was right. I have the exact same crash with your onion. Thanks to reopen this issue @KingAkeem

KingAkeem commented 8 months ago

There's likely an issue with your setup, it's not reproducible for me. I can not reach the URL that you posted from Tor Browser and I don't think there's a problem with the Tor Browwser lol. If you're the only person experiencing the issue then it's a problem with your local machine.

johala09 commented 8 months ago

You noticed in a previous message the same error that I have : an issue with SSL in reference to httpx I'll have a look on my setup but I use others script on Tor, without problem.

KingAkeem commented 8 months ago

I see a similar error message with that particular URL. When I attempt to access it from the Tor Browser, it doesn't exist. If I use a different URL then both this program and the Tor Browser work perfectly fine. There's something wrong with the particular URL, if it's still occurring for you with the other URL then I'd assume it's something wrong with your setup. Make sure you're using the latest version with git pull and try using Docker.