Hidden IRC server over Tor

February 14, 2023    Article    456 words    3 mins read

Mixing Tor and IRC is a bit more complicated than simply downloading the Tor Browser, so I will explain how to install/configure an IRC server, connect this server to the Tor network and connect to the server as a client.

What is IRC?

IRC stands for Internet Relay Chat, is a text-based chat system for instant messaging. The process of IRC is based on client-server networking model. You might want to read more about IRC in the RFC-1459, RFC-2813 - Server protocol and RFC-2812 - Client protocol.

What is Tor?

Tor, short for The Onion Router, is free and open-source software for enabling anonymous communication. It directs Internet traffic through a free, worldwide, volunteer overlay network consisting of more than seven thousand relays. Using Tor makes it more difficult to trace a user’s Internet activity. Tor protects personal privacy, concealing a user’s location and usage from anyone performing network surveillance or traffic analysis. It protects user’s freedom and ability to communicate confidentially through IP address anonymity using Tor exit nodes.

Server configuration

The Linux installation used to host the server may be a remote Virtual Private Server (VPS), a Raspberry Pi or even just a personal server on your local network. I assume you are using a Debian-based distro, if not you should adjust your package manager accordingly.

Start by installing Tor and InspIRCd on your server:

$ sudo apt install inspircd tor

Configuration for the InspIRCd server can be found inside the /etc/inspircd/inspircd.conf file and you can read about the configuration here. Leave everything as default for now.

Open the Tor configuration file /etc/tor/torrc and add two lines to it:

HiddenServiceDir /var/lib/tor/my_hidden_irc_service
HiddenServicePort 6667

Start the InspIRCd server and Tor:

$ sudo systemctl start tor
$ sudo systemctl start inspircd

Give Tor a bit of time to connect to the Tor relays and you can test the connection now. First you need to figure out your address.

$ cat /var/lib/tor/my_hidden_irc_service/hostname

Client configuration

Open your IRC client and point it to the new Tor server address, set the port to 6667 and remember to configure the SOCKS5 proxy to use Tor: Address Port 9050 by default.

You may notice that after the onion address is looked up, the IP provided is the localhost address on the server itself, This is because Tor routes connecting clients to the server and does not at any point disclose the server’s public IP, so clients connecting to it see the server almost as if it were on their local network, rather than at a secret IP hidden by an onion address.

Now that your server is running, you can customize it like any other IRC server and begin inviting more users to interact with its channels.