Please move this tutorial if it is in the wrong section! Thanks. ~Null
This tutorial is meant to teach you how to anonymously host a hidden server using TOR. Websites using this method are commonly referred to as 'the Tornet', 'torpark', 'the Darknet', 'Onionland', or the 'Tor Hidden Services'. Yes, I'm talking about the '.onion' domains, infamous for hosting untraceable illegal markets, child porn, and other unpleasant things. Please note that I do not condone any of these things, and this tutorial is meant for good and not evil. If you go crazy making online drug markets and get caught, please don't blame me! Now, let's get started.
Download the TOR browser bundle from the TOR project website for your OS. The installation should be fairly straightforward. Once you finish installing the TOR browser bundle, start up TOR. For people to see your hidden service, you have to always be running TOR. After an encrypted connection is established, the specially configured Firefox browser ('Vidailia') should start up. If you want to check if TOR is working correctly, go to https://check.torproject.org
If the web page says you are using TOR, you have installed it correctly! Now shut down TOR for the next step.
- Step 2 - Configuring Server Software
What kind of server do you want? Hidden Services aren't just limited to web servers- you can anonymously host any type of server. Yes, even Minecraft servers. For web servers, the TOR, website recommends Savant web server on Windows over the all-powerful Apache web server. But like I said before, you can use any server software to host any type of server, provided you know how to locally host it. On Savant, click the 'Configuration' button. Set the 'Server DNS Entry' box to 'localhost'. This will host the web server locally, so right now only people on your LAN can see it. Also, take note of the port your server is being hosted on. Change it if you like. A good list of ports and what they are usually used for can be found at: http://en.m.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
Now would be a good time to enter some test content to test your server.
- Step 3 - Registering your Hidden Service
Now for the cool stuff. First off, make sure TOR isn't running at the moment. Then locate your torrc file. If you installed the TOR browser bundle like I told you to, the torrc file should be in the tor browser/data/tor directory. Open it with you're favorite text editor. I recommend Notepad++ or gedit! Now add this to the end of the file:
HiddenServicePort 80 127.00.1:80
But replace path/to/dir with a path to a directory of your choice. Please note it should NOT be the root directory of you're server. The HiddenServiceDir should be a unused directory just for the hidden service. For the HiddenServicePort, the first number should be the port you want your service accessible on. Leave 127.00.1 alone, and change the :80 to be the port your server is running on, that we saved earlier. Example: If you have a web server running on port 3333 on a windows computer, but want the server to be accessible from a normal web browser, you could type in:
HiddenServicePort 80 127.00.1:3333
Also please note you should create the directory you listed as the Hidden Service Dir if it doesn't already exist. Now you're ready to test the server! Save the torrc file, and restart TOR. Check the Message Log on the Vidailia Control Panel for errors. Of it's free of errors, go to the directory you listed as the HiddenServiceDir. There should be two files in it now: hostname, and private_key. Don't delete or modify anything in this directory! Keep the private key file safe, and never give it or what it contains to anyone, or else they will be able to steal your server. Open the hostname file in your favorite text editor. The text inside is your websites URL! It should look something like woxbwvslcuwbapfvwpa.onion. Don't edit this file! You can give this URL out to people who want to access your website. Try it out! You should find that you can only access the website with the .onion address.
- Step 4 - Optional Other Stuff
People often ask if there is any way to get a custom hostname, ie ininjas.onion.There is no way to totally customize your URL. However you can partially customize your hostname with software like Shallot. Shallot generates hostnames and private keys extremely fast until it finds one that includes the text you originally specified. It works great for small words, but as Shallots git page says, 'Generating an entire URL would take much longer than the universe in believed to exist.'. The Git Page also has a nice little table that shows numbers of characters and the amount of time it usually takes to generate an address with it. An average Shallot generated hostname looks like: ininjasxjwnbwfudp6j.onion. You can find Shallot at: https://github.com/katmagic/Shallot