App逆向 - 希音 - 无感与图标验证码纯算

App 逆向 - 希音 - 无感与图标验证码纯算

文章目录

概要

也是非常久没有发文章了,这次整理一下希音(S***)App 的无感与图标验证码。验证码页面通过 Android WebView 加载,分析重点是:初始化、获取资源、提交验证,以及验证后的业务恢复。

注意:课程基本上已全部更新,趁现在有活动,需要了解的主页V♥抠我!!!

整体架构流程

本次样本中的"无感",是先点击确认框完成第一阶段校验,随后继续进入图形验证。它仍会提交触控行为和环境数据。
#mermaid-svg-cGsP1pwRMhyltYDM{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-cGsP1pwRMhyltYDM .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-cGsP1pwRMhyltYDM .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-cGsP1pwRMhyltYDM .error-icon{fill:#552222;}#mermaid-svg-cGsP1pwRMhyltYDM .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-cGsP1pwRMhyltYDM .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-cGsP1pwRMhyltYDM .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-cGsP1pwRMhyltYDM .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-cGsP1pwRMhyltYDM .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-cGsP1pwRMhyltYDM .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-cGsP1pwRMhyltYDM .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-cGsP1pwRMhyltYDM .marker{fill:#333333;stroke:#333333;}#mermaid-svg-cGsP1pwRMhyltYDM .marker.cross{stroke:#333333;}#mermaid-svg-cGsP1pwRMhyltYDM svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-cGsP1pwRMhyltYDM p{margin:0;}#mermaid-svg-cGsP1pwRMhyltYDM .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-cGsP1pwRMhyltYDM .cluster-label text{fill:#333;}#mermaid-svg-cGsP1pwRMhyltYDM .cluster-label span{color:#333;}#mermaid-svg-cGsP1pwRMhyltYDM .cluster-label span p{background-color:transparent;}#mermaid-svg-cGsP1pwRMhyltYDM .label text,#mermaid-svg-cGsP1pwRMhyltYDM span{fill:#333;color:#333;}#mermaid-svg-cGsP1pwRMhyltYDM .node rect,#mermaid-svg-cGsP1pwRMhyltYDM .node circle,#mermaid-svg-cGsP1pwRMhyltYDM .node ellipse,#mermaid-svg-cGsP1pwRMhyltYDM .node polygon,#mermaid-svg-cGsP1pwRMhyltYDM .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-cGsP1pwRMhyltYDM .rough-node .label text,#mermaid-svg-cGsP1pwRMhyltYDM .node .label text,#mermaid-svg-cGsP1pwRMhyltYDM .image-shape .label,#mermaid-svg-cGsP1pwRMhyltYDM .icon-shape .label{text-anchor:middle;}#mermaid-svg-cGsP1pwRMhyltYDM .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-cGsP1pwRMhyltYDM .rough-node .label,#mermaid-svg-cGsP1pwRMhyltYDM .node .label,#mermaid-svg-cGsP1pwRMhyltYDM .image-shape .label,#mermaid-svg-cGsP1pwRMhyltYDM .icon-shape .label{text-align:center;}#mermaid-svg-cGsP1pwRMhyltYDM .node.clickable{cursor:pointer;}#mermaid-svg-cGsP1pwRMhyltYDM .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-cGsP1pwRMhyltYDM .arrowheadPath{fill:#333333;}#mermaid-svg-cGsP1pwRMhyltYDM .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-cGsP1pwRMhyltYDM .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-cGsP1pwRMhyltYDM .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-cGsP1pwRMhyltYDM .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-cGsP1pwRMhyltYDM .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-cGsP1pwRMhyltYDM .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-cGsP1pwRMhyltYDM .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-cGsP1pwRMhyltYDM .cluster text{fill:#333;}#mermaid-svg-cGsP1pwRMhyltYDM .cluster span{color:#333;}#mermaid-svg-cGsP1pwRMhyltYDM div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-cGsP1pwRMhyltYDM .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-cGsP1pwRMhyltYDM rect.text{fill:none;stroke-width:0;}#mermaid-svg-cGsP1pwRMhyltYDM .icon-shape,#mermaid-svg-cGsP1pwRMhyltYDM .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-cGsP1pwRMhyltYDM .icon-shape p,#mermaid-svg-cGsP1pwRMhyltYDM .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-cGsP1pwRMhyltYDM .icon-shape .label rect,#mermaid-svg-cGsP1pwRMhyltYDM .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-cGsP1pwRMhyltYDM .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-cGsP1pwRMhyltYDM .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-cGsP1pwRMhyltYDM :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 业务请求触发风控
加载 WebView 并初始化安全上下文
获取本次 token 和无感资源
提交无感校验
按服务端返回类型获取图形资源
图标按序点选或九宫格选择
提交图形校验
最终确认并获取通行凭据
携带凭据恢复原业务请求

无感通过、图标通过、业务恢复,是三个需要分别检查的结果。 本次链路中,图标校验成功后还需要最终确认,再将返回的凭据带回业务会话。

一、从 WebView 定位加密入口

分析入口选在 App 加载验证码的 WebView,通过 Chrome CDP 观察页面和网络请求,再对照真实成功包。

定位时重点看三个位置:

  1. 资源返回处:本次 token、验证类型、加密参数和动态规则从哪里来。
  2. 加密调用前:明文中有哪些设备指纹、触控事件、点选答案和时间字段。
  3. 请求发出前:请求头签名、Cookie、页面上下文与最终请求体如何关联。

沿着资源请求和校验请求的调用栈回溯,比直接阅读整份混淆 JS 更容易确定分析范围。

补环境适合观察原 JS 的输入和运行行为;纯算实现则需要把序列化、压缩、加密、编码等步骤拆清楚。最终项目的协议部分由 Python 实现,运行时无需调用 App 内的加密函数。

二、无感和图标阶段分别提交什么

1. 无感阶段

这一阶段主要提交移动端按下、抬起等触控记录,以及对应的环境和时间信息。即使界面上只有一个确认框,后台仍有完整的数据封装过程。

无感通过后,要继续读取服务端返回的验证类型、token 和资源参数。本次实现按实际类型进入图标点选或九宫格分支。

2. 图标阶段

图标点选需要根据提示顺序生成有序坐标,再结合触控轨迹和确认动作提交。

这里有两个坐标系:点选答案使用背景图内的归一化坐标;触控轨迹使用页面坐标,需要考虑图片偏移和按钮位置。

python 复制代码
# 坐标处理示意:背景区不包含下方提示条
x_norm = round(x_image / bg_width, 2)
y_norm = round(y_image / bg_height, 2)

另外,图标资源阶段可能下发新的 token,提交时应使用本阶段最新值。只沿用无感阶段的旧 token,会造成资源和校验上下文不一致。

自动图标识别接入的是第三方识别服务,协议处理在本地完成;九宫格分支保留人工界面。因此,"协议纯 Python"描述的是签名、加密和请求流程,图片识别仍有外部依赖。

三、把加密和签名分层看

请求中存在多套处理逻辑,可以按用途拆开:

层次 输入内容 主要处理
环境参数 anti_*** 初始化指纹、页面状态、交互记录 JSON 序列化、压缩、AES 加密、自定义编码
行为密文 w 本次轨迹、点选答案、时间等 JSON 序列化、AES-CBC、Base64
资源签名 d 本次 token、下发规则、时间戳 规则处理、摘要、加密
请求头 x-*** URL、请求体及相关上下文 按网关和动态规则生成签名

行为密文使用本次资源下发的密钥,脱敏后可以理解为:

text 复制代码
行为明文 → 紧凑 JSON → AES-CBC(key=****************) → Base64

还原时需要核对字符编码、JSON 格式、填充方式、IV 和编码字母表。请求体签名与实际发送内容也要一致,不能签名后又换一种格式重新序列化。

部分摘要逻辑存在修改,不能仅凭输出长度就判断它是标准 MD5。本次修复时,原有 d 签名与原 JS 的 1,402 组离线对照均一致,这也为后续排查环境和会话问题提供了依据。

四、几个影响结果的关键问题

1. 初始化指纹与页面实时状态不同

环境 SDK 会在隐藏 WebView 初始化时缓存窗口尺寸。本次设备的相关字段最后四项为 0,旧配置却填入了页面显示后的尺寸。

对照中保持图片和 token 不变,仅修正这四项后,图标校验、最终确认和业务回放均成功。由此可以看到,应还原 SDK 实际采集时的状态;更换设备或 WebView 后,也需要重新测量。

