Skip to content

NinjaScout77/droidguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DroidGuard AI v2.0

AI-Powered Agentic Android Security Testing Platform

License Python React


🎯 What is DroidGuard AI?

DroidGuard AI is an autonomous security testing platform for Android applications. It uses specialized AI agents to discover, validate, and report vulnerabilities - designed for daily use by bug bounty hunters and security engineers.

Key Differentiators

Feature Description
Multi-Agent Architecture 4 specialized agents (Recon, Attack, Exploit, Report) with intelligent handoffs
User-Controlled Autonomy Choose from Manual β†’ Guided β†’ Semi-Auto β†’ Full-Auto
Mandatory Approval Gate System STOPS before exploitation and asks for your decision
Non-Aggressive by Default Only safe PoCs automated; advanced attacks generate offline guides
Bug Bounty Ready Reports formatted for HackerOne, Bugcrowd, etc.

πŸ—οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         USER INTERFACE                          β”‚
β”‚              Web UI  β”‚  CLI  β”‚  REST API                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      MISSION CONTROL                            β”‚
β”‚                   (Agent Orchestration)                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β–Ό                       β–Ό                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   RECON     │────────▢│   ATTACK    │────────▢│   EXPLOIT   β”‚
β”‚   AGENT     β”‚         β”‚   AGENT     β”‚         β”‚   AGENT     β”‚
β”‚             β”‚         β”‚             β”‚         β”‚             β”‚
β”‚ β€’ APK Analysis        β”‚ β€’ Detection β”‚         β”‚ β€’ Safe PoCs β”‚
β”‚ β€’ Attack Surface      β”‚ β€’ Tests     β”‚         β”‚ β€’ Evidence  β”‚
β”‚ β€’ Tech Fingerprint    β”‚ β€’ Exploita- β”‚    β”Œβ”€β”€β”€β–Άβ”‚ β€’ Guides    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚   bility    β”‚    β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚            β”‚
                                β”‚          β”‚            β–Ό
                                β–Ό          β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚    β”‚   REPORT    β”‚
                        β”‚  USER GATE  β”‚β”€β”€β”€β”€β”˜    β”‚   AGENT     β”‚
                        β”‚  (Approval) β”‚         β”‚             β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚ β€’ CVSS      β”‚
                                                β”‚ β€’ Walkthroughs
                                                β”‚ β€’ Remediationβ”‚
                                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

βš™οΈ Autonomy Levels

Level Name Behavior
0 Manual Agent suggests, you execute everything
1 Guided Agent executes with approval at each step
2 Semi-Auto Agent runs tests, stops at exploitation gate
3 Full-Auto Agent runs everything, reports at end

Note: The exploitation gate is MANDATORY at all levels. You always decide what gets exploited.


πŸ” Exploitation Tiers

Tier Automation Risk Example
0 βœ… Auto None Pattern found in code
1 βœ… Auto (after approval) Minimal Basic validation test
2 βœ… Auto (after approval) Low Extract 1 row, screenshot
3 ❌ Guide Only Medium Full extraction guide
4 ❌ Guide Only High RCE chain documentation

πŸ“‹ Test Categories

Category Tests Description
STORAGE 8 SharedPrefs, SQLite, External, Clipboard, Logs
PLATFORM 8 Exported Components, Deep Links, WebView
NETWORK 6 Cleartext, SSL Pinning, Certificate Validation
CRYPTO 6 Hardcoded Keys, Weak Algorithms, ECB Mode
AUTH 6 Biometric Bypass, Session Management
CODE 6 Debug Mode, Obfuscation, Logging
RESILIENCE 6 Root Detection, Emulator Detection
API 10+ Auth, Injection, IDOR, Rate Limiting
BINARY 6 Native Library Analysis

πŸš€ Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 20+
  • Docker & Docker Compose
  • Android device/emulator with ADB
  • Ollama with qwen2.5-coder:7b model

Installation

Automated Setup (Recommended):

# Clone repository
git clone https://github.com/your-org/droidguard-ai.git
cd droidguard-ai

# Run automated setup script
./setup_dev.sh

This script automatically:

  • Starts Docker services (PostgreSQL, Redis, MobSF, Qdrant)
  • Creates Python virtual environments for backend and CLI
  • Installs all dependencies
  • Runs database migrations
  • Sets up the CLI package

Manual Setup:

# Clone repository
git clone https://github.com/your-org/droidguard-ai.git
cd droidguard-ai

# Start Docker services
docker compose up -d

# Backend setup
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
alembic upgrade head
uvicorn app.main:app --reload --port 8000

# Frontend setup (new terminal)
cd frontend
npm install
npm run dev

# CLI setup (optional)
cd cli
python3 -m venv venv
source venv/bin/activate
pip install -e .
droidguard --help

Note for macOS users: Use virtual environments due to PEP 668 restrictions.

First Scan

  1. Open http://localhost:3000
  2. Register an account
  3. Connect your Android device
  4. Upload an APK
  5. Configure scan settings:
    • Select categories
    • Choose autonomy level
    • Select build type
  6. Start scan
  7. Review findings at the decision gate
  8. Select exploitation actions per finding
  9. Generate report

