### Install Go on macOS Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Installs Go on macOS using Homebrew. Ensure Homebrew is installed first. ```bash brew install go ``` -------------------------------- ### Verify Go Installation Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Checks the installed Go version. This command should be run after installing Go. ```bash go version ``` -------------------------------- ### Install OnionScan using Go Install Source: https://github.com/nao1215/onionscan/blob/main/README.md Install the latest version of OnionScan directly using the Go toolchain. ```bash go install github.com/nao1215/onionscan/cmd/onionscan@latest ``` -------------------------------- ### Install Go on Ubuntu Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Installs Go on Ubuntu using snap or by downloading from the official site. Updates the PATH environment variable. ```bash # Using snap sudo snap install go --classic # Or download from official site wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile source ~/.profile ``` -------------------------------- ### Install Tor on Windows Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Installs Tor on Windows using Chocolatey. Ensure Chocolatey is installed first. ```bash choco install tor ``` -------------------------------- ### Verify Development Environment Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Runs tests, linter, and builds the project to verify the development environment setup. ```bash # Run tests make test # Run linter make lint # Build the project make build ``` -------------------------------- ### Install Tor on macOS Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Installs Tor on macOS using Homebrew. ```bash brew install tor ``` -------------------------------- ### Install OnionScan via Homebrew Source: https://github.com/nao1215/onionscan/blob/main/README.md Install OnionScan on macOS or Linux using the provided Homebrew tap. ```bash brew install nao1215/tap/onionscan ``` -------------------------------- ### Install Tor on Fedora/RHEL Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Installs the Tor package on Fedora or RHEL-based systems. ```bash sudo dnf install tor ``` -------------------------------- ### Install Tor on Arch Linux Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Installs the Tor package on Arch Linux. ```bash sudo pacman -S tor ``` -------------------------------- ### OnionScan Configuration File Format Source: https://github.com/nao1215/onionscan/blob/main/README.md Example YAML structure for configuring OnionScan, including default settings and site-specific overrides. ```yaml # Default settings for all sites defaults: cookie: "" depth: 100 headers: {} ignore_patterns: [] follow_patterns: [] # Site-specific configurations sites: exampleonion.onion: cookie: "session_id=abc123" headers: Authorization: "Bearer token" X-Custom-Header: "value" depth: 50 ignore_patterns: - "/logout" - "/admin/*" follow_patterns: - "/api/*" - "/docs/*" anotheronion.onion: cookie: "auth=xyz789" depth: 25 ``` -------------------------------- ### Install Tor on Ubuntu/Debian Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Installs the Tor package on Ubuntu or Debian-based systems. ```bash sudo apt update && sudo apt install tor ``` -------------------------------- ### Go Unit Test Example Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Example of a Go unit test using t.Parallel() for parallel execution and t.Run() for subtests. Ensure tests are readable and aim for high coverage. ```go func TestAnalyzer_Analyze(t *testing.T) { t.Parallel() t.Run("should detect email addresses", func(t *testing.T) { t.Parallel() analyzer := NewEmailAnalyzer() data := &AnalysisData{ Pages: []PageData{ {Content: "Contact: test@example.com"}, }, } findings, err := analyzer.Analyze(context.Background(), data) assert.NoError(t, err) assert.Len(t, findings, 1) }) } ``` -------------------------------- ### OnionScan Text Report Example Source: https://github.com/nao1215/onionscan/blob/main/README.md A sample of the default text-based report generated by OnionScan, showing scan metadata, severity summary, detected services, and critical findings. ```text ====================================================================== ONIONSCAN REPORT ====================================================================== Hidden Service: exampleonion.onion Scan Date: 2025-11-30 14:30:00 UTC Pages Crawled: 42 Status: Complete ---------------------------------------------------------------------- SEVERITY SUMMARY ---------------------------------------------------------------------- CRITICAL: 1 HIGH: 3 MEDIUM: 5 LOW: 2 INFO: 4 TOTAL: 15 findings ---------------------------------------------------------------------- DETECTED SERVICES ---------------------------------------------------------------------- - HTTP (80) - SSH (22) ---------------------------------------------------------------------- CRITICAL FINDINGS ---------------------------------------------------------------------- [!] Private Key Exposed Type: Tor v3 Hidden Service Private Key Location: /backup/hs_ed25519_secret_key The hidden service private key is publicly accessible. Anyone can impersonate this hidden service. ... ``` -------------------------------- ### Increase Tor Startup Timeout Source: https://github.com/nao1215/onionscan/blob/main/README.md If the embedded Tor fails to start, increase the startup timeout using the --tor-timeout flag. This is useful when the Tor process takes longer than the default to initialize. ```bash onionscan scan --tor-timeout 5m example.onion ``` -------------------------------- ### Basic OnionScan Source: https://github.com/nao1215/onionscan/blob/main/README.md Scan a single hidden service or multiple services. OnionScan automatically starts an embedded Tor instance if none is running. ```bash # Scan a hidden service (starts embedded Tor automatically) onionscan scan exampleonion.onion # Scan multiple services onionscan scan site1.onion site2.onion site3.onion ``` -------------------------------- ### Initialize OnionScan Configuration Source: https://github.com/nao1215/onionscan/blob/main/README.md Creates a default .onionscan configuration file in the current directory. ```bash onionscan init ``` -------------------------------- ### Build OnionScan from Source Source: https://github.com/nao1215/onionscan/blob/main/README.md Clone the repository and build the OnionScan executable from the source code. ```bash git clone https://github.com/nao1215/onionscan.git cd onionscan go build -o onionscan ./cmd/onionscan ``` -------------------------------- ### Run Tests and Linters Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Execute the test suite and run the linter to ensure code quality and adherence to project standards. Verify test coverage meets the minimum requirement. ```bash # Ensure all tests pass make test ``` ```bash # Linter check make lint ``` ```bash # Check coverage (80% or higher) go test -cover ./... ``` -------------------------------- ### OnionScan Politeness Settings Source: https://github.com/nao1215/onionscan/blob/main/README.md Configure politeness settings such as crawl delay and user-agent to avoid overwhelming hidden services. Adjust response body size for memory constraints. ```bash # Slower, more polite scanning (2 second delay) onionscan scan --crawl-delay 2s exampleonion.onion # Faster scanning for authorized testing (500ms delay) onionscan scan --crawl-delay 500ms exampleonion.onion # Custom User-Agent onionscan scan --user-agent "MyScanner/1.0" exampleonion.onion # Limit response body size (useful for memory-constrained environments) onionscan scan --max-body-size 1048576 exampleonion.onion # 1MB ``` -------------------------------- ### Clone OnionScan Project Source: https://github.com/nao1215/onionscan/blob/main/CONTRIBUTING.md Clones the OnionScan repository from GitHub and navigates into the project directory. ```bash git clone https://github.com/nao1215/onionscan.git cd onionscan ``` -------------------------------- ### OnionScan Output Formats Source: https://github.com/nao1215/onionscan/blob/main/README.md Generate scan reports in JSON, Markdown, or plain text formats. Use the -o flag to specify an output file. ```bash # JSON report onionscan scan --json -o report.json exampleonion.onion # Markdown report onionscan scan --markdown -o report.md exampleonion.onion # Text report to file onionscan scan -o report.txt exampleonion.onion ``` -------------------------------- ### OnionScan Scan Options Source: https://github.com/nao1215/onionscan/blob/main/README.md Customize scan behavior with options like crawl depth, maximum pages, timeout, verbosity, and concurrent scans. ```bash # Custom crawl depth onionscan scan --depth 50 exampleonion.onion # Limit maximum pages to crawl onionscan scan --max-pages 200 exampleonion.onion # Custom timeout onionscan scan --timeout 3m exampleonion.onion # Verbose logging onionscan scan -v exampleonion.onion # Concurrent scans onionscan scan --batch 5 site1.onion site2.onion site3.onion ``` -------------------------------- ### OnionScan Compare Scans Source: https://github.com/nao1215/onionscan/blob/main/README.md Compare scan results stored in the local SQLite database to track changes over time. Options include listing history, comparing specific scans, and outputting in JSON or Markdown. ```bash # Compare latest two scans for a service onionscan compare exampleonion.onion # List all scan history for a service onionscan compare -l exampleonion.onion # List all scanned services in the database onionscan compare -L # Compare with a specific historical scan by ID onionscan compare -i 5 exampleonion.onion # Compare scans since a specific date onionscan compare -s "2025-01-01" exampleonion.onion # Output comparison in JSON format onionscan compare -j exampleonion.onion # Output comparison in Markdown format onionscan compare -m exampleonion.onion ``` -------------------------------- ### Use External Tor Proxy Source: https://github.com/nao1215/onionscan/blob/main/README.md When embedded Tor startup fails, configure OnionScan to use an external Tor proxy by specifying its address and port with the -e flag. ```bash onionscan scan -e 127.0.0.1:9050 example.onion ``` -------------------------------- ### OnionScan with External Tor Source: https://github.com/nao1215/onionscan/blob/main/README.md Use an existing Tor SOCKS proxy or Tor Browser's proxy for scanning. Specify the host and port of the external Tor service. ```bash # Use existing Tor SOCKS proxy onionscan scan --external-tor 127.0.0.1:9050 exampleonion.onion # Use Tor Browser's proxy onionscan scan --external-tor 127.0.0.1:9150 exampleonion.onion ``` -------------------------------- ### Increase Request Timeout Source: https://github.com/nao1215/onionscan/blob/main/README.md To resolve connection timeouts (context deadline exceeded), increase the general request timeout using the --timeout flag. This allows more time for requests to complete, especially for slow or unresponsive hidden services. ```bash onionscan scan --timeout 5m example.onion ``` -------------------------------- ### OnionScan Secure Logging Source: https://github.com/nao1215/onionscan/blob/main/README.md OnionScan automatically sanitizes sensitive information like cookies and tokens in log output, even in verbose mode, making logs safe to share for debugging. ```bash # Verbose mode with automatic secret sanitization onionscan scan -v exampleonion.onion # Example output (secrets are masked): # INFO request sent cookie=***REDACTED*** url=http://example.onion ``` -------------------------------- ### Limit Crawl Scope for Large Sites Source: https://github.com/nao1215/onionscan/blob/main/README.md To prevent out-of-memory errors on sites with many pages, limit the crawl scope by setting --max-pages and --depth. This restricts the number of pages and the crawl depth to manage resource consumption. ```bash onionscan scan --max-pages 50 --depth 10 example.onion ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.