Skip to content

Catching malicious links red-handed, so you don’t have to.

License

Notifications You must be signed in to change notification settings

ShivKushDev/PhishSnitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


PhishSnitch Banner


Email Threat Analyzer for detecting phishing attacks in real time.


📌 Overview

PhishSnitch is a real-time email security tool that monitors your Gmail inbox and performs deep URL analysis to detect phishing links. It utilizes Gmail API, URLScan.io, SSL verification, domain reputation checks, and more to provide comprehensive alerting and logging.


✨ Features

  • ✅ Real-time Gmail monitoring (secure OAuth2)
  • 🔗 Automated URL extraction from HTML & plain text
  • 🔁 Shortened URL resolution & redirect tracing
  • 🛡️ URLScan.io integration for advanced analysis
  • 🔍 SSL certificate & domain reputation validation
  • ⚠️ Risk scoring system (Low → Critical)
  • 🔔 Native desktop notifications
  • 🧾 Persistent alert logging

📦 Installation

git clone https://github.com/ShivKushDev/PhishSnitch.git
cd PhishSnitch
pip install -r requirements.txt

🔧 Platform Notes

  • macOS: brew install terminal-notifier
  • Linux: sudo apt-get install libnotify-bin

🔐 Configuration

1. Google Cloud Setup

  • Visit Google Cloud Console
  • Create a project and enable the Gmail API
  • Generate OAuth 2.0 Client ID (Desktop App)
  • Download credentials.json and move it into:
mkdir config
mv credentials.json config/

2. URLScan.io API Key

3. Create Config File

Create config/config.yaml:

gmail:
  credentials_path: config/credentials.json
  check_interval: 300

urlscan:
  api_key: "your-urlscan-api-key"
  cache_duration: 3600

security:
  whitelist: []
  blacklist: []
  risk_threshold: 70

alerts:
  history_path: data/alert_history.json
  desktop_notifications: true

▶️ Running PhishSnitch

python src/app.py
  • Browser opens on first run to authorize Gmail access
  • Logs saved in logs/app.log
  • Alerts stored in data/alert_history.json

Note: If Ctrl+C doesn't stop the application, use PowerShell command:

Get-Process python | Stop-Process

This will forcefully terminate all Python processes.


🚨 Risk Scoring

Level Score Range Indicators
CRITICAL 80–100 Malicious domains, credential theft
HIGH 60–79 Redirect chains, no SSL, fresh domain
MEDIUM 40–59 Obfuscation, suspicious URLs
LOW 20–39 New domains, URL shorteners

🧪 Testing Guide

✅ Safe Test URLs

  • http://example.com
  • https://test-phish.example.com
  • http://bit.ly/test123

📧 Sample Test Email

Subject: Reset your password
From: [email protected]
Link: http://bit.ly/fake-login

🔬 Manual Test

python src/app.py
# Then send a test email and check logs/notifications

🧪 Run Tests

export PYTHONPATH=$PWD
python -m pytest -v tests/
python -m pytest --cov=src tests/

📸 Screenshots & Demos

Real-time Monitoring & Alerts

Alert Notifications Desktop notifications for immediate threat awareness

Comprehensive Risk Analysis

Critical Risk Alert Detailed analysis of critical security threats

High Risk Alert High risk threat detection with detailed scoring

Medium Risk Alert Medium risk assessment with comprehensive analysis

Live Testing

Real-time Testing Real-time threat detection and analysis in action


👨‍💻 Developer Utilities

black src/
mypy src/

🤝 Contributing

  1. Fork this repo
  2. Create a new branch: git checkout -b feature-name
  3. Make your changes and commit
  4. Run tests & format code
  5. Submit a pull request 🎉

📝 License

Licensed under the MIT License.


📚 References

About

Catching malicious links red-handed, so you don’t have to.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages