Overview
| Script | Purpose | Platform |
|---|---|---|
qark.bat | Orchestrate remote QARK analysis | Windows (SSH client) |
qark.sh | Execute QARK analysis on Linux | Linux |
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
| Parameter | Description | Example |
|---|---|---|
DirApp | QARK installation directory on server | /root/qark |
PathAPK | Local path to APK file | C:\samples\app.apk |
FileApk | APK filename (no extension) | app |
Timestamp | Unique timestamp identifier | 20230615_143022 |
Documentacion | Local output directory | C:\reports |
Server | SSH server hostname/IP | 192.168.1.100 |
Username | SSH username | root |
Password | SSH password | password123 |
Analysis Workflow
Upload Helper Script
Transfers Converts line endings from Windows to Unix format.
qark.sh helper script to server.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.
Script Implementation
Usage Example
qark.sh
Linux shell script that executes QARK analysis with proper parameters.Parameters
| Parameter | Description | Example |
|---|---|---|
DirApp | QARK installation directory | /root/qark |
APK | APK filename in /tmp (no extension) | vulnerable_app_20230615_143022 |
Script Implementation
QARK Command Options
| Option | Purpose |
|---|---|
--apk | Path to APK file to analyze |
--debug | Enable debug output for troubleshooting |
--exploit-apk | Generate exploit APK for identified vulnerabilities |
--report-type html | Generate HTML format report |
--sdk-path tools/ | Path to Android SDK tools |
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