TorRunner is designed to facilitate the deployment of Tor hidden services.
Project description
🧅 𝙏𝙤𝙧𝙍𝙪𝙣𝙣𝙚𝙧
TorRunner is a Python package designed to facilitate the deployment of Tor hidden services. It simplifies the process by allowing you to set up and run a hidden service that listens on a specified port. This package automates the installation and configuration of the Tor software, removing the need for manual setup and making it easier to get started.
📌 Planned for the future
- Vanguards
- Auto Bridge Updates
- Multi Threads
- Tor version check & auto update
- Proxy mode
- (not feasible) Tor preinstalled
Examples
On the command line
tor_runner --help
Output:
usage: tor_runner [-h] [-p PORT] [-l [LISTENER ...]] [-t THREADS] [-d [HIDDEN_SERVICE_DIRS ...]] [-b [BRIDGES ...]] [-s SOCKS_PORT] [-v [VANGUARDS]] [--bridge-quantity BRIDGE_QUANTITY]
[--default-bridge-type DEFAULT_BRIDGE_TYPE] [--delete] [--quiet]
Run as a Tor hidden service, allowing configuration of listeners, hidden service directories, and bridges.
options:
-h, --help show this help message and exit
-p PORT, --port PORT HTTP port for the hidden service to listen on.
-l [LISTENER ...], --listener [LISTENER ...]
List of listeners in the format 'tor_port,listen_port'.
-t THREADS, --threads THREADS
How many times Tor should start. (default: 1)
-d [HIDDEN_SERVICE_DIRS ...], --hidden-service-dirs [HIDDEN_SERVICE_DIRS ...]
Directories for storing hidden service keys and hostname files.
-b [BRIDGES ...], --bridges [BRIDGES ...]
List of bridges to use for connecting to the Tor network.
-s SOCKS_PORT, --socks-port SOCKS_PORT
SOCKS port for Tor connections.
-v [VANGUARDS], --vanguards [VANGUARDS]
Enables Vanguards with an optional thread count to protect against guard discovery and related traffic analysis attacks.
--bridge-quantity BRIDGE_QUANTITY
Number of bridges to use for connecting to the Tor network.
--default-bridge-type DEFAULT_BRIDGE_TYPE
Default bridge type to use when connecting to Tor.
--delete Delete all data associated with tor_runner.
--quiet Run the script in quiet mode with no output.
Without an App
from tor_runner import TorRunner
# Uses 11 default obfs4 bridges to connect
runner = TorRunner(
hs_dirs = ["/path/to/hs"], bridges = [],
default_bridge_type = "obfs4", bridge_quantity = 11
)
if __name__ == '__main__':
# Forwards 80 -> 5000 and 22 -> 22
runner.run([(80, 5000), (22, 22)], socks_port = 9050, quite = False, wait = True)
For Flask
from flask import Flask
from tor_runner import TorRunner
app = Flask(__name__)
# Uses 11 default obfs4 bridges to connect
runner = TorRunner(default_bridge_type = "obfs4", bridge_quantity = 11)
@app.route('/')
def index():
"""
Route accessible via the Tor network
"""
return 'Hello, Anonymous!🖐️'
if __name__ == '__main__':
runner.flask_run(app, host = '127.0.0.1', port = 9000)
For Sanic
from sanic import Sanic, HTTPResponse
from sanic.response import text
from tor_runner import TorRunner
app = Sanic(__name__)
# Uses 11 default obfs4 bridges to connect
runner = TorRunner(default_bridge_type = "obfs4", bridge_quantity = 11)
@app.route('/')
async def index(request) -> HTTPResponse:
"""
Route accessible via the Tor network
"""
return text('Hello, Anonymous!🖐️')
if __name__ == '__main__':
runner.sanic_run(app, host = '127.0.0.1', port = 8000, workers = 16)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tor_runner-1.4.2.tar.gz
(32.2 kB
view hashes)
Built Distribution
tor_runner-1.4.2-py3-none-any.whl
(32.4 kB
view hashes)
Close
Hashes for tor_runner-1.4.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56ff1a6743fb8f95bfb2ebe3e121dcaa93bd2f9f639b07a03661b55ab0a1fa1b |
|
MD5 | 0c11c1d1bd3d901991053f5f07453bcf |
|
BLAKE2b-256 | 6bce550ed1022565550c1d25f75d7b02e3b531206a05810a45ef8b754d13dc77 |