爬虫--京东登录破解(一)

本文主要写一下破解京东登录时候滑块的分析步骤,具体代码未做展示.
本来以为京东的滑块验证码如果用selenium 直接滑动的话,会很容易.但是,万万没有想到,无论怎么滑,都没法成功.后来,决定直接请求接口试试吧,没想到成功了.所以,拿来分享一下了.

首先,输入用户名和密码后,点击登录京东是一定会出现验证码的.
在这里插入图片描述

看着跟其他网站的验证码是一样的.
分析过程分为了以下几步:
第一步:获取背景图

观察接口,找到这样一个接口
在这里插入图片描述

返回值是这样的:

jsonp_08431950206685985({"message":"success","challenge":"054b3ee5fc5a44c8b585082c168f9f23","static_servers":"//iv.jd.com/","o":"loginname","api_server":"//iv.jd.com/","bg":"iVBORw0KGgoAAAANSUhEUgAAAWgAAACMCAYAAABRRzP1AAA07UlEQVR42u2di48d133f779Q1JZl62mKej9JWSK5JHcpkSJFinpQpGSuokiibbJyZMGPJJQVo5DqyMiDSuQHIGFT1lgL0kprykwV2VBau4WNukaNBEmBwoCQOG1QI0VjpGhjIDJtPab3e/b+Zn/3d3/nOWfmzr07C3wxc+fOnnncmc/5zu/8zpneE9+7p3jsO3cXj752q5nic4xeeWS2WP7tneZ/6xD26+hrB1Xd/42D5vu/X5gp3vnKFcUrL+8pl9P0gRf3lp9d5WCK/0c5KO8PX7itePT1Q7UK2/ir+S3Fz/Zdv+b1y68/VhQ//qOieOO5auqX8TcnHyxe37Wx+Hd7PzSkX9uyodh/9Y0jeuja2VL3rruuuOP9Vwzp2O6DxVMfe9LoswcfUdd5auZaVdimXBdCGbb/0dZ3CWXxYwiRdgyusnDsXzr+tBHOR+i+ndy+sfiPd2wqfwP8Lt8/cnPx5o+eyfN7D37zP3tsX/mbY3vY7vb3riul7dsTB/YY4XtMX/rCg+Uy0h989g6j0GPlx4l9qnpsPQ3KtMw3lXC3zadM+TwAahMgB6hCmJff3/Ll3cXtz+11lkGA5mUR7HOAmMoZmvaPy1yoezdaoXXmzo1DU9IvDurraeuGfN8B2g0tCWh8lpI3Nklbt8r/aMI+xSq2LI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nj3IIJuUyWQsGa7lqXKhVU6DBGhI9BurkMngdgazvr5uGwhLdtMaOAbBIZHBnODdHcqe2XnyCHIP71oLq61b8I/0Ady5dMiSfvmkVQ4zkhavccFcmr1IJ2SXQ/D0j4RpiNxf30JurQtySw5Z+W+cBS07d/ul55a1tTQj12X9vF7pwQmps930jZpJbvoCSGUrA0iNKiAzys61sPC6wQUyPDz8Jk6YjAYMhxaOz/0Wgny6GfKpRhnCDpBHySbmkftcIMVPM4xGQtyfXhynFUqqsCoCmdWzBaexf2gwkAgBMeyF5G4YlXrCKsi/8weNeYQMfIP+p9E7SL//uA5USmrZ+FSjCkAOr1SjZZA/r7YwkO94k/0IzZFzE4Vi71A7TI8F9hSNGE4spFReUBqd2gtktl36uMvYV+tUoPCjTjabpQYjAHpmtN1LoVDYR0hsE6e74VmiVe0Vm3Xv6mFj6wipuwbYBK1SQ1lQIhwK+5jk7KF2w/wXb4JETOBf2a2UKNu3pgqJbrsnmiEe6+GvtZSlSXpFMrwI0gUQQZIOUx7ZvNwMjxNNtI/t5pUWuD7dqV/9QvJdEAThZXLyFXLxbVzFPzu1u7lJL35luqaiRjGvFKF4tDjVZXw/Ik116k74PTNnac9BF8NrBwxBoEztEOUfNyMjMBX1QSrWDXc+baExbnkDRbxCk94kiKk9ez7uoG+PiqzKVst15SpPEx+/Xlreie89tgTCIHZWvaYqXK7ql5QsMkxcARFXH1sCwQUM35xdnmAAe0oXUsoz7ysB2DG2lkDs9kK5vEGvswhQeSNuQ2hVzXCND4acN0m1Z1i/LkEq5Q2GtDKsLIfWiwbRCzXLIPUoQyCSJNUlhNGfp58DACM4n9/IcRwAAAAASUVORK5CYIJoNQ==","y":31})

