Our project revolves around the idea of building a browser extension that empowers users to navigate the web with confidence by detecting and warning them about phishing sites, fake reviews, and other online threats.
- Python 3.11
- Whois cli
- pip
Install gama with git & pip
> git clone https://github.com/PhuyalGaurav/gama.git
# now be in the gama folder & make a venv
> cd gama
\gama> python -m venv venv
# install all the dependencies
\gama> venv\Scripts\activate
(venv) .. \gama> pip install -r requirements.txt
To deploy this project run
# be in the root gama folder
# make sure you have your venv activated
\gama>venv\Scripts\activate
(venv) .. \gama> cd backend
(venv) .. \gama\backend> python app.python
# Now the local server should be running
Libraries Used | Why? |
---|---|
Fast API | We Used to fast api. Because it is very light weight and also new!, we also went with a api approach so that other developers can use our api to integrate it in thier own applications |
Sk Learn | Since our data set was quite small . We went with sklearn rather than tensorflow. Also with our limited hardware we could train with it easier than tensorflow that utilizes heavy & expensive cuda cores |
Whois | We choose whois cli instead of an api because we wanted to keep this as free as possible and also keep the delay between front & backend small. |
Chrome extention | we went with chrome extension to make this as usable as possbile & reach as many people as possible we are planning to add firefox in the future so that it reaches mobie uses too |
gama/
├─ .github/
│ ├─ 0.png
│ ├─ 10.png
│ ├─ 11.png
│ ├─ 12.png
│ ├─ 8.png
│ ├─ 9.png
│ ├─ image-1.png
│ ├─ image-2.png
│ ├─ image-3.png
│ ├─ image-4.png
│ ├─ image-5.png
│ ├─ image-6.png
│ └─ image-7.png
├─ .gitignore
├─ LICENSE
├─ README.md
├─ backend/
│ ├─ Datasets/
│ │ ├─ amazon_reviews_2019.csv
│ │ ├─ fake_news_dataset.csv
│ │ └─ phishing_site_urls.csv
│ ├─ MLModels/
│ │ ├─ fakeNewsModel.pkl
│ │ ├─ fakeNewsVectorizer.pkl
│ │ ├─ phishing.pkl
│ │ ├─ reviewModel.pkl
│ │ └─ reviewVecotorizer.pkl
│ ├─ app.py
│ ├─ db/
│ │ └─ db.sqlite3
│ ├─ helpers.py
│ ├─ models.py
│ └─ news_predictor.py
├─ frontend/
│ ├─ background.js
│ ├─ contentScript.js
│ ├─ logo.png
│ ├─ manifest.json
│ ├─ override.html
│ ├─ overrideJs.js
│ ├─ overrideStyles.css
│ ├─ popup.html
│ ├─ popup.js
│ └─ styles.css
├─ proposal.pdf
└─ requirements.txt
- .github/ contains all of the images needed for github read me
- backend/ contains the backend code
- datasets/ contains all data sets used to train our models
- MLModels/ contains all the machine learning models
- Fronend/
- contains code for extention
Contains all the code for running the fast api server.
Contains all the helper function & Review model with its text pre processor
Contains the class for preding if a news is Fake or not.
Contains database models and pydantic shecma models.
GET /phishing?url=
Parameter | Type | Description |
---|---|---|
url Required |
string |
Gives true if phishing link detected else false |
GET /reports
Parameter | Type | Description |
---|---|---|
None | none | Returns all the reports that are repoted by user (saved on db). |
GET /details?url=
Parameter | Type | Description |
---|---|---|
url | string | the link of the website whose details is neededs |
value returned | Type | Description |
---|---|---|
Name | string | Returns all the reports that are repoted by user (saved on db). |
registrar | string | The registrar of the domain. |
registrant_country | string | The country of the registrant. |
creation_date | Date | The date when the domain was created. |
expiration_date | Date | The date when the domain will expire. |
last_updated | Date | The date when the domain was last updated. |
dnssec | bool | The registrant of the domain. |
registrant | string | Returns all the reports that are repoted by user (saved on db). |
emails | string | The associated emails of the domain. |
country_name | string | The country name of the domain. |
POST /report
Parameter | Type | Description |
---|---|---|
Url | string | url of the website which is to be blocked |
reason | string | the reason why the website should be blocked |
POST /report_mistake
Parameter | Type | Description |
---|---|---|
Url | string | url of the website which is to be unblocked |
reason | string | the reason why the website should be unblocked |
POST /review
Parameter | Type | Description |
---|---|---|
review | string | The review which is to be checked |
Value returned | Type | Description |
---|---|---|
prediction | bool | True if review is fake |
POST /news
Parameter | Type | Description |
---|---|---|
news | string | The news which is to be checked |
Value returned | Type | Description |
---|---|---|
prediction | bool | True if review is fake |
PUT /reports/{id}?real=
Parameter | Type | Description |
---|---|---|
id | integer | the id of the report to be made ture or false |
real | bool | The boolen value of the report to be set. |
- After the server has been set up. Add the frontend extention to your web browser . Make sure that developer mode is enabled.
- Now Load unpacked
- Now select the frontend folder from gama directory
- Now the extention should be installed. go ahead and pin it. so:
- Now the extention is installed!
- Your extention should be shown like this with details
-
Now whenever you visit a suspisous site the above screen is shown protecting you from online threats
-
If you wish to Disable this just click the checkbox
- If you ever find a site that seems suspicous you can report it by just reporting it in the textbox like so:
- If you want to check for a fake review then highlight the text and right click
- Now click on gama and click on Review check
- Now you should get a notification like this:
- If you would like to check for fake news follow the same process just click on news check :
- Then you should get a notification like this
- The python server is easily uploadable to the web & serve use through online apis
- The apis can be used by 3rd party apps too.
- The machine learning models are trained on datasets found on kaggle (With the creators permission )
- Fake News Model : 81.23%
- Phishing Detector Model : 78.93%
- Fake Review Model : 73.22%
Thank you manideep2510 for letting us use their pre-trained fake news detection model