agentsclimarketplace

Mobile app security testing

Skill xAmirHamza77/PenKit51/skills/mobile-app-security-testing

PenKit51 — Open-source AI penetration testing platform with 63 deep exploitation skills, multi-agent orchestration, PoC-validated findings, and native assistant skills for Claude, ChatGPT, and Grok. Authorized testing only.

Install
npx -y skills add xAmirHamza77/PenKit51 --skill mobile-app-security-testing

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

移动应用安全测试的专业技能和方法论

SKILL.md

6.9 KB, ~2.3k tokens by cl100k_base, as published. Nobody here has run it

Mobile App Security Testing

penkit51 AI — professional penetration testing skill pack. Authorized testing only.

Platform Methodology

移动应用安全测试

概述

移动应用安全测试是确保移动应用安全性的重要环节。本技能提供移动应用安全测试的方法、工具和最佳实践,涵盖Android和iOS平台。

测试范围

1. 应用安全

检查项目:

  • 代码混淆
  • 反编译防护
  • 调试防护
  • 证书绑定

2. 数据安全

检查项目:

  • 数据加密
  • 密钥管理
  • 敏感数据存储
  • 数据传输

3. 认证授权

检查项目:

  • 认证机制
  • Token管理
  • 生物识别
  • 会话管理

4. 通信安全

检查项目:

  • TLS/SSL配置
  • 证书验证
  • API安全
  • 中间人攻击防护

Android安全测试

静态分析

使用APKTool:

# 反编译APK
apktool d app.apk

# 查看AndroidManifest.xml
cat app/AndroidManifest.xml

# 查看Smali代码
find app/smali -name "*.smali"

使用Jadx:

# 反编译APK
jadx -d output app.apk

# 查看Java源码
find output -name "*.java"

使用MobSF:

# 启动MobSF
docker run -it -p 8000:8000 opensecurity/mobsf

# 上传APK进行分析
# 访问 http://localhost:8000

动态分析

使用Frida:

// Hook函数
Java.perform(function() {
    var MainActivity = Java.use("com.example.MainActivity");
    MainActivity.onCreate.implementation = function(savedInstanceState) {
        console.log("[*] onCreate called");
        this.onCreate(savedInstanceState);
    };
});

使用Objection:

# 启动Objection
objection -g com.example.app explore

# Hook函数
android hooking watch class_method com.example.MainActivity.onCreate

使用Burp Suite:

# 配置代理
# Android设置代理指向Burp Suite
# 安装Burp证书

常见漏洞

硬编码密钥:

// 不安全的代码
String apiKey = "1234567890abcdef";
String password = "admin123";

不安全的存储:

// SharedPreferences存储敏感数据
SharedPreferences prefs = getSharedPreferences("data", MODE_WORLD_READABLE);
prefs.edit().putString("password", password).apply();

证书验证绕过:

// 不验证证书
TrustManager[] trustAllCerts = new TrustManager[] {
    new X509TrustManager() {
        public X509Certificate[] getAcceptedIssuers() { return null; }
        public void checkClientTrusted(X509Certificate[] certs, String authType) { }
        public void checkServerTrusted(X509Certificate[] certs, String authType) { }
    }
};

iOS安全测试

静态分析

使用class-dump:

# 导出头文件
class-dump app.ipa

# 查看头文件
find app -name "*.h"

使用Hopper:

# 使用Hopper反汇编
# 打开app二进制文件
# 分析汇编代码

使用otool:

# 查看Mach-O信息
otool -L app

# 查看字符串
strings app | grep -i "password\|key\|secret"

动态分析

使用Frida:

// Hook Objective-C方法
var className = ObjC.classes.ViewController;
var method = className['- login:password:'];
Interceptor.attach(method.implementation, {
    onEnter: function(args) {
        console.log("[*] Login called");
        console.log("Username: " + ObjC.Object(args[2]).toString());
        console.log("Password: " + ObjC.Object(args[3]).toString());
    }
});

使用Cycript:

# 附加到进程
cycript -p app

# 执行命令
[UIApplication sharedApplication]

常见漏洞

硬编码密钥:

// 不安全的代码
NSString *apiKey = @"1234567890abcdef";
NSString *password = @"admin123";

不安全的存储:

// Keychain存储不当
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:password forKey:@"password"];

证书验证绕过:

// 不验证证书
- (void)connection:(NSURLConnection *)connection 
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
    [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] 
          forAuthenticationChallenge:challenge];
}

工具使用

MobSF

# 启动MobSF
docker run -it -p 8000:8000 opensecurity/mobsf

# 上传应用进行分析
# 支持Android和iOS

Frida

# 安装Frida
pip install frida-tools

# 运行脚本
frida -U -f com.example.app -l script.js

Objection

# 安装Objection
pip install objection

# 启动Objection
objection -g com.example.app explore

Burp Suite

配置代理:

  1. 配置Burp Suite监听器
  2. 移动设备设置代理
  3. 安装Burp证书
  4. 拦截和分析流量

测试清单

应用安全

  • 代码混淆检查
  • 反编译防护
  • 调试防护
  • 证书绑定

数据安全

  • 数据加密检查
  • 密钥管理
  • 敏感数据存储
  • 数据传输安全

认证授权

  • 认证机制测试
  • Token管理
  • 会话管理
  • 生物识别

通信安全

  • TLS/SSL配置
  • 证书验证
  • API安全测试
  • 中间人攻击防护

常见安全问题

1. 硬编码密钥

问题:

  • API密钥硬编码
  • 密码硬编码
  • 加密密钥硬编码

修复:

  • 使用密钥管理服务
  • 使用环境变量
  • 使用安全存储

2. 不安全的存储

问题:

  • 明文存储敏感数据
  • 使用不安全的存储方式
  • 数据未加密

修复:

  • 使用加密存储
  • 使用Keychain/Keystore
  • 实施数据加密

3. 证书验证绕过

问题:

  • 不验证SSL证书
  • 接受自签名证书
  • 证书固定未实施

修复:

  • 实施证书固定
  • 验证证书链
  • 使用系统证书存储

4. 调试信息泄露

问题:

  • 日志包含敏感信息
  • 错误信息泄露
  • 调试模式未禁用

修复:

  • 移除调试代码
  • 限制日志输出
  • 生产环境禁用调试

最佳实践

1. 代码安全

  • 实施代码混淆
  • 禁用调试功能
  • 实施反调试保护
  • 使用证书绑定

2. 数据安全

  • 加密敏感数据
  • 使用安全存储
  • 实施密钥管理
  • 限制数据访问

3. 通信安全

  • 使用TLS/SSL
  • 实施证书固定
  • 验证服务器证书
  • 使用安全API

4. 认证安全

  • 实施强认证
  • 安全Token管理
  • 实施会话管理
  • 使用生物识别

注意事项

  • 仅在授权环境中进行测试
  • 遵守法律法规
  • 注意不同平台的差异
  • 保护用户隐私

Validation & Reporting

  • Confirm every finding with reproducible PoC before reporting
  • Document: severity (CVSS), affected asset, steps, evidence, remediation
  • Use record_vulnerability when running inside the penkit51 platform
  • Chain low-severity findings into higher-impact attack paths
  • Never report without evidence — distinguish hypothesis from confirmed vuln

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,970. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.