An open API service indexing awesome lists of open source software.

https://github.com/stef/torpy

tool and python module to manipulate tor hidden services
https://github.com/stef/torpy

Last synced: about 1 year ago
JSON representation

tool and python module to manipulate tor hidden services

Awesome Lists containing this project

README

          

* Torpy - a hidden service controller and py module

run torpy from the commandline:

generate a password for accessing tor remotely, and append it to your torrc
#+BEGIN_SRC shell
% /usr/sbin/tor --hash-password "password"
Oct 23 23:39:44.561 [notice] Tor v0.2.3.22-rc (git-4a0c70a817797420) running on Linux.
Oct 23 23:39:44.561 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Oct 23 23:39:44.564 [notice] This version of OpenSSL has a known-good EVP counter-mode implementation. Using it.
16:1387221FFADC246D60BEAA58274647717AA12A2ACE268F7AF0D5BF271A

% sudo printf "\nCookieAuthentication 0\nHashedControlPassword 16:1387221FFADC246D60BEAA58274647717AA12A2ACE268F7AF0D5BF271A\n" >>/etc/tor/torrc
#+END_SRC

#+BEGIN_SRC shell
git submodule init
git submodule update

virtualenv env
source env/bin/activate
pip install pytorctl/ #note the / at the end!

echo 'passphrase="password"' >config.py
#+END_SRC

usage:

#+BEGIN_SRC shell
torpy list
torpy status
torpy start
torpy stop "
#+END_SRC

or use it from python:

#+BEGIN_SRC python
tp=Torpy(passphrase)
# list services
tp.list()
# check if test_service is running
print "running" if tp.status("test_service") else "not running"
# start test_service
tp.start("test_service","localhost:80","80")
# check again
print "running" if tp.status("test_service") else "not running"
# stop service
tp.stop("test_service")
# don't forget to close the control connection
tp.close()
#+END_SRC

*warning* if you start a new onion service using start, the full path must be
readable, writable, and executable (o+rwx) by the user running tor.