How to set up Xchat with Tor + SASL

Prologue

Many who use IRC use the client Xchat, myself included. For some mobile tethering is their only means of internet; others may be facing problems with firewalls and ISP blocking. Setting your Xchat client to use the Tor network can help you around this.

In this post I will detail how to set up Xchat with Tor on Debian or Debian based OS. Part of this involves using SASL, an authentication protocol, since unauthenticated Tor connections are automatically blocked by most IRC servers (FreeNode in particular).

Procedure

I’ll assume you already have Xchat installed. In that case, the first step is to install Tor.

sudo apt-get install tor

Tor is a small package and should not take long to download. It will automatically daemonize and begin running.
Next you need to edit /etc/tor/torrc:

gksu your_favorite_editor /etc/tor/torrc

at the end of that file, append

# For FreeNode IRC
mapaddress 10.40.40.40 p4fsi4ockecnea7l.onion

Save the file and close.

Now you need to download and save a SASL plugin script to ~/.xchat2. You can download this file here: http://dl.dropbox.com/u/54881717/files/cap_sasl_xchat.pl
This file is available a few other places on the web as well.

With that completed, open up Xchat. Press the “Add” button to add a new network. Give the new network the name “free” (although any name will work). Next press “Edit”. In the top text box, replace “newserver/6667” with

10.40.40.40

Check “Connect to Selected Server Only” and “Use SSL for all the servers on this network” and close. Click the “Connect” button.

While Xchat futilely attempts to connect, type

sasl

You should be rewarded with this output:

 SASL [action] [action paramters]
     actions:
     load        reload SASL information from disk
     save        save the current SASL information to disk
     set         set the SASL information for a particular network
         set <net> <user> <passord or keyfile> <mechanism>
     delete      delete the SASL information for a particular network
         delete <net>

     show        display which networks have SASL information set
     mechanisms  display supported mechanisms

     help        show help message

If so, next type

/sasl set free your_nick your_password PLAIN

So if my username was (surprise) cortman, and my password was (it’s not) “squid”, I would write

/sasl set free cortman squid PLAIN

Press enter, and you should get this:

SASL: added free: [PLAIN] your_nick *

Almost there. Next go to the Settings tab and select Preferences. Go to the “Network Setup” tab. Here you will set the proxy server settings.
In the “Hostname” text box, type

127.0.0.1 (not localhost)

Set the port to 9050.
Set the type to Socks5.
And finally, set “Use proxy for:” to “IRC Server Only”.

Click ok and restart Xchat and connect to your “free” network. You should be connected!

Final Notes

While I have found tor to be the only way to use IRC in some cases (such as the ones outlined at the beginning), it often isn’t very reliable. Don’t be surprised if you cannot connect occasionally. Keep reconnecting, and the odds are you will eventually get through.

 

Advertisements