Running a ToR Relay to Help the Dark Web

Oct 30, 2023
 

Create a ToR Relay

 

Setup Unattended Upgrades

 

1. Update Repo and Install Unattended Upgrades

#Update repositories

apt update

#install unattended upgrades

apt-get install unattended-upgrades apt-listchanges
 

2. Configure Unattended Upgrades

#open the config file in nano

nano /etc/apt/apt.conf.d/50unattended-upgrades
 

Remove this config from the file:

#add this config

Unattended-Upgrade::Allowed-Origins {
  "${distro_id}:${distro_codename}-security";
  "TorProject:${distro_codename}";
  };
  Unattended-Upgrade::Package-Blacklist {
  };
  
Unattended-Upgrade::Automatic-Reboot "true";
 

3. Test Unattended upgrades

unattended-upgrade --debug
 

Install ToR

 

1. Add Official ToR Repos


#Install prereqs

apt install apt-transport-https

 

Find your Debian version

cat /etc/debian_version
 

Create a new sources file


#Create the new file with nano

nano /etc/apt/sources.list.d/tor.list

 

Add these two repos

replace {yourdistro} with your Debian version

deb [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org {yourdistro} main
deb-src [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org {yourdistro} main
 

2. Add the GPG Key

wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null
 

3. Install ToR

apt update
apt install tor deb.torproject.org-keyring
 

Configure ToR

 

1. Open the ToR Configuration File

nano /etc/tor/torrc
 

2. Add the following config

## BASE CONFIG

Nickname 
ContactInfo your@e-mail 
ORPort 443 
ExitRelay 0
SocksPort 0

## BANDWIDTH
## The config below has a maximum of 800GB
## (up/down) per month, starting on the 1st 
## at midnight
AccountingMax 800 GB
AccountingStart month 1 0:00

## MONITORING

ControlPort 9051
CookieAuthentication 1

 

3. Enable ToR and Restart

systemctl enable tor
systemctl restart tor
 

Install Monitoring


## Installing Nyx

apt install nyx

## Run Nyx

nyx