Torify Torrentflux-b4rt
In my quest to anonymize all traffic leaving my home network, I ran into the problem of torifying my bittorrent transfers. Routing the actual transfers through Tor would be far too slow so I will be showing you how to anonymize only the tracker requests. But remember, pirating is bad mmmkay.
Torrentflux-b4rt is a web based transfer control client. Nothing is more convenient than starting a new download from anywhere, at anytime. Whether it be from a work computer, a friend’s computer, or a phone, having this installed on your server is a godsend.
Tor is a software project that helps you defend against traffic analysis. Though some consider the use of bittorrent over Tor to be counter to the goals of the Tor project, this article does not seek to answer the questions about the validity of any protocol over the Tor network but merely how to do it. Also, be aware that the BT protocol itself my reveal a nodes real IP. Be informed about the technologies you use.
Assuming you already have Torrentflux-b4rt installed and running.
- Install the Tor and Privoxy packages.
sudo apt-get install tor privoxy - Next, edit the Privoxy config file to forward requests to Tor
sudo nano /etc/privoxy/config - Uncomment or add the the following line in the Forwarding section:
forward-socks4a/localhost:9050 . - Save and close the file while remembering to restart the Privoxy service.
sudo /etc/init.d/privoxy restart
Now to hack the BitTornado client used by Torrentflux-b4rt.
- Edit the following file located in the Torrentflux-b4rt directory:
sudo nano /html/bin/clients/tornado/BitTornado/zurllib.py - Add the following to the
connect()method defined within thebtHTTPconclass:self.host = '127.0.0.1' self.port = 8118
- The full class should read:
class btHTTPcon(HTTPConnection): def connect(self): # proxy hack start self.host = '127.0.0.1' self.port = 8118 # proxy hack end HTTPConnection.connect(self) try: self.sock.settimeout(30) except: pass
- Next, alter the following line in the
_open()method defined within theurlopenclass to read:self.connection.request('GET', scheme + '://' + netloc + url, None, { 'User-Agent': VERSION, 'Accept-Encoding': 'gzip' } )
You can test if your trackers are being routed through Tor by uncommenting the logfile option in /etc/privoxy/config.
tail -50f /var/log/privoxy/logfile
Jan 06 05:19:44.360 Privoxy(437c4950) Request: vip.tracker.thepiratebay.org/announce?info_hash=%198un61bQ%102%7B%0Are%93C%9BD%93%A9%F6%C4%DB%AC%D8&peer_id=T13I-----e.0jIFpqnF7&port=49297&uploaded=138199040&downloaded=686426112&left=50331648&no_peer_id=1&compact=1&key=UKf9P-
Coming soon: Patch file for zurllib.py
Download: zurllib.patch
MD5SUM: 7bbb38bdf74a1dbdf7517d129af22e11
Copy patch to the /html/bin/clients/tornado/BitTornado/ directory and type:
patch -p0 < zurllib.patch

[...] Частичный Torify TorrentFlux [...]
Hi,
Thanks for this, i m searching to use a proxy over an extern server (not TOR) to forward tracker and download flux. can you give a little explanation about this ?
i wait since years to can setup a fuc***g proxy over TF. Thanks
You can use this hack with any proxy server, not just TOR. Just ignore the TOR/Privoxy bit and change the addresses and port to the proxy of your choice.