Skip to content

A Rest API which which takes url as input from user and display the result if the url is legitmate or phish.

Notifications You must be signed in to change notification settings

amitkroutthedev/phishing-url-detection-backend

Repository files navigation

phishing-url-detection-backend

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.

Documentation

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.

image

Deployment

Deploy

Main Features

  • The phish/legitmate percentage
  • All the 15 feature extraction values

API Reference

Get item

  GET https://django-temp-app.herokuapp.com/api/?url=${url}
Parameter Type Description
url string Required. the url given by client

Screenshots

image

Run Locally

Prerequisites:

  • 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

Contributing

Contributions are always welcome!

About

A Rest API which which takes url as input from user and display the result if the url is legitmate or phish.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published