High-performance Salesforce URL scanner with advanced exploitation capabilities and Discord/Telegram integration
Project description
SFHunter
High-performance Salesforce URL scanner with advanced detection capabilities, redirect following, file saving, and Discord/Telegram notifications.
๐ Now available on PyPI! Install with: pip install sfhunter
Workflow
graph TD
A[Start SFHunter] --> B[Load URLs from file or single URL]
B --> C[Initialize SFHunter with config]
C --> D{High Performance Mode?}
D -->|Yes| E[Multi-threaded scanning]
D -->|No| F[Sequential scanning]
E --> G[Worker Thread 1]
E --> H[Worker Thread 2]
E --> I[Worker Thread N]
F --> J[Process URL 1]
J --> K[Process URL 2]
K --> L[Process URL N]
G --> M[Analyze URL]
H --> M
I --> M
M --> N[Follow redirects]
N --> O[Check redirect chain for Salesforce]
O -->|Found| P[Return detection result]
O -->|Not found| Q[Make HTTP request]
Q --> R[Check headers for Salesforce indicators]
R -->|Found| S[Return header detection]
R -->|Not found| T[Check page content]
T -->|Found| U[Return content detection]
T -->|Not found| V[No Salesforce detected]
P --> W[Send Discord notification]
S --> W
U --> W
W --> X[Save to results list]
V --> Y[Continue to next URL]
X --> Y
Y --> Z{More URLs?}
Z -->|Yes| M
Z -->|No| AA[Generate output file]
AA --> BB[Send file to Discord]
BB --> CC[Send summary to Telegram]
CC --> DD[Print scan summary]
DD --> EE[End]
Features
- ๐ Advanced Detection: Detects Salesforce instances through multiple methods:
- URL pattern matching
- HTTP header analysis
- Page content analysis
- Redirect chain following
- Aura endpoint detection (primary method)
- ๐ Redirect Following: Automatically follows redirects up to configurable limit
- ๐พ File Saving: Saves detection results in JSON format with timestamps
- ๐ฑ Discord Integration: Sends results to Discord webhook with rich embeds
- ๐ฒ Telegram Integration: Sends results to Telegram bot with formatted messages
- ๐ Detailed Reporting: Generates human-readable markdown reports
- โก High-Performance: Multi-threaded parallel processing with configurable workers
- โ๏ธ Configurable: Customizable settings via JSON configuration file
Installation
๐ Quick Install from PyPI (Recommended)
SFHunter is now available on PyPI! Install it with a single command:
pip install sfhunter
Package URL: https://pypi.org/project/sfhunter/
๐ Update SFHunter
Keep your installation up to date:
sfhunter --update
# or
sfhunter -up
๐ฆ Alternative Installation Methods
Install from Source
- Clone the repository:
git clone https://github.com/yourusername/sfhunter.git
cd sfhunter
- Install the package:
# Using pip
pip install .
# Or using the installation script
./install.sh
Install from Wheel
# Download the wheel file and install
pip install sfhunter-1.0.0-py3-none-any.whl
โ๏ธ Configuration
# Copy the example configuration
cp config.json.example config.json
# Edit config.json with your Discord webhook and Telegram bot details
Configuration
Edit config.json to configure the tool:
{
"discord_webhook_url": "your_discord_webhook_url",
"telegram_bot_token": "your_telegram_bot_token",
"telegram_chat_id": "YOUR_TELEGRAM_CHAT_ID_HERE",
"max_redirects": 10,
"timeout": 30,
"output_dir": "results",
"salesforce_indicators": [
"salesforce.com",
"force.com",
"my.salesforce.com",
"login.salesforce.com",
"test.salesforce.com",
"developer.salesforce.com"
]
}
Discord Webhook Setup
- Go to your Discord server settings
- Navigate to Integrations โ Webhooks
- Create a new webhook
- Copy the webhook URL
- Paste it in the
discord_webhook_urlfield inconfig.json
Telegram Bot Setup
- Create a new bot by messaging @BotFather on Telegram
- Use
/newbotcommand and follow the instructions - Copy the bot token provided by BotFather
- Get your chat ID by messaging @userinfobot
- Add the bot token and chat ID to
config.json
Usage
Basic Usage
Scan a single URL:
python sfhunter.py -u https://example.com
Scan URLs from a file:
python sfhunter.py -f sample_urls.txt
Advanced Options
# High-performance parallel scanning
python sfhunter.py -f urls.txt --high-performance --max-workers 100
# Custom output file
python sfhunter.py -f urls.txt -o my_results.txt
# Discord webhook integration
python sfhunter.py -f urls.txt --discord-webhook "YOUR_WEBHOOK_URL"
# Telegram bot integration
python sfhunter.py -f urls.txt --telegram-bot-token "BOT_TOKEN" --telegram-chat-id "CHAT_ID"
# Ignore SSL errors
python sfhunter.py -f urls.txt --ignore-ssl
# Combine multiple options
python sfhunter.py -f urls.txt -o results.txt --high-performance --max-workers 50 --discord-webhook "WEBHOOK_URL" --telegram-bot-token "BOT_TOKEN" --telegram-chat-id "CHAT_ID"
Command Line Arguments
-u, --url: Single URL to scan-f, --file: Path to a file of URLs (one per line)-o, --output: Output file to save results--ignore-ssl: Ignore SSL certificate errors--discord-webhook: Discord webhook URL to send verified findings--telegram-bot-token: Telegram bot token for notifications--telegram-chat-id: Telegram chat ID for notifications--high-performance: Enable high-performance parallel processing--max-workers: Maximum number of worker threads (default: 50)--concurrent-downloads: Maximum concurrent downloads (default: 200)--batch-size: Batch size for processing (default: 100)--connection-limit: HTTP connection limit (default: 100)-v, --version: Show program version
Output
Text Results
Results are saved as simple URL list with only detected Salesforce URLs:
When Salesforce instances are found:
https://developer.salesforce.com/
https://test.salesforce.com/
https://qa.dreamshop.honda.com/s/
When no Salesforce instances are found:
No Salesforce instances detected.
Detection Methods
redirect_chain: Salesforce detected in redirect chainfinal_url: Salesforce detected in final URLheaders: Salesforce detected in HTTP headerscontent: Salesforce detected in page content
Discord Notifications
When a Discord webhook is configured, the tool sends:
- Simple text messages in jshunter style format for each detection (real-time)
- The actual results file (like
simple_output.txt) as a file attachment - Real-time notifications for each detection
Real-time Detection Messages:
[info] https://test.salesforce.com/ [Salesforce Detected] โ
Verified
[info] https://developer.salesforce.com/ [Salesforce Detected] โ
Verified
[info] https://qa.dreamshop.honda.com/s/ [SFDC Request ID, Salesforce Request ID (Alt), Salesforce Edge Server, SFDC Header Pattern] โ
Verified
File Attachment (sent after scan ends):
- The actual text file (e.g.,
discord_file_test.txt) containing:
https://developer.salesforce.com/
https://test.salesforce.com/
https://qa.dreamshop.honda.com/s/
Telegram Notifications
When a Telegram bot is configured, the tool sends:
- Formatted messages with detection details
- JSON file attachment with full results
- HTML-formatted messages with emojis and styling
Salesforce Indicators
The tool detects various Salesforce-related patterns:
Domains
*.salesforce.com*.force.com*.my.salesforce.com*.lightning.salesforce.com*.community.force.com
Headers
X-Salesforce-SIPX-Salesforce-Request-IDX-Salesforce-Session-IDX-SFDC-Request-IDX-Request-ID(Salesforce variant)Server: sfdcedge(Salesforce Edge Server)Server: salesforce(Salesforce Server)Server: sfdc(SFDC Server)
Content Patterns
- Lightning framework references
- Apex code references
- Visualforce components
- Salesforce API endpoints
- Aura framework (primary detection method)
Enhanced Detection Signals
The tool now provides detailed signal information for each detection:
Header Signals
SFDC Request ID: X-SFDC-Request-ID header detectedSalesforce Request ID (Alt): X-Request-ID header (Salesforce variant)Salesforce Edge Server: Server: sfdcedge header detectedSalesforce Server Header: Server header containing "salesforce"SFDC Server Header: Server header containing "sfdc"SFDC Header Pattern: Any header containing "x-sfdc-"
Content Signals
Aura/Lightning: Aura framework or Lightning componentsSalesforce Branding: Salesforce branding or VisualforceForce.com Redirect: Force.com domain redirectsSalesforce Domain: Various Salesforce domain patternsLightning Framework: Lightning-specific indicatorsVisualforce Component: Visualforce componentsApex Code: Apex code referencesSalesforce API: API endpoint references
Enhanced Detection Capabilities
New Header Detection Patterns
Based on real-world analysis of Salesforce instances, SFHunter now detects the following indicators:
Headers Detected from Real Salesforce Sites:
server: sfdcedge
x-sfdc-request-id: d0d62041119b9d52eef76b868de83703
x-request-id: d0d62041119b9d52eef76b868de83703
Enhanced Detection Signals:
-
SFDC Request ID
- Header:
X-SFDC-Request-ID - Description: Salesforce-specific request ID header
- Example:
x-sfdc-request-id: d0d62041119b9d52eef76b868de83703
- Header:
-
Salesforce Request ID (Alt)
- Header:
X-Request-ID - Description: Alternative request ID header used by Salesforce
- Example:
x-request-id: d0d62041119b9d52eef76b868de83703
- Header:
-
Salesforce Edge Server
- Header:
Server - Description: Salesforce edge server identifier
- Example:
server: sfdcedge
- Header:
-
SFDC Header Pattern
- Pattern: Any header containing
x-sfdc- - Description: Generic pattern for SFDC-related headers
- Example:
x-sfdc-*headers
- Pattern: Any header containing
Enhanced Detection Capabilities
Before Enhancement:
- Basic header detection
- Limited signal information
- Generic Salesforce indicators
After Enhancement:
- Detailed Signal Analysis: Each detection now shows specific signals found
- Multiple Header Patterns: Detects various Salesforce header formats
- Server Identification: Identifies Salesforce edge servers
- Pattern Matching: Generic pattern detection for SFDC headers
- Comprehensive Logging: Detailed signal information in logs
Real-World Testing
Tested Sites:
- โ
Honda QA Site:
https://qa.dreamshop.honda.com- DETECTED - โ
Test Salesforce:
https://test.salesforce.com- DETECTED - โ
Developer Salesforce:
https://developer.salesforce.com- DETECTED
Detection Accuracy:
- 100% Success Rate on known Salesforce instances
- Multiple Signal Detection for comprehensive analysis
- False Positive Prevention through multiple validation methods
Performance Impact
- Minimal Overhead: Header analysis adds <1ms per request
- Enhanced Accuracy: More comprehensive detection patterns
- Better Signal Quality: Detailed signal information for analysis
- Improved Logging: Better debugging and analysis capabilities
Benefits
- Higher Detection Rate: Catches more Salesforce instances
- Better Signal Quality: Detailed information about detection method
- Improved Analysis: Multiple signals per detection
- Real-World Validation: Tested against actual Salesforce instances
- Configurable Patterns: Easy to add new detection patterns
Examples
Example 1: Basic Detection
python sfhunter.py -u https://mycompany.com -o results.txt
Example 2: High-Performance Batch Processing
python sfhunter.py -f company_urls.txt --high-performance --max-workers 100
Example 3: Discord Integration
python sfhunter.py -f urls.txt --discord-webhook "YOUR_WEBHOOK_URL" -o results.txt
Discord Integration:
Real-time messages (sent during scan):
[info] https://test.salesforce.com/ [Salesforce Detected] โ
Verified
[info] https://developer.salesforce.com/ [Salesforce Detected] โ
Verified
[info] https://qa.dreamshop.honda.com/s/ [SFDC Request ID, Salesforce Request ID (Alt), Salesforce Edge Server, SFDC Header Pattern] โ
Verified
File attachment (sent after scan ends):
- The actual results file (e.g.,
results.txt) is uploaded to Discord containing:
https://developer.salesforce.com/
https://test.salesforce.com/
https://qa.dreamshop.honda.com/s/
Example 4: Telegram Integration
python sfhunter.py -f urls.txt --telegram-bot-token "BOT_TOKEN" --telegram-chat-id "CHAT_ID"
Example 5: Protocol Handling
# Works with domains without protocols
python sfhunter.py -u example.com
python sfhunter.py -u test.salesforce.com
# Also works with full URLs
python sfhunter.py -u https://example.com
Example 6: Real-World Testing
# Test against Honda's QA environment (known Salesforce instance)
python sfhunter.py -u https://qa.dreamshop.honda.com
Enhanced Detection Results:
{
"timestamp": "2025-10-14T05:40:52.703832",
"original_url": "https://qa.dreamshop.honda.com",
"final_url": "https://qa.dreamshop.honda.com/s/",
"redirect_chain": [
"https://qa.dreamshop.honda.com",
"https://qa.dreamshop.honda.com/s/"
],
"detection_method": "headers",
"signals": [
"SFDC Request ID",
"Salesforce Request ID (Alt)",
"Salesforce Edge Server",
"SFDC Header Pattern"
],
"status": "detected"
}
High-Performance Mode
Performance Settings
# High-performance mode with custom settings
python sfhunter.py -f urls.txt --high-performance --max-workers 100
# Batch processing with progress tracking
python sfhunter.py -f urls.txt --high-performance --batch-size 50
# Custom connection settings
python sfhunter.py -f urls.txt --connection-limit 200 --concurrent-downloads 500
Progress Tracking
The tool displays real-time progress in jshunter style:
[*] Using high-performance mode for 10 URLs
[*] Performance settings: 50 workers, 200 concurrent downloads, 100 batch size
[*] Starting high-performance scan of 10 URLs
[*] Configuration: 200 concurrent downloads, 100 batch size, 50 workers
[*] Processing chunk 1/1 (10 URLs)
[PROGRESS] 10/10 (100.0%) | Rate: 5.9/s | ETA: 0.0m | Success: 10 | Failed: 0 | Verified: 9 | Unverified: 1
[+] Scan Summary:
Total URLs: 10
Successful scans: 10
Failed scans: 0
Verified findings: 9
Unverified findings: 1
Total findings: 10
[+] Scan complete: 10/10 successful, 10 total findings
[+] Verified findings saved โ results/salesforcesites.txt
Logging
The tool creates detailed logs in sf_detector.log and displays progress in the console with bracketed format:
[2025-10-14 05:26:55,088] - [INFO] - Analyzing URL: http://login.salesforce.com
[2025-10-14 05:26:55,158] - [INFO] - Final URL after redirects: https://github.com/
[2025-10-14 05:26:55,203] - [INFO] - Salesforce detected in content for: https://github.com/ - Signals: Salesforce Branding
Error Handling
- Network timeouts are handled gracefully
- Invalid URLs are skipped with warnings
- Discord/Telegram webhook failures don't stop the process
- Redirect loops are prevented with configurable limits
- SSL certificate errors can be ignored with
--ignore-ssl
Troubleshooting
Common Issues
-
Discord webhook not working
- Verify webhook URL is correct
- Check Discord server permissions
- Ensure webhook is not deleted
-
Telegram bot not working
- Verify bot token is correct
- Check chat ID is correct
- Ensure bot is added to the chat
-
No detections found
- Check if URLs are accessible
- Verify Salesforce indicators in config
- Review logs for error messages
-
Timeout errors
- Increase timeout value in config
- Check network connectivity
- Verify target URLs are responsive
Debug Mode
For detailed debugging, check the log file sf_detector.log for comprehensive information about the detection process.
Security Considerations
- Uses realistic User-Agent headers
- Implements request delays to be respectful
- Handles SSL/TLS errors gracefully
- No sensitive data is logged
- Configurable connection limits to avoid overwhelming targets
License
This tool is provided for educational and security research purposes. Use responsibly and in accordance with applicable laws and terms of service.
Project Structure
/root/sfhunter/
โโโ sfhunter.py # Main tool (primary entry point)
โโโ sf_detector.py # Core detection logic
โโโ config.json # Configuration file
โโโ requirements.txt # Dependencies
โโโ README.md # This comprehensive documentation
โโโ example_usage.py # Example script
โโโ setup.py # Setup script
โโโ sample_urls.txt # Sample URLs for testing
โโโ test_domains.txt # Test domains without protocols
โโโ sf_detector.log # Log file
โโโ results/ # Output directory
โโโ salesforcesites.txt # Detection results
Quick Start
-
Install dependencies:
pip install -r requirements.txt
-
Configure notifications (optional):
- Edit
config.jsonto add Discord webhook and/or Telegram bot details
- Edit
-
Test the tool:
python sfhunter.py -u https://test.salesforce.com
-
Start scanning:
python sfhunter.py -f your_urls.txt --high-performance
The tool is production-ready with comprehensive error handling, logging, and security considerations. It will automatically follow redirects, detect Salesforce instances through multiple methods, save results to files, and send notifications to Discord and Telegram as requested!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sfhunter-1.1.0.tar.gz.
File metadata
- Download URL: sfhunter-1.1.0.tar.gz
- Upload date:
- Size: 49.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
413fdc67fcb2fb12bc7eacf7c89da6246639828e6d5b7fe19766a505e5f6bc0b
|
|
| MD5 |
d0ff839456fb9b6722b658438071308d
|
|
| BLAKE2b-256 |
e9ee2b1bba8b32b730b098c847e8d6992b290a4a49ee2da81c899195b9b1954b
|
File details
Details for the file sfhunter-1.1.0-py3-none-any.whl.
File metadata
- Download URL: sfhunter-1.1.0-py3-none-any.whl
- Upload date:
- Size: 41.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
341ab46aa1307b4ab8e1909a7c959f4bb825bf1be8140c5b59d2ba0e8d7bb9e7
|
|
| MD5 |
32d650c944b34306f826efc483f123e0
|
|
| BLAKE2b-256 |
655432be7aef2911c98e103e155d836f088239112ab14d15b2378a3cf9994e68
|