-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
B/c ipv6 of Tor implements currently no DirPort I copied+pasted together the following solution to deliver a Tor exit notice over HTTP port of ipv6 too :
The python snippet runs under a non-privileged user w/o login shell :
$ cat ipv6-httpd.py import socket from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler
class MyHandler(SimpleHTTPRequestHandler): def do_GET(self): return SimpleHTTPRequestHandler.do_GET(self)
class HTTPServerV6(HTTPServer): address_family = socket.AF_INET6
def main(): server = HTTPServerV6(('::', 8181), MyHandler) server.serve_forever()
if __name__ == '__main__': main()
The ip6table rules to redirect fort 80 from outside to the local non-privileged port :
from=80 to=8181 $IPT -t nat -A PREROUTING -i enp3s0 -p tcp -m tcp --destination-port $from -j REDIRECT --to-ports $to $IPT -A INPUT -p tcp -m tcp --destination-port $to -j ACCEPT
And finally the script to start it during boot :
$> cat /home/simplehttp/ipv6-httpd.sh #!/bin/sh #
d=$(mktemp -d /tmp/XXXXXX) &&\ cd $d &&\ cp /etc/tor/tor-exit-notice_DE.html ./index.html &&\ nice python ~/ipv6-httpd.py 1>./log 2>&1
:-)
- -- Toralf pgp key: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 0076 E94E
On 05/21/2015 06:45 PM, Toralf Förster wrote:
nice python ~/ipv6-httpd.py 1>./log 2>&1
Gah - and of course never ever use this crap which just gives a nifty DDoS flank - therefore change this line to :
nice python2 ~/ipv6-httpd.py >& /dev/null
tor-relays@lists.torproject.org