Skip to main content

Automated Static Analysis of APKs

Project description

๐Ÿ” DroidSentinel - Android APK Static Vulnerability Scanner

DroidSentinel Banner Python 3.6+ License: MIT PRs Welcome

DroidSentinel is a powerful, open-source static analysis tool that scans Android APK files for security vulnerabilities, hardcoded secrets, and potential privacy issues.

โœจ Features

  • API Key & Secret Detection: Identifies hardcoded API keys, tokens, and credentials
  • Exported Component Analysis: Flags potentially vulnerable exported activities, services, and receivers
  • WebView Vulnerability Detection: Detects insecure WebView implementations
  • Security Configuration Analysis: Examines permissions and security settings
  • Comprehensive Risk Scoring: Generates a weighted risk score to prioritize issues
  • Beautiful Reports: Outputs easy-to-read console output with color-coded findings
  • Exportable Results: Save findings as JSON or text reports

๐Ÿ–ผ๏ธ Screenshot

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘ โ–ˆโ–€โ–€โ–„ โ–ˆโ–€โ–€โ–ˆ โ–ˆโ–€โ–€โ–ˆ โ–€โ–ˆโ–€ โ–ˆโ–€โ–€โ–„    โ–ˆโ–€โ–€ โ–ˆโ–€โ–€ โ–ˆโ–€โ–€โ–„ โ–€โ–€โ–ˆโ–€โ–€ โ–€โ–ˆโ–€ โ–ˆโ–€โ–€โ–„ โ–ˆโ–€โ–€ โ–ˆ โ•‘
โ•‘ โ–ˆ  โ–ˆ โ–ˆโ–„โ–„โ–€ โ–ˆ  โ–ˆ  โ–ˆ  โ–ˆ  โ–ˆ    โ–€โ–€โ–ˆ โ–ˆโ–€โ–€ โ–ˆ  โ–ˆ   โ–ˆ    โ–ˆ  โ–ˆ  โ–ˆ โ–ˆโ–€โ–€ โ–ˆ โ•‘
โ•‘ โ–€โ–€โ–€  โ–€ โ–€โ–€ โ–€โ–€โ–€โ–€ โ–€โ–€โ–€ โ–€โ–€โ–€     โ–€โ–€โ–€ โ–€โ–€โ–€ โ–€  โ–€   โ–€   โ–€โ–€โ–€ โ–€  โ–€ โ–€โ–€โ–€ โ–€โ–€โ–€โ–€ โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
           Android APK Static Vulnerability Scanner by Ch3tanbug

๐Ÿš€ Installation

Prerequisites

  • Python 3.6 or higher
  • apktool (automatically installed on Linux/macOS if missing)

Option 1: Using pip

pip install droidsentinel

Option 2: From source

git clone https://github.com/ch3tanbug/droidsentinel.git
cd droidsentinel
pip install -r requirements.txt

๐Ÿ’ป Usage

python droidsentinel.py path/to/your/app.apk

Or if installed via pip:

droidsentinel path/to/your/app.apk

๐Ÿ” What It Detects

1. API Keys & Secrets

  • API keys (Google, Facebook, Twitter, etc.)
  • Authentication tokens (Bearer, Basic, JWT)
  • Database credentials
  • Secret keys and passwords

2. Exported Components

  • Activities accessible from other apps
  • Services that can be started by third parties
  • Broadcast receivers exposed to the system
  • Content providers with public data

3. WebView Vulnerabilities

  • JavaScript enabled without proper protections
  • File access enabled in WebView
  • SSL error handling bypasses
  • JavaScript interfaces that could lead to JavaScript injection

4. Other Security Issues

  • Insecure file permissions
  • Improper SSL/TLS implementations
  • Insecure random number generation
  • Use of insecure cryptographic methods
  • Sensitive permissions usage

๐Ÿ“Š Sample Output

APK SECURITY ANALYSIS RESULTS
================================================================================

Overall Risk Score: 42/100
Risk Level: Medium

--------------------------------------------------------------------------------
SCAN SUMMARY
--------------------------------------------------------------------------------
  APK File: example.apk
  Scan Date: 2025-03-07 14:30:22
  Total Issues Found: 12
  High Severity Issues: 3
  Medium Severity Issues: 5
  Low Severity Issues: 4

