极验4.0滑动验证码逆向

声明:本文内容仅供学习交流使用,不得用于商业或非法用途。抓包内容、敏感网址、数据接口已脱敏处理,严禁转载、修改或二次传播。若有侵权,请联系作者删除。

极验滑块第4代逆向分析

网址:aHR0cHM6Ly9ndDQuZ2VldGVzdC5jb20v

好久没水文了,接着之前的极验滑块逆向https://www.cnblogs.com/FlowerNotGiveYou/p/15800165.html,发现最新的滑块有所变化,新增了一些参数,因此重新瞧瞧新的代码,开启目前的最新滑块进行这一篇文章。

加密参数分析

首先请求分析,过滤掉图片请求后找到load(加载)和verify(验证)两个请求,从分析他们的入参和返回值,可发现验证接口只有一个W为加密参数,其他的值都能在load的入参或者返回值找到,因此只需要分析W值生成就好



找加密点

我是直接通过搜索process_token找到W的加密位置,你也能直接搜索W:来知道,这个和之前版本的一致

下断点

通过多次请求,可以知道计算W值的函数内变量有(或者说你需要计算的参数):

pow_msg
pow_sign
c74d2cb0: {d076: '9c74'} 计算得来
passtime 滑动时间
setLeft 滑动距离
userresponse
So89: "1AnD" 请求不同的js会变化,但是可固定 
1、参数 c74d2cb0: {d076: ‘9c74’}

往上翻,发现此参数就是a,然后a根据i和r计算得出

可以看到i和r计算和lot和lotRes值有关,直接搜索一下693和652,lot和lotRes生成的地方

可以看到lot的实际赋值与一串字符串有关,刚开始我将这个固定死了(对结果无影响),后来发现直接在前面的一个自执行函数中有赋值,而未知参数So89的值也已经有了

跳转到计算的函数,抠出来后缺啥补啥,大体可以得到这样的目录结构,执行完和目标一致

此时新增的键值对已经扣完。

2、参数pow_msg、pow_sign

简单看下pow_msg组成

1|0|md5|2025-04-14T08:48:05.208562+08:00|54088bb07d2df3c46b79f80300b0abbe|63d16e4da9fc4682aed6b359c796769c||6b6f5fb017bcaaea

可知道这个组成为:时间戳(已知,load返回)+ captcha_id(已知) + lot_number(已知)+ h (未知)

直接全局搜pow_msg可以找到pow_msg生成的位置

当然你也可以通过堆栈的方式寻找,但是有点麻烦

找到h的生成函数,发现和之前的版本一致,一个随机的16位数

此时pow_msg的值已经知道,进一步查看pow_sign的生成发现pow_sign为MD5(pow_msg)

对比后发现此md5加密未修改

有关滑块的距离和时间这些就不分析了,此版本没有对轨迹进行加密,只需要判断滑动距离和时间就ok

3、参数W的生成

断点后进入函数,发现又回到了熟悉的两段拼接,进一步分析两段

3-1 _ 值的生成

简要分析,_ᖗᕿᖚᖚ 传入值为随机16位字符,实际就是 new (_ᖀᖈᖙᖗ[_ᖈᕸᕸᖚ(7)])函数加密16位字符

后续就是扣代码了,还是通过全局的思想,将此函数通过window全局,方便后面调用

大体是这样

调用流程需要与chrome步骤保持一致,不然会导致this的指向问题

调用后能正确返回值,验证_的生成

3-2 u值的生成

分析得知,u值的加密是函数跟_的加密函数大体一致,不同的是u的生成取的是symmetrical函数

依然是全局抠出来

可以看到是一致的,最后的一步arrayToHex就不扣了。其中需要注意的点,随机的16位字符串保持一致。

4、验证结果

