Automated Static Analysis of APKs
Project description
๐ DroidSentinel - Android APK Static Vulnerability Scanner
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:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Make your changes
- Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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:
- Native Library Analysis: Detection of hardcoded secrets in native C/C++
.sofiles - React Native Support: Enhanced analysis and listing of libraries used in React Native applications
- Firebase Vulnerability Automation: Streamlined detection and validation of common Firebase configuration issues
- Deep Code Flow Analysis: Improved tracking of data flow to identify complex vulnerabilities
- 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:
- Thorough manual code review by experienced security engineers
- Dynamic analysis and penetration testing
- 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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42a916caa02640ec6a8561880039c7785cecb30e9fe60c1408639822652655a7
|
|
| MD5 |
1d3f59a276abed3987237da70b6538df
|
|
| BLAKE2b-256 |
22580bee67004889677fcac0f29dcc275dc4c6ef5ada0879f30c5a740d61055f
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37f481ae0456486b0914cb665e9add8a022c5935f77a78edddd20c102e0d1fad
|
|
| MD5 |
3490073b9bb1fc301e02968d165b43b9
|
|
| BLAKE2b-256 |
ff4ed52e0c1963584b64236bc87b3b08bb04647e835b2702b2624eaa93834674
|