{"id":22665266,"url":"https://github.com/volkansah/run-multiple-tor-instances","last_synced_at":"2025-04-12T08:44:08.868Z","repository":{"id":162582765,"uuid":"615041330","full_name":"VolkanSah/run-multiple-Tor-instances","owner":"VolkanSah","description":"run multiple Tor instances with different configuration files (torrc) to host different hidden services on the same machine","archived":false,"fork":false,"pushed_at":"2024-07-10T08:08:21.000Z","size":325,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T03:51:14.140Z","etag":null,"topics":["bash","config","configuration","hidden-service","hidden-services","hidden-webservice","host","instance","multiple-torrc","shell","tor","tor-instance","torch","torrc"],"latest_commit_sha":null,"homepage":"https://volkansah.github.io/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VolkanSah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["VolkanSah"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-03-16T20:42:33.000Z","updated_at":"2024-11-26T10:16:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"1b5a9416-d39a-4878-8231-498e6d1af8a2","html_url":"https://github.com/VolkanSah/run-multiple-Tor-instances","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolkanSah%2Frun-multiple-Tor-instances","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolkanSah%2Frun-multiple-Tor-instances/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolkanSah%2Frun-multiple-Tor-instances/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolkanSah%2Frun-multiple-Tor-instances/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VolkanSah","download_url":"https://codeload.github.com/VolkanSah/run-multiple-Tor-instances/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248543825,"owners_count":21121837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","config","configuration","hidden-service","hidden-services","hidden-webservice","host","instance","multiple-torrc","shell","tor","tor-instance","torch","torrc"],"created_at":"2024-12-09T13:29:49.062Z","updated_at":"2025-04-12T08:44:08.837Z","avatar_url":"https://github.com/VolkanSah.png","language":null,"funding_links":["https://github.com/sponsors/VolkanSah","https://github.com/sponsors/volkansah"],"categories":[],"sub_categories":[],"readme":"# Multiple Tor Instances for Hidden Services/Tunnels\n\n![Screenshot](more_onions.jpg)\n###### Image K.I generated\n\nRun multiple Tor instances with different configuration files (torrc) to host different hidden services/tunnels on the same machine. This setup is particularly useful when working with tools like SoCat for offensive security purposes.\n\n## Table of Contents\n- [Prerequisites](#prerequisites)\n- [Setup Instructions](#setup-instructions)\n  - [1. Install Tor Service](#1-install-tor-service)\n  - [2. Create Configuration Directories](#2-create-configuration-directories)\n  - [3. Create Configuration Files](#3-create-configuration-files)\n  - [4. Set Up Directories and Permissions](#4-set-up-directories-and-permissions)\n  - [5. Create Systemd Service Files](#5-create-systemd-service-files)\n  - [6. Reload Systemd and Start Services](#6-reload-systemd-and-start-services)\n  - [7. Check Service Status](#7-check-service-status)\n  - [8. Retrieve .onion Addresses](#8-retrieve-onion-addresses)\n- [Ethical Guidelines](#ethical-guidelines)\n- [License](#license)\n\n## Prerequisites\n\nMake sure you have the Tor service installed on your system.\n\n## Setup Instructions\n\n### 1. Install Tor Service\n\nEnsure Tor is installed on your system:\n```\nsudo apt-get install tor\n```\n\n### 2. Create Configuration Directories\n\nCreate a new directory for each hidden service configuration:\n```\nsudo mkdir -p /etc/tor/instances/hidden_service_1\nsudo mkdir -p /etc/tor/instances/hidden_service_2\n```\nReplace `hidden_service_1` and `hidden_service_2` with the desired names for your hidden services.\n\n### 3. Create Configuration Files\n\nCreate new configuration files for each hidden service:\n```\nsudo nano /etc/tor/instances/hidden_service_1/torrc\nsudo nano /etc/tor/instances/hidden_service_2/torrc\n```\nAdd the following configuration to each torrc file, adjusting the `HiddenServiceDir` and `HiddenServicePort` values as needed:\n```\nRunAsDaemon 1\nDataDirectory /var/lib/tor/instances/hidden_service_1\nPidFile /var/run/tor/instances/hidden_service_1.pid\nSocksPort 0\nHiddenServiceDir /var/lib/tor/hidden_service_1/\nHiddenServicePort 80 127.0.0.1:8080\n```\nReplace `hidden_service_1` with the appropriate hidden service name, and adjust the `HiddenServicePort` value to point to the correct local address and port for the associated web service (e.g., Nginx reverse proxy listening on a different port for each hidden service).\n\nSave the changes and exit the editor.\n\n### 4. Set Up Directories and Permissions\n\nCreate the required directories and set the correct ownership for the data directories:\n```\nsudo mkdir -p /var/lib/tor/instances/hidden_service_1\nsudo mkdir -p /var/lib/tor/instances/hidden_service_2\nsudo chown -R debian-tor:debian-tor /var/lib/tor/instances\n```\n\n### 5. Create Systemd Service Files\n\nCreate a new systemd service file for each Tor instance:\n```\nsudo nano /etc/systemd/system/tor@hidden_service_1.service\nsudo nano /etc/systemd/system/tor@hidden_service_2.service\n```\nAdd the following content to each systemd service file, adjusting the `hidden_service_1` and `hidden_service_2` values as needed:\n```\n[Unit]\nDescription=Tor Hidden Service %I\nAfter=network.target\n\n[Service]\nUser=debian-tor\nType=simple\nExecStart=/usr/sbin/tor -f /etc/tor/instances/%I/torrc\nRestart=on-failure\n\n[Install]\nWantedBy=multi-user.target\n```\nSave the changes and exit the editor.\n\n### 6. Reload Systemd and Start Services\n\nReload the systemd configuration:\n```\nsudo systemctl daemon-reload\n```\nEnable and start the new Tor instances:\n```\nsudo systemctl enable tor@hidden_service_1.service\nsudo systemctl start tor@hidden_service_1.service\nsudo systemctl enable tor@hidden_service_2.service\nsudo systemctl start tor@hidden_service_2.service\n```\n\n### 7. Check Service Status\n\nCheck the status of the new Tor instances to ensure they are running correctly:\n```\nsudo systemctl status tor@hidden_service_1.service\nsudo systemctl status tor@hidden_service_2.service\n```\n\n### 8. Retrieve .onion Addresses\n\nRetrieve the .onion addresses for your hidden services:\n```\nsudo cat /var/lib/tor/hidden_service_1/hostname\nsudo cat /var/lib/tor/hidden_service_2/hostname\n```\n\nNote the .onion addresses for each hidden service, as you will use them to access the respective services.\n\nNow you have multiple Tor instances running with different torrc files, each hosting a separate hidden service/tunnel.\n\n## Ethical Guidelines\n\nThis information is intended for educational purposes and to support ethical security testing. It is crucial to use these instructions responsibly. Unauthorized use of this knowledge for malicious purposes is strictly prohibited.\n\n- **No Unauthorized Use**: Do not use these instructions to access, disrupt, or compromise any systems or networks without explicit permission from the owner.\n- **Ethical Responsibility**: Use these instructions to improve security, understand network anonymity, and for lawful research and educational purposes only.\n- **No Support for Malicious Activities**: Any requests for assistance with illegal activities will be ignored.\n\n## Your Support\nIf you find this project useful and want to support it, there are several ways to do so:\n\n- If you find the white paper helpful, please ⭐ it on GitHub. This helps make the project more visible and reach more people.\n- Become a Follower: If you're interested in updates and future improvements, please follow my GitHub account. This way you'll always stay up-to-date.\n- Learn more about my work: I invite you to check out all of my work on GitHub and visit my developer site https://volkansah.github.io. Here you will find detailed information about me and my projects.\n- Share the project: If you know someone who could benefit from this project, please share it. The more people who can use it, the better.\n**If you appreciate my work and would like to support it, please visit my [GitHub Sponsor page](https://github.com/sponsors/volkansah). Any type of support is warmly welcomed and helps me to further improve and expand my work.**\n\nThank you for your support! ❤️ S. Volkan Kücükbudak\n\n## License\n\nThis project is licensed under the MIT - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolkansah%2Frun-multiple-tor-instances","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvolkansah%2Frun-multiple-tor-instances","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolkansah%2Frun-multiple-tor-instances/lists"}