返回值有两个值bg和patch,猜想应该是base64编码后的值,解析试一下:

img = base64.b64decode(patch)
file = open('patch.jpg','wb')
file.write(img)
file.close()

img = base64.b64decode(bg)
file = open('bg.jpg','wb')
file.write(img)
file.close()

查看保存的图片,bg是带缺口的背景图,patch是滑块.
那我们直接构造请求就可以了,请求参数:


在这里插入图片描述

其中有一个e参数,在页面找不到.不过经过多次测试,可以把它写死,可以顺利得到图片.

第二步:计算缺口位置

接下来,我们就需要找出缺口位置了,京东是没有完整的图片的,不能按照一般的寻找缺口位置的方法,可以使用python的cv2模块做图像处理,得出缺口位置.

第三步:发送滑块滑动验证

滑动滑块后,可以发现会发出下面一个请求:


在这里插入图片描述

后面的返回值可以看出是滑动是否成功的信息,观察一下请求参数
在这里插入图片描述

这些参数大部分都可以找到,e可以是上一步写死的参数,s的值如过全局搜索一下,会发现是接口

https://seq.jd.com/jseqf.html?bizId=passport_jd_com_login_pc&platform=js&version=1

的返回值里的sessionId,c是上一步得到图片的返回值challenge,其他的在网页上也都能得到,只有d这个参数,怎么都找不到,猜想猜想是不是跟滑动的位置信息有关,因为我们得到的缺口的位置还没有找到.
设置一个鼠标mouseleave时间,调试跟踪一下(需要有耐心),找到了生成d的js位置:


在这里插入图片描述

当再次滑动滑块的时候,松开,js会暂停到这里,此时,在控制台输入g,可以看到g是一个数组,这个数组的元素有三个值,猜测应该是坐标和时间戳:
在这里插入图片描述

经过多次调试发现规律,
  1. 数组的第一组基本不变.
  2. 数组的最后一个元素的第一个数减去第一个元素的第一个元素,正是第二步得到的缺口位置.且每两个元素之间的差值不大
  3. 数组的每一个元素的第二个数基本不变或只有很小距离的变化
  4. 数组的大小不固定

现在可以知道,小数组的x是屏幕距离和滑块滑动过程中的滑动的距离之和,y则是滑动时候鼠标的位置,z是时间戳
按照这个规律,我们构建构建数组就行.构建数组的时候使用了一个别人的生成轨迹的函数:

def get_tracks(distance):
   trace = []
   faster_distance = distance * 3 / 5

   # 设置初始位置、初始速度、时间间隔
   start, v0, t = 0.0, 0.5, 0.2
   # 当尚未移动到终点时
   while start < distance:
       # 如果处于加速阶段
       if start < faster_distance:
           # 设置加速度为2
           a = round(random.uniform(0.5, 0.8), 2)
       # 如果处于减速阶段
       else:
           # 设置加速度为-3
           a = round(random.uniform(-0.7, -0.9), 2)
       # 移动的距离公式
       move = v0 * t + 1 / 2 * a * t * t
       move = int(move)
       # 此刻速度
       v = v0 + a * t
       # 重置初速度
       v0 = v
       # 重置起点
       start += move
       # 将移动的距离加入轨迹列表
       trace.append(round(move))
   # 返回轨迹信息
   return trace

我们按照js的方法对构造的数组加密,可以得到d. python执行js函数的模块可以使用pyexecjs.我们把加密js函数复制过来,执行一下就行.
接下来发送验证请求就行,结果如下:

在这里插入图片描述

以上就是滑块验证部分.限于篇幅,下一篇再分析一下如何登录京东.

你可能感兴趣的:(爬虫--京东登录破解(一))