π΅οΈββοΈ (2-in-1) Email & Username OSINT suite featuring native MCP support for deep data extraction just from a single Email/Username. Analyzes 2720+ actively maintained scan vectors (210+ email / 2510+ username) for security research, investigations, and digital footprinting.
Python cybersecuritycybersecurity-toolsemail-osintethical-hackingethical-hacking-toolsidentificationinfosecosintosint-emailosint-toolosint-toolsosint-usernamepentestingpythonredteam-toolsredteamingthreat-intelligence
Add proxy file support with round-robin rotation
Mohamed Saidi769f7c565450
diff --git a/PROXY_USAGE.md b/PROXY_USAGE.mdnew file mode 100644index 0000000..5c344f5--- /dev/null+++ b/PROXY_USAGE.md@@ -0,0 +1,120 @@+# Proxy Support Guide++## Overview++User-scanner now supports using proxies to route your requests through different IP addresses. This is useful for:+- Avoiding rate limits+- Testing from different geographic locations+- Improving privacy and anonymity+- Bypassing IP-based restrictions++## Proxy File Format++Create a text file with one proxy per line. Supported formats:++```+http://proxy.example.com:8080+https://secure-proxy.example.com:443+socks5://socks-proxy.example.com:1080+192.168.1.100:8888+```++### Features:+- **Comments**: Lines starting with `#` are ignored+- **Auto-protocol**: If no protocol is specified, `http://` is assumed+- **Multiple protocols**: Supports HTTP, HTTPS, and SOCKS5+- **Authentication**: Supports proxies with username/password++### Example with authentication:+```+http://username:[email protected]:8080+```++## Usage++### Basic Usage++Scan a username using proxies:+```bash+user-scanner -u john_doe -P proxies.txt+```++Scan an email using proxies:+```bash+user-scanner -e [email protected] -P proxies.txt+```++### Combining with Other Options++With specific category:+```bash+user-scanner -u john_doe -c dev -P proxies.txt+```++With output to file:+```bash+user-scanner -u john_doe -P proxies.txt -o results.json -f json+```++With delay between requests:+```bash+user-scanner -u john_doe -P proxies.txt -d 0.5+```++## How It Works++### Proxy Rotation++The tool uses **round-robin rotation** to distribute requests across all available proxies:+1. First request uses proxy #1+2. Second request uses proxy #2+3. When reaching the end of the list, it cycles back to proxy #1++This ensures even distribution of traffic across all your proxies.++### Thread Safety++The proxy manager is thread-safe, meaning when the tool runs multiple checks in parallel, each thread gets a different proxy without conflicts.++## Example Proxy File++See [proxies_example.txt](proxies_example.txt) for a complete example.++## Tips++1. **Free Proxies**: Be cautious with free proxy lists - they may be slow, unreliable, or insecure+2. **Testing**: Test your proxies before using them for large scans+3. **Quantity**: More proxies = better distribution and lower chance of rate limiting+4. **Speed**: SOCKS5 proxies are generally faster than HTTP proxies+5. **Authentication**: If your proxy requires authentication, include it in the format `protocol://user:pass@host:port`++## Error Handling++If a proxy fails:+- The request will timeout and be marked as an error+- The next request will use the next proxy in rotation+- Check the console output for connection errors++If the proxy file is invalid:+- The tool will display an error message and exit+- Check that the file exists and contains valid proxy entries++## Common Issues++### "No valid proxies found in file"+- Ensure the file contains at least one valid proxy+- Check that proxy lines are not all commented out++### Connection timeouts+- Verify your proxies are online and accessible+- Try increasing the timeout with longer delays (`-d` flag)+- Test proxies individually with a single module (`-m github`)++### Authentication errors+- Ensure credentials are correct+- Format: `http://username:password@proxy:port`+- Some proxies may not support authentication++## Security Note++WARNING: Proxies can see your traffic. Only use proxies you trust, especially when sending sensitive information. Free public proxies may log or intercept your data.diff --git a/QUICKSTART_PROXY.md b/QUICKSTART_PROXY.mdnew file mode 100644index 0000000..d6a45ef--- /dev/null+++ b/QUICKSTART_PROXY.md@@ -0,0 +1,79 @@+# Quick Start: Using Proxy Support++## Basic Usage++### 1. Create a proxy file (one proxy per line)+```+http://proxy1.example.com:8080+http://proxy2.example.com:3128+https://secure-proxy.example.com:443+192.168.1.100:8888+```++### 2. Scan with proxies+```bash+# Scan a username with proxies+user-scanner -u john_doe -P proxies.txt++# Scan with specific category+user-scanner -u john_doe -c dev -P proxies.txt++# Scan with output to file+user-scanner -u john_doe -P proxies.txt -o results.json -f json+```++## Validate Proxies First (Recommended)++```bash+# Test proxies against google.com before using+python validate_proxies.py++# This creates working_proxies.txt with only working proxies+user-scanner -u john_doe -P working_proxies.txt+```++## Batch Testing Multiple Usernames++```bash+# Create usernames.txt with one username per line+# Then run batch test+python test_batch.py+```++## Pro Tips++1. **Free proxies** - Most free proxies don't work (as you saw: 11/2000)+2. **Use validation** - Always validate proxies first with `validate_proxies.py`+3. **Rotation works** - Proxies rotate automatically (round-robin)+4. **Add delays** - Use `-d 0.5` to add delay between requests+5. **Without proxies** - Just omit `-P` flag to use direct connection++## π― Example Workflow++```bash+# Step 1: Validate your proxy list+python validate_proxies.py++# Step 2: Scan with working proxies+user-scanner -u myusername -c social -P working_proxies.txt -o results.json -f json++# Step 3: Check results+cat results.json+```++## Files in This Implementation++- `validate_proxies.py` - Tests proxies against google.com+- `test_batch.py` - Batch tests multiple usernames+- `usernames.txt` - Sample username list+- `working_proxies.txt` - Validated working proxies (generated)+- `PROXY_USAGE.md` - Full documentation+- `proxies_example.txt` - Example proxy file format++## That's It!++You now have:+- Proxy support integrated+- Automatic proxy rotation+- Validation tools+- Batch testing capabilitydiff --git a/README.md b/README.mdindex 4684acb..da7b13c 100644--- a/README.md+++ b/README.md@@ -85,6 +85,16 @@ Generate & check username variations using a permutation from the given suffix:user-scanner -u john_ -p ab # john_a, ..., john_ab, john_ba```+### Using Proxies++Route requests through proxy servers:++```bash+user-scanner -u john_doe -P proxies.txt+```++See [PROXY_USAGE.md](PROXY_USAGE.md) for detailed proxy configuration and usage.+## Important Flags| Flag | Description |@@ -93,6 +103,7 @@ user-scanner -u john_ -p ab # john_a, ..., john_ab, john_ba| `-l, --list` | List all available modules for username scanning || `-m, --module MODULE` | Scan a single specific module || `-p, --permute PERMUTE` | Generate username permutations using a pattern/suffix |+| `-P, --proxy-file FILE` | Use proxies from file (one per line) || `-s, --stop STOP` | Limit the number of permutations generated || `-d, --delay DELAY` | Delay (in seconds) between requests || `-f, --format {csv,json}` | Select output format |diff --git a/proxies_example.txt b/proxies_example.txtnew file mode 100644index 0000000..9515533--- /dev/null+++ b/proxies_example.txt@@ -0,0 +1,25 @@+# Example proxy file for user-scanner+# One proxy per line+# Supported formats:+# - http://proxy:port+# - https://proxy:port+# - socks5://proxy:port+# - proxy:port (will be treated as http://)+# Lines starting with # are ignored++# HTTP proxies+http://proxy1.example.com:8080+http://proxy2.example.com:3128++# HTTPS proxies+https://secure-proxy.example.com:443++# SOCKS5 proxies+socks5://socks-proxy.example.com:1080++# Proxies without protocol (will default to http://)+192.168.1.100:8888+10.0.0.50:3128++# Proxies with authentication+http://username:[email protected]:8080diff --git a/test_batch.py b/test_batch.pynew file mode 100644index 0000000..f344da6--- /dev/null+++ b/test_batch.py@@ -0,0 +1,57 @@+"""+Test username scanner with validated proxies+"""+import subprocess+import sys+import os++def read_usernames(filename):+ """Read usernames from file"""+ usernames = []+ with open(filename, 'r', encoding='utf-8') as f:+ for line in f:+ line = line.strip()+ if line and not line.startswith('#'):+ usernames.append(line)+ return usernames++def test_usernames(usernames_file, proxy_file, category='dev', output_file='results.json'):+ """Test all usernames with proxies"""+ usernames = read_usernames(usernames_file)++ print(f"[*] Testing {len(usernames)} usernames")+ print(f"[*] Using proxy file: {proxy_file}")+ print(f"[*] Category: {category}")+ print(f"[*] Output: {output_file}\n")++ python_exe = r"C:/Users/ms070/OneDrive/Desktop/user-scanner/.venv/Scripts/python.exe"++ for i, username in enumerate(usernames, 1):+ print(f"\n{'='*60}")+ print(f"[{i}/{len(usernames)}] Testing username: {username}")+ print(f"{'='*60}\n")++ cmd = [+ python_exe,+ "-m", "user_scanner",+ "-u", username,+ "-c", category,+ "-P", proxy_file,+ "-f", "json",+ "-o", output_file+ ]++ subprocess.run(cmd)++ print(f"\n{'='*60}")+ print(f"[+] All tests complete! Results saved to {output_file}")+ print(f"{'='*60}")++if __name__ == "__main__":+ # Wait for proxy validation to complete+ if not os.path.exists("working_proxies.txt"):+ print("[!] working_proxies.txt not found!")+ print("[*] Please run validate_proxies.py first")+ sys.exit(1)++ test_usernames("usernames.txt", "working_proxies.txt", category="dev", output_file="scan_results.json")diff --git a/user_scanner/__main__.py b/user_scanner/__main__.pyindex 127ee25..73c71fd 100644--- a/user_scanner/__main__.py+++ b/user_scanner/__main__.py@@ -15,7 +15,9 @@ from user_scanner.core.helpers import (load_modules,find_module,get_site_name,- generate_permutations+ generate_permutations,+ set_proxy_manager,+ get_proxy_count)from user_scanner.core.orchestrator import (@@ -76,6 +78,9 @@ def main():parser.add_argument("-o", "--output", type=str, help="Output file path")+ parser.add_argument(+ "-P", "--proxy-file", type=str, help="Path to proxy list file (one proxy per line)")+parser.add_argument("-U", "--update", action="store_true", help="Update the tool")@@ -108,6 +113,16 @@ def main():parser.print_help()return+ # Initialize proxy manager if proxy file is provided+ if args.proxy_file:+ try:+ set_proxy_manager(args.proxy_file)+ proxy_count = get_proxy_count()+ print(f"{G}[+] Loaded {proxy_count} proxies from {args.proxy_file}{X}")+ except Exception as e:+ print(f"{R}[β] Error loading proxies: {e}{X}")+ sys.exit(1)+check_for_updates()print_banner()diff --git a/user_scanner/core/email_orchestrator.py b/user_scanner/core/email_orchestrator.pyindex 77dceb7..2253271 100644--- a/user_scanner/core/email_orchestrator.py+++ b/user_scanner/core/email_orchestrator.py@@ -4,7 +4,7 @@ from typing import Listfrom types import ModuleTypefrom colorama import Fore, Style-from user_scanner.core.helpers import load_categories, load_modules, find_category+from user_scanner.core.helpers import load_categories, load_modules, find_category, get_proxyfrom user_scanner.core.result import Result# Concurrency controldiff --git a/user_scanner/core/helpers.py b/user_scanner/core/helpers.pyindex 5ba6959..7afc4f6 100644--- a/user_scanner/core/helpers.py+++ b/user_scanner/core/helpers.py@@ -3,7 +3,9 @@ import importlib.utilfrom itertools import permutationsfrom types import ModuleTypefrom pathlib import Path-from typing import Dict, List+from typing import Dict, List, Optional+import random+import threadingdef get_site_name(module) -> str:@@ -93,3 +95,81 @@ def generate_permutations(username: str, pattern: str, limit: int | None = None,return sorted(permutations_set)return sorted(permutations_set)+++class ProxyManager:+ """Thread-safe proxy manager that loads and rotates proxies from a file."""++ def __init__(self, proxy_file: str):+ self.proxies = []+ self.current_index = 0+ self.lock = threading.Lock()+ self._load_proxies(proxy_file)++ def _load_proxies(self, proxy_file: str) -> None:+ """Load proxies from a text file. Supports http://, https://, and socks5:// proxies."""+ try:+ with open(proxy_file, 'r', encoding='utf-8') as f:+ for line in f:+ line = line.strip()+ if line and not line.startswith('#'):+ # Add protocol if not present+ if not line.startswith(('http://', 'https://', 'socks5://')):+ line = 'http://' + line+ self.proxies.append(line)++ if not self.proxies:+ raise ValueError("No valid proxies found in file")++ except FileNotFoundError:+ raise FileNotFoundError(f"Proxy file not found: {proxy_file}")+ except Exception as e:+ raise Exception(f"Error loading proxies: {e}")++ def get_next_proxy(self) -> Optional[str]:+ """Get the next proxy in rotation (round-robin)."""+ if not self.proxies:+ return None++ with self.lock:+ proxy = self.proxies[self.current_index]+ self.current_index = (self.current_index + 1) % len(self.proxies)+ return proxy++ def get_random_proxy(self) -> Optional[str]:+ """Get a random proxy from the list."""+ if not self.proxies:+ return None+ return random.choice(self.proxies)++ def count(self) -> int:+ """Return the number of loaded proxies."""+ return len(self.proxies)+++# Global proxy manager instance+_proxy_manager: Optional[ProxyManager] = None+++def set_proxy_manager(proxy_file: Optional[str]) -> None:+ """Initialize the global proxy manager with a proxy file."""+ global _proxy_manager+ if proxy_file:+ _proxy_manager = ProxyManager(proxy_file)+ else:+ _proxy_manager = None+++def get_proxy() -> Optional[str]:+ """Get the next proxy from the global proxy manager."""+ if _proxy_manager:+ return _proxy_manager.get_next_proxy()+ return None+++def get_proxy_count() -> int:+ """Get the count of loaded proxies."""+ if _proxy_manager:+ return _proxy_manager.count()+ return 0+diff --git a/user_scanner/core/orchestrator.py b/user_scanner/core/orchestrator.pyindex cec1f9f..1857514 100644--- a/user_scanner/core/orchestrator.py+++ b/user_scanner/core/orchestrator.py@@ -5,7 +5,7 @@ from pathlib import Pathfrom user_scanner.core.result import Resultfrom typing import Callable, Listfrom types import ModuleType-from user_scanner.core.helpers import find_category, get_site_name, load_categories, load_modules+from user_scanner.core.helpers import find_category, get_site_name, load_categories, load_modules, get_proxydef _worker_single(module: ModuleType, username: str) -> Result:@@ -79,6 +79,12 @@ def make_request(url: str, **kwargs) -> httpx.Response:if "timeout" not in kwargs:kwargs["timeout"] = 5.0+ # Add proxy if available and not already set+ if "proxy" not in kwargs:+ proxy = get_proxy()+ if proxy:+ kwargs["proxy"] = proxy+method = kwargs.pop("method", "GET")return httpx.request(method.upper(), url, **kwargs)diff --git a/usernames.txt b/usernames.txtnew file mode 100644index 0000000..8b06077--- /dev/null+++ b/usernames.txt@@ -0,0 +1,11 @@+# List of usernames to test+john_doe+alice_smith+testuser+developer123+coderlife+techguru+gamerpro+creative_mind+digital_nomad+code_masterdiff --git a/validate_proxies.py b/validate_proxies.pynew file mode 100644index 0000000..6ed4499--- /dev/null+++ b/validate_proxies.py@@ -0,0 +1,79 @@+"""+Proxy Validator - Tests all proxies against google.com and keeps only working ones+"""+import httpx+from concurrent.futures import ThreadPoolExecutor, as_completed+from colorama import Fore, Style, init++init(autoreset=True)++def test_proxy(proxy, timeout=10):+ """Test if a proxy works by connecting to google.com"""+ try:+ with httpx.Client(proxy=proxy, timeout=timeout) as client:+ response = client.get("https://www.google.com", follow_redirects=True)+ if response.status_code == 200:+ return proxy, True+ else:+ return proxy, False+ except Exception:+ return proxy, False++def load_proxies(filename):+ """Load proxies from file"""+ proxies = []+ with open(filename, 'r', encoding='utf-8') as f:+ for line in f:+ line = line.strip()+ if line and not line.startswith('#'):+ proxies.append(line)+ return proxies++def validate_proxies(input_file, output_file, max_workers=50):+ """Validate all proxies and save working ones"""+ print(f"{Fore.CYAN}[*] Loading proxies from {input_file}...{Style.RESET_ALL}")+ proxies = load_proxies(input_file)+ total = len(proxies)+ print(f"{Fore.CYAN}[*] Found {total} proxies to test{Style.RESET_ALL}\n")++ working_proxies = []+ failed = 0+ tested = 0++ print(f"{Fore.YELLOW}[*] Testing proxies (this may take a few minutes)...{Style.RESET_ALL}")++ with ThreadPoolExecutor(max_workers=max_workers) as executor:+ futures = {executor.submit(test_proxy, proxy): proxy for proxy in proxies}++ for future in as_completed(futures):+ proxy, is_working = future.result()+ tested += 1++ if is_working:+ working_proxies.append(proxy)+ print(f"{Fore.GREEN}[β] {tested}/{total} - Working: {proxy}{Style.RESET_ALL}")+ else:+ failed += 1+ print(f"{Fore.RED}[β] {tested}/{total} - Failed: {proxy}{Style.RESET_ALL}")++ # Save working proxies+ with open(output_file, 'w', encoding='utf-8') as f:+ for proxy in working_proxies:+ f.write(proxy + '\n')++ print(f"\n{Fore.CYAN}{'='*60}{Style.RESET_ALL}")+ print(f"{Fore.GREEN}[+] Validation Complete!{Style.RESET_ALL}")+ print(f"{Fore.GREEN}[+] Working proxies: {len(working_proxies)}/{total}{Style.RESET_ALL}")+ print(f"{Fore.RED}[-] Failed proxies: {failed}/{total}{Style.RESET_ALL}")+ print(f"{Fore.CYAN}[+] Working proxies saved to: {output_file}{Style.RESET_ALL}")+ print(f"{Fore.CYAN}{'='*60}{Style.RESET_ALL}")++if __name__ == "__main__":+ input_file = "http_proxies (1).txt"+ output_file = "working_proxies.txt"++ print(f"{Fore.MAGENTA}{'='*60}{Style.RESET_ALL}")+ print(f"{Fore.MAGENTA} PROXY VALIDATOR - Testing Against Google.com{Style.RESET_ALL}")+ print(f"{Fore.MAGENTA}{'='*60}{Style.RESET_ALL}\n")++ validate_proxies(input_file, output_file, max_workers=50)