<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>爬虫 on 想记录少女的心事…</title><link>https://blog.20033999.xyz/tags/%E7%88%AC%E8%99%AB/</link><description>Recent content from 想记录少女的心事…</description><generator>Hugo</generator><language>zh-cn</language><managingEditor>yursamor@users.noreply.github.com (yursamor)</managingEditor><webMaster>yursamor@users.noreply.github.com (yursamor)</webMaster><copyright>本博客所有文章除特别声明外，均采用 BY-NC-SA 许可协议。转载请注明出处！</copyright><lastBuildDate>Mon, 29 Jun 2026 17:30:23 +0800</lastBuildDate><atom:link href="https://blog.20033999.xyz/tags/%E7%88%AC%E8%99%AB/index.xml" rel="self" type="application/rss+xml"/><item><title>把极验 v3 的 w 参数生成器搬到 Python — 一场没完全赢的逆向</title><link>https://blog.20033999.xyz/post/geetest-v3-w-reverse-engineer/</link><pubDate>Fri, 26 Jun 2026 16:45:00 +0800</pubDate><author>yursamor@users.noreply.github.com (yursamor)</author><guid>https://blog.20033999.xyz/post/geetest-v3-w-reverse-engineer/</guid><description>
<![CDATA[<h1>把极验 v3 的 w 参数生成器搬到 Python — 一场没完全赢的逆向</h1><p>作者：yursamor（yursamor@users.noreply.github.com）</p>
        
          <blockquote>
<p>这篇文章是我尝试用 Python 复刻住房和城乡建设部「全国建筑市场监管公共服务平台」(jzsc.mohurd.gov.cn) 上极验 v3 滑块 <code>w</code> 参数生成器的完整记录。结论一句话：<strong>算法还原了，但 server 不让纯 Python 跑</strong>。下面把过程都摆出来。</p>
</blockquote>
<h2 id="背景">
<a class="header-anchor" href="#%e8%83%8c%e6%99%af"></a>
背景
</h2><p>业务方要批量查 jzsc 上的一些企业资质信息。每次请求前都得过一次极验滑块，弹出来挡住你，验证完了才能查数据。</p>
<p>我手上有两份别人写好的 Python 脚本（<code>geetest_v3_params.py</code> 和 <code>geetest_params.py</code>），号称能算 <code>w</code> 参数。但跑起来发现：</p>
<ul>
<li>一个用 <strong>MD5 占位</strong> 当 modulus，明显是 demo</li>
<li>一个流程对，但调用 <code>get.php</code> 时拿不到 <code>key</code> 字段，server 返 <code>error_21: not proof</code></li>
</ul>
<p>也就是说：<strong>算法有了，但缺真 modulus</strong>。我得自己从头把它跑通。</p>
<h2 id="极验-v3-的-w-是什么">
<a class="header-anchor" href="#%e6%9e%81%e9%aa%8c-v3-%e7%9a%84-w-%e6%98%af%e4%bb%80%e4%b9%88"></a>
极验 v3 的 w 是什么
</h2><p><code>w</code> 是极验滑块最终提交给 <code>ajax.php</code> 的那个长字符串，本质上是<strong>三段拼接</strong>：</p>
<pre tabindex="0"><code>w = customB64( AES-128-CBC(JSON, seed) )  +  hex( RSA-1024(seed) )
</code></pre><ul>
<li><strong>JSON</strong>：包含 challenge、gt、客户端环境指纹（<code>ep</code>/<code>em</code>）、时间戳等</li>
<li><strong>seed</strong>：16 字节 ASCII 随机串，作为 AES 的 key</li>
<li><strong>AES-128-CBC</strong>：IV 全零，PKCS7 padding</li>
<li><strong>customB64</strong>：极验自家改的 Base64，字符表 <code>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789()</code>，pad 是 <code>.</code>，掩码 <code>[7274496, 9483264, 19220, 235]</code></li>
<li><strong>RSA-1024</strong>：PKCS1-v1.5 加密 seed，e=65537，n 来自 <code>get.php</code> 响应里的 <code>key</code> 字段</li>
</ul>
<p>知道算法是一回事，能拿到 <code>key</code> 是另一回事。</p>
        
        <hr><p>本文2026-06-26首发于<a href='https://blog.20033999.xyz/'>想记录少女的心事…</a>，最后修改于2026-06-29</p>]]></description><category>技术</category></item></channel></rss>