Skip to content

tarxemo/VishingBackend

Repository files navigation

📞🔍 Vishing Detection System

Django Backend + Android Frontend

This project is a Vishing (Voice Phishing) Detection System that uses an Android mobile application to intercept incoming phone calls and send call information to a Django backend for real-time analysis. The backend analyzes the call data and determines whether the call is safe, suspicious, or potentially harmful.


🚀 Overview

This system consists of two major components:

1. Android App (Frontend)

  • Runs on the user’s phone.
  • Intercepts incoming calls (using Android Telephony API).
  • Extracts caller phone number and metadata.
  • Sends call information to the Django backend via REST API.
  • Displays the backend’s analysis (Safe / Suspicious / Vishing).

2. Django Server (Backend)

  • Receives call data from Android devices.
  • Runs ML or rule-based vishing detection logic.
  • Returns a JSON response with the risk analysis.
  • Stores logs for future training and improvement.

🧠 How It Works (System Flow)

  1. A call arrives on the Android phone.

  2. Android App captures:

    • Phone number
    • Call time
    • Call type (incoming/outgoing)
  3. App sends this data to Django backend → /api/call-detection/

  4. Django backend:

    • Processes the phone number
    • Checks machine-learning or blacklist rules
    • Generates a "risk score" or "threat category"
  5. Backend responds with:

    {
      "status": "suspicious",
      "score": 87,
      "reason": "Number reported multiple times"
    }
  6. Phone displays an alert (RED / YELLOW / GREEN).

  7. Django saves the call analysis for future dataset building.


🏗️ Technologies Used

Backend (Django)

  • Django REST Framework
  • Python
  • SQLite / PostgreSQL
  • Machine Learning model or rule-based detector

Frontend (Android)

  • Android Studio (Java/Kotlin)
  • TelephonyManager
  • Retrofit for API calls
  • Notifications / UI alerts

📦 Django API Endpoints

POST /api/call-detection/

Send call details to backend.

Example request:

{
  "phone_number": "+123456789",
  "call_type": "incoming",
  "timestamp": "2025-11-16T10:30:00"
}

Example response:

{
  "status": "vishing",
  "confidence": 0.92,
  "message": "Number associated with scam patterns"
}

🛠️ Setup Instructions (Backend)

1. Clone the project

git clone https://github.com/yourusername/vishing-detector-backend.git
cd vishing-detector-backend

2. Create virtual environment

python3 -m venv venv
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Apply migrations

python manage.py migrate

5. Run server

python manage.py runserver

📱 Android App Setup (Frontend)

  1. Open /android_app/ folder with Android Studio

  2. Update backend URL in Retrofit service:

    const val BASE_URL = "http://YOUR_SERVER_IP:8000/"
  3. Run on device

  4. App requests permissions:

    • READ_CALL_LOG
    • READ_PHONE_STATE
    • POST_NOTIFICATIONS
  5. Intercepted calls will now be analyzed by Django server.


🤖 Detection Logic

You may use:

Option 1 — Machine Learning Model

  • Train using past call logs + labels (safe/spam/vishing)
  • Use logistic regression, SVM, or transformer language model on call remarks

Option 2 — Rule-Based Detection

  • Check phone number:

    • Reported spam lists
    • Known fraud numbers
    • Short suspicious patterns (e.g., “+255 6XX 00XX”)
    • Time-based anomalies

📊 Database Example

Phone Number Status Score Timestamp
+255621XXXX vishing 0.91 2025-11-15
+1415555XXXX safe 0.02 2025-11-16
+255784XXXX suspicious 0.62 2025-11-16

📜 License

About

This is the django backend project for the vishing call detection with the java android front end

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors