How uzukhai/malicious-url-detection-using-machine-learning-algorithm works
This repository provides a Flask interface for submitting a URL and viewing a malicious/benign classification. The request handler launches the prediction script; prediction validates the URL, extracts features, loads the trained Random Forest and label encoder, then prints the predicted label for the results page. A separate training workflow builds and saves those model artifacts. The archive is documented as containing the model and dataset. Feature extraction is shown; templates and archive contents are not sampled, so their internal details are omitted.
Main entry points: predict.py Prediction CLI · train.py Model training · app.py Flask request handler · extract.py URL feature extraction
Components 11
Web interface
- Flask request handler
app.py - Results page
app.py
URL classification
- Prediction CLI
predict.py - URL feature extraction
extract.py - URL features
extract.py - Classification label
predict.py
Model training
- Model training
train.py
Model artifacts
- Random Forest
model and dataset.zip - Label encoder
model and dataset.zip - URL dataset
model and dataset.zip
Other components
- URL submitter
Connections 12
- URL submitter → Flask request handler: submits URL
app.py - Flask request handler → Prediction CLI: launches CLI
app.py - Prediction CLI → URL feature extraction: extracts features
predict.py - URL feature extraction → URL features: produces
extract.py - Prediction CLI → Random Forest: loads and predicts
predict.py - Prediction CLI → Label encoder: decodes label
predict.py - Prediction CLI → Classification label: prints label
predict.py - Flask request handler → Results page: renders result
app.py - Model training → URL dataset: reads dataset
train.py - Model training → URL feature extraction: extracts features
train.py - Model training → Random Forest: trains and saves
train.py - Model training → Label encoder: fits and saves
train.py