#include <ros/ros.h> #include <turtlesim/Pose.h> #include <geometry_msgs/Twist.h> #include <std_srvs/Empty.h> #include <cmath> ros::Publisher twist_pub; void poseCallback(const turtlesim::Pose& pose) { static bool is_forward = true; static int count = 0; static float x_start = pose.x; static float y_start = pose.y; static float theta_start = pose.theta; // Calculate distance from starting points float dist = std::sqrt(std::pow(pose.x - x_start, 2) + std::pow(pose.y - y_start, 2)); geometry_msgs::Twist twist_msg; twist_msg.linear.x = 1.0; twist_msg.linear.y = 0.0; twist_msg.linear.z = 0.0; twist_msg.angular.x = 0.0; twist_msg.angular.y = 0.0; twist_msg.angular.z = 0.0; // Check if turtle has reached distance of 2. If so, stop and shutdown the node. if (pose.x - x_start1) { twist_msg.linear.x = 0.0; twist_msg.linear.y = 1.0; twist_pub.publish(twist_msg); // Publish command if(pose.y - y_start>=2.0){ twist_msg.linear.x = -1.0; twist_msg.linear.y = 0.0; twist_pub.publish(twist_msg); // Publish command if(dist<=2.0){ twist_msg.linear.x = 0.0; twist_msg.linear.y = -1.0; twist_pub.publish(twist_msg); // Publish command ROS_INFO("Stop and Completed!"); twist_pub.publish(twist_msg); // Publish command ros::shutdown(); } } } twist_pub.publish(twist_msg); // Publish command } int main(int argc, char** argv) { ros::init(argc, argv, "lab1_node"); ros::NodeHandle nh; twist_pub = nh.advertise<geometry_msgs::Twist>("turtle1/cmd_vel", 1); ros::Subscriber pose_sub = nh.subscribe("turtle1/pose", 1, poseCallback); // reset the turtlesim when this node starts ros::ServiceClient reset = nh.serviceClient<std_srvs::Empty>("reset"); std_srvs::Empty empty; reset.call(empty); ros::spin(); // Keep node running until ros::shutdown() return 0; } 这段代码为什么不能实现乌龟沿完整矩形轨迹运动?并给出修改后的代码
07-09
这段代码不能实现乌龟沿完整矩形轨迹运动的原因是在判断乌龟是否到达目标点时的条件判断有误。具体来说,代码中的`if (pose.x - x_start1)`应该改为`if (dist >= 2.0)`,来判断乌龟是否到达了目标距离2.0。此外,代码中也缺少了对乌龟角度的控制,需要在适当的时候设置`twist_msg.angular.z`来控制乌龟的旋转。 下面是修改后的代码: ```cpp #include <ros/ros.h> #include <turtlesim/Pose.h> #include <geometry_msgs/Twist.h> #include <std_srvs/Empty.h> #include <cmath> ros::Publisher twist_pub; void poseCallback(const turtlesim::Pose& pose) { static bool is_forward = true; static int count = 0; static float x_start = pose.x; static float y_start = pose.y; static float theta_start = pose.theta; // Calculate distance from starting points float dist = std::sqrt(std::pow(pose.x - x_start, 2) + std::pow(pose.y - y_start, 2)); geometry_msgs::Twist twist_msg; twist_msg.linear.x = 1.0; twist_msg.linear.y = 0.0; twist_msg.linear.z = 0.0; twist_msg.angular.x = 0.0; twist_msg.angular.y = 0.0; twist_msg.angular.z = 0.0; // Check if turtle has reached distance of 2. If so, stop and shutdown the node. if (dist >= 2.0) { twist_msg.linear.x = 0.0; twist_msg.linear.y = 0.0; twist_pub.publish(twist_msg); // Publish command ROS_INFO("Stop and Completed!"); ros::shutdown(); } twist_pub.publish(twist_msg); // Publish command } int main(int argc, char** argv) { ros::init(argc, argv, "lab1_node"); ros::NodeHandle nh; twist_pub = nh.advertise<geometry_msgs::Twist>("turtle1/cmd_vel", 1); ros::Subscriber pose_sub = nh.subscribe("turtle1/pose", 1, poseCallback); // reset the turtlesim when this node starts ros::ServiceClient reset = nh.serviceClient<std_srvs::Empty>("reset"); std_srvs::Empty empty; reset.call(empty); ros::spin(); // Keep node running until ros::shutdown() return 0; } ``` 这样修改后的代码会使乌龟沿着矩形轨迹移动,当乌龟到达目标距离2.0时,会停止运动并关闭节点。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值