Skip to content

0xChimra/Flask-Hidden-Service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask-Hidden-Service :

Flask-Hidden-Service is a small project that tries to make creating Hidden Services using Flask easier, it uses Stem , a Python controller library for Tor . In this script, Stem routes the flask application's page over tor to create a so called "Tor Hidden Service", these services can only be reached with the Tor Browser or any requesting tool using a tor proxy.

⚠️ Important ⚠️ :

This script is still experimental and i cannot give any promise that it will work 100% fine, so do not rely on it not to leak.

Feature :

This script takes the desired Tor Control Port and if chosen, generates a custom torrc file, which contains the following :

  • Control Port
  • Socks Port ( automatically generated by default )
  • Cookie Authentication
  • Run Type ( Daemon )
  • Hashed Control Password ( will be auto generated )

To keep the flask-hidden-service-apps clean, you can import the script by importing the hidden_service.py file. This can be done by adding the following line in the import section of your program : from hidden_service import run_hidden_service .

Requirements :

  • To Install the requirements for the script, execute: pip install -r requirements.txt

Usage & Example :

Most Important Detail : ⚠️ DO NOT RUN THIS SCRIPT AS ROOT OR WITH SUDO ⚠️

In a normal flask-app you start the website by adding app.run() to the end of the program. Instead of doing that, you use the function provided by hidden_services called run_hidden_service and give it the Required data :

  • control_port = [PORT_YOU_CHOSE]
  • application = [THE_VAR_OF_YOUR_APP] ( example : app from the code app = Flask(__name__) )

Optional Data :

  • verbose = True or False ( this will turn the print functions of the script on or off )
  • leave_address_alive = True or False (if this is option is True the onion address will be saved and reused if the same control_port or hidden_dir_name gets selected again, ⚠️ the same hidden_dir_name must be used if it was used before ⚠️ )
  • socks_port = [CUSTOM_SOCKS_PORT] ( control_port + 1 by default )
  • flask_port = [CUSTOM_FLASK_PORT] ( control_port + 2 by default )
  • torrc_file = True or False ( this will turn the generation of a torrc file on or off, it is off by default )
  • tor_password = [CUSTOM_TOR_PASSWORD] ( if not specified, the password will be automatically generated )
  • hidden_dir_name = [CUSTOM_NAME] ( will set a custom name for the directory generated in /tmp )
  • show_requests = True or False ( this will turn the logging of requests to the website on or off )

This is an example usage of the run_hidden_service function provided by my script.

alt text

About

A module to create hidden services with flask

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages