Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phishing URL Detection

A simple, practical machine learning project to detect phishing URLs using URL-based features and a lightweight ML model, wrapped with a Flask web interface.

This project is meant to demonstrate how classical ML techniques can be applied to real-world cybersecurity problems, with a clean and easy to understand codebase.


Project Overview

Phishing attacks rely heavily on malicious URLs that look legitimate at first glance. This project analyzes different characteristics of a URL and predicts whether it is phishing or legitimate.

The focus is on:

  • Feature engineering from raw URLs
  • Using a trained ML model for prediction
  • Serving predictions via a Flask web app

📁 Project Structure

phishing_url_detection/
│
├── app.py            # Flask application entry point
├── features.py       # URL feature extraction logic
├── templates/        # HTML templates for the web interface
├── README.md         # Project documentation
├── LICENSE           # MIT License
└── .gitignore        # Ignored files and folders

How It Works

  1. User inputs a URL through the web interface
  2. The URL is passed to features.py
  3. Multiple lexical and structural features are extracted
  4. These features are fed into a trained ML model
  5. The model predicts whether the URL is Phishing or Safe

Machine Learning Model

  • The model is trained on a labeled phishing URL dataset

  • It uses URL-based features such as:

    • Length of URL
    • Presence of special characters
    • Use of IP address instead of domain
    • Suspicious keywords
    • Number of subdomains

Note on Model File

The trained ML model file (.pkl / .joblib) is not included in this repository because it exceeds GitHub’s file size limit.

How to Handle the Model File

You have two recommended options:

Option 1: Cloud Storage (Recommended)

  • Upload the trained model to:

    • Google Drive
    • Dropbox
    • AWS S3
  • Download it locally before running the app

Option 2: Retrain Locally

  • Use the same feature extraction logic
  • Train the model again using your dataset
  • Save it locally and load it inside app.py

Running the Project Locally

1️ Clone the Repository

git clone https://github.com/akshitago01/phishing_url_detection.git
cd phishing_url_detection

2️ Install Dependencies

pip install -r requirements.txt

(If requirements.txt is missing, install Flask, scikit-learn, numpy, pandas manually.)

3️ Run the Flask App

python app.py

4️ Open in Browser

http://127.0.0.1:5000/

Use Cases

  • Educational ML & cybersecurity project
  • Demonstrating feature engineering on text data
  • Foundation for a larger phishing detection platform
  • Can be extended into a browser extension or API

Built with curiosity, learning, and a focus on cybersecurity.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages