Skip to content

✅ 一、一份完整的爬虫逆向工程师工具清单(带下载链接)

工具类别工具名称用途简述下载链接 / 官网
抓包工具https://www.charlesproxy.com/HTTP/HTTPS 抓包,支持断点、Map Local、SSL 代理https://www.charlesproxy.com/download/
https://www.telerik.com/fiddler免费抓包工具,支持 HTTPS 解密与脚本扩展https://www.telerik.com/download/fiddler
https://portswigger.net/burpWeb 安全测试 & 抓包,Community 版免费https://portswigger.net/burp/communitydownload
https://mitmproxy.org/可编程抓包代理,支持 Python 脚本干预请求https://mitmproxy.org/download/
https://www.wireshark.org/底层网络抓包,支持分析 TCP/UDP/HTTP2 等协议https://www.wireshark.org/download.html
浏览器工具Chrome DevTools(内置)分析 XHR/Fetch 请求、断点调试 JS、查看加密逻辑浏览器自带,快捷键 F12
JS逆向工具https://lelinhtinh.github.io/de4js/在线 JS 混淆代码反混淆工具https://lelinhtinh.github.io/de4js/
https://jsnice.org/JS 代码美化,提高可读性https://jsnice.org/
https://astexplorer.net/查看 JS 代码的抽象语法树(AST),用于高级逆向分析https://astexplorer.net/
代码模拟https://www.python.org/downloads/编写爬虫与模拟请求https://www.python.org/downloads/
https://nodejs.org/执行 JS 代码,本地调试加密函数https://nodejs.org/
https://github.com/doloopwhile/execjs(Python库)在 Python 中执行 JS 代码pip install execjs
https://github.com/sqreen/PyMiniRacer高性能 JS 执行引擎(推荐)pip install py_mini_racer
代理工具https://github.com/Dreamacro/clash科学上网 / 代理 IP 池管理https://github.com/Dreamacro/clash
https://www.v2fly.org/代理工具,支持多种协议https://www.v2fly.org/
https://www.proxifier.com/Windows 下强制程序走代理https://www.proxifier.com/
逆向工具https://frida.re/动态注入 JS,Hook 函数,打印参数/返回值https://frida.re/docs/installation/
https://github.com/skylot/jadxAndroid APK 反编译工具(开源)https://github.com/skylot/jadx/releases
https://ibotpeaches.github.io/Apktool/反编译 APK,查看资源与 Smali 代码https://ibotpeaches.github.io/Apktool/
https://www.hex-rays.com/products/ida/逆向分析 C/C++ SO 库,商业软件(昂贵)https://www.hex-rays.com/products/ida/
https://ghidra-sre.org/免费逆向工具,支持 SO/ELF/PE,NSA 出品https://ghidra-sre.org/
OCR/验证码https://www.chaojiying.com/打码平台,识别验证码https://www.chaojiying.com/
无头浏览器https://playwright.dev/自动化浏览器,支持反检测,比 Selenium 更强大https://playwright.dev/python/
https://pptr.dev/Node.js 控制的无头 Chrome,支持反检测插件https://github.com/puppeteer/puppeteer
综合平台https://xz.aliyun.com/安全/逆向技术分享社区https://xz.aliyun.com/
https://www.kanxue.com/逆向安全论坛,老牌中文逆向社区https://www.kanxue.com/
https://www.freebuf.com/网络安全/爬虫逆向资讯https://www.freebuf.com/

✅ 二、一个逆向实战案例:某网站 sign 参数破解步骤(以常见“timestamp + nonce + key”为例)

🎯 目标

某网站 API 请求如下:

plain
GET https://api.example.com/data?page=1
Params:
- timestamp: 1698765432100
- nonce: abc123
- sign: 8a9s8df8a9s8dfa9s8dfa9s8dfa9s8d

其中 sign 是动态生成的,用于鉴权,没有它请求会被拒绝。


🔍 逆向步骤

第一步:抓包定位请求

  • 工具:Chrome DevTools → Network → XHR
  • 找到目标 API,查看其 Request Params,发现 sign 是必填参数,且每次请求都不同。

