目标:aHR0cHM6Ly91c2VyLnF1bmFyLmNvbS9wYXNzcG9ydC9sb2dpbi5qc3A=
验证接口: https://vercode.qunar.com/inner/captcha/snapshot
可以发现是encryption方法生成,进入encryption里面,发现是AES加密的轨迹
track就是轨迹
直接搜索track.push定位到轨迹的生成
clientX就是 MouseEvent 或 Touch 对象的属性,它表示事件触发点相对于浏览器可视区域的水平坐标(不包括滚动条)说白了就是你的鼠标到你电脑最左边的距离clientY 表示事件触发点相对于浏览器可视区域的垂直坐标(不包括滚动条)说白了就是你的鼠标到你电脑最上边的距离
这个n就是滑动的距离,总距离是430.4
轨迹数组的生成
def generate_track():timestamp = int(time.time() * 1000) % 100000# 生成20 - 25个数据点num_points = random.randint(20, 25)# 固定第三部分的值third_part = 183# 目标结束范围target_end_min, target_end_max = 410, 430# 起始值start = random.randint(3, 5)# 平均每步增长量avg_increment = (target_end_min - start) / (num_points - 1)trajectory = []current = startfor i in range(num_points):# 时间戳增加随机间隔timestamp += random.randint(10, 50)if i == num_points - 1:current = random.randint(target_end_min, target_end_max)else:# 计算带随机性的增量current += int(avg_increment * (1 + random.uniform(-0.1, 0.1)))current = min(current, target_end_max)fourth = current + 2# 构建字符串data_point = f"{timestamp};{current}.00;{third_part}.00;{fourth}.00"trajectory.append(data_point)return trajectory
def aes_encryption(sliderInfo):e = json.dumps(sliderInfo, separators=(',', ':'))e_bytes = e.encode('utf-8')key = "227V2xYeHTARSh1R".encode('utf-8')cipher = AES.new(key, AES.MODE_ECB)padded_data = pad(e_bytes, AES.block_size)encrypted_bytes = cipher.encrypt(padded_data)encrypted_base64 = base64.b64encode(encrypted_bytes).decode('utf-8')return encrypted_base64
如果轨迹失败则这个code为1,成功为0
但是经博主发现,sliderInfo = {‘track’:[]}就行了,逆天
也就是说data固定成"/dHV8EazlsBjBhW4zZiWFg=="即可