--------------------------------------------------------------------------------
POTENTIAL SECRETS/API KEYS FOUND
--------------------------------------------------------------------------------
[1] API Key found in:
  File: assets/config.json:15
  Value: AIzaSyD8XUgGg3zV7bo1GgL2k2nF9H7x8uKC4Rk
  Context: "apiKey": "AIzaSyD8XUgGg3zV7bo1GgL2k2nF9H7x8uKC4Rk", "authDomain": "example-app.firebaseapp.com"

๐Ÿ“‹ Risk Scoring

DroidSentinel intelligently assigns a risk score (0-100) based on multiple security factors, including:

๐Ÿ” Key Risk Factors:

  • ๐Ÿ”‘ Hardcoded Secrets: Number and sensitivity of exposed credentials
  • ๐Ÿ” Exported Components: Insecure activities, services, receivers, and content providers
  • ๐ŸŒ WebView Configuration: Risky JavaScript interfaces or mixed-content issues
  • ๐Ÿ›‘ Security Vulnerabilities: Presence of known misconfigurations and weaknesses
  • ๐Ÿ“ฒ App Permissions & Configurations: Excessive or dangerous permissions

๐Ÿ† Risk Score Breakdown

Score Range Risk Level ๐Ÿšจ Impact Level
75 - 100 ๐Ÿ”ฅ Critical Severe security risks โ€“ Immediate action required
50 - 74 โš ๏ธ High Major security concerns โ€“ Needs urgent review
25 - 49 โšก Medium Potential risks โ€“ Should be addressed
0 - 24 โœ… Low Minimal risk โ€“ Best practices still recommended

DroidSentinel helps you prioritize security fixes by providing a clear risk assessmentโ€”so you can focus on what matters most! ๐Ÿš€

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Commit your changes (git commit -m 'Add some amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

๐Ÿ™ Acknowledgements

  • Thanks to the apktool project for enabling APK decompilation
  • Thanks to the mobile security community for defining best practices

๐Ÿ”ฎ Upcoming Features

We're constantly improving DroidSentinel! Here's what's planned for future releases:

  1. Native Library Analysis: Detection of hardcoded secrets in native C/C++ .so files
  2. React Native Support: Enhanced analysis and listing of libraries used in React Native applications
  3. Firebase Vulnerability Automation: Streamlined detection and validation of common Firebase configuration issues
  4. Deep Code Flow Analysis: Improved tracking of data flow to identify complex vulnerabilities
  5. Custom Rule Creation: Ability to define and share custom scanning rules

โš ๏ธ Important Disclaimer

No automated tool can guarantee complete security! DroidSentinel is designed to assist security professionals by identifying common issues, but should never replace:

  1. Thorough manual code review by experienced security engineers
  2. Dynamic analysis and penetration testing
  3. Proper security architecture design and implementation

We strongly recommend using DroidSentinel as part of a comprehensive security program that includes manual decompilation and code review. The security landscape evolves constantly, and while we strive to keep this tool updated with the latest patterns, new vulnerability classes emerge regularly.

This tool should be considered an aid to, not a replacement for, security expertise. The developers of DroidSentinel assume no liability for any security issues not detected by the tool or for misuse of the tool itself.

This tool is intended for security research and vulnerability assessment purposes only. Always obtain proper authorization before scanning applications you don't own. The authors are not responsible for any misuse of this tool.


Made with โค๏ธ by Ch3tanbug

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

droidsentinel-1.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

droidsentinel-1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file droidsentinel-1.0.tar.gz.

File metadata

  • Download URL: droidsentinel-1.0.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for droidsentinel-1.0.tar.gz
Algorithm Hash digest
SHA256 42a916caa02640ec6a8561880039c7785cecb30e9fe60c1408639822652655a7
MD5 1d3f59a276abed3987237da70b6538df
BLAKE2b-256 22580bee67004889677fcac0f29dcc275dc4c6ef5ada0879f30c5a740d61055f

See more details on using hashes here.

File details

Details for the file droidsentinel-1.0-py3-none-any.whl.

File metadata

  • Download URL: droidsentinel-1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for droidsentinel-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37f481ae0456486b0914cb665e9add8a022c5935f77a78edddd20c102e0d1fad
MD5 3490073b9bb1fc301e02968d165b43b9
BLAKE2b-256 ff4ed52e0c1963584b64236bc87b3b08bb04647e835b2702b2624eaa93834674

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page