Giter VIP home page Giter VIP logo

tinytor's People

Contributors

lontivero avatar marten4n6 avatar rage-proof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tinytor's Issues

Little help

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

V3 Support

Hey, I was wondering if you were any close to adding a V3 implementation or if you are still working on this project.

Small ed25519 python implementation

In the code I can read you don't use NTOR because openssl on MacOS:

TinyTor/tinytor.py

Lines 544 to 545 in 4e1d611

The reason for using TAP instead of NTOR is that macOS / OSX comes
with LibreSSL (2.2.7) which doesn't support curve25519.

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

send_cell and versions race condition

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

Incorrect padding and no worky in python3

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?

Documentation on what still needs to be implemented

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?

base64 missing padding chars

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 "):

patch.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.