Overview
Tool Information
QARK: Quick Android Review Kit- Developer: LinkedIn
- Repository:
https://github.com/linkedin/qark - Type: Static analysis and exploit generation tool
- Purpose: Identify Android application vulnerabilities and create proof-of-concept exploits
Installation
From install scripts (Linux):qark.bat
Windows batch script that orchestrates remote QARK analysis on a Linux server.Parameters
Analysis Workflow
1
Upload APK
Transfers APK file to
/tmp/ directory on remote server.2
Upload Helper Script
Transfers Converts line endings from Windows to Unix format.
qark.sh helper script to server.3
Manual Execution Prompt
Script pauses and instructs user to manually run QARK on server.User must SSH to server and execute command, then press key to continue.
4
Archive Results
Creates tar.gz archive of analysis results.
5
Download Report
Transfers archive back to local Windows machine.
6
Cleanup
Removes temporary files from remote server.
Script Implementation
Usage Example
qark.sh
Linux shell script that executes QARK analysis with proper parameters.Parameters
Script Implementation
QARK Command Options
Analysis Output
The script generates:- HTML Report: Detailed vulnerability findings in
Report_<APK>/ - Logs: Analysis execution logs in
logs/ - Exploit APKs: Proof-of-concept exploits in
exploit/
Output Structure
After analysis, the tar.gz archive contains:Vulnerability Detection
QARK identifies common Android security issues:Security Checks
- Exported Components: Activities, services, receivers without protection
- Intent Vulnerabilities: Implicit intents, intent injection
- WebView Issues: JavaScript enabled, file access, XSS vulnerabilities
- Cryptography: Weak algorithms, hardcoded keys, insecure random
- Data Storage: World-readable files, unencrypted databases
- Network Security: Clear-text traffic, SSL/TLS issues
- Permissions: Dangerous permissions, custom permission issues
- Code Obfuscation: ProGuard configuration analysis
Exploit Generation
QARK automatically generates exploit APKs for:- Exported component exploitation
- Intent hijacking
- Broadcast theft
- Activity hijacking
- Service manipulation
Manual Execution Workflow
- Windows to Linux
- Direct Linux
- Run qark.bat on Windows machine
- Wait for prompt to execute on server
- SSH to Linux server in separate terminal
- Execute command shown in prompt:
- Wait for completion (may take several minutes)
- Return to Windows terminal and press key
- Archive downloads automatically
Troubleshooting
Script Not Found
Line Ending Issues
tr -d '\15\32' to fix Windows line endings automatically.
QARK Not Installed
Missing Android SDK
Exploit APK Not Generated
If no exploit APK appears inexploit/ directory:
- No exploitable vulnerabilities found
- Build process failed (check logs/)
- Android SDK tools not properly configured
Performance Considerations
- Analysis Time: 5-15 minutes for typical APK
- Large APKs: May take 30+ minutes for complex applications
- Server Resources: Requires adequate CPU and memory
- Network: Upload/download time depends on APK size and connection speed
Security Best Practices
- Credential Management: Avoid hardcoding passwords in scripts
- Secure Transport: Use SSH keys instead of passwords when possible
- Network Security: Ensure SSH traffic is on trusted network
- Cleanup: Script automatically removes temporary files
- Archive Security: Protect downloaded archives containing sensitive analysis data
Related Scripts
mobsf.bat: Alternative mobile security frameworkandrobugs_framework.bat: Another APK security scannerapktool_decode_local.bat: Manual APK decompilation for code review