CLI Usage

# Login
droidguard auth login

# List devices
droidguard devices list

# Run scan
droidguard scan app.apk \
  --device emulator-5554 \
  --autonomy semi_auto \
  --categories STORAGE,PLATFORM,NETWORK \
  --output report.md

πŸ“ Project Structure

droidguard-ai/
β”œβ”€β”€ CLAUDE.md              # Instructions for Claude Code
β”œβ”€β”€ README.md              # This file
β”œβ”€β”€ docker-compose.yml     # Service definitions
β”œβ”€β”€ .env.example           # Environment template
β”‚
β”œβ”€β”€ docs/                  # All specifications
β”‚   β”œβ”€β”€ REQUIREMENTS.md
β”‚   β”œβ”€β”€ ARCHITECTURE.md
β”‚   β”œβ”€β”€ AGENTS.md
β”‚   β”œβ”€β”€ DATABASE.md
β”‚   β”œβ”€β”€ API_SPEC.md
β”‚   β”œβ”€β”€ MCP_REGISTRY.md
β”‚   β”œβ”€β”€ PROMPTS.md
β”‚   β”œβ”€β”€ EXPLOITATION.md
β”‚   β”œβ”€β”€ FRONTEND.md
β”‚   β”œβ”€β”€ TASKS.md
β”‚   └── TEST_CASES.md
β”‚
β”œβ”€β”€ backend/               # FastAPI backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ agents/        # AI agents
β”‚   β”‚   β”œβ”€β”€ api/           # Route handlers
β”‚   β”‚   β”œβ”€β”€ core/          # Config, DB, Security
β”‚   β”‚   β”œβ”€β”€ mcp/           # MCP adapters
β”‚   β”‚   β”œβ”€β”€ models/        # SQLAlchemy models
β”‚   β”‚   β”œβ”€β”€ orchestrator/  # Agent coordination
β”‚   β”‚   └── services/      # Business logic
β”‚   └── tests/
β”‚
β”œβ”€β”€ frontend/              # React frontend
β”‚   └── src/
β”‚
β”œβ”€β”€ cli/                   # Command-line interface
β”œβ”€β”€ prompts/               # LLM prompt templates
β”œβ”€β”€ frida_scripts/         # Pre-built Frida scripts
└── checkpoints/           # Scan state (auto-generated)

πŸ”§ Configuration

Environment Variables

Variable Description Default
DATABASE_URL PostgreSQL connection Required
REDIS_URL Redis connection redis://localhost:6379
JWT_SECRET Token signing key Required
OLLAMA_BASE_URL Ollama API URL http://localhost:11434
OLLAMA_MODEL LLM model to use qwen2.5-coder:7b
MOBSF_URL MobSF instance URL http://localhost:8001
RAG_ENABLED Enable RAG features false
EXPLOITATION_ENABLED Allow exploitation true

Build Types

Type Behavior
development Skip hardening bypass tests
staging Auto-detect hardening level
production Full testing including bypasses
custom User-defined settings

πŸ“Š Sample Output

Decision Gate

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              EXPLOITATION DECISION REQUIRED                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Detection complete. Found 15 vulnerabilities.                  β”‚
β”‚                                                                  β”‚
β”‚  Critical: 2  β”‚  High: 5  β”‚  Medium: 6  β”‚  Low: 2              β”‚
β”‚                                                                  β”‚
β”‚  Please select an action for each finding:                      β”‚
β”‚  [ ] Skip       - Report as-is                                  β”‚
β”‚  [ ] Simple PoC - Safe automated exploitation                   β”‚
β”‚  [ ] Offline Guide - Generate manual exploitation guide         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Report Summary

# Security Assessment Report
## com.example.app v1.0.0

### Executive Summary
- **Critical:** 2 findings
- **High:** 5 findings  
- **Medium:** 6 findings
- **Low:** 2 findings

### Critical Findings

#### 1. SQL Injection in UserContentProvider
- **CVSS:** 9.1 (Critical)
- **Status:** Confirmed (PoC executed)
- **Evidence:** Screenshot, extracted data sample
- **Remediation:** Use parameterized queries...

πŸ›‘οΈ Security Considerations

  1. Always get authorization before testing any application
  2. Use on test devices only - never on devices with real user data
  3. Review offline guides carefully before manual exploitation
  4. Store reports securely - they contain sensitive vulnerability details
  5. Rate limiting is enforced to prevent accidental DoS

πŸ“š Documentation

Document Description
REQUIREMENTS.md Functional requirements
ARCHITECTURE.md System architecture
AGENTS.md Agent specifications
API_SPEC.md REST API reference
EXPLOITATION.md Exploitation tiers & Frida scripts
TASKS.md Implementation roadmap

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: pytest
  5. Submit a pull request

πŸ“„ License

MIT License - see LICENSE for details.


πŸ™ Acknowledgments

  • OWASP MASTG/MASVS for security testing standards
  • MobSF for static analysis
  • Frida for dynamic instrumentation
  • The bug bounty community for real-world insights

Built with ❀️ for the security community

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors