No Description

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


  • Create a password hash for the control port

    ❯ tor --hash-password reallygoodpassword
  • Configure Tor daemon /etc/tor/torrc

    SocksPolicy           accept 
    SocksPolicy           accept
    SocksPolicy           reject *
    Log                   notice syslog
    RunAsDaemon           1
    DataDirectory         /var/lib/tor
    ControlPort           9051
    HashedControlPassword 16:E3080659B8209B3B60FFB5084A5B3BFC09E334182A07822BD5E93C95FC
    HiddenServiceDir      /var/lib/tor/hidden_service/
    HiddenServicePort     80
  • Restart Tor daemon systemctl restart tor

  • Create a ~/.torctlrc file

    password: reallygoodpassword
    port: 9051


  • 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


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