Phishing Website Detection is a machine learning project that classifies URLs as legitimate or potentially phishing. It provides a Streamlit interface where a user can enter a URL, run the trained Random Forest model, and view both the prediction and the URL signals used for that prediction.
For the visual project presentation, visit the Phishing Website Detection project page.
Financial services and other online platforms process a large volume of real-time transactions. This makes them attractive targets for fraud and social engineering attacks. Phishing is one of the most common techniques used to steal sensitive information from unsuspecting users.
In a typical phishing attack, an attacker creates a website that imitates a trusted organization. The victim may be directed to the site through an email, message, or misleading link and asked to enter information such as a name, telephone number, account details, or password. The stolen information can then be used for unauthorized access or fraudulent transactions.
Phishing websites often look convincing and attackers continuously change their techniques to avoid detection. An automated URL analysis system can help identify suspicious characteristics before a user trusts a link.
This project explores how URL-based features can be used to distinguish legitimate websites from phishing websites. The feature-extraction workflow analyzes signals such as:
- URL length and redirection patterns
- IP addresses and prefix/suffix separation
- Number of subdomains
- URL-shortening services
- HTTPS token usage
- DNS and domain-registration information
- Domain age and statistical reputation signals
These features are passed to a trained Random Forest classifier. The application then displays the resulting classification as Legitimate or Phishing.
- Enter a complete URL in the Streamlit interface.
- Extract the URL features used during model training.
- Pass the numeric feature vector to the saved Random Forest model.
- Display the prediction and the extracted feature values.
This tool is intended for experimentation and educational use. Its prediction should not be treated as a guarantee that a website is safe or malicious.
app.py- Streamlit application and prediction workflowfeatureExtraction.py- URL feature-extraction logicRandomForestModel.sav- trained Random Forest modelnotebooks/- feature extraction and model-training notebooksraw_datasets/- source URL datasets used for experimentationdocs/- standalone GitHub Pages project presentationrequirements.txt- Python dependencies
Create or activate the repository virtual environment, then install the dependencies into that environment:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txtStart the application:
streamlit run app.pyThe app extracts the same URL signals used by the model, displays the prediction, and lets you inspect the extracted values.
The raw_datasets/ directory contains the source URL lists, and notebooks/ documents feature extraction and model training. Run the feature-extraction notebook first; it creates the ignored generated_data/ CSV files consumed by the classifier notebooks.
The production runtime consists of app.py, featureExtraction.py, and RandomForestModel.sav. The notebooks and raw datasets are kept separately for reproducibility and experimentation.
Built by chamanthmvs.