An enhanced version of the OnionScanner tool for scanning and analyzing .onion V3 domains on the Dark Web. This version features SQLite database integration, domain validation, persistence, and scalability for handling large datasets, optimized for efficient scanning of unique .onion V3 domains.
This project is an enhanced version of the .onion
domain scanner for the Dark Web, designed to efficiently process and analyze unique .onion
V3 domains. It includes databases, advanced validation, and optimization to handle large volumes of data.
- Introduction
- Key Features
- Improvements Over the Original Version
- Requirements
- Installation
- Configuration
- Usage
- Importing Domains from a Text File
- Project Structure
- Security Considerations
- Contributions
- License
- Acknowledgments
The OnionScanner project is an advanced modification of Darkweb_OnionScan, originally published by 4n6shetty. Since the original project has not been updated since February 23, 2021, it was decided to create this new repository with significant improvements in functionality, efficiency, and scalability.
The main objective of this project is to provide a robust and efficient tool for scanning and analyzing hidden services on the Tor network, specifically focusing on .onion
V3 domains.
- Specifically designed to process unique
.onion
V3 domains. - Avoids duplicates and invalid domains, including V2.
- Utilizes SQLite databases to store scan results and lists of
.onion
domains. - Implements validation for
.onion
domains to enhance data accuracy. - Offers increased persistence and scalability to handle large volumes of information.
- Allows automatic discovery and storage of new
.onion
domains found during scanning. - Implements error handling and timeout systems to manage connectivity issues.
- Utilizes multithreading to improve scanning efficiency.
-
Database Usage:
- Implementation of SQLite to store results and domain lists.
- Enables faster queries and better scalability.
- Facilitates later analysis of collected data.
-
Domain Validation:
- Includes specific validation for
.onion
V3 domains. - Improves the accuracy of stored data.
- Avoids unnecessary processing of invalid or outdated domains.
- Includes specific validation for
-
Enhanced Persistence:
- The database structure allows for more detailed and organized storage.
- Facilitates later queries and analysis.
- Maintains a history of scans for tracking and comparison.
-
Optimization:
- The use of SQLite significantly improves the efficiency in handling large volumes of data.
- Implementation of multithreading for simultaneous scanning.
- Tor identity change system to avoid blocking and improve anonymity.
-
Scalability:
- The new structure better supports the handling of large amounts of information.
- Facilitates the implementation of new features and scanning modules.
- Allows for future expansion to include more complex analyses.
- Python 3.7+
- Tor (configured to use control port 9051)
- OnionScan (modified version for V3 domains)
- Python Libraries:
stem
,sqlite3
For the proper functioning of this project, the OnionScan version from the repository mhatta/onionscan, created by mhatta, should be used. This is a modification of the original project s-rah/onionscan by s-rah.
-
Clone this repository:
git clone https://github.com/n4rr34n6/OnionScanner.git cd OnionScanner
-
Install the Python dependencies:
pip3 install -r requirements.txt
-
Install the modified version of OnionScan:
go get github.com/mhatta/onionscan
-
Ensure that Tor is installed and configured to use control port 9051.
-
Add the Go binaries directory to your PATH:
export PATH=$PATH:~/go/bin
-
Configure the Tor control password in the script (replace
_n4rr34n6_
with your actual password):torcontrol.authenticate("_n4rr34n6_")
-
Run the main script:
python3 OnionScanner.py
-
The script will begin scanning the
.onion
domains stored in the database. -
The results will be stored in the SQLite database and also saved as individual JSON files in the
onionscan_results
directory. -
To query the results, you can use the functions of the
OnionDatabase
class or query the SQLite database directly.
An additional script, migrate_from_file_to_db.py
, is provided to facilitate the migration of .onion
domains from a text file into the SQLite database. This is particularly useful for users who may already have a list of domains and want to quickly import them without manual entry.
-
Ensure you have your
.onion
domains listed in a text file, with each domain on a new line. For example, create a file namedonion_dir_list.txt
. -
Run the migration script by specifying the path to your text file and the database path:
python3 migrate_from_file_to_db.py
OnionScanner.py
: Main script that manages the scanning process.OnionStorage
: Class for handling storage of.onion
domains.OnionDatabase
: Class for handling storage of scan results.run_onionscan()
: Function to run OnionScan on a specific domain.process_results()
: Function to process and store the results of the scan.add_new_onions()
: Function to add newly discovered domains during the scan.
- This script interacts with the Tor network and hidden services. Ensure you understand the security and privacy implications before using it.
- It is recommended to run this script in a virtual machine or an isolated environment.
- Using this tool to scan services without authorization may be illegal. Use it only for ethical and legal purposes.
- The Tor control password is hardcoded in the script. Consider implementing a more secure method to handle this sensitive information.
Contributions are welcome. Please follow these steps:
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature/AmazingFeature
). - Make your changes and commit (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a Pull Request.
For significant changes, please open an issue first to discuss what you would like to change.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for more details.