/cybersecurity-skills-zh:performing-dynamic-analysis-of-android-appfrom cybersecurity-skills-zh
Performs runtime dynamic analysis of Android apps using Frida, Objection, and ADB. Useful for hooking methods, bypassing root detection, and identifying security flaws missed by static analysis.
Ships in cybersecurity-skills-zh. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
适用于以下情况:
不适用场景:未经授权不得在生产环境中使用——动态插桩可能改变应用行为并触发安全告警。
frida-tools 和 objection 包# 检查设备架构
adb shell getprop ro.product.cpu.abi
# 输出:arm64-v8a
# 从 GitHub releases 下载匹配的 Frida 服务端
# https://github.com/frida/frida/releases
# 推送到设备
adb push frida-server-16.x.x-android-arm64 /data/local/tmp/frida-server
adb shell chmod 755 /data/local/tmp/frida-server
adb shell /data/local/tmp/frida-server &
# 验证 Frida 连接
frida-ps -U
# 列出所有包
frida-ps -U -a
# 附加 Objection 进行高级别探测
objection --gadget com.target.app explore
# 列出活动、服务、广播接收器
android hooking list activities
android hooking list services
android hooking list receivers
# 列出已加载的类
android hooking list classes
android hooking search classes com.target.app
# Hook 类的所有方法
android hooking watch class com.target.app.auth.LoginManager
# Hook 特定方法并转储参数
android hooking watch class_method com.target.app.auth.LoginManager.authenticate --dump-args --dump-return
# Hook 加密操作
android hooking watch class javax.crypto.Cipher --dump-args
android hooking watch class java.security.MessageDigest --dump-args
# Hook 网络调用
android hooking watch class okhttp3.OkHttpClient --dump-args
android hooking watch class java.net.URL --dump-args
// hook_crypto.js - 拦截加密/解密操作
Java.perform(function() {
var Cipher = Java.use("javax.crypto.Cipher");
Cipher.doFinal.overload("[B").implementation = function(input) {
var mode = this.getAlgorithm();
console.log("[Cipher] 算法: " + mode);
console.log("[Cipher] 输入: " + bytesToHex(input));
var result = this.doFinal(input);
console.log("[Cipher] 输出: " + bytesToHex(result));
return result;
};
function bytesToHex(bytes) {
var hex = [];
for (var i = 0; i < bytes.length; i++) {
hex.push(("0" + (bytes[i] & 0xFF).toString(16)).slice(-2));
}
return hex.join("");
}
});
# 执行自定义 Frida 脚本
frida -U -f com.target.app -l hook_crypto.js --no-pause
// root_bypass.js - 常见 Root 检测绕过
Java.perform(function() {
// 绕过 RootBeer 库
var RootBeer = Java.use("com.scottyab.rootbeer.RootBeer");
RootBeer.isRooted.implementation = function() {
console.log("[RootBeer] isRooted() 已绕过");
return false;
};
// 绕过基于文件的通用 Root 检测
var File = Java.use("java.io.File");
var originalExists = File.exists;
File.exists.implementation = function() {
var path = this.getAbsolutePath();
var rootPaths = ["/system/app/Superuser.apk", "/system/xbin/su",
"/sbin/su", "/system/bin/su", "/data/local/bin/su"];
if (rootPaths.indexOf(path) >= 0) {
console.log("[Root] 已阻断检测: " + path);
return false;
}
return originalExists.call(this);
};
// 绕过 SafetyNet/Play Integrity
try {
var SafetyNet = Java.use("com.google.android.gms.safetynet.SafetyNetApi");
console.log("[SafetyNet] 发现该类 - 可能需要额外绕过");
} catch(e) {}
});
// network_monitor.js - 监控所有 HTTP 请求
Java.perform(function() {
// Hook OkHttp3
try {
var OkHttpClient = Java.use("okhttp3.OkHttpClient");
var Interceptor = Java.use("okhttp3.Interceptor");
var Chain = Java.use("okhttp3.Interceptor$Chain");
console.log("[OkHttp] 正在监控网络请求...");
var Request = Java.use("okhttp3.Request");
Request.url.implementation = function() {
var url = this.url();
console.log("[OkHttp] URL: " + url.toString());
return url;
};
} catch(e) {
console.log("[OkHttp] 未找到,尝试 HttpURLConnection");
}
// Hook HttpURLConnection
var URL = Java.use("java.net.URL");
URL.openConnection.overload().implementation = function() {
console.log("[URL] 打开: " + this.toString());
return this.openConnection();
};
});
# 使用 Objection 快速提取
objection --gadget com.target.app explore
# 转储 Android Keystore 条目
android keystore list
android keystore dump
# 在堆中搜索敏感对象
android heap search instances com.target.app.model.User
android heap evaluate <handle> "JSON.stringify(clazz)"
# 内存字符串搜索
memory search "password" --string
memory search "api_key" --string
| 术语 | 定义 |
|---|---|
| 动态插桩 | 通过向运行中的进程注入代码,在运行时修改应用行为 |
| 方法 Hook | 替换或包装函数实现,以拦截参数和返回值 |
| Frida 服务端 | 运行在目标设备上的守护进程,接收来自主机的插桩命令 |
| Dalvik/ART 运行时 | Android 运行时环境;Frida 在 ART 级别 Hook Java/Kotlin 方法 |
| 堆检查 | 检查应用内存堆中的活跃对象,以提取运行时数据 |
/proc/self/maps 来检测 Frida。使用 Frida Gadget 注入或自定义服务端构建版本。a.b.c.d())。使用 android hooking search classes 发现实际运行时名称。Java.enumerateLoadedClasses()。What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
android-security, frida, dynamic-analysis, mobile-pentesting, hook
npx claudepluginhub killvxk/cybersecurity-skills-zh --plugin cybersecurity-skills-zh735 skills in this plugin
/acquiring-disk-image-with-dd-and-dcfldd使用 dd 和 dcfldd 创建取证级逐位磁盘镜像,通过哈希验证保持证据完整性。/analyzing-active-directory-acl-abuse使用 ldap3 检测 Active Directory 中危险的 ACL 配置错误,识别 GenericAll、WriteDACL 和 WriteOwner 等滥用路径/analyzing-android-malware-with-apktool使用 apktool 进行反编译、jadx 恢复 Java 源码、androguard 进行权限分析,对 Android APK 恶意软件样本执行静态分析,包括清单检查和可疑 API 调用检测。Other plugins' skills for the same job