A high-performance web application designed to detect malicious URLs, phishing attempts, and suspicious websites. Built with Flask and powered by Google Safe Browsing API.
- Malicious Link Detection: Uses Google Safe Browsing API to flag potential phishing or malware-hosting URLs
- Protocol Validation: Checks for HTTPS encryption and flags unsecured HTTP connections
- Domain Analysis: Extracts WHOIS information including registrar, creation date, and country
- SSL/TLS Certificate Verification: Validates SSL certificates and displays issuer/expiry details
- Fraud Keyword Detection: Identifies suspicious keywords commonly used in phishing attacks
- URL Pattern Analysis: Detects IP-based URLs, excessive length, and other suspicious patterns
- Rate Limiting: Protects against API abuse with configurable rate limits
- CSRF Protection: Secure forms with CSRF token validation
- SSRF Protection: Blocks access to private/internal IP addresses
- Activity History: Tracks recent scans (last 5 URLs)
- Downloadable Reports: Generate text reports of URL analysis
- Security Tips: Built-in educational content for safe browsing
- Python 3.8+
- Flask 3.0+
- Google Safe Browsing API Key (optional but recommended)
-
Clone the repository
git clone <repository-url> cd URL-Detector
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
Copy
.env.exampleto.envand configure:cp .env.example .env
Edit
.envfile:# Flask Configuration FLASK_ENV=development SECRET_KEY=your-secret-key-here-change-in-production DEBUG=False # Google Safe Browsing API SAFE_BROWSING_API_KEY=your-api-key-here # Admin Configuration ADMIN_EMAIL=admin@example.com # Rate Limiting RATE_LIMIT_PER_MINUTE=10 # Security Settings ALLOWED_PROTOCOLS=http,https MAX_URL_LENGTH=2048
-
Get Google Safe Browsing API Key (Optional)
- Visit Google Cloud Console
- Create a new project or select existing
- Enable Safe Browsing API
- Create credentials (API Key)
- Add the key to your
.envfile
-
Run the application
python app.py
-
Open your browser Navigate to
http://localhost:5000 -
Analyze a URL
- Paste any suspicious URL into the input box
- Click "ANALYZE URL"
- View the security verdict and detailed analysis
| Feature | Description |
|---|---|
| Input Validation | All URLs are validated and sanitized before processing |
| SSRF Protection | Blocks access to private/internal IP addresses |
| CSRF Protection | All forms include CSRF token validation |
| Rate Limiting | Prevents API abuse (10 requests/minute default) |
| XSS Prevention | Output is escaped using MarkupSafe |
| Secure SSL Context | Proper certificate verification enabled |
URL-Detector/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── .gitignore # Git ignore rules
├── README.md # This file
├── templates/
│ └── index.html # Main HTML template
├── static/
│ ├── style.css # Stylesheet
│ └── assets/ # Images and other static files
└── LICENSE # License file
- Never commit
.envfile - Contains sensitive API keys and secrets - Change SECRET_KEY - Generate a strong random key for production
- Disable DEBUG mode - Set
DEBUG=Falsein production - Use HTTPS - Always deploy behind HTTPS in production
- Rate Limiting - Adjust limits based on your API quota
| Variable | Default | Description |
|---|---|---|
FLASK_ENV |
development | Flask environment mode |
SECRET_KEY |
dev-key... | Session encryption key |
DEBUG |
False | Enable/disable debug mode |
SAFE_BROWSING_API_KEY |
None | Google API key |
ADMIN_EMAIL |
admin@example.com | Report destination email |
MAX_URL_LENGTH |
2048 | Maximum URL length (chars) |
ALLOWED_PROTOCOLS |
http,https | Allowed URL protocols |
| Endpoint | Method | Description |
|---|---|---|
/ |
GET, POST | Main URL analysis page |
/security-tips |
GET | Returns security tips (JSON) |
/report-scam |
POST | Submit malicious URL report |
Run the application and test with these sample URLs:
- Safe:
https://google.com - Suspicious:
http://login-secure-bank.com - Test patterns: Try URLs with keywords like "win", "prize", "gift"
See LICENSE file for details.
- Yash Gupta - Full-Stack Developer & Cybersecurity Enthusiast
- Saksham Gupta - Backend Architecture & Security
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
For issues or questions, please open an issue on GitHub or contact the authors directly.
# PHISHERMEN | System Active: 2026