No Description

philoctetes409bc 060cc2d19b clean up setup.py 4 months ago
dist f13b942448 add setup.py 4 months ago
torctl.egg-info f13b942448 add setup.py 4 months ago
.gitignore f13b942448 add setup.py 4 months ago
Pipfile 0fb4e077c5 first commit 4 months ago
Pipfile.lock 0fb4e077c5 first commit 4 months ago
README.md a3af423550 update readme add support for params 4 months ago
__main__.py f13b942448 add setup.py 4 months ago
setup.py 060cc2d19b clean up setup.py 4 months ago
torctl.py a3af423550 update readme add support for params 4 months ago

README.md

Configuration

  • Create a password hash for the control port
❯ tor --hash-password reallygoodpassword
16:E3080659B8209B3B60FFB5084A5B3BFC09E334182A07822BD5E93C95FC
  • Configure Tor daemon /etc/tor/torrc
SocksPolicy           accept 198.18.0.0/17 
SocksPolicy           accept 127.0.0.0/8
SocksPolicy           reject *
Log                   notice syslog
RunAsDaemon           1
DataDirectory         /var/lib/tor
ControlPort           9051
HashedControlPassword 16:E3080659B8209B3B60FFB5084A5B3BFC09E334182A07822BD5E93C95FC
HiddenServiceDir      /var/lib/tor/hidden_service/
HiddenServicePort     80 127.0.0.1:80
  • Restart Tor daemon systemctl restart tor

  • Create a ~/.torctlrc file

config:
  host: 127.0.0.1
  password: reallygoodpassword
  port: 9051

Usage

  • pipenv shell
  • pipenv sync

Available commands

❯ python -m torctl

        valid commands are:
        add-event-listener add-status-listener attach-stream authenticate clear-cache close close-circuit close-stream connect connection-time create-ephemeral-hidden-service create-hidden-service drop-guards enable-feature extend-circuit from-port from-socket-file get-accounting-stats get-circuit get-circuits get-conf get-conf-map get-effective-rate get-exit-policy get-hidden-service-conf get-hidden-service-descriptor get-info get-latest-heartbeat get-listeners get-microdescriptor get-microdescriptors get-network-status get-network-statuses get-newnym-wait get-pid get-ports get-protocolinfo get-server-descriptor get-server-descriptors get-socket get-socks-listeners get-start-time get-streams get-uptime get-user get-version is-alive is-authenticated is-caching-enabled is-feature-enabled is-geoip-unavailable is-localhost is-newnym-available is-set is-user-traffic-allowed list-ephemeral-hidden-services load-conf map-address msg new-circuit reconnect remove-ephemeral-hidden-service remove-event-listener remove-hidden-service remove-status-listener repurpose-circuit reset-conf save-conf set-caching set-conf set-hidden-service-conf set-options signal

Creating a new circuit

❯ python -m torctl new-circuit
result: 33

Creating a new identity

python -m torctl signal newnym
result: None

Installing

  • For python3 python setup.py install --user installs to ~/.local/
  • Run with python -m torctl
  • Add alias torctl="python3 -m torctl" to your .bashrc or .zshrc