Marten4n6 / TinyTor

A tiny Tor client implementation (in pure python).
GNU General Public License v3.0
129 stars 30 forks source link

Incorrect padding and no worky in python3 #10

Open nigeljohnson73 opened 2 years ago

nigeljohnson73 commented 2 years ago

My Pi doesn't seem t ohave PIP and wont install it with apt-get. I do have Python3 and PIP3 all fine. When I try to run this in python 2, I get an error about cryptography being missing, and I cannot install it with pip due to the first sentence. Plus, anyway, python3 has a bigger number so must be the future.

For the record, I am also a PHP developer, so, please be gentle :)

When I run this from the command line on my raspberry pi, I get the following

pi@mnrtor:/tmp/TinyTor $ python3 --version
Python 3.7.3
pi@mnrtor:/tmp/TinyTor $ python3 tinytor.py --host ckwtzols3ukgmnam5w2bixq3iyw6d5oedp7a5cli6totg6ektlyknsqd.onion --verbose
  _____  _               _____            
 |_   _|(_) _ __   _   _|_   _|___   _ __ 
   | |  | || '_ \ | | | | | | / _ \ | '__|
   | |  | || | | || |_| | | || (_) || |    @Marten4n6 (v0.0.1)
   |_|  |_||_| |_| \__, | |_| \___/ |_|    GPLv3 licensed
                   |___/                  

[DEBUG] tinytor.py - Using directory authority "longclaw"...
[DEBUG] tinytor.py - Consensus URL: http://199.58.81.140:80/tor/status-vote/current/consensus
[DEBUG] tinytor.py - Parsing the consensus...
[WARNING] tinytor.py - Stopped after reading 200 onion routers.
[DEBUG] tinytor.py - Using guard relay "pembs2"...
[DEBUG] tinytor.py - Descriptor URL: http://193.47.147.252:3030/tor/server/fp/00410438E5E2D6367AB67F9851351329714F27A6
[DEBUG] tinytor.py - Parsing the guard relays keys...
[DEBUG] tinytor.py - Connecting socket to the guard relay...
[DEBUG] tinytor.py - Sending VERSIONS cell...
[DEBUG] tinytor.py - Retrieving VERSIONS cell...
[DEBUG] tinytor.py - Supported link protocol versions: [3, 4, 5]
[DEBUG] tinytor.py - Retrieving CERTS cell...
[DEBUG] tinytor.py - Retrieving AUTH_CHALLENGE cell...
[DEBUG] tinytor.py - Retrieving NET_INFO cell...
[DEBUG] tinytor.py - Our public IP address: 86.182.13.16
[DEBUG] tinytor.py - Sending NET_INFO cell...
[DEBUG] tinytor.py - Creating new circuit...
[DEBUG] tinytor.py - Handshake verified, onion router's shared secret has been set.
[DEBUG] tinytor.py - Extending the circuit to "darknebula"...
Traceback (most recent call last):
  File "tinytor.py", line 1140, in <module>
    main()
  File "tinytor.py", line 1135, in main
    log.info("Received response: \n%s" % tor.http_get(arguments.host))
  File "tinytor.py", line 1109, in http_get
    circuit.extend(extend_relay)
  File "tinytor.py", line 797, in extend
    key_agreement = KeyAgreementNTOR(onion_router)
  File "tinytor.py", line 654, in __init__
    self._B = b64decode(self._onion_router.key_ntor.encode())
  File "/usr/lib/python3.7/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
pi@mnrtor:/tmp/TinyTor $ 

What am I doing wrong?

ghost commented 1 year ago

the address you connected to is v3 which comes to bunch of changes that tinytor does not support