Re frida script author

From dslsdzc/rev-skills · View interactive version

Re frida script author is an AI agent skill from the GitHub repository dslsdzc/rev-skills. Frida 脚本生成方法论:目标特征 → 模板选择 → 改写 → 验证。独立于执行插桩(re-frida)。 触发词:生成Frida脚本、写hook脚本、frida脚本怎么写、写个hook、脚本生成。

How to use this skill

Skill file

Frida 脚本生成

何时使用 / 何时不用

工具准备

frida-tools(脚本编写与运行验证)

python3(配合脚本调试)

反编译辅助(侦察用)

目标设备/模拟器

操作步骤

按「探 → 选 → 改 → 验」四步,先探后写,不猜。每步产物(特征清单/脚本/验证输出)记录路径 + sha256(见 [[re-triage]]),供报告引用。

  1. 目标侦察:
  1. 模板选择:按特征清单对照 [[re-frida/frida-scripts]] 模板表:

| 目标特征 | 模板 |

|---|---|

| HTTPS 抓包被 TLS 加密(BoringSSL) | TLS 密钥日志(SSLKEYLOGFILE) |

| 证书固定挡抓包 | SSL 固定绕过(TrustManager/CertificatePinner) |

| 加密算法/密钥要提取 | 加密拦截(Cipher/SecretKeySpec 全 overload) |

| 加固/运行时解密 | DEX dump(类加载点)/ SO dump |

| 双向 TLS 客户端证书 | keystore p12 导出 |

| JNI 动态注册要还原 | RegisterNatives + 汇聚点双 hook |

| 反调试/检测拦截 | 检测绕过表(root/属性/文件/命令) |

  1. 改写:

```js

Java.perform(function () {

var Cls = Java.use("com.target.Cls");

Cls.method.overload("java.lang.String").implementation = function (s) {

try { send({ type: "call", arg: s ? s.toString() : null }); }

catch (e) { send({ type: "error", msg: String(e) }); }

return this.method(s); // 调原实现(保留原 this)

};

});

Interceptor.attach(

Process.getModuleByName("libtarget.so").getExportByName("func"),

{ onEnter: function (args) { send({ type: "native", arg0: args[0].toInt32() }); } }

);

```

  1. 验证:

```sh

frida -U -f <pkg> -l script.js --pause # spawn + 停在早期代码前

frida -U -f <pkg> -l script.js -o out.json # 输出存文件(大流量/批量时)

```

跨域联合

常见坑与陷阱

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.