Conducting mobile app penetration test

From mukul975/Anthropic-Cybersecurity-Skills · View interactive version

Conducting mobile app penetration test is an AI agent skill from the GitHub repository mukul975/Anthropic-Cybersecurity-Skills. Conducts penetration testing of iOS and Android mobile applications following the OWASP Mobile Application Security Testing Guide (MASTG) to identify vulnerabilities in data storage, network communication, authentication, cryptography, and platform-specific security controls. The tester performs sta

How to use this skill

Skill file

Conducting Mobile App Penetration Test

When to Use

Do not use against mobile applications without written authorization from the application owner, for distributing modified or repackaged applications, or for testing apps on the public app stores without a separate test build.

Prerequisites

Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.

Workflow

Step 1: Static Analysis

Analyze the application binary without executing it:

Android Static Analysis:

iOS Static Analysis:

Step 2: Network Security Testing

Intercept and analyze all network communications:

Step 3: Data Storage Analysis

Test for insecure local data storage:

Android Data Storage:

iOS Data Storage:

Step 4: Authentication and Session Management

Test mobile-specific authentication controls:

Step 5: Runtime Manipulation

Test the application's resistance to runtime attacks:

Key Concepts

| Term | Definition |

|------|------------|

| OWASP MASTG | Mobile Application Security Testing Guide; comprehensive manual for mobile app security testing covering both iOS and Android platforms |

| Certificate Pinning | A mobile security control that restricts which TLS certificates the app trusts, preventing man-in-the-middle attacks through proxy interception |

| Frida | Dynamic instrumentation toolkit that allows injection of JavaScript into running processes to hook functions, modify behavior, and bypass security controls |

| Root/Jailbreak Detection | Application-level checks to detect if the device has been modified to grant root access, typically blocking app usage on compromised devices |

| Android Keystore | Hardware-backed credential storage on Android that protects cryptographic keys and secrets from extraction even on rooted devices |

| App Transport Security (ATS) | iOS security feature that enforces HTTPS connections by default; ATS exceptions may indicate insecure network communication |

| Deep Links | URL schemes that open specific screens within a mobile application, which may bypass normal navigation and authentication flows if not properly validated |

Tools & Systems

Common Scenarios

Scenario: Mobile Banking Application Security Assessment

Context: A bank is launching a new mobile banking app for iOS and Android. The app handles account viewing, fund transfers, bill payment, and check deposit. OWASP MASVS L2 compliance is required due to the financial data handled.

Approach:

  1. Static analysis of the Android APK reveals API endpoints, a hardcoded staging server URL, and an AWS API key in a configuration file
  2. Certificate pinning is implemented but bypassed with Frida SSL pinning bypass script
  3. API traffic analysis reveals that the balance check endpoint returns all account numbers associated with the user, not just the requested account
  4. Local data storage analysis finds that the app caches the last 10 transactions in an unencrypted SQLite database
  5. Biometric authentication bypass: Frida hook on the biometric callback always returns success, granting access without fingerprint
  6. Root detection is present but bypassed with Magisk Hide module, allowing the app to run on a rooted device with full data access

Pitfalls:

Output Format

## Finding: Biometric Authentication Bypass via Frida Instrumentation

**ID**: MOB-003
**Severity**: High (CVSS 7.7)
**Platform**: Android and iOS
**OWASP MASVS**: MASVS-AUTH-2 (Biometric Authentication)

**Description**:
The mobile banking app's biometric authentication can be bypassed using Frida
dynamic instrumentation. The authentication callback function accepts a boolean
result from the biometric API, which can be hooked and forced to return true
without presenting a valid fingerprint or face scan.

**Proof of Concept (Android)**:
frida -U -f com.bank.mobileapp -l bypass-biometric.js --no-pause

// bypass-biometric.js
Java.perform(function() {
  var BiometricCallback = Java.use("com.bank.mobileapp.auth.BiometricCallback");
  BiometricCallback.onAuthenticationSucceeded.implementation = function(result) {
    console.log("[*] Biometric bypassed");
    this.onAuthenticationSucceeded(result);
  };
});

**Impact**:
An attacker with physical access to an unlocked device can bypass biometric
authentication and access the victim's bank accounts, initiate transfers,
and view financial data without biometric verification.

**Remediation**:
1. Implement server-side biometric verification using Android BiometricPrompt
   CryptoObject tied to a Keystore key
2. Require the biometric operation to decrypt a server-side challenge, making
   client-side bypass ineffective
3. Add runtime integrity checks to detect Frida and other instrumentation frameworks
4. Implement step-up authentication for high-risk operations (transfers > threshold)
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.