Skip to content

100Psycho007/smart-phishing-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Smart Phishing Detector πŸ›‘οΈ

A modern web-based tool that combines AI analysis and threat intelligence to detect phishing attempts. Built with vanilla JavaScript, it provides real-time URL analysis using GPT models and VirusTotal's comprehensive threat database.

✨ Features

  • πŸ” Dual Analysis: AI-powered URL analysis + threat intelligence
  • πŸ“· OCR Support: Extract URLs from images using Tesseract.js
  • πŸ€– Multiple AI Models: Support for GPT-4, Claude, Gemini, and more
  • πŸ›‘οΈ Real-time Scanning: Live threat detection via VirusTotal
  • πŸ“± Responsive Design: Works on desktop and mobile devices
  • πŸ”’ Privacy-Focused: No data storage, client-side processing
  • ⚑ Fast & Lightweight: No heavy frameworks, pure JavaScript

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/yourusername/smart-phishing-detector.git
cd smart-phishing-detector

2. Configure API Keys

Edit api-key.js and add your API keys:

// Get your OpenRouter key from: https://openrouter.ai/keys
const OPENROUTER_API_KEY = 'your_openrouter_api_key_here';

// Get your VirusTotal key from: https://www.virustotal.com/gui/join-us
const VIRUSTOTAL_API_KEY = 'your_virustotal_api_key_here';

// Optional: Choose your preferred AI model
const GPT_MODEL = 'openai/gpt-4'; // or 'anthropic/claude-3-opus', etc.

3. Open in Browser

Simply open index.html in your web browser. No server setup required!

πŸ“‹ Prerequisites

Required API Keys

OpenRouter API Key

  1. Visit OpenRouter
  2. Sign up for a free account
  3. Generate an API key
  4. Add funds to your account (pay-per-use)

VirusTotal API Key

  1. Visit VirusTotal
  2. Create a free account
  3. Get your API key from the profile section

Browser Requirements

  • Modern browser with ES6+ support
  • Internet connection for API calls
  • JavaScript enabled

🎯 How to Use

Method 1: Direct URL Input

  1. Paste or type a URL in the input field
  2. Click "Check URL"
  3. View AI analysis and threat intelligence results

Method 2: Image Upload with OCR

  1. Upload an image containing a URL (screenshot, email, etc.)
  2. Click "Extract & Check URL"
  3. The tool will extract the URL and analyze it automatically

Understanding Results

AI Analysis Card

  • Risk Level: Low/Medium/High assessment
  • Key Findings: Main concerns identified
  • Analysis: Detailed explanation
  • Recommendation: What you should do

Threat Intelligence Card

  • Detection Rate: How many security vendors flagged the URL
  • Vendor Results: Specific threats detected
  • Scan Date: When the URL was last analyzed
  • Full Report: Link to detailed VirusTotal report

Overall Assessment

  • Clear "SAFE" or "DANGEROUS" badge
  • Combined analysis from both sources
  • Actionable advice

πŸ—οΈ Project Structure

smart-phishing-detector/
β”œβ”€β”€ index.html             # Main UI
β”œβ”€β”€ style.css              # Modern, responsive styles
β”œβ”€β”€ api-key.js             # API key configuration (local only)
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ ocr.js             # Tesseract.js OCR functionality
β”‚   β”œβ”€β”€ gpt-check.js       # OpenRouter GPT analysis
β”‚   └── vt-check.js        # VirusTotal threat intelligence
β”œβ”€β”€ assets/                # Icons and sample images
β”œβ”€β”€ docs/                  # Documentation
β”‚   β”œβ”€β”€ walkthrough.md     # How it works guide
β”‚   └── model-info.md      # Technical details
└── README.md              # This file

πŸ”§ Configuration

AI Model Selection

Choose your preferred AI model in api-key.js:

// Available models:
const GPT_MODEL = 'openai/gpt-4';           // Best analysis, higher cost
const GPT_MODEL = 'anthropic/claude-3-opus'; // Advanced reasoning
const GPT_MODEL = 'google/gemini-pro';      // Cost-effective
const GPT_MODEL = 'mistralai/mistral-large'; // Open model

Customization

  • Modify style.css for custom styling
  • Edit prompts in scripts/gpt-check.js for different analysis focus
  • Adjust OCR settings in scripts/ocr.js for better text extraction

πŸ›‘οΈ Security & Privacy

Privacy Protection

  • βœ… No URLs are stored or logged
  • βœ… All processing happens in real-time
  • βœ… API keys kept local and secure
  • βœ… No personal data collection
  • βœ… Client-side OCR processing

Security Features

  • βœ… HTTPS-only API calls
  • βœ… Input validation and sanitization
  • βœ… Rate limiting compliance
  • βœ… Error handling without data exposure

πŸ’° Cost Considerations

OpenRouter (AI Analysis)

  • GPT-4: ~$0.03 per 1K input tokens
  • Claude-3 Opus: ~$0.015 per 1K input tokens
  • Gemini Pro: ~$0.0005 per 1K input tokens

VirusTotal (Threat Intelligence)

  • Free Tier: 4 requests/minute, 500 requests/day
  • Paid Plans: Starting at $10/month

Cost Optimization

  • Use appropriate model for your use case
  • Monitor usage to stay within budget
  • Consider caching for repeated checks

πŸ› Troubleshooting

Common Issues

"API key not configured"

  • Add your API keys to api-key.js
  • Ensure keys are valid and have proper permissions
  • Check for typos in the configuration

"OCR failed to extract URL"

  • Try a clearer image with better contrast
  • Ensure the URL is clearly visible
  • Check that the image format is supported

"Analysis timeout"

  • Check your internet connection
  • Verify API services are available
  • Try again in a few minutes

Getting Help

  1. Check the browser console for detailed error messages
  2. Verify your API keys are working
  3. Test with known safe URLs first
  4. Consult the documentation in docs/

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Areas for Improvement

  • Additional AI models
  • More threat intelligence sources
  • Browser extension version
  • Server-side API endpoint
  • Machine learning enhancements

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • OpenRouter for AI model access
  • VirusTotal for threat intelligence
  • Tesseract.js for OCR functionality
  • Font Awesome for icons

πŸ“ž Support

If you need help or have questions:

  • Check the documentation in docs/
  • Open an issue on GitHub
  • Test with known URLs first

⚠️ Disclaimer: This tool is for educational and informational purposes. Always verify results with multiple sources and use your judgment when making security decisions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors