Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

[Tutorial] How to host a TOR hidden service

IMPORTANT NOTE:
This is a minimal hidden service setup. This guide is not intended to be used to host illegal or otherwise dissalowed activities and is not designed to keep you anonymous. If you use this setup to host anything that could be considered "blackhat" you will most likely be de-anoynmized and busted! This is for educational purposes only.

Note: This setup is for LINUX, if you would like to set up a TOR Hidden Service. Click here for WINDOWS TOR Hidden Service.

[Image: XVcz7Fx.png]
How to host a TOR hidden service



Purpose: The purpose of this tutorial is to show users how to:
  • Install and Configure TOR
  • Setup a simple Hello World website
  • Configure a hidden service
  • Generate an .onion host (and how to customize it!)

Chapter 0: Prerequisites

Requirements:
  • Fresh Linux Server (For this tutorial, I will be using: Ubuntu Server 14.04)
  • Basic Knowledge of Linux
  • 1 Hour of Time

Chapter 1: Initial Setup

Server:
I have opted to use Amazon Web Services (AWS) for this tutorial. I am using ami-2d39803a, here are my instance details:
Spoiler (Click to View)


Don't worry about the security groups warning just yet, we will fix that later on.

Click Launch and you will get to a PEM key download page. Use an existing PEM or create a new one. I created a new one, named it Lrrr, and downloaded it...

Spoiler (Click to View)

Now that our instance is setup, we should have a public IP address assigned to us from AWS, time for the fun stuff.

Connect to your instance with the PEM you downloaded earlier
Code
ssh -i my_pem.pem -l ubuntu <instance IP address>

NOTE: As a member pointed out, if you are on windows and using putty;
(Sep 1, 2016 11:10 PM)SIM-2848947 Wrote:  One thing for anyone trying to connect to the instance with Putty. You need to download Putty Gen and change your .pem file into a putty private key (a .ppk). Then underneath Auth in putty you should be able to select the key.
Thank you RYDIOO!


Let's add some sources, and update the box:

Code
sudo nano /etc/apt/sources.list

At the end of the sources.list file, paste this:

Code
#Tor
deb http://deb.torproject.org/torproject.org trusty main
deb-src http://deb.torproject.org/torproject.org trusty main

CTRL+X and Y to save the file.

Now we need to add our keys, update the repo's, and install tor,nginx,make, and gcc:

Code
sudo gpg --keyserver keys.gnupg.net --recv 886DDD89
sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install tor deb.torproject.org-keyring -y
sudo apt-get install gcc unzip make libcurl4-openssl-dev nginx -y
sudo apt-get dist-upgrade

If all of this goes as planned, you should be able to run the following command and the output should say TOR is running:

Code
$ service tor status
* tor is running

If you have anything other than * Tor is running, check the output for any failures and post them here.

Chapter 2: Firewall & Routing

Remember when I said we would worry about the security group policies at a later time? Now is that time! Head back over to your AWS instance panel, highlight your instance, and choose "launch-wizard-n" where n is whatever the auto-increment has made it to, ie: launch-wizard-30.

Once you are at the Security Groups screen, you will see four (4) tabs in the bottom pane, click the INBOUND pane and select EDIT. If you have been following this guide, a single SSH rule exists for source "Anywhere". Change that source to "My IP". Save.

Because TOR works off a socks proxy, there is no need to open any ports other than port 22 (ssh) to access the server.

Chapter 3: Generating an .onion Host

Now that we have tor running, we need to make some modifications to our torrc file.

Code
sudo nano /etc/tor/torrc

find and remove the # symbol from the following:
  • #RunAsDaemon 1
  • #DataDirectory /var/lib/tor
  • #HiddenServiceDir /var/lib/tor/hidden_service/
  • #HiddenServicePort 80 127.0.0.1:80
  • The first option will run tor as a daemon
  • The second will set the main data directory to /var/lib/tor
  • The third will set a hidden service to be found in /var/lib/tor/
  • The fourth is stating port 80, meaning we want the hidden service to be some type of website.

Now when you restart tor, it will create the hidden_service directory and generate a new onion hostname:

Code
service nginx start; sudo service tor restart;
* Stopping tor daemon...                                                                                                                             [ OK ]
* Starting tor daemon...                                                                                                                             [ OK ]
sudo cat /var/lib/tor/hidden_service/hostname
3pet3xqf7phhqufd.onion

This should work *out of the box*. To test, go ahead and open your tor browser and head to the onion host you got from the last command and you should see:

Code
Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

Spoiler (Click to View)


Chapter 4: Onion Host Customization

So a random .onion host isn't cutting it for you, and you want a fancy host with some custom letters in the host...something like HFGodxqf7phhqufd.onion (not a real onion as of 31/08/2016)

For this, we will need to use a tool to bassicly "brute" (for lack of a better term). There are a few tools to help you do this:
  • Onionhash - Linux
  • Shallot - Linux
  • Eschalot - Linux
  • Scallion - Linux
  • Garlic - Windows

For this tutorial, I will be setting up and using Shallot, because I think it's the easiest to setup. Login to your server and run the following:

Code
sudo su
cd ~
wget https://github.com/katmagic/Shallot/archive/master.zip
unzip master.zip
cd Shallot-master/
./configure && make
cp ./shallot /usr/bin/shallot; chmod +x /usr/bin/shallot;

Now that we have shallot installed as a global script, we can test this by generating a test host:

Code
shallot ^Hack

This will start a search/brute of any onion host starting with "Hack"....according to Shallot's github page the following breakdown for how long this should take is as follows:

Characters | Time to generate
1 | Less than 1 second
2 | Less than 1 second
3 | Less than 1 second
4 | 2 seconds
5 | 1 minute
6 | 30 minutes
7 | 1 day

As you can see, the more precise you try to get, the longer it takes to generate the required keys.

For this test, I used the term "lol" to make a match quickly.

Code
shallot ^lol
---------------------------------------------------------------
Found matching domain after 17215 tries: lolaklefegf7caci.onion
---------------------------------------------------------------
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCmFppQ4OfaY1RljHXBRA0KjwT/NkqlxwGFYV3ExxBzYidIhi8b
qoTvyu0B/WCFcV9i8ZjcEDXB+BNDGMcDeBeL5LK4hHW+EMwlOTZOyVcoDHWJjlQq
x4T4V7lPP8eTdbuqCqRuzwOxuwb7iUCLn5wy/wdtmRoNQOwIoOFex9QauwIDAUw7
AoGAJ6PaljNDkMTVa9sr7wv5Nz4R1zd1VAm5eC6XsMKTs/WudoBEE8cR0BGsWbL4
HL4J6QSAtHUdkZMljy9FOifYG5Oa1gEcys4u46Xqh3f+BuQUIMuHX8n6Lod1n7cQ
WC5KJRjWf3hAC+aVumhGxv632WAKpVBbkQEnhwgr0MWyNMMCQQDTlLbUMub5r4hg
uq0VgAYHljdMU95wC9m/56dCyCmiqB/QjNTpMqL88Dfo5mE0/aQr6pEjqRfCxIHI
6POal8ppAkEAyPTqaSZxkPwZkJ4tgKlvfIi3XrybbY5E1q1u3kI6L8KY2/YlagaA
o60thbgUEQNlRjfgelTB/Rg9HuAua8RvgwJAX0a2GNtHfjlBIEeKPUNm7oe/4nRO
/XJfRRKV15mitkThfjVSbf0pAR6dP1tfnpTx9uXygh1RUDK/3MKVlAw0WwJAFhK1
W0S5Ge1eDIaVAB1mAvzJHLQTa4MzQDMWf7h/bXvd3I6vcUPZ8vg5ZDpLjooGP3H2
mJArAOTWMiqIiB/XJwJBAJro6e0qo2htUParsFteTxze4/1aGcdVrBwntPlc1uvD
Ri9aVGOnBdrTrVsOxzXSa6NcfNxqo90po6FGvHtknBE=
-----END RSA PRIVATE KEY-----

Now, with this info we can set your new host:

Code
cd /var/lib/tor/hidden_service/
echo "lolaklefegf7caci.onion" > hostname
echo "" > private_key; nano private_key;

now paste the key Shallot gave you into the private_key file and restart tor.

Code
service tor restart
* Stopping tor daemon...                                                                                                            [ OK ]
* Starting tor daemon...                                                                                                            [ OK ]

Open TOR browser and direct it to your new host: lolaklefegf7caci.onion

You should see your "Welcome to nginx!" message again.


Conclusion

Hopefully this tutorial helped you, if you have any questions on how or why this setup works, please don't hesitate to post below.

-Lrrr
(Jul 12, 2023 04:49 AM)-Scrub Wrote:  i fucked my friend in the ass while he sucked off his friend and then switched and then my friend fucked his friend in the ass and i fucked my friends friend in the ass and we all cummed on my friends friend..
Great tutorial OP!
Bookmarking this to read all of it later.
This is one amazing and detailed tutorial Lrrr.
Great job my man!
Amazing HQ tutorial by HQ user :)!
Very nice tutorial, thanks for sharing this Lrrr 🤝
This guide is very helpful to a lot of people thank you mate.
Thank's guys, let me know if you need help setting this up on your own!
(Jul 12, 2023 04:49 AM)-Scrub Wrote:  i fucked my friend in the ass while he sucked off his friend and then switched and then my friend fucked his friend in the ass and i fucked my friends friend in the ass and we all cummed on my friends friend..
I was 99.9999999% sure we could not discuss this stuff on Hf? Am I mistaken?
LOL, I'm glad someone copied + pasted this tutorial from other places. This tutorial is nowhere near being new. Great leeching, OP! Never thought this forum would partially mirror LeakForums

https://www.torproject.org/docs/tor-hidd...ce.html.en

I don't think that, you OP, realize the consequences, and the other lots of security measurements, which should be taken regarding having a darknet web server. Ubuntu is the WORST distribution of choice for this. If you're familiar with the development of the distribution, you'd know. I can't bother explaining. You can't just blindly-guide a lot of unacknowledged people like this.
(Sep 1, 2016 10:34 AM)Pharaoh1100 Wrote:  LOL, I'm glad someone copied + pasted this tutorial from other places. This tutorial is nowhere near being new. Great leeching, OP! Never thought this forum would partially mirror LeakForums

https://www.torproject.org/docs/tor-hidd...ce.html.en

I don't think that, you OP, realize the consequences, and the other lots of security measurements, which should be taken regarding having a darknet web server. Ubuntu is the WORST distribution of choice for this. If you're familiar with the development of the distribution, you'd know. I can't bother explaining. You can't just blindly-guide a lot of unacknowledged people like this.

Since I wrote the entire thing myself, I'd love for you to show me where I copied pasted anything. Thanks <3
(Jul 12, 2023 04:49 AM)-Scrub Wrote:  i fucked my friend in the ass while he sucked off his friend and then switched and then my friend fucked his friend in the ass and i fucked my friends friend in the ass and we all cummed on my friends friend..
(Sep 1, 2016 11:34 AM)Lrrr Wrote:  Since I wrote the entire thing myself, I'd love for you to show me where I copied pasted anything. Thanks <3

Right from where I've posted the link 🤝
This is way too basic information. You're not the first one to create this type of a tutorial.
(Sep 1, 2016 10:34 AM)Mino Wrote:  I was 99.9999999% sure we could not discuss this stuff on Hf? Am I mistaken?

We can discuss TOR and how it works, we can NOT discuss the other shit that happens there...

(Sep 1, 2016 11:35 AM)Pharaoh1100 Wrote:  Right from where I've posted the link 🤝
This is way too basic information. You're not the first one to create this type of a tutorial.

My tutorial at the very top stated "do not use this for blackhat or you will be de-anonymized". I did not cover any type of black-hat related topics because it is against HF rules.

