How to get a custom domain name for Tor hidden service
Anyone can create their own Tor hidden service. You can find detailed instructions on how to do this by following the links
- How to set up Tor hidden service in Debian (Kali Linux, Linux Mint, Ubuntu)
- How to install Tor and create Tor hidden service on Windows
The hidden service address ends in .onion, always consists of 56 characters (this is in version 3, and in version 2 the addresses consist of 16 characters), which can be any small letters and numbers from 2 to 7. These addresses are generated automatically, and usually they are an unreadable set of characters, almost impossible to remember.
However, it is possible to get a .onion domain name that contains or starts with the string you want (main site domain, your name, service name, etc.). For example, the address hacking5xcj4mtc63mfjqbshn3c5oa2ns7xgpiyrg2fenl2jd4lgooad.onion starts with “hacking” string. If you clicked on the link, and the page was unavailable, then you are not connected to the Tor network - you need to open it, for example, in the Tor Browser. Another good, in my opinion, domain name with a lot of repeating letters is hackwareennyyxdk.onion (address for the second version), it is also good if after the desired line (site or company name) there is a number, for example, hackware6r2lay6j.onion, kalitools3cfvozx.onion, hacktools5nfie4s.onion.
You cannot customly create a .onion domain name, but you can create a large number of random names and choose the appropriate ones from them. With the help of Scallion you can automate and speed up this process by using a graphics card. It looks for domain addresses that match one of the entered regular expressions, but it only works with the second version. There is mkp224o program for TOR Onion v3 vanity, but it only works on the central processor. We'll cover both of these programs in this article.
Transition from TOR Onion service version 2 to Onion 3
TOR Onion version 2 hidden services will stop working in October 2021. Check the Tor logs to find out which version you are using. If you see the following line there, then you are using the second version and you need to upgrade to the third:
Jan 23 09:28:09.671 [warn] DEPRECATED: Onion service version 2 are deprecated. Please use version 3 which is the default now. Currently, version 2 is planned to be obsolete in the Tor version 0.4.6 stable series.
If you are interested, you can check out the Tor Rendezvous Specification - Version 3 for yourself. I’ll look at what this transition means in practice.
In practice, this means:
- change of software for generating beautiful names for hidden service
- you need to inform visitors about the new address of your server
The most annoying thing is that at present I have not been able to find a program that would generate beautiful names of hidden Tor services on the video card. There is software that runs only on the central processor. The excellent Scallion program only supports TOR Onion service version 2 and will probably never support the third version as the authors announced that they had abandoned the project.
How to get beautiful name TOR Onion v3 vanity
There are several programs for generating beautiful names of hidden services, they all run on the CPU, some have already been sent to the archive by the authors:
- mkp224o: https://github.com/cathugger/mkp224o
- horse25519: https://github.com/Yawning/horse25519
- oniongen-go: https://github.com/rdkr/oniongen-go
- oniongen-c: https://github.com/rdkr/oniongen-c
I will show an example of generating a beautiful name using the mkp224o program as an example.
How to install mkp224o - a program for generating beautiful names TOR Onion v3 vanity
Let's start by installing the dependency to compile this program.
On Debian, Kali Linux, Linux Mint, Ubuntu and their derivatives, run:
sudo apt install gcc libsodium-dev make autoconf git
On Arch Linux, Manjaro, BlackArch and their derivatives, run:
sudo pacman -S libsodium autoconf gcc
Further, it is the same on all distributions:
git clone https://github.com/cathugger/mkp224o cd mkp224o/ ./autogen.sh ./configure make ./mkp224o -h
Installation on Windows
Go to the official website of the program on the release page: https://github.com/cathugger/mkp224o/releases and download the archive “mkp224o-*-w64.zip”.
Unpack the downloaded archive.
For simplicity, rename the folder, for example, “mkp224o-*-w64.zip” to “mkp224o”.
To work with the program, you need to run it on the command line. If you do not know what this is, then read the article “How to set up the PowerShell environment on Windows and Linux”.
1. Let's open PowerShell - for this press Win+x and select “Windows PowerShell”.
2. Suppose the mkp224o.exe file is located in the C:\Users\MiAl\Downloads\mkp224o\ folder, go to it using the cd command:
cd C:\Users\MiAl\Downloads\mkp224o\
3. To start generating addresses of the hidden Tor service, run a command of the form (replace hackware with the word you need):
./mkp224o.exe hackware
How to use mkp224o
To start generating the names of hidden services, run a command like:
./mkp224o FILTER1 FILTER2 FILTER3 FILTER4
For example, to generate (or rather filter out) names with the string “hack” in their name:
./mkp224o hack
By default, keys will be saved to the current folder. In order not to litter in the current folder, let's create a new one:
mkdir hackware
And using the -d option, we specify the folder where we want to save the generated keys:
./mkp224o -d hackware hackware
You can run it with several filters at once:
./mkp224o -d hackware hackware kalitools hacktools
Filters do not need to be specified on the command line - they can be taken from a file. For a complete list of options for the mkp224o program, see this page: https://en.kali.tools/?p=1210
How to use the generated keys
If it was possible to generate a key suitable for filters, then one or several folders will be created, for example: hacking5xcj4mtc63mfjqbshn3c5oa2ns7xgpiyrg2fenl2jd4lgooad.onion
There are three files in each folder:
- hostname
- hs_ed25519_public_key
- hs_ed25519_secret_key
In the folder name, as well as in the hostname file, you can see the name of your home.
Technically only hs_ed25519_secret_key is required, but you can copy the entire folder to where you want to store the keys. For example, by default they are located in the /var/lib/tor/hidden_service/ folder.
In the following example, I move the keys folder to the /var/lib/tor/hackware directory:
sudo mv /media/sf_Share/hacking5xcj4mtc63mfjqbshn3c5oa2ns7xgpiyrg2fenl2jd4lgooad.onion /var/lib/tor/hackware
Set the correct owner and permissions.
On Debian, Kali Linux, Linux Mint, Ubuntu and derivatives:
sudo chown -R debian-tor: /var/lib/tor/hackware sudo chmod -R u+rwX,og-rwx /var/lib/tor/hackware
On Arch Linux, Manjaro, BlackArch run:
sudo chown -R tor: /var/lib/tor/hackware sudo chmod -R u+rwX,og-rwx /var/lib/tor/hackware
Include these keys in the /etc/tor/torrc file:
sudo gedit /etc/tor/torrc
For instance:
HiddenServiceDir /var/lib/tor/hackware/ HiddenServicePort 80 127.0.0.1:80
We restart the service and check its status:
sudo systemctl restart tor systemctl status tor
See also articles:
- How to set up Tor hidden service in Debian (Kali Linux, Linux Mint, Ubuntu)
- How to install Tor and create Tor hidden service on Windows
How to get a nice name TOR Onion v2 (Scallion instruction)
Attention! Scallion only supports TOR Onion service version 2 and apparently will never support the third version as the authors announced that they had abandoned the project.
The program works on Linux and Windows. I'll show you how to work with the program using Windows as an example.
The source code of the program is located on this page. There you can also find a link to download an executable file for Windows, at the moment the latest version is 2.1, a link to it.
Unpack the downloaded archive. The program must be run on the command line. To do this, open the command line Widnows (Win+x) and drag the scallion.exe file there.
After a space, write down the phrase you are interested in and press Enter. At each launch, a quick SHA-1 test is performed and then the search begins. If the word is short, the result will be found quickly.
Through the syntax of primitive regular expressions, Scallion supports single or multiple searches. Only character classes are supported (for example, [abcd]). Symbol . (dot) means any character. By default, the entered phrase is considered the beginning of the domain name. If you are searching in the end of the name, then add $ to the end of the phrase (for example, DEAD$). Finally, the pipe character (for example, pattern1|pattern2) can be used to search across multiple patterns at once. Adding a lot of regular expressions has almost no performance impact.
Scallion examples
Generate a domain name starting with the prefix phrase followed by any digit:
scallion.exe prefix[234567]
Search multiple patterns at the same time (remember that the -c option makes scallion keep generating even if the result is already found)
scallion.exe -c prefix scallion hashes scallion.exe -c "prefix|scallion|hashes"
Search with the ending “badbeef”
scallion.exe .........badbeef scallion.exe --gpg badbeef$ $ # Generate GPG key
A tricky but obvious example:
scallion.exe "suffixa$|suffixb$|prefixa|prefixb|a.suffix$|a.test.$"
Scallion Help
Usage:
scallion [OPTIONS]+ regex [regex]+
Searches for a tor hidden service address that matches one of the provided regexes.
Options:
-k, --keysize=VALUE Specifies keysize for the RSA key -n, --nonoptimized Runs non-optimized kernel -l, --listdevices Lists the devices that can be used. -h, -?, --help Displays command line usage help. --gpg GPG vanitygen mode. -d, --device=VALUE Specifies the opencl device that should be used. -g, --groupsize=VALUE Specifies the number of threads in a workgroup. -w, --worksize=VALUE Specifies the number of hashes preformed at one time. -t, --cputhreads=VALUE Specifies the number of CPU threads to use when creating work. (EXPERIMENTAL - OpenSSL not thread-safe) -p, --save-kernel=VALUE Saves the generated kernel to this path. -o, --output=VALUE Saves the generated key(s) and address(es) to this path. --skip-sha-test Skip the SHA-1 test at startup. --quit-after=VALUE Quit after this many keys have been found. --timestamp=VALUE Use this value as a timestamp for the RSA key. -c, --continue Continue to search for keys rather than exiting when a key is found. --command=VALUE When a match is found specified external program is called with key passed to stdin. Example: "--command 'tee example.txt'" would save the key to example.txt If the command returns with a non-zero exit code, the program will return the same code.
Using Scallion Results
Usually, the automatically generated domain name and private key are located in the /var/lib/tor/hidden_service/ folder. Copy your new domain name to the hostname file, and the private key to the private_key.
You can find a detailed description of launching a hidden service here and here.
Related articles:
- How to install Tor and create Tor hidden service on Windows (100%)
- How to set up Tor hidden service in Debian (Kali Linux, Linux Mint, Ubuntu) (98.7%)
- How to make proxy with Tor in Windows (58.3%)
- Tor tips and usage examples (58.3%)
- Anonymous scanning through Tor with Nmap, sqlmap or WPScan (57%)
- How to hack a Windows password (RANDOM - 1.3%)