A Rest API which which takes url as input from user and display the result if the url is legitmate or phish.
Based on python3.8
and Django4.0
.
From phishing-url-detection-ml,
the XGBoost Model had the best result. The model is saved in the .sav
file. We integrate the file
with the Django app. We also added all the
15 features in
the feature. For building the API, we used
REST API. In the API, we used a GET request to
get the URL from the client and predict the
URL through the saved model.
For the safety of the API, we use CORS,
which allows in-browser requests to your
Django application from other origins.
The result is sent to the user in JSON format.
We can get following data form the API
"url"
: Name of the website"featureExtraction"
: values of 15 feature extractions from the URL"predictionMade"
: If the value is ‘1’ then the URL is a Phishing URL and if the value is ‘0’ then the URL is a Legitimate URL."successRate"
: The percentage of the URL to a be legitimate."phishRate"
: The percentage of the URL to be a phish.
- The phish/legitmate percentage
- All the 15 feature extraction values
GET https://django-temp-app.herokuapp.com/api/?url=${url}
Parameter | Type | Description |
---|---|---|
url |
string |
Required. the url given by client |
- Have the appropriate Python version.
Install virtualenv
pip install virtualenv
Clone the project
git clone https://github.com/amitkroutthedev/phishing-url-detection-backend.git
Go to the project directory
cd my-project
Assigning virtualenv name
virtualenv --python C:\Path\To\Python\python.exe {virtualenv_name}
Activating Virtual Enviroment
.\{virtualenv_name}\Scripts\activate
Installing packages
pip freeze > requirements.txt
Run the project
django-admin startproject myproject
Deactivate the virtual environment
deactivate
- Frontend - https://github.com/amitkroutthedev/phishing-url-detection-frontend
- Live Extension - https://github.com/amitkroutthedev/phishing-url-detection-extension
- ML - https://github.com/amitkroutthedev/phishing-url-detection-ml
Contributions are always welcome!