marten4n6 / tinytor Goto Github PK
View Code? Open in Web Editor NEWA tiny Tor client implementation (in pure python).
License: GNU General Public License v3.0
A tiny Tor client implementation (in pure python).
License: GNU General Public License v3.0
Link provided in README return 404: https://pypi.org/project/tinytor/
hello I am currently trying to add support for V3 services with this code as a base,
however I am running into a problem in line 972.
the problem is that ssl.wrap_socket requires an additional "certfile" however I am not sure how to deal with this error
ValueError: certfile must be specified
I know I can pass a certfile argument, but I do not know what the value of it should be in the context of this project
Hey, I was wondering if you were any close to adding a V3 implementation or if you are still working on this project.
Ideally, I think a circuit must consist of unique ORs.
Line 1107 in 98fbfeb
In the code I can read you don't use NTOR because openssl on MacOS:
Lines 544 to 545 in 4e1d611
Probably you already know this but anyway, there is a small ed25519 implementation in pure python:
http://ed25519.cr.yp.to/python/ed25519.py
This is also used in the official Tor project. You can see how the use it here: https://gitweb.torproject.org/tor.git/tree/src/test/ed25519_exts_ref.py
I know this is not maintained anymore but it's here for anyone trying to get this working
When send_versions
is called it calls cell.get_bytes
which does not work properly until _retrieve_versions
is called but send_versions
is called first and thus there is race condition
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?
I'd love to use TinyTor, and I'm willing to contribute time to finishing off the implementation so I can do so.
Would it be possible to get tickets for the things that still need to be implemented, or at least a TODO file?
[WARNING] tinytor.py - Circuit 3154026557 destroyed, reason: 1
'TINYTOR_IMPLEMENTATION_IS_NOT_FINISHED'
Can't we just extend the circuit?
I've tried to make a PR but Github is completely broken today: https://twitter.com/lontivero/status/1054160998259658752
diff --git a/tinytor.py b/tinytor.py
index 40e11e0..e7b3ecc 100644
--- a/tinytor.py
+++ b/tinytor.py
@@ -186,16 +186,11 @@ class Consensus:
tor_port = int(split_line[7])
dir_port = int(split_line[8])
- while True:
- try:
- # The fingerprint here is base64 encoded bytes.
- # The descriptor URL uses the base16 encoded value of these bytes.
- # Documentation for this was hard to find...
- identity = b16encode(b64decode(identity.encode())).decode()
- break
- except binascii.Error:
- # Incorrect base64 padding.
- identity = identity + "="
+ # The fingerprint here is base64 encoded bytes.
+ # The descriptor URL uses the base16 encoded value of these bytes.
+ # Documentation for this was hard to find...
+ identity += '=' * (-len(identity) % 4)
+ identity = b16encode(b64decode(identity.encode())).decode()
onion_router = OnionRouter(nickname, ip, dir_port, tor_port, identity)
elif line.startswith("s "):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.