Skip to content

torcontroller is an extremely lightweight tor and privoxy process control scripts debian package, with apt-get installation and commands that make it easy to control tor by most programming languages.

License

Notifications You must be signed in to change notification settings

Seicrypto/torcontroller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

torcontroller

GitHub release Hits Github All Releases

What is tor? "The Onion Router," is free and open-source software for enabling anonymous communication.

torcontroller is a Debian package which combines tor, privoxy, systemctl packages, and so on. torcontroller Dev built some scripts to let you just command on Linux: Debian bullseye environments including docker container. You will be able to run your application and control tor router by a function that writes any back-end program.

If you are not reading this on github, please go to https://github.com/Seicrypto/torcontroller Read more

Japanese README: 日本語説明こちら

What does torcontroller do?

UML sequence diagram with mermaid:

sequenceDiagram
%% Declaration
    box blue Your sources
    participant usr as Back-End Applications
    end
    box green torcontroller
    participant pv as Privoxy
    participant tor as TOR server nodes
    end
    participant tg as Target (Domain/IP)
%% Relation
    usr->>pv: request, 8118 port
    Note over pv: non-caching
    Note over pv: modifying HTTP headers
    pv->>tor: socket, 9050 port
    Note over tor: wrap IP address
    tor->>tg: CRUD
    tg->>tor: response
    Note over tor: Auth
    tor->>pv: response
    Note over pv: Controlling access
    Note over pv: Blocking tracking
    pv->>usr: response data
Loading

Actually, there are more feature with privoxy and TOR. If you were interested in privoxy and TOR features, please visit thier sites. torcontroller only simple scripts to controll them.

QuickStart

Use in:

Linux

Debian Ubuntu

Now torcontroller suport on Linux Debian / Ubuntu else.

Step1. Download and install

#!/bin/bash
apt-get update

# Intel / AMD cpu:
wget https://github.com/Seicrypto/torcontroller/releases/download/v1.0.1/torcontroller_1.0.1_amd64.deb
apt-get install -y ./torcontroller_1.0.1_amd64.deb

# ARM cpu:
# wget https://github.com/Seicrypto/torcontroller/releases/download/v1.0.1/torcontroller_1.0.1_arm64.deb
# apt-get install -y ./torcontroller_1.0.1_arm64.deb

# * How to know your machine using ARM or Intel / AMD
# uname -m
# Response :
# aarch64 (Means ARM)
# x86_64 (Means Intel / AMD)

Step2. Set up your AUTHENTICATE password

#!/bin/bash
torcontoller --version
# torcontroller version X.X

torcontroller --resetpassword
# torcontroller info ...
# Enter old TOR password:
# (torcontroller set as default password)

Step3. Check tor and privoxy feature

#!/bin/bash
torcontroller --start
# log info...
# Start command succeeded.

curl -x 127.0.0.1:8118 http://icanhazip.com/
# 176.10.99.200 (a example tor ip address)
curl http://icanhazip.com/
# 89.196.159.79 (a example your ture ip address)

Use in docker container

Docker

Please make sure your docker image base on debian. Such as bullseye, bookworm:

  • golang:bullseye
  • golang:bookworm
  • python:3.9-bullseye
  • node:bullseye
  • so on...

Step1. Download and Install package

# dockerfile
# Recommend bullseye / bookworn ... else built according degina system.
From golang:bullseye
# Of course work for any programming you want,
# just remmember use image: bullseye, bookworm, and so on.
WORKDIR /app

# Make sure there's wget in your docker image.
RUN apt-get update

# Intel / AMD cpu:
RUN wget https://github.com/Seicrypto/torcontroller/releases/download/v1.0.1/torcontroller_1.0.1_amd64.deb
RUN apt-get install -y /app/torcontroller_1.0.1_amd64.deb
# Be careful about your download and install path.

# ARM cpu:
# RUN wget https://github.com/Seicrypto/torcontroller/releases/download/v1.0.1/torcontroller_1.0.1.arm64.deb
# RUN apt-get install -y /app/torcontroller_1.0.1_arm64.deb

Step2. Set up your AUTHENTICATE password

Terminal (Recommend)

# Terminal
# This sample using 9050 as socketPort, 9051 as controlPort on machine.
docker run -it -p 9050:9050 -p 9051:9051 --name <your-container-name> <docker-image>

# Check torcontroller installed properly.
docker exec <your-container-name> torcontroller --version
# torcontroller version X.X-X

# On terminal to control docker.
docker exec -i <your-container-name> torcontroller --resetpassword
# torcontroller info ...
# Enter old TOR password:
# (torcontroller set as default password)

Step3. Check tor and privoxy feature

Call bash in your programing function. You could build it by yourself or import it.

Be careful! Use 127.0.0.1:8118 Port as proxy in your application. It would go through tor socket 9050 Port in your docker container.

Example:

Detail

Read more torcontroller command:

torcontroller command list

Reference

A step-by-step guide how to use Python with Tor and Privoxy :

Which is my basic script content reference.

tor.service file for systemctl

privoxy.service file for systemctl

About

torcontroller is an extremely lightweight tor and privoxy process control scripts debian package, with apt-get installation and commands that make it easy to control tor by most programming languages.

Topics

Resources

License

Stars

Watchers

Forks