I ran into the problem, that i wanted to connect to one irc-net via tor while connecting to the rest just “normal”. There is a small wrapper script called “torify” within the tor-packet (at least on debian based distros), which can, as the name implies, force applications to use the tor-network instead of just going straight to the net.
Torifying the whole irssi instance was no option, because there are some irc-nets who don’t like tor, or you have at least fill in some magic to make it work.
Here is the point where znc comes into play. znc is a nice little bnc with a lot of optional modules, that’s why i prefer it to other bnc’s like psyBNC.
The short version: we just torify the znc, let it connect to the ircnet we want, and then tell irssi to connect to the znc. Of course, the connection between irssi and znc could be seen as a security-risk, but in this case, they both run on the same server, so the risk is kind of limited to a minimum.
The longer version: I use the Telecomix Network as an example. At the moment, the guys have two hidden services at
- ctcj7wybt4naqpqk.onion
- kci6ipu55m43qsdj.onion
which listen on port 6667
First install tor (e.g.: sudo apt-get install tor) and edit the config file (e.g.: nano /etc/tor/torrc). For each hidden service add a line like this at the end of the file: mapaddress <ip-adress> <hidden-service> in our example this would be:
mapaddress 10.40.40.40 ctcj7wybt4naqpqk.onion
mapaddress 10.40.40.41 kci6ipu55m43qsdj.onion
The ip-addresses are free to choose, just make sure they don’t collide with any other ip you may have used somewhere.After that, reload your tor-service (e.g.: /etc/init.d/tor reload)
Then install znc (e.g.: sudo apt-get install znc) and start it with “znc -makeconf”. Now you get an interactive dialogue where you can create your new config. The settings are really self explanatory. As a port to listen to, you choose one above 1024 and you’ll be fine. I chose for example 31337. When it asks you about server names and ports, just tell it to connect to 10.40.40.40 and 10.40.40.41 on the standard irc-port 6667.
When you are finished, just start your znc by typing “torify znc”.
Now, within irssi just connect to your znc instance by typing “/connect 127.0.0.1 31337″ and you should be greetet by a passwort prompt, where you login with username and password you just choose during the config-making. If everything works fine, a nice telecomix logo appears and you are connected to the ircnet via a hidden service.