2. 事件时间要早于提交时间

旧实现先生成提交时间,再采集设备和传感器事件,部分事件因此晚于提交时间约 1~2 秒。

修复后的顺序是:采集完成后再生成最终提交时间。尚未收到真实传感器事件时,相关数组保持为空。

3. 会话身份与设备档案要一致

独立会话分别维护身份,同一条流程内则持续复用,并在分进程提交时恢复原状态。UA、品牌、系统、屏幕和像素比也使用同一套设备档案。

本轮对照中,旧固定身份配合设备档案仍失败,仅更换身份但混入实机 ADB 数据也失败;使用独立会话身份配合一致的机型档案后连续通过。这支持排查身份复用和数据混杂,服务端内部判定规则仍无法直接确认。

4. 页面和资源上下文跟随当前会话

站点、地区、App 语言和验证码资源语言需要分别处理,资源选择语言取本次返回值。token、资源规则、Cookie 与安全配置也要作为同一会话的状态一起维护。

五、怎么确认整条链路跑通

成功标准包括:图标校验成功、最终确认成功、取得通行凭据、原业务请求返回正常结果。

项目记录中的两组测试如下,失败均保留,未通过重试替换样本:

测试方式 全链路首次成功 未完成原因
50 个独立进程串行执行 47/50,94% 3 次识别服务超时,未提交图标校验
10 并发、共 100 次 85/100,85% 13 次识别服务余额不足,2 次图标校验返回 9001

100 次测试中,无感阶段全部首次通过。正常获得坐标的 87 次里,85 次完成全链路,条件成功率为 97.70% ;该比例排除了识别服务余额不足的样本,总体成功率仍为 85% 。

两次 9001 尚未独立确定是坐标问题还是服务端风控拒绝,不能仅凭错误码判断为算法更新。这些数据反映当次测试结果,后续表现仍受识别服务、网络和服务端状态影响。

本次分析中,签名对照、初始化指纹、事件时间和会话状态都需要分别验证。将这些环节与图片识别分开记录,才能看清失败发生在哪一步,也便于后续维护。

六、其它Ai完成的项目

1. 某川App的某里234缺口滑块验证:
2. 某德的某里234直滑验证:
3. 某航的狗动点选验证+训练模型:
4. e罗斯的x_wbass_token盾:

七、关于课程

目前,我负责的课程内容基本已经更新完毕,纯古法教学。

课程整体覆盖 AI 逆向、AST 反混淆、JS 逆向、小程序逆向和风控等方向,具体内容可以看下面的大纲。

提示:需要了解课程的主页+v

相关推荐
小白的高手之路32 分钟前
【LeetCode 热题 100】206. 反转链表|链表、迭代、递归(Python)
笔记·python·算法·leetcode·链表·职场和发展·力扣
惯兰高手1 小时前
信阳政务系统开发的消息通知功能实际设计要注意什么?
python
kyh10033811202 小时前
从仿生学到深度学习:人工神经网络原理解析
人工智能·python·深度学习
承渊政道2 小时前
【Python编程快速上手—让繁琐工作自动化】(组织文件:用Python批量改名,把整个文件夹打包备份)
开发语言·python·pycharm·自动化·文件整理·组织文件
Darkwanderor2 小时前
在 Win11 和 CentOS 7.6 安装Python 3.12.7 的流程和踩坑记录
python·腾讯云·python安装·踩坑记录
Metaphor6922 小时前
使用 Python 轻松调整 Word 文档的页边距
python·word·页边距
郝学胜-神的一滴2 小时前
量化交易从入门到精通 04:量化生意的四大特点
开发语言·数据结构·c++·python·算法·pycharm
青少儿编程课堂3 小时前
蓝桥杯青少组图形化真题:校园失物招领智能匹配解析(全国青少年信息素养、电子学会图形化考级同源考点)
c++·python·算法·bfs·信息学竞赛
布语world3 小时前
IDA Pro 9.4 深度解析:DSC 重做、Swift ABI 落地,以及一次被低估的自动化下放
python·安全·ida·app逆向
小白的高手之路3 小时前
【【LeetCode 热题 100】160. 相交链表|链表、哈希表、双指针(Python)
python·算法·leetcode·链表·力扣·散列表