第二步:全局搜索关键字

  • Chrome DevTools → Sources 面板,全局搜索:
plain
sign
timestamp
nonce
encrypt
generateSign
md5
sha1
hmac
  • 找到类似如下 JS 代码片段:
javascript
function generateSign(timestamp, nonce) {
    var key = "abcdef123456";  // 可能是固定的,也可能是从其它地方动态获取
    var str = timestamp + nonce + key;
    return md5(str);  // 也可能是 sha1 / hmac_sha256 等
}

第三步:分析加密算法

  • 假定你发现它使用的是:md5(timestamp + nonce + key)
  • 你可以在浏览器控制台手动验证:
javascript
// 在 Console 直接执行
function md5(str) { /* 引入或使用已有的 MD5 实现 */ }
var timestamp = Date.now();
var nonce = "abc123";
var key = "abcdef123456";
var sign = md5(timestamp + nonce + key);
console.log(sign);
  • 或者直接把这段逻辑复制到 Python 中模拟:

第四步:用 Python 模拟 sign 生成

python
import hashlib
import time

def generate_sign(timestamp: int, nonce: str, key: str = "abcdef123456") -> str:
    raw = f"{timestamp}{nonce}{key}"
    return hashlib.md5(raw.encode('utf-8')).hexdigest()

timestamp = int(time.time() * 1000)  # 毫秒级
nonce = "abc123"
sign = generate_sign(timestamp, nonce)

print("timestamp:", timestamp)
print("nonce:", nonce)
print("sign:", sign)

用这个 sign,你就可以自己构造合法 API 请求了!


🧠 拓展:

  • 如果是 HMAC-SHA256,可以用 hmac + hashlib 模块:
python
import hmac
import hashlib
import base64

def hmac_sha256(key: str, msg: str) -> str:
    return hmac.new(key.encode(), msg.encode(), hashlib.sha256).hexdigest()
  • 如果是 RSA / AES,可以使用 pycryptodomersa 等库解密或加密。

✅ 三、Python 模拟加密参数的模板代码

以下是一个通用模板,适用于大多数常见签名场景,比如:

  • timestamp + nonce + key → md5 / sha1 / hmac-sha256
  • 参数排序后拼接签名
  • 可拓展为任意自定义加密逻辑

🧩 模板代码:MD5 / HMAC-SHA256 签名模拟

python
import hashlib
import hmac
import time

# --------------------------
# 示例1:MD5 签名(timestamp + nonce + key)
# --------------------------
def generate_md5_sign(timestamp: int, nonce: str, key: str = "your_secret_key") -> str:
    raw = f"{timestamp}{nonce}{key}"
    return hashlib.md5(raw.encode('utf-8')).hexdigest()

# --------------------------
# 示例2:HMAC-SHA256 签名(更安全,推荐)
# --------------------------
def generate_hmac_sha256_sign(message: str, secret_key: str) -> str:
    return hmac.new(
        secret_key.encode('utf-8'),
        message.encode('utf-8'),
        hashlib.sha256
    ).hexdigest()

# ====================
# 使用示例
# ====================
if __name__ == "__main__":
    # 模拟参数
    timestamp = int(time.time() * 1000)  # 毫秒时间戳
    nonce = "randomNonce123"
    secret = "abcdef123456"

    # MD5 方式
    sign_md5 = generate_md5_sign(timestamp, nonce, secret)
    print("[MD5] Sign:", sign_md5)

    # HMAC-SHA256 方式
    message = f"{timestamp}{nonce}"
    sign_hmac = generate_hmac_sha256_sign(message, secret)
    print("[HMAC-SHA256] Sign:", sign_hmac)

你可以直接修改 generate_md5_sign()generate_hmac_sha256_sign() 来适配目标网站的签名算法。

如果目标网站是:

  • MD5(timestamp + key + nonce)
  • SHA1(参数排序后拼接)
  • HMAC-SHA256(token + body)
  • RSA 加密某个字段

都可以用类似方式模拟。如果遇到复杂加密(如 AES-CBC、自定义加密),可以进一步分析 JS 加密函数并移植到 Python。


