├── .gitignore ├── LICENSE ├── README.md ├── app ├── __init__.py ├── templates │ ├── base.html │ └── index.html └── views.py ├── run.py └── screenshots └── front.png /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | app.db 4 | search.db 5 | flask 6 | 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Satwik Kansal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tor-hidden-service-python 2 | 3 | > A simple boilerplate of creating a `.onion` website for Tor using Flask and Python. 4 | 5 | ## Table of Contents 6 | 7 | - [Instructions](#instructions) 8 | - [Screenshots](#screenshots) 9 | - [Contributing](#contributing) 10 | - [License](#license) 11 | 12 | ## Instructions 13 | 14 | - Download Tor browser from the official site ([link](https://www.torproject.org/download/download)) 15 | 16 | - Configure your hidden service. 17 | + Go to the Tor browser directory. 18 | + Open the "torrc" file in an editor. (Probably located in `Browser/TorBrowser/Data/Tor` directory) 19 | + Add the following lines to the file 20 | ``` 21 | HiddenServiceDir /any/path/where/you/want/config/to/be/stored 22 | HiddenServicePort 80 127.0.0.1:5000 23 | ``` 24 | + Save and close the file. 25 | 26 | - Clone this repository in your local system 27 | ```sh 28 | $ git clone https://github.com/satwikkansal/tor-hidden-service-python.git 29 | $ cd tor-hidden-service 30 | ``` 31 | 32 | - Install the pypi requirements 33 | ```sh 34 | $ pip -r requirements.txt 35 | ``` 36 | 37 | - Run the server 38 | ```sh 39 | $ python run.py 40 | ``` 41 | 42 | - Launch the Tor Browser 43 | 44 | - Copy the url generated in the `hostname` file 45 | ```sh 46 | $ cat /path/to/config/directory/hostname 47 | >>> some-obfuscated-url.onion 48 | ``` 49 | 50 | - Open this copied url in the Tor Browser and it should work :tada: 51 | 52 | 53 | ## Screenshots 54 | 55 |  56 | 57 | 58 | ## Contributing 59 | 60 | All patches welcome! 61 | 62 | 63 | ## License 64 | 65 | MIT License - see the [LICENSE](https://github.com/satwikkansal/tor-hidden-service-python/blob/master/LICENSE) file for details. 66 | -------------------------------------------------------------------------------- /app/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | 3 | app = Flask(__name__) 4 | 5 | from app import views -------------------------------------------------------------------------------- /app/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |21 | At [{{ post.time }}], {{ post.author.nickname }} says: {{ post.body }} 22 |
23 | {% endfor %} 24 |