PhishSentinel is a modular, rule-based phishing detection toolkit developed in Python. It analyzes URLs, websites, emails, domains, and files using defensive security techniques without relying on machine learning or external threat intelligence services.
The project follows a modular architecture where each scanner is responsible for analyzing a specific type of input.
+----------------------+
| main.py |
+----------+-----------+
|
|
+---------------+----------------+
| |
CLI Utilities Logger Utilities
| |
+---------------+----------------+
|
Scanner Framework
|
-------------------------------------------------
| | | | |
URL Website Email Domain File
Scanner Scanner Scanner Scanner Scanner
Performs rule-based phishing analysis on URLs.
Detection includes:
- HTTPS verification
- IP address detection
- Long URL detection
- URL shortener detection
- Suspicious keyword detection
- Suspicious TLD detection
- Brand impersonation detection
Downloads and analyzes webpage HTML.
Checks include:
- Login forms
- Password fields
- Hidden iframes
- JavaScript redirects
- External JavaScript
- Suspicious HTML elements
Parses .eml email files.
Analysis includes:
- Email headers
- Subject inspection
- URL extraction
- SPF header presence
- DKIM signature presence
- DMARC(Authentication-Results) header presence
- Suspicious keywords
- Suspicious attachments
Collects domain intelligence.
Checks include:
- WHOIS lookup
- Registrar information
- Domain age
- Expiration analysis
- DNS records
- MX records
- SSL certificate validation
Analyzes local files.
Checks include:
- SHA-256 hashing
- MD5 hashing
- Double extensions
- Executable files
- Macro-enabled Office documents
- Suspicious filenames
Each scanner generates findings.
Every finding has:
- Category
- Severity
- Description
- Risk weight
The total risk score is calculated by summing the configured weights.
Example:
HTTP 15
IP Address 20
Brand Detection 30
Total Score 65
Risk levels:
| Score | Level |
|---|---|
| 0–24 | Low |
| 25–49 | Medium |
| 50–74 | High |
| 75+ | Critical |
PhishSentinel/
│
├── scanners/
├── utils/
├── models/
├── samples/
├── logs/
│
├── config.py
├── main.py
└── requirements.txt
The project follows:
- Modular architecture
- Single Responsibility Principle (SRP)
- Rule-based detection
- Code reusability
- Separation of concerns
- Readable and maintainable code
Language
- Python 3.12+
Libraries
- requests
- beautifulsoup4
- validators
- tldextract
- dnspython
- python-whois
- colorama
Standard Library
- hashlib
- ssl
- socket
- logging
- pathlib
- ipaddress
- urllib.parse
Application activity is recorded in:
logs/phishsentinel.log
Each log entry includes:
- Scanner
- Target
- Risk score
- Risk level
- Findings count
- Timestamp