✅ 四、Frida Hook 指南与实战脚本


🎯 什么是 Frida?

Frida 是一个 动态插桩工具,可以 Hook 运行中的 APP / 浏览器 / 进程中的函数,比如:

  • 打印函数参数 / 返回值
  • 修改函数返回值
  • 拦截加密函数、网络请求、签名生成
  • 逆向分析 APP 内部逻辑,而无需反编译

📦 安装 Frida

1. 安装 Frida CLI 工具(电脑端):

bash
pip install frida-tools

2. 安装手机/设备上的 Frida Server:

  • Android:
    • 下载对应架构的 https://github.com/frida/frida/releases(如 arm64-v8a)
    • 推送到设备:adb push frida-server /data/local/tmp/
    • 启动:adb shell chmod +x /data/local/tmp/frida-server && adb shell /data/local/tmp/frida-server &
  • iOS: 需越狱 + 安装 FridaGadget.dylib

🛠️ 基础用法

查看进程:

bash
frida-ps -U

Hook 某个进程中的 JS 函数:

创建一个 hook 脚本,比如 hook_sign.js

javascript
// hook_sign.js
Interceptor.attach(Module.findExportByName(null, "generateSign"), {
    onEnter: function (args) {
        this.timestamp = args[0].toInt32();
        this.nonce = args[1].readUtf8String();
        this.key = args[2].readUtf8String();
        console.log("[*] generateSign called");
        console.log("    timestamp:", this.timestamp);
        console.log("    nonce:", this.nonce);
        console.log("    key:", this.key);
    },
    onLeave: function (retval) {
        var sign = retval.toString();
        console.log("[*] sign 返回值:", sign);
    }
});

然后运行:

bash
frida -U -n com.example.app -l hook_sign.js

注意:generateSign 是目标函数名,需要你通过逆向分析得到(可用 IDA / jadx / Frida API 搜索)


✅ 更通用的 Frida Hook(打印函数参数)

如果你不知道函数名,但知道是某个 JS 方法或 Native 函数,Frida 提供强大的动态追踪能力,比如:

  • Hook 所有调用某个模块的方法
  • 拦截网络库、加密库调用
  • 自动打印参数和返回值

🧪 实战案例:Hook 网络请求的 URL 和 Headers

javascript
// hook_fetch.js
Interceptor.attach(ObjC.classes.NSURLSession["- dataTaskWithRequest:completionHandler:"].implementation, {
    onEnter: function(args) {
        var request = ObjC.Object(args[2]);
        var url = request.URL().absoluteString();
        var headers = request.allHTTPHeaderFields();
        console.log("[*] Request URL:", url);
        console.log("[*] Headers:", headers);
    }
});

✅ 总结:你需要的 4 份资料已完整提供

类别内容包含什么
1. 工具清单爬虫逆向全工具下载与介绍抓包、JS逆向、代理、APP逆向、模拟浏览器、反编译等工具,全部带官方下载链接
2. 实战案例某网站 sign 参数逆向步骤从抓包 → 搜索 JS → 分析算法 → 用 Python 模拟,手把手可复现
3. 模板代码Python 模拟加密参数(MD5 / HMAC-SHA256)通用签名生成模板,支持常见加密逻辑,可直接套用
4. Frida 指南Frida 安装 + Hook 脚本 + 实战动态注入、打印参数、逆向 APP 逻辑,附带 实战 JS Hook 脚本

🎁 如果你想要:

  • 一个完整的爬虫逆向实战视频 / walk-through(比如某电商 / 小说网站)
  • 一份 Python 爬虫 + 逆向签名自动抓取项目模板
  • Frida 高级脚本(如 Hook RSA / AES / 指纹函数)
  • 某个具体网站 / APP 的逆向分析(可提供 URL 或抓包数据)

👉 欢迎继续提问!我可以给你出详细逆向步骤、代码、脚本、工具使用教程!

评论
  • 按正序
  • 按倒序
  • 按热度
Powered by Waline v3.7.1

Released under the MIT License.