Skip to main content

torspy is a Python package for exploring .onion sites via Tor. It scrapes HTML content, localizes text, and detects hidden directories. With subdomain scanning, torspy enables thorough reconnaissance.

Project description

torspy

GitHub GitHub last commit PyPI PyPI - Python Version PyPI - Downloads

torspy is a robust Python package fortified with powerful algorithms, designed for seamless exploration of websites, including both normal and .onion sites via the Tor network. Its arsenal includes adept scraping of HTML from URLs, precise text localization within the acquired content, and proficient storage of findings. Moreover, torspy boasts formidable subdomain scanning capabilities, enabling thorough reconnaissance across diverse subdomains. Additionally, it excels at detecting hidden directories, further enhancing its efficacy in navigating and extracting valuable information from the web. torspy also features advanced content analysis, comprehensive link extraction, detailed service information retrieval, and efficient content downloading, making it an indispensable tool for web exploration and analysis.

Index

Advantages

  • torspy is easy to use

  • Many hidden directories can be found using torspy

  • Each request torspy makes for your purpose will be anonymous

  • torspy can be used to extract required text or content from the website

  • HTML files can be downloaded using torspy

  • With torspy you can search for the files you need

  • torspy is the leading package for dark web scraping.

  • Finding links from onion sites

  • Finding services from onion sites

  • Download files from onion sites

  • Analyzing onion sites

- torspy is the leading package for dark web scraping.

Disadvantages

  • Since requests are made using the Tor network, this tool will run slowly

  • The probability of finding hidden directories, subdomains and files is less than 20%

  • Sometimes you have to wait some time for this tool to work

  • Some processes may take time to complete

When using torspy tool you must use Tor otherwise it won't work : $ tor

Coding

Installation

You can install torspy via pip:

pip install torspy

Usage

Command-Line Interface

torspy allows you to interact with .onion sites from the command line:

Command 01

  • To display the content of a .onion site:
torspy http://example.onion
  • When the above command is run, a request goes through the Tor network to that onion site, and then the HTML page of the onion site is displayed on your terminal.

command 02

  • To save the displayed content to a file:
torspy http://example.onion -s file.html
  • The -s flag indicates saving, and you can specify any file name.

  • The above command transfers the entire HTML code that were printed on your terminal to another file

  • Also you can change the name of file.html to any name of your choice

command 03

  • How to move this file to a directory of your choice
torspy http://example.onion -s file.html -d /path/home/
  • -d stands for directory

  • Given after -d is your path and if you run the above command your file will move to the given path

command 04

  • Search only the content you need from Onion sites
torspy http://example.onion --find “search query”
  • If you enter the above command it will search only the content you need from the given onion site and print it.

  • The command --find means to search

command 05

    • To search for specific text within the content and save the results to a file
torspy http://example.onion --find “search query” -s search_results.html
  • If you enter the above command it will search for the content you need from the site you provided and then transfer all that content to another file.

command 06

  • How to search for content and move it to another directory
torspy http://example.onion --find “important information” -s results.html -d /path/to/directory
  • If you run the above command it will search for the content you need from the given onion site and then move it to a file and then move it to the directory you specified.

Message

  • important Remember that when trying to find subdomains, as well as trying to find directories, the success rate is only 20%.
  • Finding directories and subdomains for onion sites is more challenging than for regular websites because onion sites are part of the dark web, which is intentionally designed to be less accessible and more private.

command 07

  • Command that finds the directories on the onion site
torspy http://example.onion --dir directories-list.txt
  • This process may take some time

  • If you run the command above it will search for directories from the onion sites you provided

  • The command --dir stands for directories

  • This command performs directories scanning on the .onion site using the list of directories provided in the directories-list.txt file.

command 08

  • How to move all the lists of directories you got into another file
torspy http://example.onion --dir directories-list.txt -s output.txt
  • If you run the above command all the directory lists you get will be moved to another file

  • Also you can move this file to other directory or other path using -d command

command 09

  • Command that finds subdomains in onion site
torspy http://example.onion --sub subdomain-list.txt
  • This process may take some time

  • If you run the command above it will search for subdomains from the onion sites you provided

  • The command --sub stands for subdomains

  • This command performs subdomains scanning on the .onion site using the list of subdomains provided in the subdomains-list.txt file.

command 10

  • How to move all the lists of subdomains you got into another file
torspy http://example.onion --sub subdomain-list.txt -s output.txt
  • If you run the above command all the subdomains lists you get will be moved to

  • another file

  • Also you can move this file to other directory or other path using -d command

command 11

  • Command that analyzes content of an onion site
torspy http://example.onion --analyze
  • If you run the command above it will analyze the content of the onion site you provided.
  • The command –-analyze performs content analysis on the .onion site.

command 12

  • How to transfer the analyzed data to a file
torspy http://example.onion --analyze -s file-name.html
  • You can name the file whatever you want { chnage file-name.html }

command 13

  • Command that downloads content from an onion site
torspy http://example.onion --download -s filename
  • If you run the command above it will download the content of the onion site you provided and save it to the specified file.
  • The command –-download performs content downloading.
  • example : torspy http://example.onion –-download -s index.html , torspy http://example.onion –-download -s data.jpg
  • The command -s specifies the file name to save the downloaded content.

command 14

  • Command that finds links on an onion site
torspy http://example.onion --links
  • If you run the command above it will find all links on the onion site you provided.
  • The command –-links performs link extraction.

command 15

  • Command to convert all links into one file
torspy http://example.onion --links -s file-link.txt
  • After running the above command all the links will be changed to the file you have given

command 16

  • Command that gets service info of an onion site
torspy http://example.onion --service
  • If you run the command above it will retrieve service info of the onion site you provided.
  • The command –-service performs service information retrieval.
  • You can use -s to save

command 17

  • For more information on available options, you can use the --help flag:
torspy --help

Using torspy in a Bash Script

  • You can incorporate torspy into your Bash scripts for automated tasks. Here's an example script that fetches content from a list of .onion URLs and saves it to individual files:
#!/bin/bash

# List of .onion URLs
urls=("http://example1.onion" "http://example2.onion" "http://example3.onion")

# Loop through each URL
for url in "${urls[@]}"; do
    # Fetch content and save to a file
    torspy "$url" -s "${url##*/}.html"
done

Integrating torspy with Other Languages

Ruby

  • You can call the torspy command-line tool from Ruby using the system method:
system("torspy http://example.onion -s output.html")

Python

  • You can use the subprocess module to call torspy from a Python script:
import subprocess

subprocess.run(["torspy", "http://example.onion", "-s", "output.html"])

PHP

  • You can use the shell_exec function to call torspy from PHP:
<?php
shell_exec("torspy http://example.onion -s output.html");
?>

Node.js

  • You can use the child_process module to call torspy from Node.js:
const { exec } = require('child_process');

exec('torspy http://example.onion -s output.html', (error, stdout, stderr) => {
    if (error) {
        console.error(`Error: ${error.message}`);
        return;
    }
    if (stderr) {
        console.error(`Stderr: ${stderr}`);
        return;
    }
    console.log(`Output: ${stdout}`);
});

How torspy Works

torspy utilizes the following process to interact with .onion sites:

  • Checking Site Existence: It verifies if the .onion site exists and is reachable through the Tor network.
  • Fetching HTML Content: It retrieves the HTML content of the .onion site using Tor for anonymity.
  • Scraping and Searching: If specified, torspy searches for specific text within the content and extracts matching results.
  • Saving Results: Optionally, torspy allows you to save the retrieved content, either the entire HTML or the search results, to a file.
  • Contributing to torspy

    If you're interested in contributing to torspy, you can:

    • Report issues encountered while using torspy.
    • Suggest new features or enhancements.
    • Submit pull requests with improvements or fixes.

    Thank You, TorSpy Users!

    We at TorSpy are incredibly grateful for your support and trust in our cybersecurity tool. Your feedback and engagement drive us to continually improve and enhance our service. Together, we're making the digital world a safer place. Thank you for being a part of the TorSpy community!

    Disclaimer

    This tool is intended for ethical use only. The author is not responsible for any misuse or damage caused by this tool. Users are responsible for ensuring their activities comply with all relevant laws and regulations.
    

    Project details


    Download files

    Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

    Source Distribution

    torspy-3.0.8.tar.gz (14.7 kB view details)

    Uploaded Source

    Built Distribution

    torspy-3.0.8-py3-none-any.whl (15.8 kB view details)

    Uploaded Python 3

    File details

    Details for the file torspy-3.0.8.tar.gz.

    File metadata

    • Download URL: torspy-3.0.8.tar.gz
    • Upload date:
    • Size: 14.7 kB
    • Tags: Source
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/5.0.0 CPython/3.11.2

    File hashes

    Hashes for torspy-3.0.8.tar.gz
    Algorithm Hash digest
    SHA256 944865c3cc8c8b7a491a6760ff149fca87f92a34143445f310be39cba292c6a9
    MD5 ab475f630a2905aeb727cbe0cd000d00
    BLAKE2b-256 a105ecca80f08d83afb26c1d1c44bc3d861a67ba6d0084b41c257e248ff1b404

    See more details on using hashes here.

    File details

    Details for the file torspy-3.0.8-py3-none-any.whl.

    File metadata

    • Download URL: torspy-3.0.8-py3-none-any.whl
    • Upload date:
    • Size: 15.8 kB
    • Tags: Python 3
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/5.0.0 CPython/3.11.2

    File hashes

    Hashes for torspy-3.0.8-py3-none-any.whl
    Algorithm Hash digest
    SHA256 f0fd064912723d8532d267fba29a83fd301746f2c0ac40153bb3b5c2330cfc60
    MD5 5737b912fce553e21ff1eec4fd4e50b2
    BLAKE2b-256 58794362b10eee3387cd844e127eae5dec8661c2fdc2d921142439dc8dec01d6

    See more details on using hashes here.

    Supported by

    AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page