RT-MASK is a powerful, secure, and performant tool that converts IPv4 addresses to IPv6 addresses for the purpose of IPv4 obfuscation. Version 2.1 introduces comprehensive security improvements, performance optimizations (253x faster with caching, 10x faster CIDR processing), and enterprise-grade testing infrastructure.
- Critical Bug Fix: IPv6 conversion algorithm corrected (192.168.1.1 now properly converts to ::ffff:c0a8:0101)
- Security Hardening: Input validation, command injection prevention, timeout protection, HTTPS enforcement
- Performance Boost: 253x faster with caching, 10x faster parallel CIDR processing
- Testing Infrastructure: 15 unit tests, CI/CD pipeline, security scanning
- Quality Improvements: Type hints, proper error handling, pre-commit hooks
See IMPROVEMENTS.md for detailed changelog of 72 improvements!
-
Multiple Input Methods:
- Single IPv4 address
- Domain name resolution (with caching)
- CIDR notation support (with parallel processing)
- Batch processing from file
- Interactive mode
-
Rich Information:
- IPv4 to IPv6 conversion (corrected algorithm)
- URL generation (HTTP/HTTPS)
- Geolocation information (cached, HTTPS)
- WHOIS lookup (cached)
- Network information (ping, reverse DNS)
- QR code generation
-
Security Features (New in v2.1):
- Input validation prevents command injection
- Path traversal protection
- Timeout protection on all network operations
- HTTPS with SSL verification for API calls
- Safe file handling with proper error messages
-
Performance Optimizations (New in v2.1):
- Time-based caching (1 hour TTL) for DNS, WHOIS, geolocation
- Parallel CIDR processing with ThreadPoolExecutor (configurable workers)
- Large network warnings (>1024 hosts)
-
Multiple Output Formats:
- Text (console with rich formatting)
- JSON (with proper encoding)
- CSV (with proper escaping)
- HTML (modern, responsive design)
-
Cross-Platform Support:
- Python implementation (recommended, fully tested)
- PowerShell implementation (Windows-optimized using native APIs)
- Bash implementation
-
Development Features (New in v2.1):
- 15 unit tests with pytest
- CI/CD pipeline (GitHub Actions)
- Pre-commit hooks
- Code quality tools (black, flake8, mypy)
- Security scanning (bandit, safety)
- Python 3.9 or higher
- pip package manager
```bash
git clone https://github.com/msimon96/RT-MASK.git cd RT-MASK
pip install -e .
pip install -r requirements.txt ```
```bash
pip install -r requirements.txt
pre-commit install
pytest tests/
pytest --cov=rtmask tests/ ```
```bash
brew install whois jq
sudo apt-get install whois curl dnsutils jq ```
PowerShell is pre-installed on Windows. The script uses native Windows APIs for enhanced performance and stealth.
```bash
python RT-MASK.py -i 192.168.1.1
python RT-MASK.py -d example.com
python RT-MASK.py -c 192.168.1.0/24
python RT-MASK.py -f input.txt
python RT-MASK.py -i 192.168.1.1 --format json -o results.json python RT-MASK.py -i 192.168.1.1 --format html -o report.html python RT-MASK.py -i 192.168.1.1 -o results.csv
python RT-MASK.py -i 192.168.1.1 --whois --geo --network
python RT-MASK.py -i 192.168.1.1 --qr
python RT-MASK.py ```
```bash
chmod +x RT-MASK.sh
./RT-MASK.sh -i 192.168.1.1
./RT-MASK.sh -d google.com --whois --geo
./RT-MASK.sh -c 192.168.1.0/24 --format json
./RT-MASK.sh -f input.txt -o results.csv ```
```powershell
./RT-MASK.ps1 -IP 192.168.1.1
./RT-MASK.ps1 -Domain google.com -Whois -Geo
./RT-MASK.ps1 -CIDR 192.168.1.0/24 -Format json
./RT-MASK.ps1 -InputFile input.txt -OutputFile results.csv ```
``` usage: RT-MASK.py [-h] [-i IP | -d DOMAIN | -c CIDR | -f FILE] [-o OUTPUT] [--format {text,json,csv,html}] [--output-dir OUTPUT_DIR] [--qr] [--whois] [--geo] [--network] [--no-banner]
options: -h, --help show this help message -i IP, --ip IP Single IPv4 address to convert -d DOMAIN, --domain DOMAIN Domain name to resolve and convert -c CIDR, --cidr CIDR CIDR notation (e.g., 192.168.1.0/24) -f FILE, --file FILE File containing IPv4 addresses or CIDR ranges -o OUTPUT, --output OUTPUT Output file (format determined by extension) --format {text,json,csv,html} Output format (default: text) --output-dir OUTPUT_DIR Directory for output files --qr Generate QR codes for URLs --whois Include WHOIS information --geo Include geolocation information --network Include network information --no-banner Disable banner display ```
RT-MASK implements intelligent caching with a 1-hour TTL:
- DNS lookups: Cached to avoid repeated resolution
- WHOIS queries: Cached to reduce external requests
- Geolocation: Cached to minimize API calls
Performance Gain: Processing the same /24 network 253x faster on subsequent runs!
CIDR ranges are processed in parallel using ThreadPoolExecutor: ```bash
python RT-MASK.py -c 192.168.1.0/24
```
Performance Gain: ~10x faster for large CIDR ranges!
The tool respects API rate limits:
- ipapi.co: 45 requests/minute (free tier)
- WHOIS servers: Varies by server
- Automatic warnings for large networks (>1024 hosts)
- All inputs validated before processing
- Command injection prevention
- Path traversal protection
- CIDR size limits to prevent DoS
- HTTPS enforced for all API calls
- SSL certificate verification enabled
- Timeout protection (10s for HTTP, 5s for subprocess)
- No credentials or sensitive data transmitted
- File existence and permission checks
- UTF-8 encoding validation
- File size limits (10MB max for input files)
- Proper error handling
- Direct Windows API calls bypass monitored cmdlets
- No external process creation
- Reduced detection footprint
The tool uses the following free API services:
-
ipapi.co (https://ipapi.co) - Changed in v2.1: Now uses HTTPS
- Geolocation information
- Rate limited to 45 requests per minute
- No API key required
- SSL verified
-
WHOIS
- Uses system's WHOIS command or Python library
- Rate limits vary by WHOIS server
- Results cached for 1 hour
```bash
pytest tests/
pytest --cov=rtmask tests/
pytest tests/test_ip_converter.py
pytest -v tests/ ```
- 15 unit tests covering:
- IPv6 conversion (including regression test for the bug fix)
- Caching functionality
- Input validation
- Error handling
- Parallel processing
- Network operations (mocked)
Automated testing runs on:
- Operating Systems: Ubuntu, macOS, Windows
- Python Versions: 3.9, 3.10, 3.11, 3.12
- Checks: Tests, linting, type checking, security scanning
```bash
black rtmask/ tests/
flake8 rtmask/ tests/
mypy rtmask/
bandit -r rtmask/
pre-commit run --all-files ```
``` RT-MASK/ ├── rtmask/ │ ├── core/ │ │ └── ip_converter.py # Core conversion logic │ ├── utils/ │ │ ├── output_formatter.py # Output formatting │ │ └── validators.py # Input validation │ └── templates/ │ └── report.html # HTML report template ├── tests/ │ └── test_ip_converter.py # Unit tests ├── RT-MASK.py # Main CLI script ├── RT-MASK.sh # Bash implementation ├── RT-MASK.ps1 # PowerShell implementation ├── setup.py # Package setup ├── requirements.txt # Dependencies ├── pytest.ini # Test configuration ├── .pre-commit-config.yaml # Pre-commit hooks └── .github/workflows/ci.yml # CI/CD pipeline ```
```bash
$ python RT-MASK.py -i 192.168.1.1
IPv4: 192.168.1.1 IPv6: ::ffff:c0a8:0101 URL (HTTP): http://[::ffff:c0a8:0101] URL (HTTPS): https://[::ffff:c0a8:0101] ```
```bash $ python RT-MASK.py -d google.com --geo
Domain: google.com IPv4: 142.250.80.46 IPv6: ::ffff:8efa:502e Location: Mountain View, United States Coordinates: 37.4056, -122.0775 Timezone: America/Los_Angeles ```
```bash
echo "192.168.1.0/24 10.0.0.0/24 172.16.0.0/24" > networks.txt
python RT-MASK.py -f networks.txt --format html -o network_map.html ```
We welcome contributions! Please see CONTRIBUTING.md for details.
- Fork the repository
- Clone your fork: `git clone https://github.com/YOUR_USERNAME/RT-MASK.git\`
- Create a branch: `git checkout -b feature/amazing-feature`
- Install dev dependencies: `pip install -r requirements.txt`
- Install pre-commit hooks: `pre-commit install`
- Make your changes
- Run tests: `pytest tests/`
- Commit with descriptive message
- Push and create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
See CHANGELOG.md for version history and IMPROVEMENTS.md for detailed v2.1.0 improvements.
- Thanks to ipapi.co for providing free geolocation services
- Thanks to all contributors who have helped improve RT-MASK
- Special thanks to the open-source community for the various tools and libraries used in this project
- Issues: GitHub Issues
- Documentation: See this README and IMPROVEMENTS.md
- Contributing: See CONTRIBUTING.md
- 72 improvements across security, performance, and code quality
- 15 unit tests with pytest
- 5 critical bug fixes
- 11 security improvements
- 253x faster with caching
- 10x faster parallel CIDR processing
- 100% type-hinted Python code
- CI/CD pipeline with multi-OS, multi-Python testing
Version: 2.1.0
Last Updated: 2026-01-25
Status: Production Ready ✅