SafeWebVerify is a full-stack web application for detecting phishing websites using machine learning. It features a modern React frontend, a secure Node.js/Express backend, and a Python-based ML API for real-time phishing detection. The system is trained on a rich phishing dataset and achieves up to 98% accuracy.
- Features
- Architecture
- Client (Frontend)
- Server (Backend)
- ML API (Machine Learning)
- Phishing Dataset & Features
- Model Training & Accuracy
- Download the ML Model
- How to Run
- License
- Notes
- User Authentication: Signup, login, profile management, and password change.
- Phishing URL Detection: Enter a URL and get instant phishing/legitimate/suspicious results with confidence score.
- History Tracking: All checks are stored per user, with the ability to view and delete history.
- Whitelisted Domains: Trusted domains are instantly marked as legitimate.
- Modern UI: Responsive, user-friendly React interface.
- High Accuracy: ML model achieves up to 98% accuracy on test data.
graph TD
A[React Client] -- REST API --> B[Node.js/Express Server]
B -- REST API --> C[Python Flask ML API]
B -- MongoDB --> D[(MongoDB)]
- Tech Stack: React 19, Vite, React Router, CSS modules.
- Key Features:
- Signup/Login/Profile/History pages
- Dashboard for URL checks
- Responsive design
- Delete history entries with a single click
- Location:
/client - Start:
npm install && npm run devin/client
- Tech Stack: Node.js, Express, MongoDB (Mongoose), JWT, CORS, dotenv.
- Key Features:
- REST API for authentication, profile, history, and phishing checks
- JWT-based authentication middleware
- Secure password hashing (bcryptjs)
- API endpoints:
POST /api/auth/signup— RegisterPOST /api/auth/login— LoginGET /api/auth/profile— Get profilePATCH /api/auth/profile— Update profileDELETE /api/auth/profile— Delete accountPOST /api/auth/check-url— Check a URL (phishing detection)GET /api/auth/history— Get user’s check historyDELETE /api/auth/history/:id— Delete a history entry
- Location:
/server - Start:
npm install && npm startin/server
PORT=5500
MONGODB_URI=mongodb://localhost:27017/safewebverify
JWT_SECRET=your_jwt_secret
CLIENT_URL=http://localhost:5173
- Tech Stack: Python, Flask, scikit-learn, joblib, numpy, pandas, imbalanced-learn
- Key Features:
- Loads a pre-trained model (
phishing_model.pkl) - Exposes
/predictendpoint for feature vector prediction - Returns label (
Phishing,Legitimate,Suspicious/Unknown) and confidence - Whitelisted domains are instantly marked as legitimate
- Loads a pre-trained model (
- Location:
/ml-api - Start:
pip install -r requirements.txt && source venv/bin/activate && python app.pyin/ml-api
- Dataset:
phishing.csv(11,056 rows) - Features (30):
- UsingIP, LongURL, ShortURL, Symbol@, Redirecting//, PrefixSuffix-, SubDomains, HTTPS, DomainRegLen, Favicon, NonStdPort, HTTPSDomainURL, RequestURL, AnchorURL, LinksInScriptTags, ServerFormHandler, InfoEmail, AbnormalURL, WebsiteForwarding, StatusBarCust, DisableRightClick, UsingPopupWindow, IframeRedirection, AgeofDomain, DNSRecording, WebsiteTraffic, PageRank, GoogleIndex, LinksPointingToPage, StatsReport
- Target:
class(1= phishing,-1= legitimate)
- Model: (e.g., RandomForest, SVM, etc. — specify in your training script)
- Training: Trained on
phishing.csvwith 30 features - Epochs: (Specify if using neural network; for scikit-learn, state cross-validation or fit method)
- Accuracy: 98% on test/validation set
- Exported Model:
phishing_model.pkl
The pre-trained ML model file (phishing_model.pkl) is not included in this repository due to its size.
You can download the model from the following GitHub repository:
https://github.com/bsurajpatra/Phishing-detector-ml
- Visit the above link.
- Download the ZIP file provided in the repository.
- Extract the contents — you will find the
phishing_model.pklfile along with other training scripts and files. - You only need the
phishing_model.pklfile for this project; the rest can be ignored.
After extracting the file, place phishing_model.pkl in the /ml-api directory:
- Start MongoDB (if not running)
- Start ML API:
cd ml-api pip install -r requirements.txt python app.py - Start Backend:
cd server npm install npm start - Start Frontend:
cd client npm install npm run dev - Visit: http://localhost:5173
MIT — see LICENSE
- For best results, ensure all
.envvariables are set correctly. - The ML model and dataset are for educational/research use.
- For production, secure all secrets and use HTTPS.