A comprehensive wizard-style tool to install and configure a single-instance Tor hidden service on Debian/Ubuntu systems. It also sets up basic security (UFW, Fail2Ban), synchronizes the system clock, and optionally disables SELinux if present.
Disclaimer:
This script is intended for legitimate uses only. Operating hidden services or servers may be restricted or illegal in your jurisdiction. Always follow your local laws, and use Tor responsibly.
The Dark Web Server Wizard (setup_darkweb_server.py
) is an automated script that:
- Purges old Tor configurations to avoid conflicts with multi-instance setups.
- Installs single-instance Tor alongside security packages (
ufw
,fail2ban
,git
,build-essential
,openssl
). - Sets up a minimal Tor configuration (
/etc/tor/torrc
) that maps an.onion
address to local port 80. - Enables UFW firewall rules (allowing inbound on ports
22
,9050
, and80
only). - Enables Fail2Ban to mitigate brute-force attacks.
- Optionally disables SELinux, if detected.
- Synchronizes the system clock with
ntpdate
(important for Tor’s correct operation). - Flask Addons:
flask.py
: Deploys a minimal Flask site (“Exfil0 Here we go”) behind Tor.update_flask_site.py
: A wizard to change or replace the Flask site content/code after deployment.
This script interacts with you via yes/no prompts, making it easy to skip or include specific steps.
- Wizard-Style Prompts: Step-by-step approach, giving you full control over each operation.
- Fresh Tor Setup: Ensures no leftover multi-instance configs.
- Security Tools: Quickly hardens your server with UFW and Fail2Ban.
- Time Sync: Avoids Tor clock-related issues by installing and running
ntpdate
. - SELinux Handling: Gracefully disables SELinux if present; otherwise, it’s skipped.
- SSH Convenience: Optionally keeps SSH password authentication enabled for debugging (which you can disable later).
- Flask Deployment & Management:
flask.py
sets up a simple site.update_flask_site.py
provides a wizard to edit or replace the site’s content.
-
Clone or Download the Repository
git clone https://github.com/exfil0/Debian-Tor-Site-Engine.git cd Debian-Tor-Site-Engine
-
Make Scripts Executable
chmod +x setup_darkweb_server.py chmod +x site-deployment/flask.py chmod +x site-deployment/update_flask_site.py
-
Run the Main Wizard as Root
sudo ./setup_darkweb_server.py
You will be prompted with yes/no questions for each major step.
-
(Optional) Deploy the Flask Addon
sudo ./site-deployment/flask.py
- Installs Flask if not already present.
- Creates a simple “Exfil0 Here we go” landing page on port 80.
- (Optional) Sets up a systemd service to keep the Flask app running continuously.
-
(Optional) Modify the Flask Site Later
sudo ./site-deployment/update_flask_site.py
- Provides a wizard to replace the entire
app.py
or just edit the homepage text. - Optionally stops the systemd service before changes and restarts it afterward.
- Provides a wizard to replace the entire
-
Python 3 Requirement
On some systems, you may need to install Python 3 if it isn’t already present:
sudo apt-get update && sudo apt-get install -y python3
- Purge Old Tor? Recommended unless you need your existing Tor config.
- Sync Time? Highly recommended to ensure Tor works properly.
- Disable SELinux? Primarily for SELinux-enabled systems (like CentOS).
- Install Tor & Security Packages? Installs single-instance Tor, UFW, Fail2Ban, Git, etc.
- Write Minimal
torrc
? Creates/etc/tor/torrc
mapping.onion
to127.0.0.1:80
. - Enable & Start Tor? Waits for Tor to generate a
.onion
hostname. - Configure Security (UFW, Fail2Ban, SSH)? Locks down inbound ports except
22
,9050
,80
.
Once complete, you’ll have a .onion
address printed to your screen. To serve content:
- Run any server on
127.0.0.1:80
(e.g.,apache2
orpython3 -m http.server
). - Access your hidden service in Tor Browser at
http://YOUR_ONION_ADDRESS.onion
.
- Run
sudo ./site-deployment/flask.py
to install a minimal Flask app listening on port80
. - The landing page will display “Exfil0 Here we go.”
If you want to modify your Flask site’s text or upload a new code file, run:
sudo ./site-deployment/update_flask_site.py
This wizard can:
- Stop the systemd service (if configured).
- Replace your entire
app.py
or just edit the landing page message. - Restart the service so changes take effect immediately.
sudo journalctl -u tor -n 100 --no-pager
Shows the latest Tor logs. Adjust -n
as needed.
Enhance the sample Flask app with templating, user authentication, or database integration.
Optionally add scripts to index or monitor hidden services, or to crawl external onion links for research.
Integrate monitoring tools (like monit
or prometheus-node-exporter
) to track Tor uptime, server performance, and intrusion attempts.
-
Fork this repository.
-
Create a branch:
git checkout -b feature/new-feature
-
Commit your changes:
git commit -am 'Add some feature'
-
Push to your fork:
git push origin feature/new-feature
-
Open a Pull Request.
We appreciate bug reports, feature requests, and pull requests!
This project is open-source under the MIT License.
Feel free to fork and adapt it while attributing the original author(s).
Enjoy your new Tor hidden service and Flask site!