Skip to main content
QARK (Quick Android Review Kit) scripts automate security analysis of Android APK files by identifying vulnerabilities and generating exploit APKs. These scripts support remote Linux execution with automated reporting.

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 qark.sh helper script to server.
Converts line endings from Windows to Unix format.
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:
  1. HTML Report: Detailed vulnerability findings in Report_<APK>/
  2. Logs: Analysis execution logs in logs/
  3. 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

  1. Run qark.bat on Windows machine
  2. Wait for prompt to execute on server
  3. SSH to Linux server in separate terminal
  4. Execute command shown in prompt:
  5. Wait for completion (may take several minutes)
  6. Return to Windows terminal and press key
  7. Archive downloads automatically

Troubleshooting

Script Not Found

Solution: Ensure qark.sh was uploaded and has correct permissions:

Line Ending Issues

Solution: Script includes tr -d '\15\32' to fix Windows line endings automatically.

QARK Not Installed

Solution: Install QARK using installation commands:

Missing Android SDK

Solution: Download and configure SDK tools:

Exploit APK Not Generated

If no exploit APK appears in exploit/ 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
  • mobsf.bat: Alternative mobile security framework
  • androbugs_framework.bat: Another APK security scanner
  • apktool_decode_local.bat: Manual APK decompilation for code review