And again, it is written word for word by me 🤝
(Jul 12, 2023 04:49 AM)-Scrub Wrote:  i fucked my friend in the ass while he sucked off his friend and then switched and then my friend fucked his friend in the ass and i fucked my friends friend in the ass and we all cummed on my friends friend..
(Sep 1, 2016 11:36 AM)Lrrr Wrote:  My tutorial at the very top stated "do not use this for blackhat or you will be de-anonymized". I did not cover any type of black-hat related topics because it is against HF rules.

And again, it is written word for word by me 🤝

You're only proving of having no idea about what you're writing. First of all, security measurements have nothing to do with Blackhat. These are 2 absolutely different things. Security measurement while imposing something illegal (blackhat) is called OpSec as an abbreviation of Operation Security. And operation security can be implemented not just for blackhat-related activities, but over-all because you have the will and rights to do so. Mostly, to defend yourself or something yours from receiving malicious files, or being targeted by malicious hackers. I.e: using a VPN for educational purpose, or just to hide your real IP by encrypting your network data.
It's not called a hidden service. These are the key-words exposing that you're leeching this information from another source, just a little re-modifying the form and structure of text. Yeah, there is some information added by you, but it's completely arrogant to say that this tutorial is 100%-written by you. This information exists way before your acknowledgement. It's called a darknet web server. It's called "hidden service", because it contains hidden partitions, ultimately spoofing a lot of things.

It's all ok just to mention that your tutorial is not fully-written by you.
Quote:You're only proving of having no idea about what you're writing. First of all, security measurements have nothing to do with Blackhat.
Are you aware of the rules on HF related to TOR? You should take this time to get acquainted with them.

Quote:It's not called a hidden service.
That's literally what it's called....

Quote:These are the key-words exposing that you're leeching this information from another source, just a little re-modifying the form and structure of text. Yeah, there is some information added by you, but it's completely arrogant to say that this tutorial is 100%-written by you.
While the subject of setting up a hidden service may very well have been covered countless time, I again state this tutorial is written by me. Sorry bro, I am still waiting for you to prove otherwise. Pro-tip: You can't

Quote:This information exists way before your acknowledgement.
I agree

Quote:It's called a darknet web server. It's called "hidden service", because it contains hidden partitions, ultimately spoofing a lot of things.
Didn't you tell me just above that it's NOT called a hidden service? Furthermore there is no hidden partition broski, its simply a SOCKS proxy loop into the TOR node.

Quote:It's all ok just to mention that your tutorial is not fully-written by you.
....but it is, and your just being a LQ troll. I'm done with your silly arguments. Believe whatever the fuck you want.
(Jul 12, 2023 04:49 AM)-Scrub Wrote:  i fucked my friend in the ass while he sucked off his friend and then switched and then my friend fucked his friend in the ass and i fucked my friends friend in the ass and we all cummed on my friends friend..
(Sep 1, 2016 11:56 AM)Lrrr Wrote:  While the subject of setting up a hidden service may very well have been covered countless time, I again state this tutorial is written by me. Sorry bro, I am still waiting for you to prove otherwise. Pro-tip: You can't



I agree

This is, literally, what leeching means, and you're confirming it. The information is freely-available anywhere else, but you've just took it and compiled it into a tutorial, ultimately leeching this information.

Let me simplify the meaning. This tutorial is written by you, but the information is taken from other places, which leads to leeching information.

Malicious hackers could target not just black-hat-related activity, but anything legal as well. Ergo, security measurement, ergo OpSec, ergo hackers could target your "hidden service". Thus, security measurements could be used not only for OpSec in regards of being secure, while imposing your activity to something illegal.

Hopefully you understand what I'm trying to say. I appreciate the effort putten into compiling it in a tutorial, but there is a huge amount of other tutorials. You should mention with what, your tutorial, is special.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by YugenAug 29, 2012 02:25 PM 1 100 Aug 29, 2012 02:25 PM
Last Post: PiraX
by tylergtylergMar 12, 2012 11:52 AM 10 248 Mar 12, 2012 11:52 AM
Last Post: tylergtylerg
by D3r1v4t1v3Jan 20, 2011 02:25 PM 17 126 Jan 20, 2011 02:25 PM
Last Post: Wet