Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Master Reality SNI Scanner

Professional Reality Protocol SNI Testing Tool

πŸ“Œ Overview

Master Reality SNI Scanner is a professional-grade, cross-platform tool designed for comprehensive testing of SNI (Server Name Indication) compatibility with the Reality protocol. Built with a modern client-server architecture, it enables security researchers, network administrators, and penetration testers to systematically evaluate SNI configurations across diverse network environments.

The tool addresses the critical challenge of identifying which SNI domains work reliably with Reality-based proxy configurations, allowing users to discover optimal settings for their specific network conditions.


πŸš€ Key Features

Server Component (server-sniScanner.py)

  • Batch Processing: Efficiently handles large SNI lists by processing them in configurable batches (default: 50 SNIs per batch)
  • Dynamic Configuration: Automatically generates and applies Reality server configurations for each batch
  • UUID Security: Generates cryptographically secure random UUIDs for each session
  • Multi-Transport Support: Full compatibility with 7 transport protocols
  • Port Management: Automatic port detection and conflict resolution
  • RESTful API: Clean HTTP API for seamless client-server communication

Client Component (client-sniScanner.py)

  • Parallel Testing: Multi-threaded testing with configurable worker count (1-20 workers)
  • Five SNI Input Methods:
    • Manual entry (one-by-one)
    • File import (batch loading from text files)
    • File import with Shuffle (random order testing) ✨ NEW in v2.1.0
    • Auto-scan (discovers nearby SNI candidates)
    • Default presets (common working SNIs)
  • Smart Result Sorting: Working SNIs automatically sorted by latency (lowest first) ✨ NEW in v2.1.0
  • Partial Results on Interrupt: Ctrl+C shows and saves results from completed tests ✨ NEW in v2.1.0
  • User-Friendly Output: Clean message when no working SNIs are found ✨ NEW in v2.1.0
  • Real-time Results: Live feedback with latency metrics and success/failure status
  • Formatted Output: Beautiful ASCII tables for improved readability
  • Comprehensive Logging: Detailed results saved with timestamps

Auto Installer (dependencies-autoInstaller.py)

  • Cross-Platform: Works on Windows, Linux, and macOS
  • Intelligent Detection: Automatically detects installed dependencies
  • One-Command Setup: Installs Python packages and Xray-core
  • Status Reporting: Shows clear installation status table

πŸ› οΈ Supported Transport Protocols

Protocol Description Use Case
TCP Standard TCP protocol Maximum compatibility
WebSocket (WS) WebSocket tunneling CDN-friendly connections
gRPC High-performance RPC Low-latency requirements
HTTP/2 (h2) HTTP/2 framing Web traffic simulation
XHTTP Advanced HTTP multiplexing Recommended for optimal performance
QUIC UDP-based protocol Mobile networks, reduced latency
SplitHTTP Fragmented HTTP requests Anti-detection, CDN environments

πŸ’» Cross-Platform Compatibility

  • Linux (Ubuntu, Debian, CentOS, RHEL, Arch)
  • macOS (Intel and Apple Silicon)
  • Windows (10, 11, Server editions)

πŸ“¦ System Requirements

Server Requirements

  • Python 3.6+
  • Xray-core (v1.8.0+)
  • Root/Sudo privileges (for Xray management)
  • OpenSSL
  • 1GB+ RAM (recommended)
  • 10GB+ disk space (for logs)

Client Requirements

  • Python 3.6+
  • Xray-core (v1.8.0+)
  • 512MB+ RAM
  • Internet connection to target server

πŸ”§ Installation

Quick Install

# Clone repository
git clone https://github.com/AminDaProgrammer/Master_Reality_SNI_Scanner.git
cd Master_Reality_SNI_Scanner

# Auto-install dependencies
python3 dependencies-autoInstaller.py

# Start server (on VPS)
sudo python3 server-sniScanner.py

# Start client (on testing machine)
python3 client-sniScanner.py --server <SERVER_IP>

πŸ’‘ Windows Note:
On Windows, python3 may not be recognized by default.
The interpreter is often available as py, python, or python.exe.
Replace any python3 command with the correct one on your system (e.g., use py instead of python3).

Manual Installation

# Install Python dependencies
pip install requests cryptography

# Install Xray-core
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install

🎯 Use Cases

Use Case Description
SNI Discovery Find working SNI domains for Reality configurations
Network Testing Evaluate SNI performance across different networks
Security Auditing Verify SNI integrity and compatibility
Optimization Identify fastest SNI for specific locations
Research Analyze SNI filtering patterns in various regions

πŸ“Š Output Format

Results are saved in the results/ directory with human-readable filenames:

Master_SNI_Scanner_2025_01_15_14_30_25.txt

File Contents

  • Summary Statistics: Total tested, working, failed, success rate
  • Working SNIs Table: Ranked list with latency metrics (sorted by latency - lowest first)
  • Failed SNIs Table: List of non-functional domains
  • Configuration Links: Ready-to-use VLESS configuration strings

Partial Results on Interrupt ✨ NEW in v2.1.0

If you press Ctrl+C during testing, partial results are automatically:

  • Displayed in the terminal (same format as complete scan)
  • Saved to results/ directory (same format as complete scan)
  • Includes all tested SNIs with their status and latency

πŸ”’ Security Considerations

  • Random UUID Generation: Each session uses cryptographically secure UUIDs
  • No Hardcoded Credentials: All configurations generated dynamically
  • Minimal Attack Surface: API exposed only during active testing
  • Cleanup Routine: Xray processes terminated after testing
  • No Persistent Data: All logs and configs are temporary

πŸ“ Project Structure

Master_Reality_SNI_Scanner/
β”œβ”€β”€ server-sniScanner.py          # Server module - Reality config management
β”œβ”€β”€ client-sniScanner.py          # Client module - SNI testing & reporting
β”œβ”€β”€ dependencies-autoInstaller.py # Auto installer - Cross-platform dependencies
β”œβ”€β”€ results/                      # Test results directory (auto-created)
β”‚   β”œβ”€β”€ Master_SNI_Scanner_*.txt
β”‚   └── Master_SNI_Scanner_working_*.txt
β”œβ”€β”€ domains.txt                  # list of domains
└── README.md                     # Project documentation


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         CLIENT                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  SNI Input: Manual | File | File+Shuffle | Auto | Def   β”‚   β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚
β”‚  β”‚  Transport Selection: TCP | WS | gRPC | h2 | XHTTP...  β”‚   β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚
β”‚  β”‚  Parallel Testing: Worker Pool (1-20 threads)          β”‚   β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚
β”‚  β”‚  Results: Real-time table + File export (sorted by ping)β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β”‚ HTTP API (Port: 8080)
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         SERVER                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Batch Processing: 50 SNIs per batch                    β”‚   β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚
β”‚  β”‚  Reality Config Builder: UUID, Private/Public Keys      β”‚   β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚
β”‚  β”‚  Xray Manager: Start/Stop/Restart Service               β”‚   β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚
β”‚  β”‚  Transport Config: TCP | WS | gRPC | h2 | XHTTP...    β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ˆ Performance Benchmarks

Metric Value
SNIs per Batch 50 (configurable)
Parallel Workers 5-10 (configurable)
Test Duration (50 SNIs) ~30-45 seconds
Test Duration (500 SNIs) ~5-8 minutes
Memory Usage ~150-300MB
CPU Usage ~25-50% (with 5 workers)

πŸ›‘οΈ Error Handling

  • Graceful Degradation: Continues testing even if individual SNIs fail
  • Automatic Recovery: Restores previous config on server failure
  • Timeout Management: Configurable timeouts prevent hanging
  • Resource Cleanup: Automatic termination of Xray processes
  • User Interrupt: Ctrl+C gracefully shows and saves partial results ✨ NEW in v2.1.0

🀝 Contributing

We welcome contributions! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

MIT License - Free for personal and commercial use.

MIT License

Copyright (c) 2025 Master Reality SNI Scanner Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

⚑ Quick Commands

# Install dependencies
python3 dependencies-autoInstaller.py

# Start server (Linux/macOS)
sudo python3 server-sniScanner.py

# Start server (Windows - as Administrator)
python server-sniScanner.py

# Start client (interactive mode)
python3 client-sniScanner.py

# Start client with specific server
python3 client-sniScanner.py --server 192.168.1.100 --api-port 8080

πŸ”— Related Projects


Master Reality SNI Scanner - Empowering security professionals with reliable SNI testing for Reality protocol deployments.

About

Professional Reality Protocol SNI Testing Tool

Resources

Stars

87 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages