Skip to content

AnnshAgrawaal/ClickSafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔍 ClickSafe - Smart Link & Email Safety Analyzer

ClickSafe is an advanced security tool that helps users identify potentially malicious links and email content. Built with Python Flask and a modern web interface, it provides real-time analysis to protect against phishing attempts, malware, and online scams.

🌟 Key Features

🔗 Link Analysis

  • Comprehensive URL Scanning: Deep analysis of URLs for potential threats
  • Risk Assessment: Categorizes links as Safe, Suspicious, or Dangerous
  • Detailed Reports: Provides clear explanations for risk assessments
  • Confidence Scoring: Indicates the reliability of each analysis
  • Batch Processing: Analyze multiple links simultaneously

✉️ Email Content Analysis

  • Phishing Detection: Identifies common phishing patterns and social engineering attempts
  • Spoofing Alerts: Detects email spoofing and impersonation attempts
  • Malware Link Detection: Flags suspicious download links and attachments
  • Content Analysis: Evaluates email content for suspicious patterns

🛡️ Advanced Detection Methods

  • URL Analysis

    • URL shortener detection
    • Suspicious domain patterns (IDN homograph attacks, typosquatting)
    • IP address usage detection
    • HTTPS/SSL validation
    • URL length and structure analysis
    • Query parameter inspection
  • Domain Analysis

    • Trusted domain whitelist
    • Suspicious TLD detection
    • Domain age and reputation checking (future)
    • SSL certificate validation (future)
  • Content Analysis

    • Phishing keyword detection
    • Suspicious file extension identification
    • Malware pattern matching
    • Social engineering red flags

🚀 Quick Start

Prerequisites

  • Python 3.7 or higher
  • Node.js 14+ (for frontend development)
  • pip package manager

🛠️ Installation & Setup

Backend Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/ClickSafe.git
    cd ClickSafe
  2. Create and activate a virtual environment:

    # Windows
    python -m venv venv
    .\venv\Scripts\activate
    
    # macOS/Linux
    python3 -m venv venv
    source venv/bin/activate
  3. Install Python dependencies:

    pip install -r requirements.txt

Frontend Setup

  1. Install Node.js dependencies:
    npm install

Running the Application

  1. Start the Flask backend:

    python app.py
  2. In a new terminal, start the development server:

    npm start
  3. Access the web interface at http://localhost:5000

Production Deployment

For production deployment, use Gunicorn:

gunicorn --bind 0.0.0.0:5000 app:app

Or deploy using Vercel with the included vercel.json configuration.

Troubleshooting

Common Issues and Solutions

  1. ModuleNotFoundError: No module named 'flask_cors'

    • Solution: Ensure you've installed dependencies with pip install -r requirements.txt
    • Verify the package is installed with pip list | grep -i flask
  2. ModuleNotFoundError: No module named 'flask'

    • Solution: Ensure you've installed dependencies with pip install -r requirements.txt
    • Verify the package is installed with pip list | grep -i flask
  3. FileNotFoundError: [Errno 2] No such file or directory: 'index.html'

    • Solution: Ensure the index.html file is in the same directory as app.py
    • Verify with ls -la (Linux/Mac) or dir (Windows)
  4. Port already in use

    • Solution: Stop any existing instances of the app or change the port in app.py
    • Kill existing processes: lsof -i :5000 (Linux/Mac) or netstat -ano | findstr :5000 (Windows)

Verifying Installation

To verify all dependencies are installed correctly:

pip install -r requirements.
python -c "import flask; import flask_cors; print('All dependencies installed successfully')"

API Endpoints

  • POST /api/analyze - Analyze a single URL
  • POST /api/batch-analyze - Analyze multiple URLs
  • GET /api/health - Health check endpoint
  • GET /api/stats - Get detector statistics

Example API Usage

Health Check:

curl -X GET http://localhost:5000/api/health

Single URL Analysis:

curl -X POST http://localhost:5000/api/analyze \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Batch URL Analysis:

curl -X POST http://localhost:5000/api/batch-analyze \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://google.com", "https://github.com"]}'

🧪 Testing

Run the test suite using either:

# Run JavaScript tests
npm test

# Or run Python tests
python test-clicksafe.py

Test coverage includes:

  • URL analysis accuracy
  • Email content parsing
  • Risk assessment logic
  • API endpoint functionality
  • Edge case handling

Deployment

The application is configured for deployment on Vercel through the vercel.json configuration file.

For production deployment, you can use Gunicorn:

gunicorn --bind 0.0.0.0:5000 app:app

🎯 Future Enhancements

Planned Features

  • Enhanced Detection

    • Real-time threat intelligence integration
    • Machine learning for pattern recognition
    • Browser extension for on-the-fly analysis
    • Mobile application for on-the-go protection
  • Advanced Analytics

    • Historical analysis and trend tracking
    • Custom threat intelligence feeds
    • User reporting system
    • Community-driven threat database
  • Enterprise Features

    • API rate limiting and authentication
    • Detailed audit logs
    • Custom rule configuration
    • Team collaboration tools

🤝 Contributing

We welcome contributions! Please read our Contributing Guidelines for details on our code of conduct and the process for submitting pull requests.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

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

🙏 Acknowledgments

  • Built with ❤️ using Python, Flask, and modern web technologies
  • Inspired by the need for better online security tools
  • Thanks to all contributors who have helped improve this project

About

Resources

Stars

Watchers

Forks

Contributors